[Krafton Jungle] PintOS 2.0.0
크래프톤 정글 PintOS
 
Loading...
Searching...
No Matches
loader.h
Go to the documentation of this file.
1#ifndef THREADS_LOADER_H
2#define THREADS_LOADER_H
3
4/* Constants fixed by the PC BIOS. */
5#define LOADER_BASE 0x7c00 /* Physical address of loader's base. */
6#define LOADER_END 0x7e00 /* Physical address of end of loader. */
7
8/* Physical address of kernel base. */
9#define LOADER_KERN_BASE 0x8004000000
10
11/* Kernel virtual address at which all physical memory is mapped. */
12#define LOADER_PHYS_BASE 0x200000
13
14/* Multiboot infos */
15#define MULTIBOOT_INFO 0x7000
16#define MULTIBOOT_FLAG MULTIBOOT_INFO
17#define MULTIBOOT_MMAP_LEN MULTIBOOT_INFO + 44
18#define MULTIBOOT_MMAP_ADDR MULTIBOOT_INFO + 48
19
20#define E820_MAP MULTIBOOT_INFO + 52
21#define E820_MAP4 MULTIBOOT_INFO + 56
22
23/* Important loader physical addresses. */
24#define LOADER_SIG (LOADER_END - LOADER_SIG_LEN) /* 0xaa55 BIOS signature. */
25#define LOADER_ARGS (LOADER_SIG - LOADER_ARGS_LEN) /* Command-line args. */
26#define LOADER_ARG_CNT (LOADER_ARGS - LOADER_ARG_CNT_LEN) /* Number of args. */
27
28/* Sizes of loader data structures. */
29#define LOADER_SIG_LEN 2
30#define LOADER_ARGS_LEN 128
31#define LOADER_ARG_CNT_LEN 4
32
33/* GDT selectors defined by loader.
34 More selectors are defined by userprog/gdt.h. */
35#define SEL_NULL 0x00 /* Null selector. */
36#define SEL_KCSEG 0x08 /* Kernel code selector. */
37#define SEL_KDSEG 0x10 /* Kernel data selector. */
38#define SEL_UDSEG 0x1B /* User data selector. */
39#define SEL_UCSEG 0x23 /* User code selector. */
40#define SEL_TSS 0x28 /* Task-state segment. */
41#define SEL_CNT 8 /* Number of segments. */
42
43#endif /* threads/loader.h */