source: libcaca/trunk/kernel/multiboot.h @ 4369

Last change on this file since 4369 was 4369, checked in by Sam Hocevar, 8 years ago

Add the copyright unit test and update copyright information everywhere.

  • Property svn:keywords set to Id
File size: 3.0 KB
RevLine 
[568]1/* multiboot.h - the header for Multiboot */
[4369]2/* copied into libcaca in 2010 by sam@hocevar.net */
[568]3/* Copyright (C) 1999  Free Software Foundation, Inc.
[4300]4
[568]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.
[4300]9
[568]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.
[4300]14
[568]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/* Macros.  */
20
21/* The magic number for the Multiboot header.  */
[4300]22#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
[568]23
24/* The flags for the Multiboot header.  */
[4300]25#define MULTIBOOT_HEADER_FLAGS 0x00010003
[568]26
27/* The magic number passed by a Multiboot-compliant boot loader.  */
[4300]28#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
[568]29
30/* The size of our stack (16KB).  */
[4300]31#define STACK_SIZE 0x4000
[568]32
33/* C symbol format. HAVE_ASM_USCORE is defined by configure.  */
34#ifdef HAVE_ASM_USCORE
[4300]35# define EXT_C(sym) _ ## sym
[568]36#else
[4300]37# define EXT_C(sym) sym
[568]38#endif
39
40#ifndef ASM
41/* Do not include here in boot.S.  */
42
43/* Types.  */
44
45/* The Multiboot header.  */
46typedef struct multiboot_header
47{
48  unsigned long magic;
49  unsigned long flags;
50  unsigned long checksum;
51  unsigned long header_addr;
52  unsigned long load_addr;
53  unsigned long load_end_addr;
54  unsigned long bss_end_addr;
55  unsigned long entry_addr;
56} multiboot_header_t;
57
58/* The symbol table for a.out.  */
59typedef struct aout_symbol_table
60{
61  unsigned long tabsize;
62  unsigned long strsize;
63  unsigned long addr;
64  unsigned long reserved;
65} aout_symbol_table_t;
66
67/* The section header table for ELF.  */
68typedef struct elf_section_header_table
69{
70  unsigned long num;
71  unsigned long size;
72  unsigned long addr;
73  unsigned long shndx;
74} elf_section_header_table_t;
75
76/* The Multiboot information.  */
77typedef struct multiboot_info
78{
79  unsigned long flags;
80  unsigned long mem_lower;
81  unsigned long mem_upper;
82  unsigned long boot_device;
83  unsigned long cmdline;
84  unsigned long mods_count;
85  unsigned long mods_addr;
86  union
87  {
88    aout_symbol_table_t aout_sym;
89    elf_section_header_table_t elf_sec;
90  } u;
91  unsigned long mmap_length;
92  unsigned long mmap_addr;
93} multiboot_info_t;
94
95/* The module structure.  */
96typedef struct module
97{
98  unsigned long mod_start;
99  unsigned long mod_end;
100  unsigned long string;
101  unsigned long reserved;
102} module_t;
103
104/* The memory map. Be careful that the offset 0 is base_addr_low
105   but no size.  */
106typedef struct memory_map
107{
108  unsigned long size;
109  unsigned long base_addr_low;
110  unsigned long base_addr_high;
111  unsigned long length_low;
112  unsigned long length_high;
113  unsigned long type;
114} memory_map_t;
115
116#endif /* ! ASM */
Note: See TracBrowser for help on using the repository browser.