1 #ifndef THREADS_LOADER_H
2 #define THREADS_LOADER_H
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. */
8 /* Physical address of kernel base. */
9 #define LOADER_KERN_BASE 0x100000 /* 1 MB. */
11 /* Kernel virtual address at which all physical memory is mapped.
13 The loader maps the 4 MB at the bottom of physical memory to
14 this virtual base address. Later, paging_init() adds the rest
15 of physical memory to the mapping.
17 This must be aligned on a 4 MB boundary. */
18 #define LOADER_PHYS_BASE 0xc0000000 /* 3 GB. */
20 /* Offsets within the loader. */
21 #define LOADER_BIOS_SIG (LOADER_END - 2) /* 0xaa55 BIOS signature. */
22 #define LOADER_CMD_LINE_LEN 0x80 /* Command line length. */
23 #define LOADER_CMD_LINE (LOADER_BIOS_SIG - LOADER_CMD_LINE_LEN)
24 /* Kernel command line. */
25 #define LOADER_RAM_PAGES (LOADER_CMD_LINE - 4) /* # of pages of RAM. */
27 /* GDT selectors defined by loader.
28 More selectors are defined by userprog/gdt.h. */
29 #define SEL_NULL 0x00 /* Null selector. */
30 #define SEL_KCSEG 0x08 /* Kernel code selector. */
31 #define SEL_KDSEG 0x10 /* Kernel data selector. */
33 #endif /* threads/loader.h */