adding kernel crti/crtn but ctors/dtors not called yet
This commit is contained in:
42
modules.yaml
42
modules.yaml
@@ -40,6 +40,27 @@ kernel:
|
|||||||
- src/kernel/syscall.s
|
- src/kernel/syscall.s
|
||||||
- src/kernel/crtn.s
|
- src/kernel/crtn.s
|
||||||
|
|
||||||
|
boot:
|
||||||
|
kind: exe
|
||||||
|
target: boot
|
||||||
|
output: boot.elf
|
||||||
|
source:
|
||||||
|
- src/boot/crt0.s
|
||||||
|
- src/boot/console.cpp
|
||||||
|
- src/boot/guids.cpp
|
||||||
|
- src/boot/loader.cpp
|
||||||
|
- src/boot/main.cpp
|
||||||
|
- src/boot/memory.cpp
|
||||||
|
- src/boot/reloc.cpp
|
||||||
|
- src/boot/utility.cpp
|
||||||
|
|
||||||
|
nulldrv:
|
||||||
|
kind: exe
|
||||||
|
target: host
|
||||||
|
output: nulldrv
|
||||||
|
source:
|
||||||
|
- src/drivers/nulldrv/main.s
|
||||||
|
|
||||||
elf:
|
elf:
|
||||||
kind: lib
|
kind: lib
|
||||||
output: libelf.a
|
output: libelf.a
|
||||||
@@ -90,24 +111,3 @@ tests:
|
|||||||
- src/tests/linked_list.cpp
|
- src/tests/linked_list.cpp
|
||||||
- src/tests/main.cpp
|
- src/tests/main.cpp
|
||||||
- src/tests/memory_manager.cpp
|
- src/tests/memory_manager.cpp
|
||||||
|
|
||||||
boot:
|
|
||||||
kind: exe
|
|
||||||
target: boot
|
|
||||||
output: boot.elf
|
|
||||||
source:
|
|
||||||
- src/boot/crt0.s
|
|
||||||
- src/boot/console.cpp
|
|
||||||
- src/boot/guids.cpp
|
|
||||||
- src/boot/loader.cpp
|
|
||||||
- src/boot/main.cpp
|
|
||||||
- src/boot/memory.cpp
|
|
||||||
- src/boot/reloc.cpp
|
|
||||||
- src/boot/utility.cpp
|
|
||||||
|
|
||||||
nulldrv:
|
|
||||||
kind: exe
|
|
||||||
target: host
|
|
||||||
output: nulldrv
|
|
||||||
source:
|
|
||||||
- src/drivers/nulldrv/main.s
|
|
||||||
|
|||||||
14
src/kernel/crti.s
Normal file
14
src/kernel/crti.s
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
section .init
|
||||||
|
global _init:function
|
||||||
|
_init:
|
||||||
|
push rbp
|
||||||
|
mov rbp, rsp
|
||||||
|
; Control flow falls through to other .init sections
|
||||||
|
|
||||||
|
section .fini
|
||||||
|
global _fini:function
|
||||||
|
_fini:
|
||||||
|
push rbp
|
||||||
|
mov rbp, rsp
|
||||||
|
; Control flow falls through to other .fini sections
|
||||||
|
|
||||||
10
src/kernel/crtn.s
Normal file
10
src/kernel/crtn.s
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
section .init
|
||||||
|
; Control flow falls through to here from other .init sections
|
||||||
|
pop rbp
|
||||||
|
ret
|
||||||
|
|
||||||
|
section .fini
|
||||||
|
; Control flow falls through to here from other .fini sections
|
||||||
|
pop rbp
|
||||||
|
ret
|
||||||
|
|
||||||
Reference in New Issue
Block a user