summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-11-30 09:40:11 +0000
committerimp <imp@FreeBSD.org>2004-11-30 09:40:11 +0000
commit4671aabad620459d9378871b8537f7c8d53e4a18 (patch)
tree2c6a33d5bf24e6ad5401cb052e0091374fed0be4
parent789e532c6d8e6c097fad3f55e5b2040564e4d3ec (diff)
downloadFreeBSD-src-4671aabad620459d9378871b8537f7c8d53e4a18.zip
FreeBSD-src-4671aabad620459d9378871b8537f7c8d53e4a18.tar.gz
Add observations of the Linux98 and Grub/98 boot loaders. These
observations lead me to believe that the convetion for pc98 boot loaders is to have a jump unstruction, followed by a string, followed by code. The jump usually doesn't have a nop after it and usually the string is NUL terminated, but Grub/98 breaks both of these rules. # I looked for, but failed to find the Minux boot blocks for PC-9801 port.
-rw-r--r--sys/geom/geom_pc98.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/geom/geom_pc98.c b/sys/geom/geom_pc98.c
index 0b24690..f30cb9d 100644
--- a/sys/geom/geom_pc98.c
+++ b/sys/geom/geom_pc98.c
@@ -84,11 +84,21 @@ g_pc98_modify(struct g_geom *gp, struct g_pc98_softc *ms, u_char *sec)
#if 0
/*
- * FreeBSD's boot0 IPL uses the name IPL1. This test initially was
- * based on that observation. However, other boot loaders have use
- * different names. A likely good test would be to test if the first
- * 4 bytes are a jump to location 11 (or greater?) as well as the next
- * 7 bytes being printable or with trailing NUL's.
+ * By convetion, it seems that the ipl program has a jump at location
+ * 0 to the real start of the boot loader. By convetion, it appears
+ * that after this jump, there's a string, terminated by at last one,
+ * if not more, zeros, followed by the target of the jump. FreeBSD's
+ * pc98 boot0 uses 'IPL1' followed by 3 zeros here, likely for
+ * compatibility with some older boot loader. Linux98's boot loader
+ * appears to use 'Linux 98' followed by only two. GRUB/98 appears to
+ * use 'GRUB/98 ' followed by none. These last two appear to be
+ * ported from the ia32 versions, but appear to show similar
+ * convention. Grub/98 has an additional NOP after the jmp, which
+ * isn't present in others.
+ *
+ * The following test was inspired by looking only at partitions
+ * with FreeBSD's boot0 (or one that it is compatible with). As
+ * such, if failed when other IPL programs were used.
*/
if (sec[4] != 'I' || sec[5] != 'P' || sec[6] != 'L' || sec[7] != '1')
return (EBUSY);
OpenPOWER on IntegriCloud