VirtualBox refuses INT 13H extensions when using El Torito

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.
Post Reply
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

VirtualBox refuses INT 13H extensions when using El Torito

Post by mariuszp »

I'm trying to port my bootloader to boot from ISO, so that I'm using the same bootloader on the hard disk and on the ISO. Previously i was using grub-mkrescue to generate a GRUB bootable CD.

I test for INT 13H extensions using:

Code: Select all

; make sure INT13 extensions are present
mov ah, 0x41
; drive number already in DL
mov bx, 0x55AA
int 0x13
jc boot_failed
This works perfectly when booting from disk, in both VirtualBox and Bochs. However, when I create a bootable CD using:

Code: Select all

mkisofs -R -V 'Glidix Installer' -b boothde.img -hard-disk-boot -o glidix.iso isodir
Where "boothde.img" is a hard drive image containing that same MBR and VBR, the MBR jumps to boot_failed at that point (which invokes INT 18H). Why then does it not support the extensios on the El Torito disk, and what can be done about this?
linuxyne
Member
Member
Posts: 211
Joined: Sat Jul 02, 2016 7:02 am

Re: VirtualBox refuses INT 13H extensions when using El Tori

Post by linuxyne »

The commit adds support for int13h,ah=0x41 while emulating a hard disk. It is 3 months old. Is it likely that your version of VirtualBox is older?
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

Re: VirtualBox refuses INT 13H extensions when using El Tori

Post by mariuszp »

linuxyne wrote:The commit adds support for int13h,ah=0x41 while emulating a hard disk. It is 3 months old. Is it likely that your version of VirtualBox is older?
Is it bad to assume that the extensions are present? Should I be using CHS in my bootloader instead? OR is this problem very rare and only appears in older versions of VirtualBox on emulated disks?
linuxyne
Member
Member
Posts: 211
Joined: Sat Jul 02, 2016 7:02 am

Re: VirtualBox refuses INT 13H extensions when using El Tori

Post by linuxyne »

mariuszp wrote:Is it bad to assume that the extensions are present? Should I be using CHS in my bootloader instead?
It is definitely better to check for extensions and adapt, than to assume that they are present/absent.
mariuszp wrote:OR is this problem very rare and only appears in older versions of VirtualBox on emulated disks?
The problem here is quite specific - int13 extension support when a cdrom is booted up in hard-disk emulation mode.

The bios implementation of VirtualBox (which resembles quite closely that of Bochs) has decided to duplicate the implementation of the int13 extensions for each of the three boot cases - cdrom-no-emul, cdrom-harddisk-emul, and harddisk. On top of that, each implementation has varying degrees of support for the extensions.

It would have been better, imho, if a single instance of the implementation was written, and each of the three cases called into it.

I think that Bochs does not support int13 extensions when booting a cdrom in harddisk emulation mode - i.e. you would experience the same problem you reported here with Bochs as well. For both VirtualBox and Bochs, when the control jumps to boot_failed, the AH is likely set to 1 (which their code says they use to signal unimplemented functionality.)

Edit: The VirtualBox changes to support int13x with cdrom-harddisk-emul boot seems to have been prompted by the needs raised by Symantec Ghost. The changelog says:

Symantec Ghost 11.5 bootable CD also uses El Torito hard disk emulation, uses INT13X without checking for support, and crashes if INT13X is not supported on the emulated drive.
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

Re: VirtualBox refuses INT 13H extensions when using El Tori

Post by mariuszp »

Well, turns out it was easier to just implement an el torito no-emulation bootloader.
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: VirtualBox refuses INT 13H extensions when using El Tori

Post by BenLunt »

Sorry to dig this thread back up, but I have a question for anyone reading.

Do you know of any emulator or actual BIOS that does support the "El Torito" emulation mode? i.e.: supports functions 0x4A, 0x4B, 0x4C, and 0x4D? Especially function 0x4C?

I know that Bochs has the "beginnings" of this, QEMU uses the same BIOS, and VirtualBox doesn't support it either.

I have an image at https://github.com/fysnet/FYSOS/tree/ma ... es/boot_cd that relies upon the El Torito specification to boot a menu allowing different images to boot. However, with no support in the most common/used emulators, and no known BIOS (that I have anyway), I haven't an idea if it actually works.

Thanks,
Ben
Post Reply