• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  GRUB  --  GRand Unified Bootloader
3  *  Copyright (C) 2000   Free Software Foundation, Inc.
4  *
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.
9  *
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.
14  *
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.
18  */
19 
20 #ifndef MBOOT_MB_HEADER_H
21 #define MBOOT_MB_HEADER_H
22 
23 #include <inttypes.h>
24 
25 /*
26  *  MultiBoot Header description
27  */
28 
29 struct multiboot_header {
30     /* Must be MULTIBOOT_MAGIC - see below.  */
31     uint32_t magic;
32 
33     /* Feature flags - see below.  */
34     uint32_t flags;
35 
36     /*
37      * Checksum
38      *
39      * The above fields plus this one must equal 0 mod 2^32.
40      */
41     uint32_t checksum;
42 
43     /* These are only valid if MULTIBOOT_AOUT_KLUDGE is set.  */
44     uint32_t header_addr;
45     uint32_t load_addr;
46     uint32_t load_end_addr;
47     uint32_t bss_end_addr;
48     uint32_t entry_addr;
49 
50     /* These are only valid if MULTIBOOT_VIDEO_MODE is set.  */
51     uint32_t mode_type;
52     uint32_t width;
53     uint32_t height;
54     uint32_t depth;
55 };
56 
57 /*
58  * The entire multiboot_header must be contained
59  * within the first MULTIBOOT_SEARCH bytes of the kernel image.
60  */
61 #define MULTIBOOT_SEARCH		8192
62 
63 /* Magic value identifying the multiboot_header.  */
64 #define MULTIBOOT_MAGIC			0x1BADB002
65 
66 /*
67  * Features flags for 'flags'.
68  * If a boot loader sees a flag in MULTIBOOT_MUSTKNOW set
69  * and it doesn't understand it, it must fail.
70  */
71 #define MULTIBOOT_MUSTKNOW		0x0000FFFF
72 
73 /* currently unsupported flags...  this is a kind of version number.  */
74 #define MULTIBOOT_UNSUPPORTED		0x0000FFF8
75 
76 /* Align all boot modules on i386 page (4KB) boundaries.  */
77 #define MULTIBOOT_PAGE_ALIGN		0x00000001
78 
79 /* Must pass memory information to OS.  */
80 #define MULTIBOOT_MEMORY_INFO		0x00000002
81 
82 /* Must pass video information to OS.  */
83 #define MULTIBOOT_VIDEO_MODE		0x00000004
84 
85 /* This flag indicates the use of the address fields in the header.  */
86 #define MULTIBOOT_AOUT_KLUDGE		0x00010000
87 
88 #endif /* MBOOT_MB_HEADER_H */
89