Skip to content

Commit

Permalink
Remove stack start (/size) from LD script
Browse files Browse the repository at this point in the history
  • Loading branch information
djphoenix committed May 4, 2019
1 parent 2991f0d commit 2fd8674
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion ld/system.ld
Expand Up @@ -5,7 +5,6 @@
OUTPUT_FORMAT(elf64-x86-64)
ENTRY(_efi_start)

PROVIDE(__stack_start__ = 0x1000);
PROVIDE(__stack_end__ = 0x2000);
PROVIDE(__first_page__ = 0x2000);
PROVIDE(__pagetable__ = 0x20000);
Expand Down
4 changes: 3 additions & 1 deletion src/platform/pagetable.cpp
Expand Up @@ -85,9 +85,11 @@ void Pagetable::init() {
const EFI_SYSTEM_TABLE *ST = EFI::getSystemTable();
MULTIBOOT_PAYLOAD *multiboot = Multiboot::getPayload();

static const size_t stack_size = 0x1000;

asm volatile("mov %%cr3, %q0":"=r"(pagetable));
asm volatile("lea __stack_start__(%%rip), %q0":"=r"(stack_start));
asm volatile("lea __stack_end__(%%rip), %q0":"=r"(stack_top));
stack_start = stack_top - stack_size;
asm volatile("lea __text_start__(%%rip), %q0":"=r"(text_start));
asm volatile("lea __data_end__(%%rip), %q0":"=r"(data_top));
asm volatile("lea __modules_start__(%%rip), %q0":"=r"(modules_start));
Expand Down

0 comments on commit 2fd8674

Please sign in to comment.