Reading from and writing to disk sectors in protected mode

Started by brodeur235, July 25, 2010, 05:00:23 AM

Previous topic - Next topic

brodeur235

I am writing an OS using the Netwide Assembler, not Microsoft's; I know that violates the license. What I'm look for is the simplest conventional way to read from and write to an HDD (in p-mode, so no BIOS ints). Simple documentation links, explanations, and asm code snippets are what I find to be the most helpful. Help appreciated,

Brodeur235

MichaelW

The ATA/ATAPI standards should be useful. You used to be able to get the working drafts for free from the committee responsible for the standards:

http://www.t13.org/Default.aspx

But they are apparently no longer available, so you're probably left with buying the published standards. Try the Global Engineering Documents link on the t13 Published Standards page. The download price seems to be in the vicinity of $30.

PIO mode through the command/control block registers used to be easy to do, at least for the purposes of identifying the drive.

eschew obfuscation

sinsi

You have 2 options. One is to switch to real mode, do the bios int 13 call then switch back to pmode, but that is very slow.
The other is to write a driver, the ports and commands are well documented.

You might want to look at osdev.org or the OS construction forum at board.flatassembler.net
Light travels faster than sound, that's why some people seem bright until you hear them.

sinsi

I have the atapi6 pdf somewhere, I can upload it here when I dig it out if anyone wants.
Light travels faster than sound, that's why some people seem bright until you hear them.

Geryon

"Some people have got a mental horizon of radius zero and call it their point of view." --D.Hilbert