Disk geometry (Int 13h AH=08h) problem
Posted: Fri Aug 19, 2011 6:41 am
Currently I'm making my boot-loader a little bit more fancy. Now a problem arises when I try to acquire the disc geometry. I call bios interrupt 13h AH=08h (in 16bit mode) for the first hard drive (which is a 1mb image loaded with qemu 'qemu <image_name>'). The max head number is 15, the max sector number is 63 and the max cylinder number is 0. If I'm correct this results in a disk smaller then 1mb? I use my own assembler which is non-English, but I know for sure that the code I wrote is the code that is written, here is the result from ndisasm:
After this code I call my print number routine which tells me that cx contains the number 63, so cylinder count == 0. So what is wrong with this code? Is there a other way to acquire the disk geometry (the disk doesn't have a MBR because I use a different layout that I designed myself). I searched for a way to force the bios to use LBA (since some places hinted at the existence of such functionality) but could not find any information, is it possible?
Code: Select all
mov ax,0x0
mov es,ax
mov di,0x0
mov ah,0x8
mov dl,[0x8227] ;here is the drive id stored (0h80)
int 0x13
jc error
cmp dl, 0
je error