Rev 42 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
42 | pj | 1 | /* |
2 | * GRUB -- GRand Unified Bootloader |
||
3 | * Copyright (C) 1996 Erich Boleyn <erich@uruk.org> |
||
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 | /* |
||
21 | * MultiBoot Header description |
||
22 | * |
||
23 | * |
||
24 | * struct multiboot_header |
||
25 | * { |
||
26 | * Must be MULTIBOOT_MAGIC - see below. |
||
27 | * unsigned magic; |
||
28 | * |
||
29 | * Feature flags - see below. |
||
30 | * unsigned flags; |
||
31 | * |
||
32 | * |
||
33 | * Checksum |
||
34 | * |
||
35 | * The above fields plus this one must equal 0 mod 2^32. |
||
36 | * |
||
37 | * unsigned checksum; |
||
38 | * |
||
39 | * These are only valid if MULTIBOOT_AOUT_KLUDGE is set. |
||
40 | * unsigned header_addr; |
||
41 | * unsigned load_addr; |
||
42 | * unsigned load_end_addr; |
||
43 | * unsigned bss_end_addr; |
||
44 | * unsigned entry_addr; |
||
45 | * }; |
||
46 | */ |
||
47 | |||
48 | /* |
||
49 | * The entire multiboot_header must be contained |
||
50 | * within the first MULTIBOOT_SEARCH bytes of the kernel image. |
||
51 | * #define MULTIBOOT_SEARCH 8192 |
||
52 | * #define MULTIBOOT_FOUND(addr, len) \ |
||
53 | * (!((addr) & 0x3) && ((len) >= 12) && (*((int *)(addr)) == MULTIBOOT_MAGIC) \ |
||
54 | * && !(*((unsigned *)(addr)) + *((unsigned *)(addr+4)) \ |
||
55 | * + *((unsigned *)(addr+8))) \ |
||
56 | * && (!(MULTIBOOT_AOUT_KLUDGE & *((int *)(addr+4))) || ((len) >= 32))) |
||
57 | */ |
||
58 | |||
59 | /* Magic value identifying the multiboot_header. */ |
||
60 | #define MULTIBOOT_MAGIC 0x1BADB002 |
||
61 | |||
62 | /* |
||
63 | * Features flags for 'flags'. |
||
64 | * If a boot loader sees a flag in MULTIBOOT_MUSTKNOW set |
||
65 | * and it doesn't understand it, it must fail. |
||
66 | */ |
||
67 | #define MULTIBOOT_MUSTKNOW 0x0000FFFF |
||
68 | |||
69 | /* currently unsupported flags... this is a kind of version number. */ |
||
70 | #define MULTIBOOT_UNSUPPORTED 0x0000FFFC |
||
71 | |||
72 | /* Align all boot modules on i386 page (4KB) boundaries. */ |
||
73 | #define MULTIBOOT_PAGE_ALIGN 0x00000001 |
||
74 | |||
75 | /* Must pass memory information to OS. */ |
||
76 | #define MULTIBOOT_MEMORY_INFO 0x00000002 |
||
77 | |||
78 | /* This flag indicates the use of the other fields in the header. */ |
||
79 | #define MULTIBOOT_AOUT_KLUDGE 0x00010000 |
||
80 |