Move stack to .bss and use it for function calls as well
This commit is contained in:
parent
dd565454e3
commit
eb637d0bbb
@ -8,8 +8,8 @@ SECTIONS
|
|||||||
*(.text)
|
*(.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
.data :
|
.bss :
|
||||||
{
|
{
|
||||||
*(.data)
|
*(.bss)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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 $
|
||||||
|
Loading…
x
Reference in New Issue
Block a user