From fc6fa9d5e2d50be1fa8d1fc24ce7d25fbe1c1905 Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 27 Jun 1999 08:34:46 +0000 Subject: [PATCH] add stage2 id --- ChangeLog | 19 +++++++++++++++++++ docs/grub.texi | 7 +++++-- stage1/stage1.S | 2 +- stage2/asm.S | 2 ++ stage2/shared.h | 24 ++++++++++++++++++++++-- 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60a18994c..8e186e096 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +1999-06-27 OKUJI Yoshinori + + * stage2/shared.h (STAGE2_STAGE2_ID): New macro. + (STAGE2_VER_STR_OFFS): Set to 0xd. + (STAGE2_ID_STAGE2): New macro. + (STAGE2_ID_FFS_STAGE1_5): Likewise. + (STAGE2_ID_E2FS_STAGE1_5): Likewise. + (STAGE2_ID_FAT_STAGE1_5): Likewise. + (STAGE2_ID) [!STAGE1_5]: Defined as STAGE2_ID_STAGE2. + (STAGE2_ID) [STAGE1_5] [FSYS_FFS]: Defined as + STAGE2_ID_FFS_STAGE1_5. + (STAGE2_ID) [STAGE1_5] [FSYS_EXT2FS]: Defined as + STAGE2_ID_STAGE1_5. + (STAGE2_ID) [STAGE1_5] [FSYS_FAT]: Defined as + STAGE2_ID_FAT_STAGE1_5. + (COMPAT_VERSION_MINOR): Set to 1. + * stage2/asm.S (stage2_id): New variable. + * stage1/stage1.S: Change the minor version to 1. + 1999-06-27 OKUJI Yoshinori * configure.in (CFLAGS): Set to "-g", since only this flag is diff --git a/docs/grub.texi b/docs/grub.texi index 9a495ab22..a22bbccdd 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1385,7 +1385,7 @@ entry is an offset number): This is the major version byte (should be 2). @item @dfn{minor version} (0x1bd) -This is the minor version byte (should be 0). +This is the minor version byte (should be 1). @item @dfn{stage2 start address} (0x1b8) This is the data for the @code{ljmp} command to the starting address of @@ -1453,7 +1453,10 @@ If a @dfn{stage1.5} is being used, it will pass its own @dfn{install_partition} to any @dfn{stage2} it loads, therefore overwriting the one present in the @dfn{stage2}. -@item @dfn{version_string} (0xc) +@item @dfn{stage2_id} (0xc) +This is the @dfn{stage1.5} or @dfn{stage2} identifier. + +@item @dfn{version_string} (0xd) This is the @dfn{stage1.5} or @dfn{stage2} version string. It isn't meant to be changed, simply easy to find. diff --git a/stage1/stage1.S b/stage1/stage1.S index b1fe1aeda..a99b09435 100644 --- a/stage1/stage1.S +++ b/stage1/stage1.S @@ -444,7 +444,7 @@ bootit: * * DO NOT MOVE THIS!!! */ - .byte 2, 0 + .byte 2, 1 /* * This is where an MBR would go if on a hard disk. The code diff --git a/stage2/asm.S b/stage2/asm.S index a02bd2cde..3143737e9 100644 --- a/stage2/asm.S +++ b/stage2/asm.S @@ -61,6 +61,8 @@ _start: VARIABLE(install_partition) .long 0x020000 +VARIABLE(stage2_id) + .byte STAGE2_ID VARIABLE(version_string) .string VERSION VARIABLE(config_file) diff --git a/stage2/shared.h b/stage2/shared.h index 1e312d3eb..5ae068947 100644 --- a/stage2/shared.h +++ b/stage2/shared.h @@ -117,7 +117,7 @@ extern char *grub_scratch_mem; */ #define COMPAT_VERSION_MAJOR 2 -#define COMPAT_VERSION_MINOR 0 +#define COMPAT_VERSION_MINOR 1 #define COMPAT_VERSION ((COMPAT_VERSION_MINOR<<8)|COMPAT_VERSION_MAJOR) #define STAGE1_VER_MAJ_OFFS 0x1bc @@ -127,8 +127,28 @@ extern char *grub_scratch_mem; #define STAGE2_VER_MAJ_OFFS 0x6 #define STAGE2_INSTALLPART 0x8 -#define STAGE2_VER_STR_OFFS 0xc +#define STAGE2_STAGE2_ID 0xc +#define STAGE2_VER_STR_OFFS 0xd +/* Stage 2 identifiers */ +#define STAGE2_ID_STAGE2 0 +#define STAGE2_ID_FFS_STAGE1_5 1 +#define STAGE2_ID_E2FS_STAGE1_5 2 +#define STAGE2_ID_FAT_STAGE1_5 3 + +#ifndef STAGE1_5 +#define STAGE2_ID STAGE2_ID_STAGE2 +#else +#if defined(FSYS_FFS) +#define STAGE2_ID STAGE2_ID_FFS_STAGE1_5 +#elif defined(FSYS_EXT2FS) +#define STAGE2_ID STAGE2_ID_E2FS_STAGE1_5 +#elif defined(FSYS_FAT) +#define STAGE2_ID STAGE2_ID_FAT_STAGE1_5 +#else +#error "unknown Stage 2" +#endif +#endif /* * defines for use when switching between real and protected mode