[SeaBIOS] [PATCH 3/9] Don't access drive_g->desc from boot_cdrom().
Kevin O'Connor
kevin at koconnor.net
Wed Dec 29 18:47:14 CET 2010
The drive description is allocated with malloc_tmp() and is thus only
available during the POST phase - boot_cdrom() is called during the
boot phase.
---
src/boot.c | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/boot.c b/src/boot.c
index d37e10f..8e33d53 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -275,27 +275,27 @@ interactive_bootmenu(void)
pos = pos->next;
}
+ // Get key press
for (;;) {
scan_code = get_keystroke(1000);
- if (scan_code == 0x01)
- // ESC
+ if (scan_code >= 1 && scan_code <= maxmenu+1)
break;
- if (scan_code < 1 || scan_code > maxmenu+1)
- continue;
- int choice = scan_code - 1;
-
- // Find entry and make top priority.
- 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;
}
static int HaveHDBoot, HaveFDBoot;
@@ -431,7 +431,7 @@ boot_cdrom(struct ipl_entry_s *ie)
struct drive_s *drive_g = (void*)ie->vector;
int status = cdrom_boot(drive_g);
if (status) {
- printf("Boot failed: Could not read from CDROM %s (code %04x)\n", drive_g->desc, status);
+ printf("Boot failed: Could not read from CDROM (code %04x)\n", status);
return;
}
--
1.7.3.4
More information about the SeaBIOS
mailing list