How to R/W hard disk when CPU is in Protect Mode?

Posted by smwikipedia on Stack Overflow See other posts from Stack Overflow or by smwikipedia
Published on 2010-06-08T04:46:22Z Indexed on 2010/06/08 4:52 UTC
Read the original article Hit count: 212

Filed under:
|
|

I am doing some OS experiment. Until now, all my code utilized the real mode BIOS interrupt to manipulate hard disk and floppy. But once my code enabled the Protect Mode of the CPU, all the real mode BIOS interrupt service routine won't be available. How could I R/W the hard disk and floppy? I have a feeling that I need to do some hardware drivers now. Am I right? Is this why an OS is so difficult to develop?

I know that hardwares are all controlled by reading from and writing to certain control or data registers. For example, I know that the Command Block Registers of hard disk range from 0x1F0 to 0x1F7. But I am wondering whether the register addresses of so many different hardwares are the same on the PC platform? Or do I have to detect that before using them? How to detect them??

For any responses I present my deep appreciation.

© Stack Overflow or respective owner

Related posts about linux

Related posts about operating-system