Code Comments
Programming Forum and web based access to our favorite programming groups.Hello everyone. Programming in real mode, how can I determinate how many harddisks are present in my pc ? and how they are numbered ? And to use these function (and other): Int 13/AH=03h - DISK - WRITE DISK SECTOR(S) Int 13/AH=02h - DISK - READ SECTOR(S) INTO MEMORY how can i know what is the maximum number of cylinder, head and sector per each hardDisk ? and what exactly does this mean ? "DL = drive number (bit 7 set for hard disk)" I have to set DL to my driver number and OR it with 0x40 ? Thanks in advance Cya Matic
Post Follow-up to this messageOn Wed, 31 Mar 2004 21:47:00 +0000 (UTC), Matic <matic999@hotmail.com> wrote: >Hello everyone. > >Programming in real mode, how can I determinate how many harddisks are >present in my pc ? and how they are numbered ? > >And to use these function (and other): >Int 13/AH=03h - DISK - WRITE DISK SECTOR(S) >Int 13/AH=02h - DISK - READ SECTOR(S) INTO MEMORY > >how can i know what is the maximum number of cylinder, head and sector per >each hardDisk ? >and what exactly does this mean ? >"DL = drive number (bit 7 set for hard disk)" >I have to set DL to my driver number and OR it with 0x40 ? > >Thanks in advance >Cya >Matic > You will find a lot of info in Ralf Brown's Interrupt List. Note that if you expect to run on anything over 4 GB you should probably forget about the CHS system and go to LBA (Logical Block Addressing). As for the DOS drive numbering, bit 7 is 80h, so the first (0th) hard drive is 80h, which is almost always called drive C, 81h would be D, and so on. Hope this helps! Bob Masta dqatechATdaqartaDOTcom D A Q A R T A Data AcQuisition And Real-Time Analysis www.daqarta.com
Post Follow-up to this messageMatic <matic999@hotmail.com> wrote: >Programming in real mode, how can I determinate how many harddisks are >present in my pc ? The byte at linear address 0x475 contains the number of hard drives known to the BIOS. In Turbo C: unsigned num_hds = pb(0x40, 0x75); >and how they are numbered ? I don't think there's a standard for this; it depends on the OS, how the hard drives are partitioned, and (for DOS and Windows) the filesystem type for each partition. >And to use these function (and other): >Int 13/AH=03h - DISK - WRITE DISK SECTOR(S) >Int 13/AH=02h - DISK - READ SECTOR(S) INTO MEMORY These are fairly simple; see Ralf Brown's famous Interrupt List (search for it). >how can i know what is the maximum number of cylinder, head and sector per >each hardDisk ? Use INT 13h AH=08h to retrieve the hard disk geometry information. Large (new!) hard drives may not have a valid CHS geometry, so you should also look at using the LBA disk functions in the BIOS: INT 13h AH=41h/AH=42h/AH=43h >and what exactly does this mean ? >"DL = drive number (bit 7 set for hard disk)" >I have to set DL to my driver number and OR it with 0x40 ? 0x80 is the INT 13h number of the first hard drive, 0x81 is the second hard drive, etc.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.