Rev 532 | Rev 602 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 532 | Rev 534 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | /** IA-32 linker script |
|
- | 2 | * |
|
- | 3 | * umapped section: |
|
- | 4 | * kernel text |
|
- | 5 | * kernel data |
|
- | 6 | * mapped section: |
|
- | 7 | * kernel text |
|
- | 8 | * kernel data |
|
- | 9 | */ |
|
- | 10 | ||
- | 11 | #define __ASM__ |
|
- | 12 | #include <arch/boot/boot.h> |
|
- | 13 | #include <arch/mm/page.h> |
|
- | 14 | ||
- | 15 | ENTRY(kernel_image_start) |
|
- | 16 | ||
- | 17 | SECTIONS { |
|
- | 18 | .unmapped BOOTSTRAP_OFFSET: AT (BOOTSTRAP_OFFSET) { |
|
- | 19 | unmapped_ktext_start = .; |
|
- | 20 | *(K_TEXT_START); |
|
- | 21 | *(K_TEXT_START_2); |
|
- | 22 | unmapped_ktext_end = .; |
|
- | 23 | ||
- | 24 | unmapped_kdata_start = .; |
|
- | 25 | *(K_DATA_START); |
|
- | 26 | unmapped_kdata_end = .; |
|
- | 27 | } |
|
- | 28 | ||
- | 29 | .mapped (PA2KA(BOOT_OFFSET+BOOTSTRAP_OFFSET)+SIZEOF(.unmapped)): AT (BOOTSTRAP_OFFSET+SIZEOF(.unmapped)) { |
|
- | 30 | ktext_start = .; |
|
- | 31 | *(BOOT_DATA); |
|
- | 32 | *(.text); |
|
- | 33 | ktext_end = .; |
|
- | 34 | ||
- | 35 | kdata_start = .; |
|
- | 36 | *(.data); /* initialized data */ |
|
- | 37 | *(.rodata*); /* string literals */ |
|
- | 38 | *(COMMON); /* global variables */ |
|
- | 39 | hardcoded_load_address = .; |
|
- | 40 | LONG(PA2KA(BOOT_OFFSET+BOOTSTRAP_OFFSET)); |
|
- | 41 | hardcoded_ktext_size = .; |
|
- | 42 | LONG((ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start)); |
|
- | 43 | hardcoded_kdata_size = .; |
|
- | 44 | LONG((kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start)); |
|
- | 45 | hardcoded_unmapped_ktext_size = .; |
|
- | 46 | LONG(unmapped_ktext_end - unmapped_ktext_start); |
|
- | 47 | hardcoded_unmapped_kdata_size = .; |
|
- | 48 | LONG(unmapped_kdata_end - unmapped_kdata_start); |
|
- | 49 | *(.bss); /* uninitialized static variables */ |
|
- | 50 | symbol_table = .; |
|
- | 51 | *(symtab.*); /* Symbol table, must be LAST symbol! */ |
|
- | 52 | ||
- | 53 | kdata_end = .; |
|
- | 54 | } |
|
- | 55 | ||
- | 56 | /DISCARD/ : { |
|
- | 57 | *(.note.GNU-stack); |
|
- | 58 | *(.comment); |
|
- | 59 | } |
|
- | 60 | ||
- | 61 | ||
- | 62 | _hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start); |
|
- | 63 | _hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start); |
|
- | 64 | ||
- | 65 | e820table_boot = KA2PA(e820table) - BOOT_OFFSET; |
|
- | 66 | e820counter_boot = KA2PA(e820counter) - BOOT_OFFSET; |
|
- | 67 | real_bootstrap_gdtr = PA2KA(real_bootstrap_gdtr_boot); |
|
- | 68 | } |