It depends on how you connect the device and the PC. For PCI cards, there is a set of Linux kernel mode APIs. Another set of kernel-mode APIs is used to communicate with a device connected via a USB port. To connect Ethernet and WiFi, you can use the socket API, the connection is completely in user mode. Devices connected via the serial port are also processed using the user-mode API - they are considered as files in the Linux OS.
As a rule, the firmware of the device does not depend on the OS of the host system. It depends, however, on the OS (if any) running on the device itself. The firmware code can be written in simple C without any OS or run under real-time OS. Modern devices may contain full-featured operating systems, such as embedded Linux or Windows. In this case, the entire OS with programs specific to this device is considered the firmware of the device. For example, Android OS for a specific mobile device.
source share