diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 24a4acd9..28e9451a 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -21,6 +21,7 @@ add_executable(moon ${SOURCES}) if("${ARCH}" MATCHES "x86_64") set(ASM_SOURCES src/arch/x86_64/CPU.asm + src/arch/x86_64/Entry.asm ) add_library(moon-asm STATIC ${ASM_SOURCES}) target_link_libraries(moon moon-asm) diff --git a/kernel/moon.ld b/kernel/moon.ld index 5b99a57b..c3b72198 100644 --- a/kernel/moon.ld +++ b/kernel/moon.ld @@ -1,4 +1,4 @@ -ENTRY(_start) +ENTRY(_main) OUTPUT_FORMAT(elf64-x86-64) mmio = 0xfffffffff8000000; /* these are configurable for level 2 loaders */ diff --git a/kernel/src/arch/x86_64/Entry.asm b/kernel/src/arch/x86_64/Entry.asm new file mode 100644 index 00000000..92eee7f3 --- /dev/null +++ b/kernel/src/arch/x86_64/Entry.asm @@ -0,0 +1,6 @@ +global _main +extern _start + +_main: + xor rbp, rbp + call _start \ No newline at end of file