how can i detect drives in real mode? I tried attempting to read from all the drive numbers, w/o actually reading any memory, and reporting whether or not there was an error, but that didnt yield resutls. Any ideas?
How does load an idt in real mode? do you just use lidt and it is immediately active? Do i load it, then enter PM then go back to RM? what do i use as the offest in the table entires (idt)?
detecting drives in real mode + lidt
-
- Member
- Posts: 97
- Joined: Thu Mar 15, 2007 2:27 pm
Well, you can use INT 13h with AH=08h and AH=15h.how can i detect drives in real mode? I tried attempting to read from all the drive numbers
AH=08h:
required to fill:
AH=08h
DL=drive number (00-first FDD,01-second FDD,80h:first HDD,81h:second HDD)
INT 13h
you'll get:
CF=1 on error (maybe...)
CH=the maximal number of cylinders of the drive DECREMENTED by 1
CL=the maximal number of sectors (per track?)
DH=number of heads (surfaces)
DL=the number of devices connected to the controller
Beware that this function may return curious results, if you for example, have one harddisk in your PC and you are getting info for second HDD..
AH=15h:
required to fill:
AH=15h
DL=drive number
INT 13h
you'll get:
AH=status:
00 - drive in DL does not exist
01 - diskette without indication of removability (?)
02 - diskette (or any removable media) with indication of removability (?)
03 - hard disk
CX:DX= if AH is nonzero, then it is the total number of sectors in medium
Should be...How does load an idt in real mode? do you just use lidt and it is immediately active?
inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk