[patch] teach the bootloader minor amd64 knowledge
Alexander Best
alexbestms at wwu.de
Mon Mar 22 13:50:21 UTC 2010
hi there,
since i386 and amd64 are sharing the same bootcode the bootloader gets named
"FreeBSD/i386" on amd64 too. the following patch is a cosmetic change to have
the bootloader identify itself as "FreeBSD/amd64" on amd64.
any thoughts on this one?
--
Alexander Best
-------------- next part --------------
Index: sys/boot/i386/boot2/boot2.c
===================================================================
--- sys/boot/i386/boot2/boot2.c (revision 205390)
+++ sys/boot/i386/boot2/boot2.c (working copy)
@@ -283,7 +283,11 @@
for (;;) {
if (!autoboot || !OPT_CHECK(RBX_QUIET))
+#ifdef FAKE_I386
+ printf("\nFreeBSD/amd64 boot\n"
+#else
printf("\nFreeBSD/i386 boot\n"
+#endif
"Default: %u:%s(%u,%c)%s\n"
"boot: ",
dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit,
Index: sys/boot/i386/Makefile.inc
===================================================================
--- sys/boot/i386/Makefile.inc (revision 205390)
+++ sys/boot/i386/Makefile.inc (working copy)
@@ -10,7 +10,7 @@
LDFLAGS+= -nostdlib
.if ${MACHINE_ARCH} == "amd64"
-CFLAGS+= -m32 -march=i386
+CFLAGS+= -m32 -march=i386 -DFAKE_I386
LDFLAGS+= -m elf_i386_fbsd
AFLAGS+= --32
.endif
Index: sys/boot/i386/zfsboot/zfsboot.c
===================================================================
--- sys/boot/i386/zfsboot/zfsboot.c (revision 205390)
+++ sys/boot/i386/zfsboot/zfsboot.c (working copy)
@@ -730,7 +730,11 @@
for (;;) {
if (!autoboot || !OPT_CHECK(RBX_QUIET))
+#ifdef FAKE_I386
+ printf("\nFreeBSD/amd64 boot\n"
+#else
printf("\nFreeBSD/i386 boot\n"
+#endif
"Default: %s:%s\n"
"boot: ",
spa->spa_name, kname);
Index: sys/boot/i386/loader/Makefile
===================================================================
--- sys/boot/i386/loader/Makefile (revision 205390)
+++ sys/boot/i386/loader/Makefile (working copy)
@@ -6,7 +6,11 @@
LOADER?= loader
PROG= ${LOADER}.sym
INTERNALPROG=
+.if ${MACHINE_ARCH} == "amd64"
+NEWVERSWHAT?= "bootstrap loader" amd64
+.else
NEWVERSWHAT?= "bootstrap loader" i386
+.endif
# architecture-specific loader code
SRCS= main.c conf.c vers.c
Index: sys/boot/i386/gptboot/gptboot.c
===================================================================
--- sys/boot/i386/gptboot/gptboot.c (revision 205390)
+++ sys/boot/i386/gptboot/gptboot.c (working copy)
@@ -281,7 +281,11 @@
for (;;) {
if (!autoboot || !OPT_CHECK(RBX_QUIET))
+#ifdef FAKE_I386
+ printf("\nFreeBSD/amd64 boot\n"
+#else
printf("\nFreeBSD/i386 boot\n"
+#endif
"Default: %u:%s(%up%u)%s\n"
"boot: ",
dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit,
More information about the freebsd-hackers
mailing list