extboot reloaded.
cover extboot reloaded.
Hi,
How about this one? extboot rom and interface are unmodified.
The windup in qemu is very different though. It is now implemented as isa bus device (which is what extboot actually is). It is properly integrated into qdev. It is much less invasive than the previous version. The patch just drops a hw/extboot.c file into the tree and adds it to Makefile.target. No code changes anywhere else in qemu.
The magic words to activate extboot are '-device extboot,drive=<name>'.
cheers,
Gerd
PATCH 1/2 extboot: add option rom.
--- Makefile | 2 +- pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/extboot.S | 680 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 682 insertions(+), 2 deletions(-) create mode 100644 pc-bios/optionrom/extboot.S
Makefile +1 -1
@@ -260,7 +260,7 @@ pxe-e1000.bin pxe-i82559er.bin \ pxe-ne2k_pci.bin pxe-pcnet.bin \ pxe-rtl8139.bin pxe-virtio.bin \ bamboo.dtb petalogix-s3adsp1800.dtb \ -multiboot.bin +multiboot.bin extboot.bin else BLOBS= endif
pc-bios/optionrom/Makefile +1 -1
@@ -13,7 +13,7 @@ CFLAGS += -I$(SRC_PATH) CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector) QEMU_CFLAGS = $(CFLAGS) -build-all: multiboot.bin +build-all: multiboot.bin extboot.bin %.img: %.o $(call quiet-command,$(LD) -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@")
pc-bios/optionrom/extboot.S new file +680 -0
680 lines not on this page · raw message
Signature · 1 line
1.6.2.5
PATCH 2/2 extboot: qemu code.
In reply to Gerd Hoffmannbooting from scsi + virtio works now.
usage: -device extboot,drive=<name>
where <name> is the name of your boot drive. You can either use the names qemu assignes by default (virtio0, scsi0-hd0, ...) or explitly name your drives via '-drive id=<name>,...' and use that one.
--- Makefile.target | 2 +- hw/extboot.c | 168 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 169 insertions(+), 1 deletions(-) create mode 100644 hw/extboot.c
Makefile.target +1 -1
@@ -197,7 +197,7 @@ obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o wdt_ib700.o -obj-i386-y += ne2000-isa.o +obj-i386-y += ne2000-isa.o extboot.o # shared objects obj-ppc-y = ppc.o ide/core.o ide/qdev.o ide/isa.o ide/pci.o ide/macio.o
hw/extboot.c new file +168 -0
168 lines not on this page · raw message
Signature · 1 line
1.6.2.5
Quoted 4 lines · Gerd Hoffmann
Hi,
How about this one? extboot rom and interface are unmodified.
Quoted 8 lines
The windup in qemu is very different though. It is now implemented as isa bus device (which is what extboot actually is). It is properly integrated into qdev. It is much less invasive than the previous version. The patch just drops a
hw/extboot.cfile into the tree and adds it to Makefile.target. No code changes anywhere else in qemu.The magic words to activate extboot are '-device extboot,drive=<name>'.
If we were going to introduce a light weight block protocol like this, I'd rather it be implemented in SeaBIOS as a block driver. Then we reuse all of the int13 code, it gets registered as a BCV device allowing selection in the boot menu, and requires no special options on the command line.
It would require a mechanism to do enumeration and identification though.
Regards,
Anthony Liguori
Quoted 6 lines
cheers,
Gerd
Quoted 2 lines · Anthony Liguori
If we were going to introduce a light weight block protocol like this, I'd rather it be implemented in SeaBIOS as a block driver.
Ok. That would mean to replace the option rom with a seabios patch. The qemu code will be unmodified though (except for the rom loading).
Quoted 3 lines
Then we reuse
all of the int13 code, it gets registered as a BCV device allowing selection in the boot menu,
Fine.
Quoted 4 lines
and requires no special options on the
command line.It would require a mechanism to do enumeration and identification though.
Huh? Do you want export *all* block devices via extboot? Will IDE drives show up twice then?
I would export only one and export it only on explicit user request, so it can be used for cases where seabios has no native support ...
cheers,
Gerd
Quoted 5 lines · Gerd Hoffmann
Quoted 2 lines · Anthony Liguori
If we were going to introduce a light weight block protocol like this, I'd rather it be implemented in SeaBIOS as a block driver.
Ok. That would mean to replace the option rom with a seabios patch. The qemu code will be unmodified though (except for the rom loading).
Yup.
Quoted 6 lines
Quoted 4 lines
and requires no special options on the
command line.It would require a mechanism to do enumeration and identification though.
Huh? Do you want export *all* block devices via extboot? Will IDE drives show up twice then?
No, because SeaBIOS already has an ATA driver so we wouldn't want to expose IDE on the extboot bus.
Quoted 1 line
I would export only one and export it only on explicit user request, so it can be used for cases where seabios has no native support ...
If we expose all of the disks, then the user can choose which one they want to boot from without having to shut down qemu and modify the command line.
It's not obvious to me how we could control the position in the IPL table of each disk though. I guess we could have a priority parameter that was part of the disk enumeration that controlled how each device was added in the table. Do you have any thoughts Kevin?
Regards,
Anthony Liguori
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
It would require a mechanism to do enumeration and identification though.
Huh? Do you want export *all* block devices via extboot? Will IDE drives show up twice then?
No, because SeaBIOS already has an ATA driver so we wouldn't want to expose IDE on the extboot bus.
"SeaBIOS already has an ATA driver" doesn't seem a convincing argument for making IDE special, because I expect the BIOS will grow support for other block devices.
Quoted 6 lines
Quoted 2 lines
I would export only one and export it only on explicit user request, so it can be used for cases where seabios has no native support ...
If we expose all of the disks, then the user can choose which one they want to boot from without having to shut down qemu and modify the command line.
Either expose ever block device qemu knows about, or have extboot as a regular block device with no special handling. I strongly prefer the latter option. In fact I'd much prefer to see extboot rewritten to just virtio-block. Simple virtio clients really aren't that hard to write.
Paul
Quoted 6 lines · Paul Brook
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
It would require a mechanism to do enumeration and identification though.
Huh? Do you want export *all* block devices via extboot? Will IDE drives show up twice then?
Quoted 6 lines
Quoted 2 lines
No, because SeaBIOS already has an ATA driver so we wouldn't want to expose IDE on the extboot bus.
"SeaBIOS already has an ATA driver" doesn't seem a convincing argument for making IDE special, because I expect the BIOS will grow support for other block devices.
One of the reasons why I'd enable it only on explicit user request, so it can be used (temporarily) for cases where the bios has no native support.
Quoted 2 lines
Either expose ever block device qemu knows about, or have extboot as a regular block device with no special handling. I strongly prefer the latter option.
Me too.
Quoted 1 line
In fact I'd much prefer to see extboot rewritten to just virtio-block.
Hmm, I'd prefer something which is *not* used by the guest OS, so it is a pure bootloader thing. When using it to boot from scsi you don't want to have the disk show up twice (as virtio and scsi) in the guest.
Some non-pci virtio proxy could do the trick though, i.e. have virtio-blk-pci and virtio-blk-boot. Would probably also simplify things on the seabios side as native virtio support code could be reused then.
cheers,
Gerd
Quoted 5 lines
Quoted 1 line
In fact I'd much prefer to see extboot rewritten to just virtio-block.
Hmm, I'd prefer something which is *not* used by the guest OS, so it is a pure bootloader thing. When using it to boot from scsi you don't want to have the disk show up twice (as virtio and scsi) in the guest.
You're assuming noone ever writes OS support for extboot...
Paul
Quoted 7 lines · Paul Brook
Quoted 5 lines
Quoted 1 line
In fact I'd much prefer to see extboot rewritten to just virtio-block.
Hmm, I'd prefer something which is *not* used by the guest OS, so it is a pure bootloader thing. When using it to boot from scsi you don't want to have the disk show up twice (as virtio and scsi) in the guest.
You're assuming noone ever writes OS support for extboot...
Which would be almost as silly as writing OS support for bios-int13 ...
cheers
Gerd
Quoted 10 lines · Gerd Hoffmann
Quoted 7 lines · Paul Brook
Quoted 5 lines
Quoted 1 line
In fact I'd much prefer to see extboot rewritten to just virtio-block.
Hmm, I'd prefer something which is *not* used by the guest OS, so it is a pure bootloader thing. When using it to boot from scsi you don't want to have the disk show up twice (as virtio and scsi) in the guest.
You're assuming noone ever writes OS support for extboot...
Which would be almost as silly as writing OS support for bios-int13 ...
Not entirely. int13 is a software interface, extboot is a hardware interface. Look at it the other way round: If I already have my low performance boot device exposed via extboot (on an otherwise diskless client), why should I have to also expose it via virtio-blk just so that the guest can access it for installing kernel upgrades.
Paul
Quoted 12 lines · Paul Brook
Quoted 10 lines · Gerd Hoffmann
Quoted 8 lines · Paul Brook
Quoted 6 lines
Quoted 2 lines
In fact I'd much prefer to see extboot rewritten to just virtio-block.
Hmm, I'd prefer something which is *not* used by the guest OS, so it is a pure bootloader thing. When using it to boot from scsi you don't want to have the disk show up twice (as virtio and scsi) in the guest.
You're assuming noone ever writes OS support for extboot...
Quoted 9 lines
Quoted 2 lines
Which would be almost as silly as writing OS support for bios-int13 ...
Not entirely. int13 is a software interface, extboot is a hardware interface. Look at it the other way round: If I already have my low performance boot device exposed via extboot (on an otherwise diskless client), why should I have to also expose it via virtio-blk just so that the guest can access it for installing kernel upgrades.
Because that's not what you'd use it for. That's what -kernel and -initrd are there for.
IMHO having a BIOS backdoor is a good thing in general. If anyone wants to destroy their user experience by writing a driver for that in their OS, I'm good with that, but let's not expose things twice _to users_ as the default case.
Alex
Quoted 9 lines · Alexander Graf
Because that's not what you'd use it for. That's what -kernel and -initrd are there for.
IMHO having a BIOS backdoor is a good thing in general. If anyone wants to destroy their user experience by writing a driver for that in their OS, I'm good with that, but let's not expose things twice
_tousers_as the default case.
N.B. regardless of whether we have an alternative, simple block interface or we have proper drivers in the BIOS, we still have the same problem to solve. We need a way to communicate the desired boot priority of each block device. This becomes quite a bit more complicated if we're doing proper drivers in BIOS.
Regards,
Anthony Liguori
Quoted 4 lines
Alex
Quoted 6 lines · Anthony Liguori
Quoted 2 lines · Gerd Hoffmann
Huh? Do you want export *all* block devices via extboot? Will IDE drives show up twice then?
No, because SeaBIOS already has an ATA driver so we wouldn't want to expose IDE on the extboot bus.
One possibility would be for QEMU to tell the bios the type of each "extboot" drive - that way seabios could ignore drives it already had native drivers for.
Quoted 11 lines
Quoted 2 lines
I would export only one and export it only on explicit user request, so it can be used for cases where seabios has no native support ...
If we expose all of the disks, then the user can choose which one they want to boot from without having to shut down qemu and modify the command line.
It's not obvious to me how we could control the position in the IPL table of each disk though. I guess we could have a priority parameter that was part of the disk enumeration that controlled how each device was added in the table. Do you have any thoughts Kevin?
Adding to the BCV list is done via the add_bcv_internal() call in src/boot.c. The list order is determined by the type of drive and its internal id - usually drives are arranged in the list in the order they are found.
The order of hard drives is determined by the BCV list. There is only one entry in the IPL table for booting from a hard drive - selecting "-boot c" prioritizes this IPL - hard drive booting always boots from the "C" drive. It's possible to tell SeaBIOS to map the C drive to something other than the first item on the BCV list, but that functionality is currently only available via the boot menu.
As an aside, I'm open to adding both an "extboot" driver and additional native drivers to SeaBIOS. Both have their uses.
-Kevin
Quoted 7 lines · Kevin O'Connor
The order of hard drives is determined by the BCV list. There is only one entry in the IPL table for booting from a hard drive - selecting "-boot c" prioritizes this IPL - hard drive booting always boots from the "C" drive. It's possible to tell SeaBIOS to map the C drive to something other than the first item on the BCV list, but that functionality is currently only available via the boot menu.
This is the bit that confused me. Does an IPL entry for the hard disk result in each BCV device being booted in order of BCV priority or is there a means to have multiple IPL entries? IOW, how would we support a boot order of first hard disk, second hard disk, then CD-ROM?
Regards,
Anthony Liguori
Quoted 9 lines · Anthony Liguori
Quoted 6 lines · Kevin O'Connor
The order of hard drives is determined by the BCV list. There is only one entry in the IPL table for booting from a hard drive - selecting "-boot c" prioritizes this IPL - hard drive booting always boots from the "C" drive. It's possible to tell SeaBIOS to map the C drive to something other than the first item on the BCV list, but that functionality is currently only available via the boot menu.
This is the bit that confused me.
The IPL and BCV stuff is confusing.
An IPL is a way to boot the machine (floppy, hard drive, cdrom, BEVs (eg, network card)). A BCV is a hard drive.
So, there is only one IPL entry for booting from a hard drive, though one may have many hard drives.
Quoted 4 lines
Does an IPL entry for the hard disk
result in each BCV device being booted in order of BCV priority or is there a means to have multiple IPL entries? IOW, how would we support a boot order of first hard disk, second hard disk, then CD-ROM?
With full compatibility, it's not possible to have a boot order of first hard drive, then second hard drive.
The only compatible way to boot from a hard drive is to map that hard drive to drive "C". Once a drive is mapped, the mapping can't be changed. (Theoretically, seabios, could alter the mappings of internally handled drives, but there is no way to remap a hard drive added by an option rom.)
The BCV list is looked at in the last stage of POST - each drive is mapped at that point. The first drive on the list becomes the "C" drive (unless one asks SeaBIOS to move a drive up by selecting it in the boot menu - in which case that drive becomes drive "C"). Each successive entry in the list becomes "D", "E", etc.
The IPL list is looked at during boot (after POST) and seabios attempts each method in the list. The "-boot" parameter instructs seabios what order of IPL entries to try during boot.
As for adding two IPL entries for hard drives - it wouldn't be useful because one can only boot from the "C" drive.
Hope this helps.
-Kevin
Quoted 6 lines · Gerd Hoffmann
Quoted 2 lines · Anthony Liguori
If we were going to introduce a light weight block protocol like this, I'd rather it be implemented in SeaBIOS as a block driver.
Ok. That would mean to replace the option rom with a seabios patch. The qemu code will be unmodified though (except for the rom loading).
Can't extboot be used with other BIOSes, though, being an option ROM?
-- Jamie
Quoted 4 lines · Jamie Lokier
Quoted 2 lines · Gerd Hoffmann
On 11/16/09 20:24, Anthony Liguori wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
If we were going to introduce a light weight block protocol like this, I'd rather it be implemented in SeaBIOS as a block driver.
Ok. That would mean to replace the option rom with a seabios patch. The qemu code will be unmodified though (except for the rom loading).
Can't extboot be used with other BIOSes, though, being an option ROM?
Except the "bus" that extboot requires doesn't exist anywhere but in qemu.
Quoted 2 lines
-- Jamie
Regards,
Anthony Liguori