AquilaOS documentation
How it works, and its code
Toggle main menu visibility
Loading...
Searching...
No Matches
boot.h
Go to the documentation of this file.
1
#ifndef _BOOT_H
2
#define _BOOT_H
3
4
#include <
core/system.h
>
5
#include <
sys/elf.h
>
6
7
/*
8
* What the boot loader passed the kernel, in the same form whatever the
9
* boot loader (Multiboot on the PC, a devicetree on aarch64): the memory
10
* map, the modules, the command line, and the kernel's symbols if they
11
* were passed.
12
*/
13
14
/* A module the boot loader loaded: the RAM disk. */
15
typedef
struct
{
16
uintptr_t
paddr
;
/* its physical address; arch_phys_map() maps it */
17
size_t
size
;
18
char
*
cmdline
;
19
}
module_t
;
20
21
/* What a region of the memory map is. */
22
enum
mmap_type
{
23
MMAP_USABLE
= 1,
24
MMAP_RESERVED
= 2
25
};
26
27
/* A region of the memory map, [start, end). */
28
typedef
struct
{
29
enum
mmap_type
type
;
30
uintptr_t
start
;
31
uintptr_t
end
;
32
}
mmap_t
;
33
34
/* Everything the boot loader passed. */
35
struct
boot
{
36
char
*
cmdline
;
37
uintptr_t
total_mem
;
/* how much memory there is, in KiB */
38
39
int
modules_count
;
40
int
mmap_count
;
41
module_t
*
modules
;
42
mmap_t
*
mmap
;
43
44
/* the kernel's ELF section headers, if the boot loader passed them,
45
* and its symbol table and string table among them */
46
elf_shdr_t
*
shdr
;
47
uint32_t
shdr_num
;
48
49
elf_shdr_t
*
symtab
;
50
size_t
symnum
;
/* how many symbols */
51
52
elf_shdr_t
*
strtab
;
53
};
54
55
#endif
elf.h
elf_shdr_t
struct elf32_shdr elf_shdr_t
Definition
elf.h:223
mmap_type
mmap_type
Definition
boot.h:22
MMAP_USABLE
@ MMAP_USABLE
Definition
boot.h:23
MMAP_RESERVED
@ MMAP_RESERVED
Definition
boot.h:24
system.h
uintptr_t
__SIZE_TYPE__ uintptr_t
Definition
stddef.h:12
uint32_t
unsigned int uint32_t
Definition
stddef.h:22
boot
Definition
boot.h:35
boot::mmap_count
int mmap_count
Definition
boot.h:40
boot::cmdline
char * cmdline
Definition
boot.h:36
boot::modules
module_t * modules
Definition
boot.h:41
boot::symtab
elf_shdr_t * symtab
Definition
boot.h:49
boot::shdr_num
uint32_t shdr_num
Definition
boot.h:47
boot::symnum
size_t symnum
Definition
boot.h:50
boot::total_mem
uintptr_t total_mem
Definition
boot.h:37
boot::strtab
elf_shdr_t * strtab
Definition
boot.h:52
boot::shdr
elf_shdr_t * shdr
Definition
boot.h:46
boot::mmap
mmap_t * mmap
Definition
boot.h:42
boot::modules_count
int modules_count
Definition
boot.h:39
mmap_t
Definition
boot.h:28
mmap_t::end
uintptr_t end
Definition
boot.h:31
mmap_t::type
enum mmap_type type
Definition
boot.h:29
mmap_t::start
uintptr_t start
Definition
boot.h:30
module_t
Definition
boot.h:15
module_t::size
size_t size
Definition
boot.h:17
module_t::cmdline
char * cmdline
Definition
boot.h:18
module_t::paddr
uintptr_t paddr
Definition
boot.h:16
kernel
include
boot
boot.h
Generated by
1.18.0