Computer Hardware

Moderators: None (Apply to moderate this forum)
Number of threads: 711
Number of posts: 1421

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Boot Physical Drive Posted by pmihail on 1 Apr 2002 at 4:55 PM
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 ?!
Report
Re: Boot Physical Drive Posted by dreammerchant on 4 May 2002 at 7:45 AM
: 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















 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.