libmeinos: +llist2
[meinos.git] / kernel2 / include / multiboot.h
blob1e4254062ff0ca49a298a01e9fbab766c5533254
1 /*
2 meinOS - A unix-like x86 microkernel operating system
3 Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
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 3 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, see <http://www.gnu.org/licenses/>.
19 #ifndef _MULTIBOOT_H_
20 #define _MULTIBOOT_H_
22 #include <sys/types.h>
23 #include <stdint.h>
25 #define MULTIBOOT_MAGIC 0x2BADB002
27 #define multiboot_checkflag(mbi,flag) (mbi->flags&(1<<flag))
29 typedef enum {
30 MULTIBOOT_FREE = 1,
31 MULTIBOOT_RESERVED
32 } multiboot_mmap_type_t;
34 typedef struct {
35 uint32_t flags;
36 uint32_t mem_lower;
37 uint32_t mem_upper;
38 uint8_t boot_device[4];
39 uint32_t cmdline;
40 uint32_t mods_count;
41 uint32_t mods_addr;
42 uint32_t syms[4];
43 uint32_t mmap_length;
44 uint32_t mmap_addr;
45 uint32_t drives_length;
46 uint32_t drives_addr;
47 uint32_t config_table;
48 uint32_t boot_loader_name;
49 uint32_t apm_table;
50 uint32_t vbe_control_info;
51 uint32_t vbe_mode_info;
52 uint32_t vbe_mode;
53 uint32_t vbe_interface_seq;
54 uint32_t vbe_interface_off;
55 uint32_t vbe_interface_len;
56 } __attribute__ ((packed)) multiboot_info_t;
58 typedef struct {
59 uint32_t size;
60 uint64_t base;
61 uint64_t length;
62 multiboot_mmap_type_t type:32;
63 } __attribute__ ((packed)) multiboot_mmape_t;
65 typedef struct {
66 uint32_t mod_start;
67 uint32_t mod_end;
68 uint32_t mod_name;
69 uint32_t reserved;
70 } __attribute__ ((packed)) multiboot_mod_t;
72 int multiboot_init(multiboot_info_t *mbi);
73 size_t multiboot_get_memlower();
74 size_t multiboot_get_memupper();
75 int multiboot_get_bootdev();
76 char* multiboot_get_cmdline();
77 void *multiboot_get_mod(size_t i,char **name,size_t *size);
78 char *multiboot_get_bootloader();
79 int multiboot_get_mmap(int item,void **addr,size_t *length,multiboot_mmap_type_t *type);
81 #endif