Move stack to .bss and use it for function calls as well

This commit is contained in:
Thomas Lovén 2017-11-11 19:43:14 +01:00
parent dd565454e3
commit eb637d0bbb
2 changed files with 9 additions and 11 deletions

View File

@ -8,8 +8,8 @@ SECTIONS
*(.text) *(.text)
} }
.data : .bss :
{ {
*(.data) *(.bss)
} }
} }

View File

@ -1,12 +1,10 @@
.intel_syntax noprefix .intel_syntax noprefix
.section .data .section .bss
check_cpuid_stack_top: .align 0x1000
.long 0 .skip 0x1000
.long 0 BootStack:
.long 0 .byte 0
check_cpuid_stack:
nop
.section .text .section .text
@ -18,7 +16,6 @@ error:
jmp $ jmp $
check_cpuid: check_cpuid:
mov check_cpuid_stack, esp
pushfd pushfd
pushfd pushfd
xor dword ptr[esp], 1<<21 xor dword ptr[esp], 1<<21
@ -51,8 +48,9 @@ check_longmode:
_start: _start:
cli cli
mov esp, offset BootStack
call check_cpuid call check_cpuid
call check_longmode call check_longmode
jmp $ jmp $