sys: add userspace bootstrap program
This commit is contained in:
18
sys/bootstrap/arch/x86_64/layout.ld
Normal file
18
sys/bootstrap/arch/x86_64/layout.ld
Normal file
@@ -0,0 +1,18 @@
|
||||
ENTRY(_start)
|
||||
|
||||
SECTIONS {
|
||||
.text ALIGN(4K) : {
|
||||
*(.text)
|
||||
*(.rodata)
|
||||
}
|
||||
|
||||
.data ALIGN(4K) : {
|
||||
*(.data)
|
||||
*(.bss)
|
||||
}
|
||||
|
||||
/DISCARD/ : {
|
||||
*(.interp)
|
||||
*(.dynamic)
|
||||
}
|
||||
}
|
||||
15
sys/bootstrap/arch/x86_64/start.S
Normal file
15
sys/bootstrap/arch/x86_64/start.S
Normal file
@@ -0,0 +1,15 @@
|
||||
.code64
|
||||
|
||||
.global _start
|
||||
.type _start, @function
|
||||
|
||||
.extern main
|
||||
.type main, @function
|
||||
|
||||
.extern exit
|
||||
.type exit, @function
|
||||
|
||||
_start:
|
||||
call main
|
||||
1: pause
|
||||
jmp 1b
|
||||
Reference in New Issue
Block a user