Page 2 of 2

Re: Bootloader INT 0x13 Never Returns

Posted: Sat Nov 24, 2012 6:30 pm
by mich
Geometrian wrote:

Code: Select all

	mov     dl, 0x80
As already noted by jnc100 don't do that. dl will have the correct drive already on boot up. Just don't overwrite it.

Also it is likely not the cause but you are actually not checking for LBA read/write capabilities but for general BIOS EDD extensions which could also be just drive eject and locking or fixed disk capabilities.

http://www.t13.org/documents/UploadedDo ... d-BIOS.pdf says:

Code: Select all

4.2 Int 13h extensions
4.2.1 Check extensions present
Entry:
AH - 41h
BX - 55AAh
DL - Drive number
Exit:
carry clear
  AH - Version of extensions
  AL - Internal use only
  BX - AA55h
  CX - Interface support bit map (seeTable 9 )
carry set
  AH - error code (01h, Invalid Command)

Table 9 − Extension result buffer
Bit   Description
0 1 - Fixed disk access subset
1 1 - Drive locking and ejecting subset
2 1 - Enhanced disk drive support subset
3-15 - Reserved, must be 0

This function is used to check for the presence of Int 13h extensions. If the carry flag is returned set, the
extensions are not supported for the requested drive. If the carry flag is returned cleared, BX shall be checked for the value AA55h to confirm that the extensions are present. If BX is AA55h, the value of CX is checked to
determine what subsets of this interface are supported for the requested drive. At least one subset must be
supported. The version of the extensions is 21h. This indicates that the Int 13h extensions are compliant with this
technical report.
Anyway like already suggested by DavidCooper and jnc100 the print call is messing with your registers!

Re: Bootloader INT 0x13 Never Returns

Posted: Sat Nov 24, 2012 6:33 pm
by egos
Reset DS before calling function 42h and probably PRINTI macros.

Re: Bootloader INT 0x13 Never Returns

Posted: Sat Nov 24, 2012 6:38 pm
by Geometrian
That was definitely the problem. I will get bochs.
mich wrote:Also it is likely not the cause but you are actually not checking for LBA read/write capabilities but for general BIOS EDD extensions which could also be just drive eject and locking or fixed disk capabilities.
Noted. Not sure how I could check it; examples? I feel like I should TEST some query against 0x7 to see that it supports everything.

Thanks all!

Re: Bootloader INT 0x13 Never Returns

Posted: Sat Nov 24, 2012 6:53 pm
by mich
Geometrian wrote:I feel like I should TEST some query against 0x7 to see that it supports everything.
Not necessarily. If you only need LBA read and write (0x42 and 0x43) it is enough to check for that (bit 2).