How does the kernel communicate with the hardware

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
Hero Doug
Posts:5
Joined:Thu Apr 17, 2008 1:04 am
How does the kernel communicate with the hardware

Post by Hero Doug » Mon Sep 15, 2008 2:43 pm

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,

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Post by Mike » Mon Sep 15, 2008 5:08 pm

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 :)

Hero Doug
Posts:5
Joined:Thu Apr 17, 2008 1:04 am

Post by Hero Doug » Tue Sep 16, 2008 12:30 am

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.

Post Reply