aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2021-02-11 15:51:24 +0100
committerHelge Deller <deller@gmx.de>2021-09-24 11:10:17 +0200
commitdb5d7e962b88a5de91b6c9c404360b5c1cbd22b5 (patch)
treebc00d64a18d6b5d6950ac6ca4c2f69ec3377df52
parent1586812b4d5d4d3f1c9a345fa153d8cda41262da (diff)
downloadseabios-hppa-db5d7e962b88a5de91b6c9c404360b5c1cbd22b5.zip
seabios-hppa-db5d7e962b88a5de91b6c9c404360b5c1cbd22b5.tar.gz
seabios-hppa-db5d7e962b88a5de91b6c9c404360b5c1cbd22b5.tar.bz2
boot.c: Add boot disc chooser for PA-RISC
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--src/boot.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/boot.c b/src/boot.c
index 1effd80..be0d734 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -790,6 +790,54 @@ interactive_bootmenu(void)
hlist_add_head(&boot->node, &BootList);
}
+#if CONFIG_PARISC
+void find_initial_parisc_boot_drives(struct drive_s **harddisc,
+ struct drive_s **cdrom)
+{
+ struct bootentry_s *pos;
+ hlist_for_each_entry(pos, &BootList, node) {
+ if ((pos->type == IPL_TYPE_CDROM) && (*cdrom == NULL))
+ *cdrom = pos->drive;
+ if ((pos->type == IPL_TYPE_HARDDISK) && (*harddisc == NULL))
+ *harddisc = pos->drive;
+ }
+}
+
+struct drive_s *select_parisc_boot_drive(char bootdrive)
+{
+ printf("Available boot devices:\n");
+
+ // Show menu items
+ int maxmenu = 0;
+ struct bootentry_s *pos;
+ hlist_for_each_entry(pos, &BootList, node) {
+ char desc[77];
+ maxmenu++;
+ printf("%d. %s\n", maxmenu
+ , strtcpy(desc, pos->description, ARRAY_SIZE(desc)));
+ }
+
+ /* try each boot device */
+ hlist_for_each_entry(pos, &BootList, node) {
+ if (((bootdrive == 'd') && (pos->type == IPL_TYPE_CDROM)) ||
+ ((bootdrive != 'd') && (pos->type == IPL_TYPE_HARDDISK))) {
+ printf("\nBooting from %s\n",pos->description);
+ return pos->drive;
+ }
+ }
+ /* if none found, choose first bootable device */
+ hlist_for_each_entry(pos, &BootList, node) {
+ if ((pos->type == IPL_TYPE_CDROM) ||
+ (pos->type == IPL_TYPE_HARDDISK)) {
+ printf("\nAuto-Booting from %s\n",pos->description);
+ return pos->drive;
+ }
+ }
+ return NULL;
+}
+#endif
+
+
// BEV (Boot Execution Vector) list
struct bev_s {
int type;