feat(kernel): hello world

This commit is contained in:
d0p1 🏳️‍⚧️ 2024-07-05 11:10:26 +02:00
parent 3d30afd5fc
commit 031e09b3ff
4 changed files with 20 additions and 5 deletions

View file

@ -211,7 +211,8 @@ common32:
; map 0xB8000 (vga) to 0xC03B0000 ; map 0xB8000 (vga) to 0xC03B0000
; 0xC03B0000 >> 12 & 0x3FF == 944 ; 0xC03B0000 >> 12 & 0x3FF == 944
mov dword [boot_768_page_table + 944 * 16], 0xB8000 + 0x3 mov dword [boot_768_page_table + 944 * 4], 0xB8000 + 0x3
mov dword [boot_page_directory + (768 * 4)], boot_768_page_table + 0x3 mov dword [boot_page_directory + (768 * 4)], boot_768_page_table + 0x3
mov eax, boot_page_directory mov eax, boot_page_directory
@ -221,8 +222,8 @@ common32:
or eax, 0x80010000 or eax, 0x80010000
mov cr0, eax mov cr0, eax
push boot_structure mov eax, STPDBOOT_MAGIC
push STPDBOOT_MAGIC mov ebx, boot_structure
mov eax, 0xC0000000 mov eax, 0xC0000000
jmp eax jmp eax

View file

@ -0,0 +1,6 @@
struc console
{
.buffer db 80*25 dup (?)
.lineno db ?
.colno db ?
}

View file

@ -21,13 +21,15 @@ db 32 dup(0)
;; ;;
kmain: kmain:
xchg bx, bx xchg bx, bx
mov [0xC03B0000], dword 0x08690948
mov [0xC03B0004], dword 0x05690648
; TODO: interupt, vmm ; TODO: interupt, vmm
cmp eax, STPDBOOT_MAGIC cmp eax, STPDBOOT_MAGIC
jne .halt jne .halt
KLOG_INIT ;KLOG_INIT
KLOG "kernel alive" ;KLOG "kernel alive"
.halt: .halt:
hlt hlt

View file

@ -1,5 +1,11 @@
klog_print_date:
clc
ret
macro KLOG_INIT { macro KLOG_INIT {
} }
macro KLOG msg { macro KLOG msg {
out 0xe9, al
} }