-#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. */