Question

I would just like to clear up the exact order of the relationships between the hardware(more precisely peripherals-mouse, keyboard etc), the OS, the Chipset/BIOS the RAM and CPU:

My understanding: Action: Click a button on screen with mouse: 1. Any input from hardware is handled by the Device Drivers(Whether it is System ROM BIOS, Option ROM BIOS or Software Drivers). 2. From the drivers the instructions are sent to the Chipset(Southbridge in case of I/O devices) and then to the CPU for processing. 3. From the CPU the commands are stored in the RAM and then passed to the OS.

Is that the correct chain of events?

Thank you

Was it helpful?

Solution

More or less, If we assume DMA access this will be the order:

  1. It starts with a hardware device raising an interrupt for an event of some kind. This causes the interrupt controller to interrupt the CPU, which (provided the interrupt isn't masked and the CPU not already executing another interrupt) will cause the CPU to take an interrupt trap and the operating system to handle it p usually by executing code in a device driver.

  2. Any input from hardware is handled by the Southbridge (which it's connected to the northbridge by an internal bus) and store values into its asigned memory's address at the main memory (RAM).

  3. The OS will wake the process which is waiting for the IO operation (the one who needs the input data) then the OS scheduler will send this program to the executing queue. Here with the help of the drivers (drivers are part of the OS, most of the time made by the hardware company) will add code to respond to the data received by the input hardware.
  4. CPU will execute the code from the RAM (where the process and data were stored in previous steps).

Remember that drivers are not made to work with the bios to get data (they can take information from there) and the OS will organize code to let the CPU to execute it. I'm not sure but i think that CPU never knows that is input from the hardware, it is just another code/data from a memory address.

Sorry for my english or if i made any mistake, please correct me and add a comment, i will update the text.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top