summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordzwdz2021-07-10 18:12:46 +0200
committerdzwdz2021-07-10 18:12:46 +0200
commit49a9de571ad0c604cb569d46d514f25bdc45d8ca (patch)
tree91d0de09529a6d286877451f4909116edd552ba1
parent1bf5e324005ce7122a195af106cec656960648dc (diff)
allocate the initial stack directly in linker.ld
IMO it's cleaner this way. I wanted to put it just under 1M, but it turns out that it isn't accessible at boot in QEMU.
-rw-r--r--linker.ld4
-rw-r--r--src/arch/i386/boot.s10
2 files changed, 4 insertions, 10 deletions
diff --git a/linker.ld b/linker.ld
index be2b44f..92db365 100644
--- a/linker.ld
+++ b/linker.ld
@@ -20,6 +20,10 @@ SECTIONS
{
*(COMMON)
*(.bss)
+
+ stack_bottom = .;
+ . += 16K;
+ stack_top = .;
}
_kernel_end = (. + 0xFFF) & ~0xFFF; /* aligned to 4K */
}
diff --git a/src/arch/i386/boot.s b/src/arch/i386/boot.s
index 74ec312..2578e87 100644
--- a/src/arch/i386/boot.s
+++ b/src/arch/i386/boot.s
@@ -1,13 +1,3 @@
-/* a lil stack TODO move to linker.ld */
-.section .bss
-.global stack_top
-.type stack_top, @object
-.align 16
-stack_bottom:
-.skip 16384
-stack_top:
-
-
.section .text
.global _start
.type _start, @function