Date: Mon, 22 Mar 2010 14:50:05 +0100 (CET) From: Alexander Best <alexbestms@wwu.de> To: <freebsd-hackers@FreeBSD.org> Subject: [patch] teach the bootloader minor amd64 knowledge Message-ID: <permail-20100322135005f7e55a9d000043cf-a_best01@message-id.uni-muenster.de>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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
[-- Attachment #2 --]
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-20100322135005f7e55a9d000043cf-a_best01>
