Boot Physical Drive - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Boot Physical Drive

Help ! I'm desperate ! I need to find out the address in BIOS where is stored the value for boot drive. I'm not talkin here about the logical boot drive (like A:, C:, D: ...etc) but i'm talking about the physical boot drive (0 for floppy, 80h for first harddisk, 81h for the second harddisk ... etc). Any system call wouldnt help me because i want to be operating system indpendent except that if that system call can tell me the address where i can find the value for the boot physical drive.
Anyone can help me ?!

Comments

  • dreammerchantdreammerchant Posts: 23Member
    : Help ! I'm desperate ! I need to find out the address in BIOS where is stored the value for boot drive. I'm not talkin here about the logical boot drive (like A:, C:, D: ...etc) but i'm talking about the physical boot drive (0 for floppy, 80h for first harddisk, 81h for the second harddisk ... etc). Any system call wouldnt help me because i want to be operating system indpendent except that if that system call can tell me the address where i can find the value for the boot physical drive.
    : Anyone can help me ?!
    :
    The Drive type is located in CMOS RAM and the addresses are as follows:
    10 Diskette drive types
    == ====================
    bits 7-4 - drive 0 type (A:)
    bits 3-0 - drive 1 type (B:)
    0000b - no drive
    0001b - 360k
    0010b - 1.2M
    0011b - 720k
    0100b - 1.44M

    11 Reserved
    12 Hard disk drive type
    == ====================
    (for drives C: and D:, when between 1 and 14)
    bits 7-4 - fixed disk 0 type (C:)
    bits 3-0 - fixed disk 1 type (D:)
    0000b = no drive
    0001b-1110b = drive type
    1111b = drive 0 (1) type stored at addr 19h (1Ah)
    13 Reserved
    14 Equipment byte
    == ==============
    bits 7-6 - no. of floppy drives (00=1, 01=2, 10=3, 11=4)
    bits 5-4 - primary display 00 = none, EGA, VGA ...
    01 = 40x25 colour
    10 = 80x25 colour
    11 = 80x25 monochrome
    bits 3-2 - reserved
    bit 1 =1 if math copro installed
    bit 0 =1 if floppy drive(s) present

    19 Disk 0 type if (CMOS addr 12H & 0fH) is 0fH
    1A Disk 1 type if (CMOS addr 12H & f0H) is f0H

    what you have to do is-

    ;Read a cmos register
    cli ; make sure no interrupt wants to access the RTC in the mean time
    mov al,10h
    out 70h,al ;first let himknow which address you want to read/write to
    nop ;a slight delay
    in al,71h ;then read
    sti

    cli
    mov al,12h ;same as above.
    out 70h,al
    nop
    in al,71h
    sti












Sign In or Register to comment.