Subversion Repositories HelenOS

Rev

Rev 285 | Rev 301 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

/** IA-32 linker script
 *  
 * umapped section:
 *  kernel text
 *  kernel data
 * mapped section:
 *  kernel text
 *  kernel data 
 */

OUTPUT_FORMAT(binary)
ENTRY(kernel_image_start)

SECTIONS {
    .unmapped 0x8000: AT (0x8000) {
        unmapped_ktext_start = .;
        *(K_TEXT_START);
        *(K_TEXT_START_2);
        unmapped_ktext_end = .;
        
        unmapped_kdata_start = .;
        *(K_DATA_START);
        unmapped_kdata_end = .;
    }
    
    .mapped (0x80100000+0x8000+SIZEOF(.unmapped)): AT (0x8000+SIZEOF(.unmapped)) { 
        ktext_start = .;
        *(BOOT_DATA)
        *(.text);
        ktext_end = .;
        
        kdata_start = .;
        *(.data);       /* initialized data */
        *(.rodata*);        /* string literals */
        *(COMMON);      /* global variables */
        hardcoded_load_address = .;
        LONG(0x80108000);
        hardcoded_ktext_size = .;
        LONG(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
        hardcoded_kdata_size = .;
        LONG(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
        hardcoded_unmapped_ktext_size = .;
        LONG(unmapped_ktext_end - unmapped_ktext_start);
        hardcoded_unmapped_kdata_size = .;
        LONG(unmapped_kdata_end - unmapped_kdata_start);
        *(.bss);        /* uninitialized static variables */
        *(K_DATA_END);

        symbol_table = .;
        *(symtab.*);            /* Symbol table, must be LAST symbol!*/

        kdata_end = .;
    }
    
    _hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start);
    _hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);
    
    _map_address = 0x80100000;
    e820table_boot = e820table - _map_address;
    e820counter_boot = e820counter - _map_address;
    real_bootstrap_gdtr = real_bootstrap_gdtr_boot + 0x80000000;
}