In the simplest terms:
OS
Contains the kernel, a graphical user interface (GUI) or at minimum a command line interface (CLI) that utilizes hardware for file management
Kernel
Part of the OS software, the doorkeeper and translator between the OS and the hardware.
In other words (from Wikipedia), the kernel's primary function is to mediate access to the computer's resources:
- -CPU
- -RAM
- -I/O
- -System Calls
Firmware
- By definition, Firmware is any instructions stored on ROM.
- Firmware is a play on words for something between software and hardware, referencing the spectrum for "ease of modification"
- Firmware is independent of the OS an exception that blurs the lines is when the entire OS is stored in ROM, thus by definition considered Firmware
- Firmware typically contains the bootstrap program which loads the OS kernel
- Firmware is the bare minimum instruction to orchestrate multiple general-purpose hardware components
- Firmware is not needed if you fully customize/print your logic/instructions with VLSI onto your very own circuit (I think this is important to realize when talking about firmware)
- Firmware is on consumer products like an RC car, OS is not
- Firmware is in all/majority of electronics, OS is not
- Virus in firmware may never be detected or removed. Virus on an OS can be cleared with a fresh install
When you power on your computer:
Firmware → Kernel → Full OS
Basically