Changeset 87db879 in mainline


Ignore:
Timestamp:
2018-11-13T20:22:20Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
948e85b
Parents:
156bae23
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-24 14:37:23)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-13 20:22:20)
Message:

Minimize wasted space in IA-32 kernel image

Location:
kernel/arch/ia32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/_link.ld.in

    r156bae23 r87db879  
    2323        kernel_load_address = PA2KA(BOOT_OFFSET);
    2424
    25         .ap_bootstrap (AP_BOOT_OFFSET): AT (AP_BOOT_OFFSET) {
    26                 ap_bootstrap_start = .;
     25        . = AP_BOOT_OFFSET + SIZEOF_HEADERS;
    2726
    28                 /* Must be first. */
    29                 *(.multiboot);
     27        /* Must be first. */
     28        .multiboot : { *(.multiboot); } :ap_boot
    3029
     30        ap_bootstrap_start = .;
     31
     32        .ap_bootstrap : {
    3133                *(K_AP_TEXT_START);
    3234                *(K_AP_DATA_START);
    33                 ap_bootstrap_end = .;
    3435        } :ap_boot
    3536
    36         .unmapped (BOOT_OFFSET): AT (BOOT_OFFSET) {
    37                 unmapped_start = .;
     37        ap_bootstrap_end = .;
     38
     39        . = BOOT_OFFSET + (ap_bootstrap_end & (PAGE_SIZE-1));
     40        unmapped_start = .;
     41
     42        .unmapped : {
    3843                *(K_TEXT_START);
    3944                *(K_DATA_START);
    40                 unmapped_end = .;
    4145        } :unmapped
     46
     47        unmapped_file_end = .;
    4248
    4349        .unmapped_bss : {
    4450                *(.bootstack);
     51                *(K_BSS_START);
    4552        } :unmapped
    4653
    47         .mapped (PA2KA(BOOT_OFFSET) + SIZEOF(.unmapped) + SIZEOF(.unmapped_bss)): AT (BOOT_OFFSET + SIZEOF(.unmapped) + SIZEOF(.unmapped_bss)) {
     54        unmapped_end = .;
     55        mapped_load_start = ALIGN(PAGE_SIZE) + (unmapped_file_end & (PAGE_SIZE-1));
     56
     57        .mapped (PA2KA(mapped_load_start)): AT (mapped_load_start) {
    4858                ktext_start = .;
    4959                *(.text .text.*);
  • kernel/arch/ia32/src/boot/multiboot.S

    r156bae23 r87db879  
    597597        ret
    598598
    599 .section K_DATA_START, "aw", @progbits
     599.section K_BSS_START, "aw", @nobits
    600600
    601601.align 4096
     
    607607        .long 0
    608608
     609SYMBOL(multiboot_eax)
     610        .long 0
     611
     612SYMBOL(multiboot_ebx)
     613        .long 0
     614
     615pt_loc:
     616        .long 0
     617kernel_end:
     618        .long 0
     619free_area:
     620        .long 0
     621
     622.section K_DATA_START, "aw", @progbits
     623
    609624SYMBOL(bootstrap_gdtr)
    610625        .word GDT_SELECTOR(GDT_ITEMS)
    611626        .long KA2PA(gdt)
    612 
    613 SYMBOL(multiboot_eax)
    614         .long 0
    615 
    616 SYMBOL(multiboot_ebx)
    617         .long 0
    618 
    619 pt_loc:
    620         .long 0
    621 kernel_end:
    622         .long 0
    623 free_area:
    624         .long 0
    625627
    626628status_prot:
Note: See TracChangeset for help on using the changeset viewer.