1 #ifndef THREADS_LOADER_H
2 #define THREADS_LOADER_H
4 /* Physical addresses of important kernel components. */
5 #define LOADER_PD_BASE 0x0f000 /* Page directory: 4 kB starting at 60 kB. */
6 #define LOADER_PT_BASE 0x10000 /* Page tables: 64 kB starting at 64 kB. */
7 #define LOADER_KERN_BASE 0x20000 /* Kernel: up to 512 kB starting at 128 kB. */
9 /* Kernel virtual address at which all physical memory is mapped.
11 The loader maps the 4 MB at the bottom of physical memory to
12 this virtual base address. Later, paging_init() adds the rest
13 of physical memory to the mapping.
15 This must be aligned on a 4 MB boundary. */
16 #define LOADER_PHYS_BASE 0xc0000000 /* 3 GB. */
18 /* GDT selectors defined by loader.
19 More selectors are defined by userprog/gdt.h. */
20 #define SEL_NULL 0x00 /* Null selector. */
21 #define SEL_KCSEG 0x08 /* Kernel code selector. */
22 #define SEL_KDSEG 0x10 /* Kernel data selector. */
24 #endif /* threads/loader.h */