Changeset 156bae23 in mainline


Ignore:
Timestamp:
2018-11-13T20:22:20Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
87db879
Parents:
6e5252a
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-24 00:27:26)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-13 20:22:20)
Message:

Allocate boot stack properly on x86

Location:
kernel/arch
Files:
6 edited

Legend:

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

    r6e5252a r156bae23  
    4242        } :unmapped
    4343
    44         .mapped (PA2KA(BOOT_OFFSET) + SIZEOF(.unmapped)) : AT (BOOT_OFFSET + SIZEOF(.unmapped)) {
     44        .unmapped_bss : {
     45                *(.bootstack);
     46        } :unmapped
     47
     48        .mapped (PA2KA(BOOT_OFFSET) + SIZEOF(.unmapped) + SIZEOF(.unmapped_bss)) : AT (BOOT_OFFSET + SIZEOF(.unmapped) + SIZEOF(.unmapped_bss)) {
    4549                ktext_start = .;
    4650                *(.text .text.*);
  • kernel/arch/amd64/src/asm.S

    r6e5252a r156bae23  
    3434#include <arch/cpu.h>
    3535#include <arch/smp/apic.h>
     36#include <arch/boot/boot.h>
     37
     38.section .bootstack, "a", @nobits
     39.align 16
     40SYMBOL(bootstack_bottom)
     41.skip BOOT_STACK_SIZE
     42SYMBOL(bootstack_top)
    3643
    3744.text
  • kernel/arch/amd64/src/boot/multiboot.S

    r6e5252a r156bae23  
    4444//       the image to get very early debug output.
    4545
    46 #define START_STACK  (BOOT_OFFSET - BOOT_STACK_SIZE)
    47 
    4846.section .multiboot, "a"
    4947
     
    9997
    10098        /* Initialize stack pointer */
    101         movl $START_STACK, %esp
     99        movl $bootstack_top, %esp
    102100
    103101        /*
     
    436434         */
    437435
    438         movq $(PA2KA(START_STACK)), %rsp
     436        movq $(PA2KA(bootstack_top)), %rsp
    439437
    440438        /* Create the first stack frame */
  • kernel/arch/ia32/_link.ld.in

    r6e5252a r156bae23  
    4141        } :unmapped
    4242
    43         .mapped (PA2KA(BOOT_OFFSET) + SIZEOF(.unmapped)): AT (BOOT_OFFSET + SIZEOF(.unmapped)) {
     43        .unmapped_bss : {
     44                *(.bootstack);
     45        } :unmapped
     46
     47        .mapped (PA2KA(BOOT_OFFSET) + SIZEOF(.unmapped) + SIZEOF(.unmapped_bss)): AT (BOOT_OFFSET + SIZEOF(.unmapped) + SIZEOF(.unmapped_bss)) {
    4448                ktext_start = .;
    4549                *(.text .text.*);
  • kernel/arch/ia32/src/asm.S

    r6e5252a r156bae23  
    3737#include <arch/istate_struct.h>
    3838#include <arch/smp/apic.h>
     39#include <arch/boot/boot.h>
     40
     41.section .bootstack, "a", @nobits
     42.align 16
     43SYMBOL(bootstack_bottom)
     44.skip BOOT_STACK_SIZE
     45SYMBOL(bootstack_top)
    3946
    4047.text
  • kernel/arch/ia32/src/boot/multiboot.S

    r6e5252a r156bae23  
    4444//       the image to get very early debug output.
    4545
    46 #define START_STACK  (BOOT_OFFSET - BOOT_STACK_SIZE)
    47 
    4846.section .multiboot, "a"
    4947
     
    9391
    9492        /* Initialize stack pointer */
    95         movl $START_STACK, %esp
     93        movl $bootstack_top, %esp
    9694
    9795        /*
     
    147145
    148146        stack_init:
     147        movl $PA2KA(bootstack_top), %esp
    149148
    150149        /* Create the first stack frame */
     
    300299        movl %edi, kernel_end
    301300        ret
     301
     302// TODO: remove this cruft
    302303
    303304/** Find free 2M (+4k for alignment) region where to store page tables */
Note: See TracChangeset for help on using the changeset viewer.