- I was wondering what differences are between firmware and software?
- What differences are between firmware and OS?
- Are boot-loaders firmware? Bios is. How about GNU grub? Is grub software or firmware?
Traditionally, firmware is CPU code that resides on a unmodifiable ROM that is necessary for a hardware device to boot and load an operating system or a binary (software) of choice. Sometimes no choice of a binary is given and one attached to the boot-portion firmware is used.
All CPUs have the classical problem in that, since they fetch instructions from memory, some sort of pre-programmed memory must exist at a fixed address when the CPU starts, so that it can do something automatically on startup. Firmware exists for this purpose. Some firmware also has code that later programs can use for services. BIOS firmware exposes many functions that DOS used for basic input and output (hence why BIOS stands for Basic Input Output System).
The distinction is not totally clear. Some (most) WLAN cards require firmware to be loaded before they will start functioning. However, usually there is a tiny firmware on the device whose job is to do nothing but accept a main "firmware" over the USB bus when the device is started by the operating system, and hand over control when it is loaded. Most people would say all of it is firmware.
Since EEPROMs and flash memory became more common, firmware usually no longer resides in an unwriteable ROM but in flash memory and can be modified. The distinction between firmware and software is blurry today with the advent of flash memory. However, one thing hasn't changed over the years and that is CPUs are still CPUs and require some code, or firmware, to be visible at startup to, well, start up.
CPUs are in more devices than ever before so developing and allowing firmware to be updated in the case of bugs is a big deal now and many hardware devices with a CPU have firmware update interfaces, sometimes undocumented.
A firmware can be used to load an OS. It can contain a boot loader or code that loads a boot loader. It is possible to store an OS image in the same location as firmware and let the boot-time code of firmware load the OS (cell phones do this). PC BIOSes as a rule do not include boot loaders. U-boot (not for PCs) is an example of a "filesystem-aware" firmware that does directly load an operating system.
FIrmwares usually do not have all the features of a full operating system because of the principle that simpler is more reliable. The simplest firmwares simply initialize a minimum of hardware, load a sector or block off of a storage device and throw execution to it. This is simple to program and therefore easy to verify as bug free. Bugs in boot time firmware particularly can spell disaster for a device.
Firmware is software, except instead of being stored on disk, it is stored in an EEPROM which is usually flashable to allow updates.
Firmware is in a way an operating system, but much more restrictive and single-purposed because it is only for controlling that device, whereas an OS is a general-purpose system that allows any kind of software to be run on multiple hardware devices.
No, boot-loaders are not firmware because they are software that exists on the disk. Yes, the BIOS is because it exists on a (flashable) chip. No, GRUB is not firmware either because, again it is not firm (there is no hardware component to it), it is software that exists on disk—though it could (and may) be installed on a chip, in which case it would be firmware.
The boundaries can be a little fuzzy.
Software typically is any instructions or routine that a computer can do.
Firmware is typically specific instructions (software) that are loaded in/on to hardware in order for them to perform their function.
I would say that pretty much every piece of hardware has some sort of firmware included in it.
Again, I do not think there is a definitive guide as to where one starts and stops - all what firmware is, is software which is compiled for whatever chip is in the device.
As for your second question about what is firmware, I would say that bootloaders are not but the BIOS is and grub isn't.
This is very hard to draw the line but... the way I look at it is that the BIOS (now EFI) is the firmware of the motherboard, and the Hard drive has it's own firmware.
So, the bootloader/grub is pure software - it may do tasks with the hard drive, but it is not directly actually controlling any hardware.
If you take an embedded device such as an Iphone/Ipad, where does the firmware end and software begin!? If you consider IOS to be firmware, then why not Windows or similar.
To me, this shows that the boundaries are where the manufacturers or vendors of any device allow you to take control and it is not actually a fixed thing/exact science.
To complicate further - when I say upon request, this can be from a driver within other software
Now, an Ipad, or an Iphone, or any other embedded device...
So.... To sum up...
For me, I would say that firmware = the software that comes on devices where as pure software is purchased as data, but I am sure others may say different!