2
* GRUB -- GRand Unified Bootloader
3
* Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
#ifndef GRUB_LINUX_MACHINE_HEADER
21
#define GRUB_LINUX_MACHINE_HEADER 1
23
#define GRUB_LINUX_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */
24
#define GRUB_LINUX_DEFAULT_SETUP_SECTS 4
25
#define GRUB_LINUX_FLAG_CAN_USE_HEAP 0x80
26
#define GRUB_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF
27
#define GRUB_LINUX_MAX_SETUP_SECTS 64
28
#define GRUB_LINUX_BOOT_LOADER_TYPE 0x72
29
#define GRUB_LINUX_HEAP_END_OFFSET (0x9000 - 0x200)
31
#define GRUB_LINUX_BZIMAGE_ADDR 0x100000
32
#define GRUB_LINUX_ZIMAGE_ADDR 0x10000
33
#define GRUB_LINUX_OLD_REAL_MODE_ADDR 0x90000
34
#define GRUB_LINUX_SETUP_STACK 0x9000
36
#define GRUB_LINUX_FLAG_BIG_KERNEL 0x1
38
/* Linux's video mode selection support. Actually I hate it! */
39
#define GRUB_LINUX_VID_MODE_NORMAL 0xFFFF
40
#define GRUB_LINUX_VID_MODE_EXTENDED 0xFFFE
41
#define GRUB_LINUX_VID_MODE_ASK 0xFFFD
43
#define GRUB_LINUX_CL_OFFSET 0x9000
44
#define GRUB_LINUX_CL_END_OFFSET 0x90FF
45
#define GRUB_LINUX_SETUP_MOVE_SIZE 0x9100
46
#define GRUB_LINUX_CL_MAGIC 0xA33F
50
/* For the Linux/i386 boot protocol version 2.03. */
51
struct linux_kernel_header
53
grub_uint8_t code1[0x0020];
54
grub_uint16_t cl_magic; /* Magic number 0xA33F */
55
grub_uint16_t cl_offset; /* The offset of command line */
56
grub_uint8_t code2[0x01F1 - 0x0020 - 2 - 2];
57
grub_uint8_t setup_sects; /* The size of the setup in sectors */
58
grub_uint16_t root_flags; /* If the root is mounted readonly */
59
grub_uint16_t syssize; /* obsolete */
60
grub_uint16_t swap_dev; /* obsolete */
61
grub_uint16_t ram_size; /* obsolete */
62
grub_uint16_t vid_mode; /* Video mode control */
63
grub_uint16_t root_dev; /* Default root device number */
64
grub_uint16_t boot_flag; /* 0xAA55 magic number */
65
grub_uint16_t jump; /* Jump instruction */
66
grub_uint32_t header; /* Magic signature "HdrS" */
67
grub_uint16_t version; /* Boot protocol version supported */
68
grub_uint32_t realmode_swtch; /* Boot loader hook */
69
grub_uint16_t start_sys; /* The load-low segment (obsolete) */
70
grub_uint16_t kernel_version; /* Points to kernel version string */
71
grub_uint8_t type_of_loader; /* Boot loader identifier */
72
grub_uint8_t loadflags; /* Boot protocol option flags */
73
grub_uint16_t setup_move_size; /* Move to high memory size */
74
grub_uint32_t code32_start; /* Boot loader hook */
75
grub_uint32_t ramdisk_image; /* initrd load address */
76
grub_uint32_t ramdisk_size; /* initrd size */
77
grub_uint32_t bootsect_kludge; /* obsolete */
78
grub_uint16_t heap_end_ptr; /* Free memory after setup end */
79
grub_uint16_t pad1; /* Unused */
80
char *cmd_line_ptr; /* Points to the kernel command line */
81
grub_uint32_t initrd_addr_max; /* Highest address for initrd */
82
} __attribute__ ((packed));
84
#endif /* ! ASM_FILE */
86
#endif /* ! GRUB_LINUX_MACHINE_HEADER */