X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Floader.h;h=b412af362f546f429324d60cee952cd6577ebf73;hb=590f912cc145f43329a8e6db8f97db3a836a1755;hp=6ae2856fc827651c3056baf9d639fba2e6b3f71d;hpb=8063d8f3b3a778e9a15eff66dfd1b08652bae523;p=pintos-anon diff --git a/src/threads/loader.h b/src/threads/loader.h index 6ae2856..b412af3 100644 --- a/src/threads/loader.h +++ b/src/threads/loader.h @@ -1,5 +1,5 @@ -#ifndef HEADER_LOADER_H -#define HEADER_LOADER_H +#ifndef THREADS_LOADER_H +#define THREADS_LOADER_H /* Constants fixed by the PC BIOS. */ #define LOADER_BASE 0x7c00 /* Physical address of loader's base. */ @@ -18,8 +18,16 @@ #define LOADER_PHYS_BASE 0xc0000000 /* 3 GB. */ /* Offsets within the loader. */ -#define LOADER_BIOS_SIG (LOADER_END - 2) /* 0xaa55 BIOS signature. */ -#define LOADER_CMD_LINE (LOADER_BIOS_SIG - 0x80) /* Kernel command line. */ -#define LOADER_RAM_PAGES (LOADER_CMD_LINE - 4) /* # of pages of RAM. */ +#define LOADER_BIOS_SIG (LOADER_END - 2) /* 0xaa55 BIOS signature. */ +#define LOADER_CMD_LINE_LEN 0x80 /* Command line length. */ +#define LOADER_CMD_LINE (LOADER_BIOS_SIG - LOADER_CMD_LINE_LEN) + /* Kernel command line. */ +#define LOADER_RAM_PAGES (LOADER_CMD_LINE - 4) /* # of pages of RAM. */ -#endif /* loader.h */ +/* GDT selectors defined by loader. + More selectors are defined by userprog/gdt.h. */ +#define SEL_NULL 0x00 /* Null selector. */ +#define SEL_KCSEG 0x08 /* Kernel code selector. */ +#define SEL_KDSEG 0x10 /* Kernel data selector. */ + +#endif /* threads/loader.h */