From c00209396cd8d7551fb6b8ddf98bab5b14aef96b Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Mon, 10 Nov 2003 19:06:09 +0000 Subject: [PATCH] Fixed loss of setting of the RB_BOOTINFO flag in rev.1.43. Fixed wrong comment about this flag in rev.1.61. It is not historical like the comment said; it is the flag that says that most of what is laboriously put in the bootinfo struct is actually there. Newer kernels were bootable by even the broken boot2 without losing anything except the symbol table, but older kernels need at least the memory sizes. Restoring the "|" with RB_BOOTINFO that was lost in rev.1.43 costs 5 bytes. The fix can be done in only 4 bytes by fixing some code that was removed in rev.1.61 (put RB_BOOTINFO back in in the initial value of "opts" and fix RBX_MASK to not clobber it.) --- sys/boot/i386/boot2/boot2.c | 4 ++-- sys/boot/i386/gptboot/gptboot.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index f3daec7bb28..5d84f0d78d4 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #define RBX_NOINTR 0x1c /* -n */ #define RBX_DUAL 0x1d /* -D */ #define RBX_PROBEKBD 0x1e /* -P */ -/* 0x1f is reserved for the historical RB_BOOTINFO option */ +/* 0x1f is reserved for the RB_BOOTINFO flag. */ /* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ #define RBX_MASK 0x2005ffff @@ -359,7 +359,7 @@ load(void) bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; - __exec((caddr_t)addr, opts & RBX_MASK, + __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.slice, dsk.unit, dsk.part), 0, 0, 0, VTOP(&bootinfo)); } diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c index f3daec7bb28..5d84f0d78d4 100644 --- a/sys/boot/i386/gptboot/gptboot.c +++ b/sys/boot/i386/gptboot/gptboot.c @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #define RBX_NOINTR 0x1c /* -n */ #define RBX_DUAL 0x1d /* -D */ #define RBX_PROBEKBD 0x1e /* -P */ -/* 0x1f is reserved for the historical RB_BOOTINFO option */ +/* 0x1f is reserved for the RB_BOOTINFO flag. */ /* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ #define RBX_MASK 0x2005ffff @@ -359,7 +359,7 @@ load(void) bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; - __exec((caddr_t)addr, opts & RBX_MASK, + __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.slice, dsk.unit, dsk.part), 0, 0, 0, VTOP(&bootinfo)); }