1*1b8adde7SWilliam Kucharski /* 2*1b8adde7SWilliam Kucharski * GRUB -- GRand Unified Bootloader 3*1b8adde7SWilliam Kucharski * Copyright (C) 1999,2000,2002,2004 Free Software Foundation, Inc. 4*1b8adde7SWilliam Kucharski * 5*1b8adde7SWilliam Kucharski * This program is free software; you can redistribute it and/or modify 6*1b8adde7SWilliam Kucharski * it under the terms of the GNU General Public License as published by 7*1b8adde7SWilliam Kucharski * the Free Software Foundation; either version 2 of the License, or 8*1b8adde7SWilliam Kucharski * (at your option) any later version. 9*1b8adde7SWilliam Kucharski * 10*1b8adde7SWilliam Kucharski * This program is distributed in the hope that it will be useful, 11*1b8adde7SWilliam Kucharski * but WITHOUT ANY WARRANTY; without even the implied warranty of 12*1b8adde7SWilliam Kucharski * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13*1b8adde7SWilliam Kucharski * GNU General Public License for more details. 14*1b8adde7SWilliam Kucharski * 15*1b8adde7SWilliam Kucharski * You should have received a copy of the GNU General Public License 16*1b8adde7SWilliam Kucharski * along with this program; if not, write to the Free Software 17*1b8adde7SWilliam Kucharski * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18*1b8adde7SWilliam Kucharski */ 19*1b8adde7SWilliam Kucharski 20*1b8adde7SWilliam Kucharski #ifndef STAGE1_HEADER 21*1b8adde7SWilliam Kucharski #define STAGE1_HEADER 1 22*1b8adde7SWilliam Kucharski 23*1b8adde7SWilliam Kucharski 24*1b8adde7SWilliam Kucharski /* Define the version numbers here, so that Stage 1 can know them. */ 25*1b8adde7SWilliam Kucharski #define COMPAT_VERSION_MAJOR 3 26*1b8adde7SWilliam Kucharski #define COMPAT_VERSION_MINOR 2 27*1b8adde7SWilliam Kucharski #define COMPAT_VERSION ((COMPAT_VERSION_MINOR << 8) \ 28*1b8adde7SWilliam Kucharski | COMPAT_VERSION_MAJOR) 29*1b8adde7SWilliam Kucharski 30*1b8adde7SWilliam Kucharski /* The signature for bootloader. */ 31*1b8adde7SWilliam Kucharski #define STAGE1_SIGNATURE 0xaa55 32*1b8adde7SWilliam Kucharski 33*1b8adde7SWilliam Kucharski /* The offset of the end of BPB (BIOS Parameter Block). */ 34*1b8adde7SWilliam Kucharski #define STAGE1_BPBEND 0x3e 35*1b8adde7SWilliam Kucharski 36*1b8adde7SWilliam Kucharski /* The offset of the major version. */ 37*1b8adde7SWilliam Kucharski #define STAGE1_VER_MAJ_OFFS 0x3e 38*1b8adde7SWilliam Kucharski 39*1b8adde7SWilliam Kucharski /* The offset of BOOT_DRIVE. */ 40*1b8adde7SWilliam Kucharski #define STAGE1_BOOT_DRIVE 0x40 41*1b8adde7SWilliam Kucharski 42*1b8adde7SWilliam Kucharski /* The offset of FORCE_LBA. */ 43*1b8adde7SWilliam Kucharski #define STAGE1_FORCE_LBA 0x41 44*1b8adde7SWilliam Kucharski 45*1b8adde7SWilliam Kucharski /* The offset of STAGE2_ADDRESS. */ 46*1b8adde7SWilliam Kucharski #define STAGE1_STAGE2_ADDRESS 0x42 47*1b8adde7SWilliam Kucharski 48*1b8adde7SWilliam Kucharski /* The offset of STAGE2_SECTOR. */ 49*1b8adde7SWilliam Kucharski #define STAGE1_STAGE2_SECTOR 0x44 50*1b8adde7SWilliam Kucharski 51*1b8adde7SWilliam Kucharski /* The offset of STAGE2_SEGMENT. */ 52*1b8adde7SWilliam Kucharski #define STAGE1_STAGE2_SEGMENT 0x48 53*1b8adde7SWilliam Kucharski 54*1b8adde7SWilliam Kucharski /* The offset of BOOT_DRIVE_CHECK. */ 55*1b8adde7SWilliam Kucharski #define STAGE1_BOOT_DRIVE_CHECK 0x4b 56*1b8adde7SWilliam Kucharski 57*1b8adde7SWilliam Kucharski /* The offset of a magic number used by Windows NT. */ 58*1b8adde7SWilliam Kucharski #define STAGE1_WINDOWS_NT_MAGIC 0x1b8 59*1b8adde7SWilliam Kucharski 60*1b8adde7SWilliam Kucharski /* The offset of the start of the partition table. */ 61*1b8adde7SWilliam Kucharski #define STAGE1_PARTSTART 0x1be 62*1b8adde7SWilliam Kucharski 63*1b8adde7SWilliam Kucharski /* The offset of the end of the partition table. */ 64*1b8adde7SWilliam Kucharski #define STAGE1_PARTEND 0x1fe 65*1b8adde7SWilliam Kucharski 66*1b8adde7SWilliam Kucharski /* The stack segment. */ 67*1b8adde7SWilliam Kucharski #define STAGE1_STACKSEG 0x2000 68*1b8adde7SWilliam Kucharski 69*1b8adde7SWilliam Kucharski /* The segment of disk buffer. The disk buffer MUST be 32K long and 70*1b8adde7SWilliam Kucharski cannot straddle a 64K boundary. */ 71*1b8adde7SWilliam Kucharski #define STAGE1_BUFFERSEG 0x7000 72*1b8adde7SWilliam Kucharski 73*1b8adde7SWilliam Kucharski /* The address of drive parameters. */ 74*1b8adde7SWilliam Kucharski #define STAGE1_DRP_ADDR 0x7f00 75*1b8adde7SWilliam Kucharski 76*1b8adde7SWilliam Kucharski /* The size of drive parameters. */ 77*1b8adde7SWilliam Kucharski #define STAGE1_DRP_SIZE 0x42 78*1b8adde7SWilliam Kucharski 79*1b8adde7SWilliam Kucharski /* The flag for BIOS drive number to designate a hard disk vs. a 80*1b8adde7SWilliam Kucharski floppy. */ 81*1b8adde7SWilliam Kucharski #define STAGE1_BIOS_HD_FLAG 0x80 82*1b8adde7SWilliam Kucharski 83*1b8adde7SWilliam Kucharski /* The drive number of an invalid drive. */ 84*1b8adde7SWilliam Kucharski #define GRUB_INVALID_DRIVE 0xFF 85*1b8adde7SWilliam Kucharski 86*1b8adde7SWilliam Kucharski #endif /* ! STAGE1_HEADER */ 87