Establish boot order in post stage.

Read boot order nvram fields in post stage and store in a variable.
Change boot menu to update boot order instead of using separate variables.
diff --git a/src/boot.c b/src/boot.c
index 53577ec..12226d6 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -8,7 +8,6 @@
 #include "util.h" // irq_enable
 #include "biosvar.h" // struct bregs
 #include "config.h" // CONFIG_*
-#include "cmos.h" // inb_cmos
 #include "ata.h" // ata_detect
 #include "disk.h" // cdrom_boot
 
@@ -23,7 +22,7 @@
 //--------------------------------------------------------------------------
 
 static const char drivetypes[][10]={
-    "", "Floppy","Hard Disk","CD-Rom", "Network"
+    "", "Floppy", "Hard Disk", "CD-Rom", "Network"
 };
 
 void
@@ -86,24 +85,14 @@
 
     SET_EBDA(ipl.sequence, seq_nr);
 
-    u16 bootdev = inb_cmos(CMOS_BIOS_BOOTFLAG2);
-    bootdev |= ((inb_cmos(CMOS_BIOS_BOOTFLAG1) & 0xf0) << 4);
+    u32 bootdev = GET_EBDA(ipl.bootorder);
     bootdev >>= 4 * seq_nr;
     bootdev &= 0xf;
 
-    /* Read user selected device */
-    u16 bootfirst = GET_EBDA(ipl.bootfirst);
-    if (bootfirst != 0xFFFF) {
-        bootdev = bootfirst;
-        /* Reset boot sequence */
-        SET_EBDA(ipl.bootfirst, 0xFFFF);
-        SET_EBDA(ipl.sequence, 0xFFFF);
-    }
-
     if (bootdev == 0)
         BX_PANIC("No bootable device.\n");
 
-    /* Translate from CMOS runes to an IPL table offset by subtracting 1 */
+    /* Translate bootdev to an IPL table offset by subtracting 1 */
     bootdev -= 1;
 
     if (bootdev >= GET_EBDA(ipl.count)) {
@@ -142,9 +131,8 @@
         }
 
         /* Always check the signature on a HDD boot sector; on FDD,
-         * only do the check if the CMOS doesn't tell us to skip it */
-        if ((type != IPL_TYPE_FLOPPY)
-            || !((inb_cmos(CMOS_BIOS_BOOTFLAG1) & 0x01))) {
+         * only do the check if configured for it */
+        if (type != IPL_TYPE_FLOPPY || GET_EBDA(ipl.checkfloppysig)) {
             if (GET_FARVAR(bootseg, *(u16*)0x1fe) != 0xaa55) {
                 print_boot_failure(type, 0);
                 return;