News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

int 13h, hard drive interrupt

Started by ninjarider, September 30, 2006, 05:16:03 PM

Previous topic - Next topic

ninjarider

how do i go about reading off the hard drive, which would be the c drive in windows.

im loading dl with 2, as the drive number.

MichaelW

Bit 7 of the drive number must be set for a hard disk, so for the first hard disk drive the value in DL should be 80h.

eschew obfuscation

ninjarider

i knew it had somthing to do with an 8. i thought it was 800 though

Tedd

The first sector from drive 80h will be the mbr/partition-table, not "drive C" -- so be careful :bdg (Though you're only reading, so it's not so bad :wink)
You need to read from the partition-table to find which sector drive C starts from (which also means identifying which entry in the table IS drive C.)
No snowflake in an avalanche feels responsible.

ninjarider

i've been having a hard time finding a bpb and epb for a windows 98 se systems that matches the drive im running on.
i tried reading the drive and displaying it and all i get are spaces. nothing valid i can read.

Tedd

Try displaying in hex so you can see what you're actually getting. You might be using a wrong offset at some point.
If you do have a valid bpb then some of it at least should contain readable ascii.

{The first place I would look is the first sector on the second cylinder (cylinder 1); or 63 sectors after the MBR -- for a sanity check, but use the partition table from the program.}
No snowflake in an avalanche feels responsible.

ninjarider

isn't that suppose to be the copy of the mbr.

MichaelW

The attachment contains a crude app that can dump the contents of the boot sector that the first partition table entry points to, if the partition is bootable and the boot sector falls within the first 256 cylinders. A complete app would need to check the other partition table entries as a minimum, if not other partition tables pointed to by the first partition table. To reach a boot sector that does not fall within the first 256 cylinders you should be able to use the functions provided by the Interrupt 13h Extensions and the (LBA) value in the peStartSector member.

The app appears to be safe, but use it at your own risk.


[attachment deleted by admin]
eschew obfuscation

ninjarider

thnx. i'll use all the info out of it that i can get.