port over extboot from kvm
cover port over extboot from kvm
$subject says pretty much everything.
extboot.[cS] are a straight copy from the kvm tree. The windup in vl,c and hw/pc.c is done slightly different, I've added a function to lookup the boot drive instead of adding a new global variable.
Booting from scsi and virtio works, using the boot=on flag.
With the usb+scsi patches in anthonys patch queue applied booting from usb works too. Syntax is this:
-drive if=none,id=pendrive,file=/path/to/image,boot=on -usb -device usb-storage,drive=pendrive
Booting a rawhide install from a virtual usb stick doesn't actually work though, looks like it stresses qemus usb emulation too much.
PATCH 1/2 extboot: add option rom.
--- Makefile | 2 +- pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/extboot.S | 695 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 697 insertions(+), 2 deletions(-) create mode 100644 pc-bios/optionrom/extboot.S
Makefile +1 -1
@@ -212,7 +212,7 @@ BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ video.x openbios-sparc32 openbios-sparc64 openbios-ppc \ pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \ bamboo.dtb petalogix-s3adsp1800.dtb \ -multiboot.bin +multiboot.bin extboot.bin else BLOBS= endif
pc-bios/optionrom/Makefile +1 -1
@@ -11,7 +11,7 @@ CFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin CFLAGS += -I$(SRC_PATH) CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"") -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 +695 -0
695 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.
--- Makefile.target | 1 + hw/extboot.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ hw/pc.c | 15 +++++- hw/pc.h | 4 ++ qemu-config.c | 4 ++ qemu-options.hx | 2 +- sysemu.h | 1 + vl.c | 12 +++++ 8 files changed, 171 insertions(+), 3 deletions(-) create mode 100644 hw/extboot.c
Makefile.target +1 -0
@@ -188,6 +188,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 += extboot.o # shared objects obj-ppc-y = ppc.o ide/core.o ide/isa.o ide/pci.o ide/macio.o
hw/extboot.c new file +135 -0
135 lines not on this page · raw message
hw/pc.c +13 -2
@@ -47,6 +47,7 @@#define BIOS_FILENAME "bios.bin"#define VGABIOS_FILENAME "vgabios.bin"#define VGABIOS_CIRRUS_FILENAME "vgabios-cirrus.bin" +#define EXTBOOT_FILENAME "extboot.bin"#define PC_MAX_BIOS_SIZE (4 * 1024 * 1024)
@@ -1130,7 +1131,7 @@ static void pc_init1(ram_addr_t ram_size,qemu_irq *isa_irq;qemu_irq *i8259;IsaIrqState *isa_irq_state; -DriveInfo *dinfo; +DriveInfo *dinfo, *boot_drive;DriveInfo *hd[MAX_IDE_BUS *MAX_IDE_DEVS ];BlockDriverState *fd[MAX_FD ];int using_vga = cirrus_vga_enabled || std_vga_enabled || vmsvga_enabled;
@@ -1218,7 +1219,10 @@ static void pc_init1(ram_addr_t ram_size, isa_bios_size, (bios_offset + bios_size - isa_bios_size) | IO_MEM_ROM); - + boot_drive =drive_get_boot (); +if (boot_drive) { + option_rom[nb_option_roms++] =qemu_strdup (EXTBOOT_FILENAME ); + } option_rom_offset =qemu_ram_alloc (0x20000 ); oprom_area_size =0 ;
@@ -1428,6 +1432,13 @@ static void pc_init1(ram_addr_t ram_size, } } } + +if (boot_drive) { +int cyls, heads, secs; +bdrv_guess_geometry (boot_drive->bdrv, &cyls, &heads, &secs); +bdrv_set_geometry_hint (boot_drive->bdrv, cyls, heads, secs); +extboot_init (boot_drive->bdrv,1 ); + } } static void pc_init_pci(ram_addr_t ram_size,
hw/pc.h +4 -0
@@ -151,4 +151,8 @@ void isa_cirrus_vga_init(void);void isa_ne2000_init (int base,qemu_irq irq,NICInfo *nd);int cpu_is_bsp (CPUState *env); + +/* extboot.c */ +void extboot_init (BlockDriverState *bs,int cmd); +#endif
qemu-config.c +4 -0
@@ -70,6 +70,10 @@ QemuOptsList qemu_drive_opts = { .name = "addr", .type = QEMU_OPT_STRING, .help = "pci address (virtio only)", + },{ + .name = "boot", + .type = QEMU_OPT_BOOL, + .help = "make this a boot drive", }, {/* end if list */ } },
qemu-options.hx +1 -1
@@ -103,7 +103,7 @@ DEF("drive", HAS_ARG, QEMU_OPTION_drive, "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" " [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n" " [,cache=writethrough|writeback|none][,format=f][,serial=s]\n" - " [,addr=A][,id=name][,aio=threads|native]\n" + " [,addr=A][,id=name][,aio=threads|native][,boot=on]\n" " use 'file' as a drive image\n") DEF("set", HAS_ARG, QEMU_OPTION_set, "-set group.id.arg=value\n"
sysemu.h +1 -0
@@ -186,6 +186,7 @@ extern TAILQ_HEAD(driveoptlist, DriveOpt) driveopts;extern DriveInfo *drive_get (BlockInterfaceType type,int bus,int unit);extern DriveInfo *drive_get_by_id (const char *id); +extern DriveInfo *drive_get_boot (void );extern int drive_get_max_bus (BlockInterfaceType type);extern void drive_uninit (BlockDriverState *bdrv);extern const char *drive_get_serial (BlockDriverState *bdrv);
vl.c +12 -0
@@ -1843,6 +1843,18 @@ DriveInfo *drive_get_by_id(const char *id)return NULL ; } +DriveInfo *drive_get_boot (void ) +{ +DriveInfo *dinfo; + + TAILQ_FOREACH(dinfo, &drives, next) { +if (qemu_opt_get_bool (dinfo->opts,"boot" ,0 ) ==0 ) +continue ; +return dinfo; + } +return NULL ; +} +int drive_get_max_bus (BlockInterfaceType type) {int max_bus;
Signature · 1 line
1.6.2.5
Hi,,
Quoted 2 lines
Booting a rawhide install from a virtual usb stick doesn't actually work though, looks like it stresses qemus usb emulation too much.
Hmm, might be linux simply doesn't like the speed of usb 1.1 for mass storage. With the attached debug patch rawhide boots up to the login prompt just fine.
cheers,
Gerd
Quoted 1 line
From
4c94383b57d66e7eedb11c4a07d579fb374bec6bMon Sep 17 00:00:00 2001
From: Gerd Hoffmann <[email protected]>
Date: Tue, 8 Sep 2009 13:53:15 +0200
Subject: [PATCH] make usb 1.1 go insane fast
--- hw/usb-uhci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/usb-uhci.c +1 -1
@@ -63,7 +63,7 @@#define UHCI_PORT_CSC (1 << 1)#define UHCI_PORT_CCS (1 << 0) -#define FRAME_TIMER_FREQ 1000 +#define FRAME_TIMER_FREQ 100000#define FRAME_MAX_LOOPS 100
Signature · 1 line
1.6.2.5
Quoted 8 lines · Gerd Hoffmann
$subject says pretty much everything.
extboot.[cS] are a straight copy from the kvm tree. The windup in vl,c and
hw/pc.cis done slightly different, I've added a function to lookup the boot drive instead of adding a new global variable.Booting from scsi and virtio works, using the boot=on flag.
Quoted 9 lines
With the usb+scsi patches in anthonys patch queue applied booting from usb works too. Syntax is this:
-drive if=none,id=pendrive,file=/path/to/image,boot=on -usb -device usb-storage,drive=pendrive
Booting a rawhide install from a virtual usb stick doesn't actually work though, looks like it stresses qemus usb emulation too much.
Before setting this definitely useful feature in stone, I have two questions though:
- -drive ...,boot=on is logically in conflict with -boot. Yes, -boot for x86 currently cannot differentiate between multiple disks, only between boot media types. Still, this two-stage configuration is rather unintuitive and looks like a patchwork. Given that we have full control over all components, is it really the preferred approach? I already thought about, e.g., -boot c2 to select the second disk. Not that nice, but I would rather vote for a consistent configuration than a scattered one.
- This is just an implementation detail: Do we really need to implement booting from virtio and scsi via an extension rom? Isn't it possible to merge the corresponding support into the main bios?
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux
Quoted 11 lines · Jan Kiszka
Before setting this definitely useful feature in stone, I have two questions though:
- -drive ...,boot=on is logically in conflict with -boot. Yes, -boot for x86 currently cannot differentiate between multiple disks, only between boot media types. Still, this two-stage configuration is rather unintuitive and looks like a patchwork. Given that we have full control over all components, is it really the preferred approach? I already thought about, e.g., -boot c2 to select the second disk. Not that nice, but I would rather vote for a consistent configuration than a scattered one.
Disk numbers are bad. Define "second hard disk". Especially for a system with different kinds of disks (say one scsi and one virtio).
Drives have names though which can be used to reference the disks, so we could use that instead. -boot cmd line syntax becomes a bit tricky then though, we somehow have to figure whenever the user gave us names or old-style letters. Something like this ...
-drive if=virtio,id=sys,file=/path/to/disk.img
-cdrom /path/to/install.iso
-boot order=[sys],once=d,menu=off
... might work out nicely. I suspect the libvirt folks will hate us for that though.
Quoted 3 lines
- This is just an implementation detail: Do we really need to implement booting from virtio and scsi via an extension rom? Isn't it possible to merge the corresponding support into the main bios?
Well. There are quite a few. bochs pcbios, seabios, coreboot ...
cheers,
Gerd
Quoted 6 lines · Gerd Hoffmann
Quoted 4 lines · Jan Kiszka
Before setting this definitely useful feature in stone, I have two questions though:
- -drive ...,boot=on is logically in conflict with -boot. Yes, -boot
x86 boot is strange. The BIOS boots from the "first hard disk" What extboot allows you do to is redefine to the bios what constitutes the "first hard disk".
This is the motivation for making it a -drive option. Perhaps this is something we want to hide from the user but that was the motivation.
For instance, it would not be possible to define a boot sequence of "first virtio disk, then second virtio disk, then cdrom" because we can't present two disks as the first hard disk.
If extboot supported BCV and our bios did, the above would be possible.
Regards,
Anthony Liguori
Quoted 9 lines · Anthony Liguori
Quoted 6 lines · Gerd Hoffmann
Quoted 4 lines · Jan Kiszka
Before setting this definitely useful feature in stone, I have two questions though:
- -drive ...,boot=on is logically in conflict with -boot. Yes, -boot
x86 boot is strange. The BIOS boots from the "first hard disk" What extboot allows you do to is redefine to the bios what constitutes the "first hard disk".
It's not just booting - it's the int 0x13 interface. Grub for example continues to use it and can boot from the second hard disk if desired.
Quoted 2 lines
This is the motivation for making it a -drive option. Perhaps this is something we want to hide from the user but that was the motivation.
I agree with this and I think we should extend it to boot=0x80|0x81.... boot=on is an alias to boot=0x80.
Quoted 5 lines
For instance, it would not be possible to define a boot sequence of "first virtio disk, then second virtio disk, then cdrom" because we can't present two disks as the first hard disk.
If extboot supported BCV and our bios did, the above would be possible.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 4 lines · Avi Kivity
Quoted 3 lines · Anthony Liguori
Quoted 2 lines · Gerd Hoffmann
On 09/08/09 15:47, Jan Kiszka wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
Before setting this definitely useful feature in stone, I have two questions though:
- -drive ...,boot=on is logically in conflict with -boot. Yes, -boot
x86 boot is strange. The BIOS boots from the "first hard disk" What extboot allows you do to is redefine to the bios what constitutes the "first hard disk".
It's not just booting - it's the int
0x13interface. Grub for example continues to use it and can boot from the second hard disk if desired.
Our BIOS can only support booting from the 0x80 and this is pretty normal.
The right way to do this from a BBS perspective would be to implement BCV support. We could then have BCV entries for every possible disk. Option roms (like extboot/gpxe) can register add new BCV entries. We'd want the user to be able to specify the priority of each disk, so..
Quoted 1 line
I agree with this and I think we should extend it to boot=0x80|0x81.... boot=on is an alias to boot=0x80.
Would be better to stick with 0-based integers. We would then use this to generate BCV priorities.
The highest priority BCV device is still exposed as int13 disk 0x80. I suspect certain OSes will only boot from disk 0x80 (probably Windows).
Regards,
Anthony Liguori
Quoted 8 lines · Anthony Liguori
Quoted 7 lines · Avi Kivity
Quoted 6 lines · Anthony Liguori
Quoted 5 lines · Gerd Hoffmann
Quoted 3 lines · Jan Kiszka
Before setting this definitely useful feature in stone, I have two questions though:
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
- -drive ...,boot=on is logically in conflict with -boot. Yes,
-bootx86 boot is strange. The BIOS boots from the "first hard disk" What extboot allows you do to is redefine to the bios what constitutes the "first hard disk".
It's not just booting - it's the int
0x13interface. Grub for example continues to use it and can boot from the second hard disk if desired.Our BIOS can only support booting from the
0x80and this is pretty normal.
The bios exports the "bios drives". You can tell grub to load a kernel from the first partition of the second disk: (hd1,0) or even chain-load another boot loaded from another disk.
Quoted 2 lines
The right way to do this from a BBS perspective would be to implement BCV support. We could then have BCV entries for every possible disk. Option roms (like extboot/gpxe) can register add new BCV entries. We'd want the user to be able to specify the priority of each disk, so..
I don't know anything about BBS/BCV but it seems reasonable.
Quoted 4 lines
Quoted 2 lines
I agree with this and I think we should extend it to boot=0x80|0x81.... boot=on is an alias to boot=0x80.
Would be better to stick with 0-based integers. We would then use this to generate BCV priorities.
Sure.
Quoted 2 lines
The highest priority BCV device is still exposed as int13 disk
0x80. I suspect certain OSes will only boot from disk0x80(probably Windows).
Windows has its own boot loader drive format that can specify other drives (I think using its own drivers, not the bios).
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Quoted 1 line · Avi Kivity
The bios exports the "bios drives". You can tell grub to load a kernel from the first partition of the second disk: (hd1,0) or even chain-load another boot loaded from another disk.
The whole point of device.map is that grub doesn't intrinsically know how to map from bios drives to real drives. In fact, when you chain-load with grub, you often have to "swap" device mappings which has the effect of hooking int13 and faking the primary drive for another OS. See http://www.gnu.org/software/grub/manual/html_node/DOS_002fWindows.html
All else aside, from a BIOS perspective, you can usually only boot from 0x80 and that can be mapped to different drives via BCV.
Regards,
Anthony Liguori
Quoted 4 lines · Anthony Liguori
Quoted 1 line · Avi Kivity
The bios exports the "bios drives". You can tell grub to load a kernel from the first partition of the second disk: (hd1,0) or even chain-load another boot loaded from another disk.
The whole point of device.map is that grub doesn't intrinsically know how to map from bios drives to real drives.
device.map is a wonderful thing, but unrelated to the bios exposing drive 0x81.
Quoted 1 line
In fact, when you chain-load with grub, you often have to "swap" device mappings which has the effect of hooking int13 and faking the primary drive for another OS. See http://www.gnu.org/software/grub/manual/html_node/DOS_002fWindows.html
But grub still has to issue a real int 13 for drive 0x81. If we don't expose it, it can't. Until a real OS is loaded, the only way to access a drive is through int 13 and if we don't expose it, it's invisible.
Quoted 1 line
All else aside, from a BIOS perspective, you can usually only boot from
0x80and that can be mapped to different drives via BCV.
There things you can do with a drive other than boot it. For example, access it via int 13.
How will you access D:\ from DOS?
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Quoted 3 lines · Avi Kivity
Quoted 1 line
In fact, when you chain-load with grub, you often have to "swap" device mappings which has the effect of hooking int13 and faking the primary drive for another OS. See http://www.gnu.org/software/grub/manual/html_node/DOS_002fWindows.html
But grub still has to issue a real int 13 for drive
0x81. If we don't expose it, it can't. Until a real OS is loaded, the only way to access a drive is through int 13 and if we don't expose it, it's invisible.
extboot ignores any non-0x80 access today FWIW so this is already broken.
Only 0x80 is generally bootable. This means even on modern systems, you still have per-adapter config menus that allow the user to configure which drive ends up getting 0x80. It's awfully messy and not worth exposing to users.
Quoted 5 lines
Quoted 1 line
All else aside, from a BIOS perspective, you can usually only boot from
0x80and that can be mapped to different drives via BCV.There things you can do with a drive other than boot it. For example, access it via int 13.
How will you access D:\ from DOS?
Let the user specify BCV priority, let the BIOS determine how to assign drive numbering. It may turn out that bios drive number isn't stable but this is also true on real machines.
Regards,
Anthony Liguori
Quoted 7 lines · Avi Kivity
Quoted 3 lines · Anthony Liguori
x86 boot is strange. The BIOS boots from the "first hard disk" What extboot allows you do to is redefine to the bios what constitutes the "first hard disk".
It's not just booting - it's the int
0x13interface. Grub for example continues to use it and can boot from the second hard disk if desired.
Some time back, I tried implementing booting from the second hard drive by passing 0x81 in "dl" during the boot. All the boot loaders I tested failed to work. I think grub may have worked if I re-configured it, but I figured it wasn't worth it due to the confusion it would cause.
So, the experience suggested to me that bootloaders today still require the boot harddrive to be mapped to 0x80. (Though, interestingly, cdrom booting is okay with any drive id..)
Quoted 5 lines
Quoted 5 lines
For instance, it would not be possible to define a boot sequence of "first virtio disk, then second virtio disk, then cdrom" because we can't present two disks as the first hard disk.
If extboot supported BCV and our bios did, the above would be possible.
FWIW, SeaBIOS does support BCVs. SeaBIOS will find all the drives and present them on the boot menu - the user can then select which drive to boot from (either floppy, any number of cdroms, any of the builtin or external "BCV" hard drives). For floppy and hard drive booting the selection is implemented by manipulating the drive mappings.
Also, as an aside, it seams likely that USB booting will be added to SeaBIOS (either directly or as an option rom). I'm not sure if this has any overlap with extboot.
-Kevin
Quoted 14 lines · Gerd Hoffmann
Quoted 11 lines · Jan Kiszka
Before setting this definitely useful feature in stone, I have two questions though:
- -drive ...,boot=on is logically in conflict with -boot. Yes, -boot for x86 currently cannot differentiate between multiple disks, only between boot media types. Still, this two-stage configuration is rather unintuitive and looks like a patchwork. Given that we have full control over all components, is it really the preferred approach? I already thought about, e.g., -boot c2 to select the second disk. Not that nice, but I would rather vote for a consistent configuration than a scattered one.
Quoted 2 lines
Disk numbers are bad. Define "second hard disk". Especially for a system with different kinds of disks (say one scsi and one virtio).
One could use the specification order, but I agree it's not very handy.
Quoted 9 lines
Drives have names though which can be used to reference the disks, so we could use that instead. -boot cmd line syntax becomes a bit tricky then though, we somehow have to figure whenever the user gave us names or old-style letters. Something like this ...
-drive if=virtio,id=sys,file=/path/to/disk.img
-cdrom /path/to/install.iso
-boot order=[sys],once=d,menu=off
Yes, this looks powerful and clean. One could even still define probe orders like "-boot order=[sys][backup]d".
Quoted 3 lines
... might work out nicely. I suspect the libvirt folks will hate us for that though.
Does anyone from libvirt want to comment on this?
Quoted 6 lines
Quoted 4 lines
- This is just an implementation detail: Do we really need to implement booting from virtio and scsi via an extension rom? Isn't it possible to merge the corresponding support into the main bios?
Well. There are quite a few. bochs pcbios, seabios, coreboot ...
Ok, but that's only an argument to have extboot as a workaround for bioses not yet supporting scsi and virtio natively, isn't it? I'm thinking long-term here, not arguing against a extboot-based short-term solution.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux
Quoted 6 lines
Quoted 3 lines
-drive if=virtio,id=sys,file=/path/to/disk.img -cdrom /path/to/install.iso
-boot order=[sys],once=d,menu=offYes, this looks powerful and clean. One could even still define probe orders like "-boot order=[sys][backup]d".
Well, except that boot orders with two hard drives in there don't work in the PC world ...
Quoted 10 lines
Quoted 5 lines
Quoted 3 lines
- This is just an implementation detail: Do we really need to implement booting from virtio and scsi via an extension rom? Isn't it possible to merge the corresponding support into the main bios?
Well. There are quite a few. bochs pcbios, seabios, coreboot ...
Ok, but that's only an argument to have extboot as a workaround for bioses not yet supporting scsi and virtio natively, isn't it? I'm thinking long-term here, not arguing against a extboot-based short-term solution.
I think it would be useful. Adding a fw_cfg knob to signal 'please boot via extboot protocol instead of ide disk' should be enougth to allow bioses supporting extboot directly. Additional plus is we can probably code it in C not asm then.
cheers,
Gerd
Quoted 8 lines · Gerd Hoffmann
Quoted 5 lines
Quoted 3 lines
-drive if=virtio,id=sys,file=/path/to/disk.img -cdrom /path/to/install.iso
-boot order=[sys],once=d,menu=offYes, this looks powerful and clean. One could even still define probe orders like "-boot order=[sys][backup]d".
Well, except that boot orders with two hard drives in there don't work in the PC world ...
That depends on your bios. I've seen many that allow disk boot ordering, though they may not support "[sys]d[backup]".
However, I see no technical reason for artificially restricting qemu bios capabilities.
Quoted 10 lines
Quoted 9 lines
Quoted 5 lines
Quoted 4 lines
- This is just an implementation detail: Do we really need to implement booting from virtio and scsi via an extension rom? Isn't it possible to merge the corresponding support into the main bios?
Well. There are quite a few. bochs pcbios, seabios, coreboot ...
Ok, but that's only an argument to have extboot as a workaround for bioses not yet supporting scsi and virtio natively, isn't it? I'm thinking long-term here, not arguing against a extboot-based short-term solution.
Quoted 4 lines
I think it would be useful. Adding a
fw_cfgknob to signal 'please boot via extboot protocol instead of ide disk' should be enougth to allow bioses supporting extboot directly. Additional plus is we can probably code it in C not asm then.
I'm still not convinced we need extboot for all bioses on the long term. And I think we should define new interfaces in a way that finally makes it obsolete, at least for our "home bios" (whatever it will be).
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux
Quoted 11 lines · Jan Kiszka
Quoted 11 lines
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines
- This is just an implementation detail: Do we really need to implement booting from virtio and scsi via an extension rom? Isn't it possible to merge the corresponding support into the main bios?
Well. There are quite a few. bochs pcbios, seabios, coreboot ...
Ok, but that's only an argument to have extboot as a workaround for bioses not yet supporting scsi and virtio natively, isn't it? I'm thinking long-term here, not arguing against a extboot-based short-term solution.
Quoted 7 lines
Quoted 2 lines
I think it would be useful. Adding a
fw_cfgknob to signal 'please boot via extboot protocol instead of ide disk' should be enougth to allow bioses supporting extboot directly. Additional plus is we can probably code it in C not asm then.I'm still not convinced we need extboot for all bioses on the long term. And I think we should define new interfaces in a way that finally makes it obsolete, at least for our "home bios" (whatever it will be).
What we won't need long term is the extboot interface (hw/extboot.c). Ideally, we would rewrite the extboot option rom to have a proper virtio-blk driver in it. Better yet, to finish up Laurent's work of adding virtio-blk support to gpxe since it gives us bcv for free. We woudl then support booting from multiple disks by specifying the bcv entry index in cmos.
Then we would need a new syntax for boot (like -boot c3 to chose the 3rd disk device).
Regards,
Anthony Liguori
Quoted 3 lines
Jan
Quoted 8 lines · Anthony Liguori
Quoted 3 lines
I'm still not convinced we need extboot for all bioses on the long term. And I think we should define new interfaces in a way that finally makes it obsolete, at least for our "home bios" (whatever it will be).
What we won't need long term is the extboot interface (
hw/extboot.c). Ideally, we would rewrite the extboot option rom to have a proper virtio-blk driver in it. Better yet, to finish up Laurent's work of adding virtio-blk support to gpxe since it gives us bcv for free.
That doesn't cover booting from scsi.
It also doesn't cover booting from usb.
cheers,
Gerd
Quoted 5 lines · Gerd Hoffmann
Quoted 4 lines · Anthony Liguori
Quoted 3 lines
I'm still not convinced we need extboot for all bioses on the long term. And I think we should define new interfaces in a way that finally makes it obsolete, at least for our "home bios" (whatever it will be).
Quoted 7 lines
Quoted 4 lines
What we won't need long term is the extboot interface (
hw/extboot.c). Ideally, we would rewrite the extboot option rom to have a proper virtio-blk driver in it. Better yet, to finish up Laurent's work of adding virtio-blk support to gpxe since it gives us bcv for free.That doesn't cover booting from scsi.
It also doesn't cover booting from usb.
It assumes support for both in option roms. The big advantage to gpxe is that it already has generic scsi support.
Regards,
Anthony Liguori
Quoted 2 lines
cheers,
Gerd
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Gerd Hoffmann
Quoted 3 lines · Jan Kiszka
- This is just an implementation detail: Do we really need to implement booting from virtio and scsi via an extension rom? Isn't it possible to merge the corresponding support into the main bios?
Quoted 6 lines
Quoted 1 line
Well. There are quite a few. bochs pcbios, seabios, coreboot ...
Ok, but that's only an argument to have extboot as a workaround for bioses not yet supporting scsi and virtio natively, isn't it? I'm thinking long-term here, not arguing against a extboot-based short-term solution.
I doubt we'll see native scsi support as I believe each scsi controller needs its own initialization. However, usb booting will bring along with it mass storage class support.
I'm not familiar with virtio, however, I don't think it would be difficult to add support to SeaBIOS. The disk access code in SeaBIOS has an intermediate layer which makes it easier to add new backends. For an example of this, see the ramdisk.c code:
The above code adds support for a virtual floppy drive that is populated with a floppy image stored in flash (useful with coreboot).
Basically, its possible to add driver support by adding a new drive type (eg, DTYPE_RAMDISK) and implementing a new drive handler (eg, process_ramdisk_op). The handler just has to implement read and write capability - the bios call handlers, interfaces, and lba manipulation are handled by SeaBIOS.
-Kevin
Quoted 6 lines · Gerd Hoffmann
$subject says pretty much everything.
extboot.[cS] are a straight copy from the kvm tree. The windup in vl,c and
hw/pc.cis done slightly different, I've added a function to lookup the boot drive instead of adding a new global variable.
I think the function here is high even if the implementation is ugly. In the past, Paul strongly objected to this. Paul, care to comment?
Regards,
Anthony Liguori
Quoted 9 lines · Anthony Liguori
Quoted 5 lines · Gerd Hoffmann
$subject says pretty much everything.
extboot.[cS] are a straight copy from the kvm tree. The windup in vl,c and
hw/pc.cis done slightly different, I've added a function to lookup the boot drive instead of adding a new global variable.I think the function here is high even if the implementation is ugly. In the past, Paul strongly objected to this. Paul, care to comment?
Doesn't gpxe support virtio-blk, without requiring any additional qemu "features"?
Paul
Quoted 8 lines · Paul Brook
Quoted 7 lines · Anthony Liguori
Quoted 5 lines · Gerd Hoffmann
$subject says pretty much everything.
extboot.[cS] are a straight copy from the kvm tree. The windup in vl,c and
hw/pc.cis done slightly different, I've added a function to lookup the boot drive instead of adding a new global variable.
Quoted 5 lines
Quoted 2 lines
I think the function here is high even if the implementation is ugly. In the past, Paul strongly objected to this. Paul, care to comment?
Doesn't gpxe support virtio-blk, without requiring any additional qemu "features"?
As far I know patches exist but where never merged. Also there is no way to boot from scsi+usb ...
cheers,
Gerd
Quoted 9 lines · Gerd Hoffmann
Quoted 8 lines · Paul Brook
Quoted 7 lines · Anthony Liguori
Quoted 5 lines · Gerd Hoffmann
$subject says pretty much everything.
extboot.[cS] are a straight copy from the kvm tree. The windup in vl,c and
hw/pc.cis done slightly different, I've added a function to lookup the boot drive instead of adding a new global variable.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I think the function here is high even if the implementation is ugly. In the past, Paul strongly objected to this. Paul, care to comment?
Doesn't gpxe support virtio-blk, without requiring any additional qemu "features"?
As far I know patches exist but where never merged. Also there is no way to boot from scsi+usb ...
I think Kevin mentioned he would likely to usb boot support for SeaBIOS. Adding virtio-blk support to SeaBIOS would also be pretty reasonable.
SCSI is a bit more tough. Doing an LSI driver in SeaBIOS would be a bit tougher.
Regards,
Anthony Liguori
Quoted 21 lines · Anthony Liguori
Quoted 11 lines · Gerd Hoffmann
Quoted 10 lines · Paul Brook
Quoted 9 lines · Anthony Liguori
Quoted 7 lines · Gerd Hoffmann
$subject says pretty much everything.
extboot.[cS] are a straight copy from the kvm tree. The windup in vl,c
andhw/pc.cis done slightly different, I've added a function to lookup
the boot drive instead of adding a new global variable.Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I think the function here is high even if the implementation is ugly. In the past, Paul strongly objected to this. Paul, care to comment?
Doesn't gpxe support virtio-blk, without requiring any additional qemu "features"?
As far I know patches exist but where never merged. Also there is no way to boot from scsi+usb ...
Quoted 7 lines
I think Kevin mentioned he would likely to usb boot support for SeaBIOS. Adding virtio-blk support to SeaBIOS would also be pretty reasonable.
SCSI is a bit more tough. Doing an LSI driver in SeaBIOS would be a bit tougher.
But why? Why do we have to emulate the entire HBA for the BIOS? The HBA is emulated, too, and just uses the bdrv interface internally anyway.
So IMHO it makes far more sense to skip the HBA emulation in the BIOS completely and just use the bdrv interface directly here.
Where is the drawback?
(Apart from the missing BIOS initialization of the HBA?)
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke zSeries & Storage [email protected] +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg)
Quoted 7 lines · Hannes Reinecke
But why? Why do we have to emulate the entire HBA for the BIOS? The HBA is emulated, too, and just uses the bdrv interface internally anyway.
So IMHO it makes far more sense to skip the HBA emulation in the BIOS completely and just use the bdrv interface directly here.
If you use the bdrv interface (ala extboot), you couldn't boot via scsi passthrough.
VirtualBox implements a paravirtual SCSI bus to allow SCSI boot without having to implement a full LSI driver. That's another way to solve the problem.
Regards,
Anthony Liguori
Quoted 8 lines · Anthony Liguori
Quoted 6 lines · Hannes Reinecke
But why? Why do we have to emulate the entire HBA for the BIOS? The HBA is emulated, too, and just uses the bdrv interface internally anyway.
So IMHO it makes far more sense to skip the HBA emulation in the BIOS completely and just use the bdrv interface directly here.
Quoted 6 lines
If you use the bdrv interface (ala extboot), you couldn't boot via scsi passthrough.
VirtualBox implements a paravirtual SCSI bus to allow SCSI boot without having to implement a full LSI driver. That's another way to solve the problem.
This has its own issues. How do you prevent the guest enumerating both the paravirt and "real" adapters, and getting the same disk twice? If this isn't a problem, then surely the user can do this explicitly.
In this case "guest" includes future fancy versions of the BIOS/bootloader.
Paul