This series adds a shortcut for network boot, similar to what is present on bare-metal machines. F11 will prioritize BCV/BEV entries for network devices over all the other items of the boot list.
After testing with a more recent QEMU I found that it deploys a BCV ROM that breaks network boot. So this series has two extra patches that track the PCI class for boot entries; this is then used to filter boot entries for network boot. A better choice of priorities for BCV and BEV is also implemented (patch 3).
After Peter Stuge's prod, I reorganized interactive_bootmenu to use a switch statement, and split the reindentation away in a separate patch.
Paolo
Paolo Bonzini (6): boot: change definition of IPL_TYPE_* constants boot: track the PCI class of BCV/BEV boot entries boot: bump priority of storage-device option ROMs boot: reorganize interactive_bootmenu boot: wait for key release before continuing boot boot: add F11 shortcut for network boot
src/boot.c | 134 ++++++++++++++++++++++++++++++++++++------------------- src/boot.h | 4 +- src/optionroms.c | 8 ++-- 3 file modificati, 94 inserzioni(+), 52 rimozioni(-)
We will soon add a PCI class in the low 4 bits. Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/boot.c | 17 +++++++++-------- 1 file modificato, 9 inserzioni(+), 8 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index 3ca7960..b9bcb57 100644 --- a/src/boot.c +++ b/src/boot.c @@ -285,12 +285,13 @@ struct bootentry_s { }; static struct bootentry_s *BootList;
-#define IPL_TYPE_FLOPPY 0x01 -#define IPL_TYPE_HARDDISK 0x02 -#define IPL_TYPE_CDROM 0x03 -#define IPL_TYPE_CBFS 0x20 -#define IPL_TYPE_BEV 0x80 -#define IPL_TYPE_BCV 0x81 +#define IPL_TYPE_FLOPPY 0x10 +#define IPL_TYPE_HARDDISK 0x20 +#define IPL_TYPE_CDROM 0x30 +#define IPL_TYPE_CBFS 0x40 +#define IPL_TYPE_BEV 0x50 +#define IPL_TYPE_BCV 0x60 +#define IPL_TYPE_MASK 0xF0
static void bootentry_add(int type, int prio, u32 data, const char *desc) @@ -491,7 +492,7 @@ boot_prep(void) // Map drives and populate BEV list struct bootentry_s *pos = BootList; while (pos) { - switch (pos->type) { + switch (pos->type & IPL_TYPE_MASK) { case IPL_TYPE_BCV: call_bcv(pos->vector.seg, pos->vector.offset); add_bev(IPL_TYPE_HARDDISK, 0); @@ -654,7 +655,7 @@ do_boot(int seq_nr)
// Boot the given BEV type. struct bev_s *ie = &BEV[seq_nr]; - switch (ie->type) { + switch (ie->type & IPL_TYPE_MASK) { case IPL_TYPE_FLOPPY: printf("Booting from Floppy...\n"); boot_disk(0x00, CheckFloppySig);
In order to find network devices in the boot list, remember the PCI class for each BCV/BEV (which is also present in the PNP header as the device type code).
Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/boot.c | 10 ++++++---- src/boot.h | 4 ++-- src/optionroms.c | 8 +++++--- 3 file modificati, 13 inserzioni(+), 9 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index b9bcb57..2835008 100644 --- a/src/boot.c +++ b/src/boot.c @@ -339,9 +339,10 @@ static inline int defPrio(int priority, int defaultprio) {
// Add a BEV vector for a given pnp compatible option rom. void -boot_add_bev(u16 seg, u16 bev, u16 desc, int prio) +boot_add_bev(u16 seg, u16 bev, u16 desc, u16 class, int prio) { - bootentry_add(IPL_TYPE_BEV, defPrio(prio, DefaultBEVPrio) + class &= 0xF; + bootentry_add(IPL_TYPE_BEV | class, defPrio(prio, DefaultBEVPrio) , SEGOFF(seg, bev).segoff , desc ? MAKE_FLATPTR(seg, desc) : "Unknown"); DefaultBEVPrio = DEFAULT_PRIO; @@ -349,9 +350,10 @@ boot_add_bev(u16 seg, u16 bev, u16 desc, int prio)
// Add a bcv entry for an expansion card harddrive or legacy option rom void -boot_add_bcv(u16 seg, u16 ip, u16 desc, int prio) +boot_add_bcv(u16 seg, u16 ip, u16 desc, u16 class, int prio) { - bootentry_add(IPL_TYPE_BCV, defPrio(prio, DefaultHDPrio) + class &= 0xF; + bootentry_add(IPL_TYPE_BCV | class, defPrio(prio, DefaultHDPrio) , SEGOFF(seg, ip).segoff , desc ? MAKE_FLATPTR(seg, desc) : "Legacy option rom"); } diff --git a/src/boot.h b/src/boot.h index afe9f2e..c237af7 100644 --- a/src/boot.h +++ b/src/boot.h @@ -4,8 +4,8 @@
// boot.c void boot_setup(void); -void boot_add_bev(u16 seg, u16 bev, u16 desc, int prio); -void boot_add_bcv(u16 seg, u16 ip, u16 desc, int prio); +void boot_add_bev(u16 seg, u16 bev, u16 desc, u16 class, int prio); +void boot_add_bcv(u16 seg, u16 ip, u16 desc, u16 class, int prio); struct drive_s; void boot_add_floppy(struct drive_s *drive_g, const char *desc, int prio); void boot_add_hd(struct drive_s *drive_g, const char *desc, int prio); diff --git a/src/optionroms.c b/src/optionroms.c index 00697b2..1f03de8 100644 --- a/src/optionroms.c +++ b/src/optionroms.c @@ -386,18 +386,20 @@ optionrom_setup(void) if (! pnp) { // Legacy rom. boot_add_bcv(FLATPTR_TO_SEG(rom), OPTION_ROM_INITVECTOR, 0 - , getRomPriority(sources, rom, 0)); + , 0, getRomPriority(sources, rom, 0)); continue; } // PnP rom - check for BEV and BCV boot capabilities. + // Note that the PNP type_lo field is the same as a PCI class + // (http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f...) int instance = 0; while (pnp) { if (pnp->bev) boot_add_bev(FLATPTR_TO_SEG(rom), pnp->bev, pnp->productname - , getRomPriority(sources, rom, instance++)); + , pnp->type_lo, getRomPriority(sources, rom, instance++)); else if (pnp->bcv) boot_add_bcv(FLATPTR_TO_SEG(rom), pnp->bcv, pnp->productname - , getRomPriority(sources, rom, instance++)); + , pnp->type_lo, getRomPriority(sources, rom, instance++)); else break; pnp = get_pnp_next(rom, pnp);
On Wed, Oct 17, 2012 at 06:23:44PM +0200, Paolo Bonzini wrote:
In order to find network devices in the boot list, remember the PCI class for each BCV/BEV (which is also present in the PNP header as the device type code).
Signed-off-by: Paolo Bonzini pbonzini@redhat.com
src/boot.c | 10 ++++++---- src/boot.h | 4 ++-- src/optionroms.c | 8 +++++--- 3 file modificati, 13 inserzioni(+), 9 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index b9bcb57..2835008 100644 --- a/src/boot.c +++ b/src/boot.c @@ -339,9 +339,10 @@ static inline int defPrio(int priority, int defaultprio) {
// Add a BEV vector for a given pnp compatible option rom. void -boot_add_bev(u16 seg, u16 bev, u16 desc, int prio) +boot_add_bev(u16 seg, u16 bev, u16 desc, u16 class, int prio) {
- bootentry_add(IPL_TYPE_BEV, defPrio(prio, DefaultBEVPrio)
- class &= 0xF;
- bootentry_add(IPL_TYPE_BEV | class, defPrio(prio, DefaultBEVPrio)
Ultimately, bootentry_add() allocates and populates a 'struct bootentry_s'. I don't think it makes sense to overload the meaning of type when one can add a new field to the struct.
Note, your patch changes the default boot order as type is used in the sorting when no priority is specified. It's unclear if that was intentional or not.
-Kevin
Il 28/10/2012 02:22, Kevin O'Connor ha scritto:
On Wed, Oct 17, 2012 at 06:23:44PM +0200, Paolo Bonzini wrote:
In order to find network devices in the boot list, remember the PCI class for each BCV/BEV (which is also present in the PNP header as the device type code).
Signed-off-by: Paolo Bonzini pbonzini@redhat.com
src/boot.c | 10 ++++++---- src/boot.h | 4 ++-- src/optionroms.c | 8 +++++--- 3 file modificati, 13 inserzioni(+), 9 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index b9bcb57..2835008 100644 --- a/src/boot.c +++ b/src/boot.c @@ -339,9 +339,10 @@ static inline int defPrio(int priority, int defaultprio) {
// Add a BEV vector for a given pnp compatible option rom. void -boot_add_bev(u16 seg, u16 bev, u16 desc, int prio) +boot_add_bev(u16 seg, u16 bev, u16 desc, u16 class, int prio) {
- bootentry_add(IPL_TYPE_BEV, defPrio(prio, DefaultBEVPrio)
- class &= 0xF;
- bootentry_add(IPL_TYPE_BEV | class, defPrio(prio, DefaultBEVPrio)
Ultimately, bootentry_add() allocates and populates a 'struct bootentry_s'. I don't think it makes sense to overload the meaning of type when one can add a new field to the struct.
Note, your patch changes the default boot order as type is used in the sorting when no priority is specified. It's unclear if that was intentional or not.
Yes, it groups together similar devices. But I can do as you requested here.
Paolo
Right now, BCVs have DefaultHDPrio priority, while BEVs have DefaultBEVPrio priority. The right thing to do instead is to look at the PCI class, while keeping DefaultHDPrio priority for legacy option ROMs.
Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/boot.c | 7 +++++-- 1 file modificato, 5 inserzioni(+), 2 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index 2835008..5101167 100644 --- a/src/boot.c +++ b/src/boot.c @@ -342,7 +342,8 @@ void boot_add_bev(u16 seg, u16 bev, u16 desc, u16 class, int prio) { class &= 0xF; - bootentry_add(IPL_TYPE_BEV | class, defPrio(prio, DefaultBEVPrio) + int def_prio = class == PCI_BASE_CLASS_STORAGE ? DefaultHDPrio : DefaultBEVPrio; + bootentry_add(IPL_TYPE_BEV | class, defPrio(prio, def_prio) , SEGOFF(seg, bev).segoff , desc ? MAKE_FLATPTR(seg, desc) : "Unknown"); DefaultBEVPrio = DEFAULT_PRIO; @@ -353,7 +354,9 @@ void boot_add_bcv(u16 seg, u16 ip, u16 desc, u16 class, int prio) { class &= 0xF; - bootentry_add(IPL_TYPE_BCV | class, defPrio(prio, DefaultHDPrio) + // Legacy option ROMs have class == 0; make them DefaultHDPrio + int def_prio = class <= PCI_BASE_CLASS_STORAGE ? DefaultHDPrio : DefaultBEVPrio; + bootentry_add(IPL_TYPE_BCV | class, defPrio(prio, def_prio) , SEGOFF(seg, ip).segoff , desc ? MAKE_FLATPTR(seg, desc) : "Legacy option rom"); }
On Wed, Oct 17, 2012 at 06:23:45PM +0200, Paolo Bonzini wrote:
Right now, BCVs have DefaultHDPrio priority, while BEVs have DefaultBEVPrio priority. The right thing to do instead is to look at the PCI class, while keeping DefaultHDPrio priority for legacy option ROMs.
Thanks Paolo. Sorry for the delay in reviewing.
Can you explain this further? How could a device register a BCV that's not for a hard drive? The BCV system is designed to allow roms to be ordered when they hook the int13 vector - if they're not registering a hard drive in that process it seems like a bug.
-Kevin
Il 28/10/2012 02:09, Kevin O'Connor ha scritto:
On Wed, Oct 17, 2012 at 06:23:45PM +0200, Paolo Bonzini wrote:
Right now, BCVs have DefaultHDPrio priority, while BEVs have DefaultBEVPrio priority. The right thing to do instead is to look at the PCI class, while keeping DefaultHDPrio priority for legacy option ROMs.
Thanks Paolo. Sorry for the delay in reviewing.
Can you explain this further? How could a device register a BCV that's not for a hard drive? The BCV system is designed to allow roms to be ordered when they hook the int13 vector - if they're not registering a hard drive in that process it seems like a bug.
I was confused by KVM's virtual APIC option ROM, which uses a dummy BCV.
Paolo
This reindents the code and introduces a switch statement, to prepare for adding F11 as a shortcut for network boot.
Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/boot.c | 76 +++++++++++++++++++++++++++++++++----------------------------- 1 file modificato, 40 inserzioni(+), 36 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index 5101167..e3bdd7b 100644 --- a/src/boot.c +++ b/src/boot.c @@ -412,48 +412,52 @@ interactive_bootmenu(void) enable_bootsplash(); int scan_code = get_keystroke(menutime); disable_bootsplash(); - if (scan_code != 0x86) - /* not F12 */ - return; - - while (get_keystroke(0) >= 0) - ; + switch (scan_code) { + case 0x86: { // F12 + printf("Select boot device:\n\n"); + wait_threads();
- printf("Select boot device:\n\n"); - wait_threads(); + // Show menu items + struct bootentry_s *pos = BootList; + int maxmenu = 0; + while (pos) { + char desc[60]; + maxmenu++; + printf("%d. %s\n", maxmenu + , strtcpy(desc, pos->description, ARRAY_SIZE(desc))); + pos = pos->next; + }
- // Show menu items - struct bootentry_s *pos = BootList; - int maxmenu = 0; - while (pos) { - char desc[60]; - maxmenu++; - printf("%d. %s\n", maxmenu - , strtcpy(desc, pos->description, ARRAY_SIZE(desc))); - pos = pos->next; - } + // Get key press + while (get_keystroke(0) >= 0) + ;
- // Get key press - for (;;) { - scan_code = get_keystroke(1000); - if (scan_code >= 1 && scan_code <= maxmenu+1) + for (;;) { + scan_code = get_keystroke(1000); + if (scan_code >= 1 && scan_code <= maxmenu+1) + break; + } + printf("\n"); + if (scan_code == 0x01) + // ESC break; + + // Find entry and make top priority. + int choice = scan_code - 1; + struct bootentry_s **pprev = &BootList; + while (--choice) + pprev = &(*pprev)->next; + pos = *pprev; + *pprev = pos->next; + pos->next = BootList; + BootList = pos; + pos->priority = 0; + break; } - printf("\n"); - if (scan_code == 0x01) - // ESC - return;
- // Find entry and make top priority. - int choice = scan_code - 1; - struct bootentry_s **pprev = &BootList; - while (--choice) - pprev = &(*pprev)->next; - pos = *pprev; - *pprev = pos->next; - pos->next = BootList; - BootList = pos; - pos->priority = 0; + default: + break; + } }
// BEV (Boot Execution Vector) list
Ensure that SeaBIOS eats the key corresponding to the menu entry, even the user keeps it pressed for a while.
Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/boot.c | 6 +++++- 1 file modificato, 5 inserzioni(+). 1 rimozione(-)
diff --git a/src/boot.c b/src/boot.c index e3bdd7b..c136ad4 100644 --- a/src/boot.c +++ b/src/boot.c @@ -456,8 +456,12 @@ interactive_bootmenu(void) }
default: - break; + return; } + + while (get_keystroke(0) >= 0) + ; + }
// BEV (Boot Execution Vector) list
This patch adds a shortcut for network boot, similar to what is present on bare-metal machines. F11 will prioritize BCV/BEV entries for network devices over all the other items of the boot list.
Signed-off-by: Paolo Bonzini pbonzini@redhat.com --- src/boot.c | 36 +++++++++++++++++++++++++++++++----- 1 file modificato, 31 inserzioni(+), 5 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index c136ad4..682f239 100644 --- a/src/boot.c +++ b/src/boot.c @@ -292,6 +292,7 @@ static struct bootentry_s *BootList; #define IPL_TYPE_BEV 0x50 #define IPL_TYPE_BCV 0x60 #define IPL_TYPE_MASK 0xF0 +#define IPL_TYPE_CLASS 0x0F
static void bootentry_add(int type, int prio, u32 data, const char *desc) @@ -406,26 +407,51 @@ interactive_bootmenu(void) while (get_keystroke(0) >= 0) ;
- printf("Press F12 for boot menu.\n\n"); + wait_threads(); + struct bootentry_s *pos; + for (pos = BootList; pos; pos = pos->next) { + if ((pos->type & IPL_TYPE_CLASS) == PCI_BASE_CLASS_NETWORK) + break; + } + + printf("Press %sF12 for boot menu.\n\n" + , pos ? "F11 for network boot, or " : "");
u32 menutime = romfile_loadint("etc/boot-menu-wait", DEFAULT_BOOTMENU_WAIT); enable_bootsplash(); int scan_code = get_keystroke(menutime); disable_bootsplash(); switch (scan_code) { + case 0x85: { // F11 + // Prioritize BEV/BCV entries + if (!pos) + return; + + struct bootentry_s **pprev = &BootList, **pprev_new = &BootList; + while ((pos = *pprev) != NULL) { + if ((pos->type & IPL_TYPE_CLASS) == PCI_BASE_CLASS_NETWORK) { + *pprev = pos->next; + pos->next = *pprev_new; + *pprev_new = pos; + pos->priority = 0; + pprev_new = &pos->next; + } else { + pprev = &pos->next; + } + } + break; + } + case 0x86: { // F12 printf("Select boot device:\n\n"); - wait_threads();
// Show menu items - struct bootentry_s *pos = BootList; int maxmenu = 0; - while (pos) { + for (pos = BootList; pos; pos = pos->next) { char desc[60]; maxmenu++; printf("%d. %s\n", maxmenu , strtcpy(desc, pos->description, ARRAY_SIZE(desc))); - pos = pos->next; }
// Get key press
On Wed, Oct 17, 2012 at 06:23:48PM +0200, Paolo Bonzini wrote:
This patch adds a shortcut for network boot, similar to what is present on bare-metal machines. F11 will prioritize BCV/BEV entries for network devices over all the other items of the boot list.
Signed-off-by: Paolo Bonzini pbonzini@redhat.com
src/boot.c | 36 +++++++++++++++++++++++++++++++----- 1 file modificato, 31 inserzioni(+), 5 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index c136ad4..682f239 100644 --- a/src/boot.c +++ b/src/boot.c @@ -292,6 +292,7 @@ static struct bootentry_s *BootList; #define IPL_TYPE_BEV 0x50 #define IPL_TYPE_BCV 0x60 #define IPL_TYPE_MASK 0xF0 +#define IPL_TYPE_CLASS 0x0F
static void bootentry_add(int type, int prio, u32 data, const char *desc) @@ -406,26 +407,51 @@ interactive_bootmenu(void) while (get_keystroke(0) >= 0) ;
- printf("Press F12 for boot menu.\n\n");
- wait_threads();
- struct bootentry_s *pos;
- for (pos = BootList; pos; pos = pos->next) {
if ((pos->type & IPL_TYPE_CLASS) == PCI_BASE_CLASS_NETWORK)
break;
- }
- printf("Press %sF12 for boot menu.\n\n"
, pos ? "F11 for network boot, or " : "");
The wait_threads() only has an impact when CONFIG_THREAD_OPTIONROMS is set. When it is set, I think we really do want threads to be able to run up until the end of the boot menu delay, as this can notably reduce overall boot time on real hardware. So, adding the call to wait_threads doesn't seem right.
I suppose the code could always print the F11 message regardless of whether or not a network card has been detected.
u32 menutime = romfile_loadint("etc/boot-menu-wait", DEFAULT_BOOTMENU_WAIT); enable_bootsplash(); int scan_code = get_keystroke(menutime); disable_bootsplash(); switch (scan_code) {
- case 0x85: { // F11
// Prioritize BEV/BCV entries
if (!pos)
return;
This function is getting a bit busy. Instead of moving everything into a switch (as in patch 4) I suggest breaking the different key actions into separate functions.
-Kevin
Il 28/10/2012 02:32, Kevin O'Connor ha scritto:
On Wed, Oct 17, 2012 at 06:23:48PM +0200, Paolo Bonzini wrote:
This patch adds a shortcut for network boot, similar to what is present on bare-metal machines. F11 will prioritize BCV/BEV entries for network devices over all the other items of the boot list.
Signed-off-by: Paolo Bonzini pbonzini@redhat.com
src/boot.c | 36 +++++++++++++++++++++++++++++++----- 1 file modificato, 31 inserzioni(+), 5 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index c136ad4..682f239 100644 --- a/src/boot.c +++ b/src/boot.c @@ -292,6 +292,7 @@ static struct bootentry_s *BootList; #define IPL_TYPE_BEV 0x50 #define IPL_TYPE_BCV 0x60 #define IPL_TYPE_MASK 0xF0 +#define IPL_TYPE_CLASS 0x0F
static void bootentry_add(int type, int prio, u32 data, const char *desc) @@ -406,26 +407,51 @@ interactive_bootmenu(void) while (get_keystroke(0) >= 0) ;
- printf("Press F12 for boot menu.\n\n");
- wait_threads();
- struct bootentry_s *pos;
- for (pos = BootList; pos; pos = pos->next) {
if ((pos->type & IPL_TYPE_CLASS) == PCI_BASE_CLASS_NETWORK)
break;
- }
- printf("Press %sF12 for boot menu.\n\n"
, pos ? "F11 for network boot, or " : "");
The wait_threads() only has an impact when CONFIG_THREAD_OPTIONROMS is set. When it is set, I think we really do want threads to be able to run up until the end of the boot menu delay, as this can notably reduce overall boot time on real hardware. So, adding the call to wait_threads doesn't seem right.
I suppose the code could always print the F11 message regardless of whether or not a network card has been detected.
Ok.
u32 menutime = romfile_loadint("etc/boot-menu-wait", DEFAULT_BOOTMENU_WAIT); enable_bootsplash(); int scan_code = get_keystroke(menutime); disable_bootsplash(); switch (scan_code) {
- case 0x85: { // F11
// Prioritize BEV/BCV entries
if (!pos)
return;
This function is getting a bit busy. Instead of moving everything into a switch (as in patch 4) I suggest breaking the different key actions into separate functions.
Ok.
Paolo
Il 29/10/2012 09:06, Paolo Bonzini ha scritto:
Il 28/10/2012 02:32, Kevin O'Connor ha scritto:
On Wed, Oct 17, 2012 at 06:23:48PM +0200, Paolo Bonzini wrote:
This patch adds a shortcut for network boot, similar to what is present on bare-metal machines. F11 will prioritize BCV/BEV entries for network devices over all the other items of the boot list.
Signed-off-by: Paolo Bonzini pbonzini@redhat.com
src/boot.c | 36 +++++++++++++++++++++++++++++++----- 1 file modificato, 31 inserzioni(+), 5 rimozioni(-)
diff --git a/src/boot.c b/src/boot.c index c136ad4..682f239 100644 --- a/src/boot.c +++ b/src/boot.c @@ -292,6 +292,7 @@ static struct bootentry_s *BootList; #define IPL_TYPE_BEV 0x50 #define IPL_TYPE_BCV 0x60 #define IPL_TYPE_MASK 0xF0 +#define IPL_TYPE_CLASS 0x0F
static void bootentry_add(int type, int prio, u32 data, const char *desc) @@ -406,26 +407,51 @@ interactive_bootmenu(void) while (get_keystroke(0) >= 0) ;
- printf("Press F12 for boot menu.\n\n");
- wait_threads();
- struct bootentry_s *pos;
- for (pos = BootList; pos; pos = pos->next) {
if ((pos->type & IPL_TYPE_CLASS) == PCI_BASE_CLASS_NETWORK)
break;
- }
- printf("Press %sF12 for boot menu.\n\n"
, pos ? "F11 for network boot, or " : "");
The wait_threads() only has an impact when CONFIG_THREAD_OPTIONROMS is set. When it is set, I think we really do want threads to be able to run up until the end of the boot menu delay, as this can notably reduce overall boot time on real hardware. So, adding the call to wait_threads doesn't seem right.
I suppose the code could always print the F11 message regardless of whether or not a network card has been detected.
Ok.
Actually, boot_add_bev is always run synchronously from option_rom_setup, not from the hw init threads. So wait_threads is not needed here.
Paolo
On Wed, Oct 17, 2012 at 06:23:42PM +0200, Paolo Bonzini wrote:
This series adds a shortcut for network boot, similar to what is present on bare-metal machines. F11 will prioritize BCV/BEV entries for network devices over all the other items of the boot list.
After testing with a more recent QEMU I found that it deploys a BCV ROM that breaks network boot. So this series has two extra patches that track the PCI class for boot entries; this is then used to filter boot entries for network boot. A better choice of priorities for BCV and BEV is also implemented (patch 3).
After Peter Stuge's prod, I reorganized interactive_bootmenu to use a switch statement, and split the reindentation away in a separate patch.
Hi Paolo,
Can you give a high-level overview of why this functionality is needed? For QEMU users, wouldn't they just add "-boot net" to their command line?
-Kevin
Il 18/10/2012 01:32, Kevin O'Connor ha scritto:
On Wed, Oct 17, 2012 at 06:23:42PM +0200, Paolo Bonzini wrote:
This series adds a shortcut for network boot, similar to what is present on bare-metal machines. F11 will prioritize BCV/BEV entries for network devices over all the other items of the boot list.
After testing with a more recent QEMU I found that it deploys a BCV ROM that breaks network boot. So this series has two extra patches that track the PCI class for boot entries; this is then used to filter boot entries for network boot. A better choice of priorities for BCV and BEV is also implemented (patch 3).
After Peter Stuge's prod, I reorganized interactive_bootmenu to use a switch statement, and split the reindentation away in a separate patch.
Hi Paolo,
Can you give a high-level overview of why this functionality is needed? For QEMU users, wouldn't they just add "-boot net" to their command line?
Good question. :) This came in as a feature request from a RH customer, and it took a while to understand that this was the feature they wanted. My only guess is the user is someone else than the administrator, so they cannot control the QEMU command-line.
I'm not sure how much of this code is used by Coreboot, but I figured this would be somewhat useful on bare-metal systems too.
Paolo
On Thu, Oct 18, 2012 at 09:50:49AM +0200, Paolo Bonzini wrote:
Il 18/10/2012 01:32, Kevin O'Connor ha scritto:
On Wed, Oct 17, 2012 at 06:23:42PM +0200, Paolo Bonzini wrote:
This series adds a shortcut for network boot, similar to what is present on bare-metal machines. F11 will prioritize BCV/BEV entries for network devices over all the other items of the boot list.
After testing with a more recent QEMU I found that it deploys a BCV ROM that breaks network boot. So this series has two extra patches that track the PCI class for boot entries; this is then used to filter boot entries for network boot. A better choice of priorities for BCV and BEV is also implemented (patch 3).
After Peter Stuge's prod, I reorganized interactive_bootmenu to use a switch statement, and split the reindentation away in a separate patch.
Hi Paolo,
Can you give a high-level overview of why this functionality is needed? For QEMU users, wouldn't they just add "-boot net" to their command line?
Good question. :) This came in as a feature request from a RH customer, and it took a while to understand that this was the feature they wanted. My only guess is the user is someone else than the administrator, so they cannot control the QEMU command-line.
Okay. I guess hitting F12 and then selecting the network card was too complex. :-)
I'm not sure how much of this code is used by Coreboot, but I figured this would be somewhat useful on bare-metal systems too.
It's the same menu on coreboot. Indeed, having the ability to select a boot device is critical when working on real hardware.
Thanks. -Kevin
Paolo Bonzini wrote:
This series adds a shortcut for network boot, similar to what is present on bare-metal machines. F11 will prioritize BCV/BEV entries for network devices over all the other items of the boot list.
After testing with a more recent QEMU I found that it deploys a BCV ROM that breaks network boot. So this series has two extra patches that track the PCI class for boot entries; this is then used to filter boot entries for network boot. A better choice of priorities for BCV and BEV is also implemented (patch 3).
After Peter Stuge's prod, I reorganized interactive_bootmenu to use a switch statement, and split the reindentation away in a separate patch.
Paolo
Might also want to update SMBIOS too. BIOS Characteristic Extension Byte 2, bit 1 should be set if BIOS supports "Network Boot Key". SMBIOS spec says it should (?) be F12, but it's currently used for boot menu.
Bit 0 of the same byte should be set too, because SeaBIOS supports BBS.
Sebastian