In embedded devices such as printer, switches, I am confused what the difference between the firmware and the operating system is. Are embedded devices operating systems similar
Firmware refers to a small piece of code that resides in non-volatile memory. In hardware peripherals that are commonly found in offices these days (e.g. printers, VoIP phones, etc.), firmware is usually responsible for loading (e.g. OS code signature verification) and managing (e.g. flashing OS in recovery mode) the operating system that is installed on the machine. It's the operating system's job to carry out the actual task (e.g. printing).
Hardware vendors commonly use a derivative of Linux (e.g. Cisco IOS), or a real-time operating system (e.g. VxWorks).