Page 1 of 1

How does the kernel communicate with the hardware

Posted: Mon Sep 15, 2008 2:43 pm
by Hero Doug
I'm trying to settle a debate with a friend of mine about how the OS communicates with the hardware (get the CD tray to eject, disable the ethernet card, play sound, etc).

He says it's through the BIOS, always. I shot that down because everything I've read tells me this can only be done in real mode, and it's kep[t quite basic, so you can't use the full power of the hardware.

I said that it's direct communication with the device through the system bus. Load your information, signal the device, let it do it's thing and wait for the result.

Can anyone post what actually happens?

Thanks,

Posted: Mon Sep 15, 2008 5:08 pm
by Mike
You should just ask your friend what the IN and OUT instructions are for ;)

You got the basic idea. When the processor executes an IN or OUT instruction, the cpu sets the IO RW line (I forget the exact name for this line atm) in the control bus and puts the data on the data bus and port address on the address bus. With the IO RW line set, the southbridge takes the port number and the device that is using the port number works with the data in some way depending on the register the port corresponds to.

During bootup, the BIOS initializes the onboard controllers and creates the IO port address space for the southbridge.

This is my understanding of it, anyways. If there are any errors or additional information I will be glad to hear it :)

Posted: Tue Sep 16, 2008 12:30 am
by Hero Doug
That was my understanding of it as well, it would pretty amazing for the BIOS to be the mediator of all known devices and future unknown devices, and to do advanced operations with a "basic" input/output system.

Thanks for providing confirmation.