2019-07-03 12:15:40 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; iceOS Kernel ;
|
|
|
|
; Developed by Marco 'icebit' Cetica ;
|
|
|
|
; (c) 2019 ;
|
|
|
|
; Released under GPLv3 ;
|
|
|
|
; https://github.com/ice-bit/iceOS ;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2019-07-03 21:04:05 +02:00
|
|
|
global kernel_loader
|
2019-07-03 18:12:57 +02:00
|
|
|
extern kernel_main
|
2019-07-03 12:15:40 +02:00
|
|
|
|
|
|
|
section .text
|
|
|
|
kernel_loader:
|
|
|
|
mov esp, kernel_stack + KERNEL_STACK_SZ ; Stack pointer
|
|
|
|
push ebx
|
2019-07-03 18:12:57 +02:00
|
|
|
call kernel_main ; jump to kernel's main function
|
2019-07-03 12:15:40 +02:00
|
|
|
.loop:
|
|
|
|
jmp .loop ; endless loop
|
|
|
|
|
|
|
|
KERNEL_STACK_SZ equ 4096 ; 4 KB for the stack
|
|
|
|
|
|
|
|
section .bss
|
|
|
|
align 4
|
|
|
|
kernel_stack:
|
2019-07-03 21:04:05 +02:00
|
|
|
resb KERNEL_STACK_SZ ; Reserver 4 KB
|
|
|
|
|
|
|
|
|
|
|
|
|