OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 1:26 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: VirtualBox refuses INT 13H extensions when using El Torito
PostPosted: Wed Mar 28, 2018 3:38 pm 
Offline
Member
Member

Joined: Sat Oct 16, 2010 3:38 pm
Posts: 587
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:
; 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:
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?


Top
 Profile  
 
 Post subject: Re: VirtualBox refuses INT 13H extensions when using El Tori
PostPosted: Wed Mar 28, 2018 10:06 pm 
Offline
Member
Member

Joined: Sat Jul 02, 2016 7:02 am
Posts: 210
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?


Top
 Profile  
 
 Post subject: Re: VirtualBox refuses INT 13H extensions when using El Tori
PostPosted: Thu Mar 29, 2018 5:00 am 
Offline
Member
Member

Joined: Sat Oct 16, 2010 3:38 pm
Posts: 587
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?


Top
 Profile  
 
 Post subject: Re: VirtualBox refuses INT 13H extensions when using El Tori
PostPosted: Thu Mar 29, 2018 8:41 am 
Offline
Member
Member

Joined: Sat Jul 02, 2016 7:02 am
Posts: 210
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.


Top
 Profile  
 
 Post subject: Re: VirtualBox refuses INT 13H extensions when using El Tori
PostPosted: Thu Mar 29, 2018 5:18 pm 
Offline
Member
Member

Joined: Sat Oct 16, 2010 3:38 pm
Posts: 587
Well, turns out it was easier to just implement an el torito no-emulation bootloader.


Top
 Profile  
 
 Post subject: Re: VirtualBox refuses INT 13H extensions when using El Tori
PostPosted: Sat Sep 22, 2018 6:40 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 934
Location: USA
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/master/images/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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot], SemrushBot [Bot] and 133 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group