Reading big Hard Drives?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Unspoken_Magi

Reading big Hard Drives?

Post by Unspoken_Magi »

How can I read a huge hard drive? (120Gig)
BIOS calls won't work...
Using ports doesn't work... (I think)
Do I have to use a "manufacturer's specified" way? (such as reading a different port, etc.)

Also, how can I partition drives bigger than the LBA field allows? The LBA only allows for 4 Gig.

Can a MBR load a partition that is somewhere above 4Gig?

If so, how?
Unspoken_Magi

Re:Reading big Hard Drives?

Post by Unspoken_Magi »

Anyone? I really need this soon, its holding me up. I don't want to use a cheap hack for the MBR anymore...
Tim

Re:Reading big Hard Drives?

Post by Tim »

Program the IDE controller directly. Forget the BIOS.

If you're talking about your MBR code, put in a disclaimer that says, "we don't support booting from partitions beyond xxx MB".
Unspoken_Magi

Re:Reading big Hard Drives?

Post by Unspoken_Magi »

Tim Robinson wrote: Program the IDE controller directly. Forget the BIOS.

If you're talking about your MBR code, put in a disclaimer that says, "we don't support booting from partitions beyond xxx MB".
Yes, but how can you even HAVE partitions past 4Gb or larger than 4 Gb... The LBA fields in the MBR are dwords...
Curufir

Re:Reading big Hard Drives?

Post by Curufir »

The last two fields in the partition entry in a standard MBR are offset into drive, and size of partition. Both are 4 bytes long, and measured in sectors.

This gives you a maximum partition size of 2^32 sectors, with the final partition being offset a possible 2^32 sectors into the disk.

Therefore the maximum size disk you can describe with the MBR is 4 Terabytes (Offset plus size) with a maximum partition size of 2 Terabytes (Assuming 512 byte sectors). I you happen to possess a 4 terabyte drive then hire someone else to write your OS, apparently you're rich enough ;D.

Int 13h uses CHS so it hits a limit which means communicating directly through the IDE ports to load sectors beyond the so called BIOS limit as Tim has already suggested.
Post Reply