X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Floader.h;fp=src%2Fthreads%2Floader.h;h=2aebb0f8f3a07965bd8690c7bfc7cb81b5f3656c;hb=8e05e0a5473ccd3988c98f95e5ec3afad225685b;hp=0000000000000000000000000000000000000000;hpb=533a5dd4b11ec58df8785b33fb003236873a16e2;p=pintos-anon diff --git a/src/threads/loader.h b/src/threads/loader.h new file mode 100644 index 0000000..2aebb0f --- /dev/null +++ b/src/threads/loader.h @@ -0,0 +1,22 @@ +#ifndef HEADER_LOADER_H +#define HEADER_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). */ + +/* 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. + This must be aligned on a 4 MB boundary. */ +#define LOADER_PHYS_BASE 0xb0000000 /* 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. */ + +#endif /* loader.h */