X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Fthreads%2Fkernel.lds.S;h=4840202174311572aa5112d6e6c9d5fcf2429ac4;hp=3b7f8b1f0e789b6414d096d73e7b522630440526;hb=21848a29ff6f6d52751bd91463be03b790f6e3e5;hpb=b0a700d18f0a0a8c87e1a4fff3a2108e0edb0fbc diff --git a/src/threads/kernel.lds.S b/src/threads/kernel.lds.S index 3b7f8b1..4840202 100644 --- a/src/threads/kernel.lds.S +++ b/src/threads/kernel.lds.S @@ -5,15 +5,22 @@ 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 : { *(.start) *(.text) } = 0x9090 - .rodata : { *(.rodata) *(.rodata.*) } - .data : { *(.data) } + .text : { *(.start) *(.text) } = 0x90 + .rodata : { *(.rodata) *(.rodata.*) + . = ALIGN(0x1000); + _end_kernel_text = .; } + .eh_frame : { *(.eh_frame) } + .data : { *(.data) + _signature = .; LONG(0xaa55aa55) } + + .plt : { *(.plt*) } /* BSS (zero-initialized data) is after everything else. */ _start_bss = .; @@ -21,4 +28,6 @@ SECTIONS _end_bss = .; _end = .; + + ASSERT (_end - _start <= 512K, "Kernel image is too big.") }