Give kernel image a header.
Kernel image now has a header with version, magic number, and a pointer to its actual entrypoint. Entry point is now _start in boot.s, and we now generate versions.s in the build tree for the version macros.
This commit is contained in:
26
src/modules/main/boot.s
Normal file
26
src/modules/main/boot.s
Normal file
@@ -0,0 +1,26 @@
|
||||
MAGIC equ 0x600db007 ; Popcorn OS header magic number
|
||||
|
||||
section .header
|
||||
align 4
|
||||
global _header
|
||||
_header:
|
||||
dd MAGIC
|
||||
db VERSION_MAJOR
|
||||
db VERSION_MINOR
|
||||
dw VERSION_PATCH
|
||||
dd VERSION_GITSHA
|
||||
dq _start
|
||||
|
||||
section .text
|
||||
align 16
|
||||
global _start:function (_start.end - _start)
|
||||
_start:
|
||||
extern kernel_main
|
||||
call kernel_main
|
||||
|
||||
cli
|
||||
|
||||
.hang:
|
||||
hlt
|
||||
jmp .hang
|
||||
.end:
|
||||
Reference in New Issue
Block a user