Bootloader INT 0x13 Never Returns

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
mich
Posts: 18
Joined: Sun Nov 11, 2012 5:36 pm

Re: Bootloader INT 0x13 Never Returns

Post 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!
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Bootloader INT 0x13 Never Returns

Post by egos »

Reset DS before calling function 42h and probably PRINTI macros.
Last edited by egos on Sat Nov 24, 2012 6:39 pm, edited 1 time in total.
If you have seen bad English in my words, tell me what's wrong, please.
Geometrian
Member
Member
Posts: 77
Joined: Tue Nov 20, 2012 4:45 pm
Contact:

Re: Bootloader INT 0x13 Never Returns

Post 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!
mich
Posts: 18
Joined: Sun Nov 11, 2012 5:36 pm

Re: Bootloader INT 0x13 Never Returns

Post 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).
Post Reply