Fix up header guards.
[pintos-anon] / src / threads / loader.h
index 2aebb0f8f3a07965bd8690c7bfc7cb81b5f3656c..b412af362f546f429324d60cee952cd6577ebf73 100644 (file)
@@ -1,22 +1,33 @@
-#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. */
-#define LOADER_SIZE 0x200       /* Loader size in bytes (one disk sector). */
+#define LOADER_END  0x7e00      /* Physical address of end of loader. */
 
 /* Physical address of kernel base. */
 #define LOADER_KERN_BASE 0x100000       /* 1 MB. */
 
-/* The loader maps 4 MB of the start of physical memory to this
-   virtual base address.  Later, the kernel adds the rest of
-   physical memory to the mapping.
+/* Kernel virtual address at which all physical memory is mapped.
+
+   The loader maps the 4 MB at the bottom of physical memory to
+   this virtual base address.  Later, paging_init() adds the rest
+   of physical memory to the mapping.
+
    This must be aligned on a 4 MB boundary. */
-#define LOADER_PHYS_BASE 0xb0000000     /* 3 GB. */
+#define LOADER_PHYS_BASE 0xc0000000     /* 3 GB. */
 
 /* Offsets within the loader. */
-#define LOADER_BIOS_SIG (LOADER_SIZE - 2)        /* aa55 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. */
+
+/* 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 /* loader.h */
+#endif /* threads/loader.h */