17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * GRUB -- GRand Unified Bootloader 37c478bd9Sstevel@tonic-gate * Copyright (C) 1999,2000,2002,2004 Free Software Foundation, Inc. 47c478bd9Sstevel@tonic-gate * 57c478bd9Sstevel@tonic-gate * This program is free software; you can redistribute it and/or modify 67c478bd9Sstevel@tonic-gate * it under the terms of the GNU General Public License as published by 77c478bd9Sstevel@tonic-gate * the Free Software Foundation; either version 2 of the License, or 87c478bd9Sstevel@tonic-gate * (at your option) any later version. 97c478bd9Sstevel@tonic-gate * 107c478bd9Sstevel@tonic-gate * This program is distributed in the hope that it will be useful, 117c478bd9Sstevel@tonic-gate * but WITHOUT ANY WARRANTY; without even the implied warranty of 127c478bd9Sstevel@tonic-gate * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 137c478bd9Sstevel@tonic-gate * GNU General Public License for more details. 147c478bd9Sstevel@tonic-gate * 157c478bd9Sstevel@tonic-gate * You should have received a copy of the GNU General Public License 167c478bd9Sstevel@tonic-gate * along with this program; if not, write to the Free Software 177c478bd9Sstevel@tonic-gate * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 187c478bd9Sstevel@tonic-gate */ 197c478bd9Sstevel@tonic-gate 207c478bd9Sstevel@tonic-gate #ifndef STAGE1_HEADER 217c478bd9Sstevel@tonic-gate #define STAGE1_HEADER 1 227c478bd9Sstevel@tonic-gate 237c478bd9Sstevel@tonic-gate 247c478bd9Sstevel@tonic-gate /* Define the version numbers here, so that Stage 1 can know them. */ 257c478bd9Sstevel@tonic-gate #define COMPAT_VERSION_MAJOR 3 267c478bd9Sstevel@tonic-gate #define COMPAT_VERSION_MINOR 2 277c478bd9Sstevel@tonic-gate #define COMPAT_VERSION ((COMPAT_VERSION_MINOR << 8) \ 287c478bd9Sstevel@tonic-gate | COMPAT_VERSION_MAJOR) 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate /* The signature for bootloader. */ 317c478bd9Sstevel@tonic-gate #define STAGE1_SIGNATURE 0xaa55 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate /* The offset of the end of BPB (BIOS Parameter Block). */ 347c478bd9Sstevel@tonic-gate #define STAGE1_BPBEND 0x3e 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate /* The offset of the major version. */ 377c478bd9Sstevel@tonic-gate #define STAGE1_VER_MAJ_OFFS 0x3e 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate /* The offset of BOOT_DRIVE. */ 407c478bd9Sstevel@tonic-gate #define STAGE1_BOOT_DRIVE 0x40 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate /* The offset of FORCE_LBA. */ 437c478bd9Sstevel@tonic-gate #define STAGE1_FORCE_LBA 0x41 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gate /* The offset of STAGE2_ADDRESS. */ 467c478bd9Sstevel@tonic-gate #define STAGE1_STAGE2_ADDRESS 0x42 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate /* The offset of STAGE2_SECTOR. */ 497c478bd9Sstevel@tonic-gate #define STAGE1_STAGE2_SECTOR 0x44 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gate /* The offset of STAGE2_SEGMENT. */ 527c478bd9Sstevel@tonic-gate #define STAGE1_STAGE2_SEGMENT 0x48 537c478bd9Sstevel@tonic-gate 54*1b8adde7SWilliam Kucharski /* The offset of BOOT_DRIVE_CHECK. */ 55*1b8adde7SWilliam Kucharski #define STAGE1_BOOT_DRIVE_CHECK 0x4b 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate /* The offset of a magic number used by Windows NT. */ 587c478bd9Sstevel@tonic-gate #define STAGE1_WINDOWS_NT_MAGIC 0x1b8 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate /* The offset of the start of the partition table. */ 617c478bd9Sstevel@tonic-gate #define STAGE1_PARTSTART 0x1be 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate /* The offset of the end of the partition table. */ 647c478bd9Sstevel@tonic-gate #define STAGE1_PARTEND 0x1fe 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gate /* The stack segment. */ 677c478bd9Sstevel@tonic-gate #define STAGE1_STACKSEG 0x2000 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate /* The segment of disk buffer. The disk buffer MUST be 32K long and 707c478bd9Sstevel@tonic-gate cannot straddle a 64K boundary. */ 717c478bd9Sstevel@tonic-gate #define STAGE1_BUFFERSEG 0x7000 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate /* The address of drive parameters. */ 747c478bd9Sstevel@tonic-gate #define STAGE1_DRP_ADDR 0x7f00 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate /* The size of drive parameters. */ 777c478bd9Sstevel@tonic-gate #define STAGE1_DRP_SIZE 0x42 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate /* The flag for BIOS drive number to designate a hard disk vs. a 807c478bd9Sstevel@tonic-gate floppy. */ 817c478bd9Sstevel@tonic-gate #define STAGE1_BIOS_HD_FLAG 0x80 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gate /* The drive number of an invalid drive. */ 847c478bd9Sstevel@tonic-gate #define GRUB_INVALID_DRIVE 0xFF 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate #endif /* ! STAGE1_HEADER */ 87