X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Fthreads%2Fkernel.lds.S;h=19082d5d3896111dae63de572d7ef5649e8220d3;hp=b911b29fa45853714f6e069468c1cdd8b4f20b9d;hb=a03618133f7df0954802a470a4bee7674f7aed45;hpb=beddf03109baecfdda77c6e4478ac975e49faf73 diff --git a/src/threads/kernel.lds.S b/src/threads/kernel.lds.S index b911b29..19082d5 100644 --- a/src/threads/kernel.lds.S +++ b/src/threads/kernel.lds.S @@ -1,19 +1,23 @@ -#include "loader.h" +#include "threads/loader.h" OUTPUT_FORMAT("elf32-i386") OUTPUT_ARCH("i386") ENTRY(start) /* Kernel starts at "start" symbol. */ SECTIONS { - /* Specifies the virtual address for the kernel base. */ - . = LOADER_PHYS_BASE + LOADER_KERN_BASE; + /* Specify the kernel base address. */ + _start = LOADER_PHYS_BASE + LOADER_KERN_BASE; - _start = .; + /* Make room for the ELF headers. */ + . = _start + SIZEOF_HEADERS; /* Kernel starts with code, followed by read-only data and writable data. */ - .text : { *(.text) } = 0x9090 - .rodata : { *(.rodata) *(.rodata.*) } - .data : { *(.data) } + .text : { *(.start) *(.text) } = 0x90 + .rodata : { *(.rodata) *(.rodata.*) + . = ALIGN(0x1000); + _end_kernel_text = .; } + .data : { *(.data) + _signature = .; LONG(0xaa55aa55) } /* BSS (zero-initialized data) is after everything else. */ _start_bss = .; @@ -21,4 +25,6 @@ SECTIONS _end_bss = .; _end = .; + + ASSERT (_end - _start <= 512K, "Kernel image is too big.") }