feat(kernel): hello world
This commit is contained in:
parent
3d30afd5fc
commit
031e09b3ff
|
@ -211,7 +211,8 @@ common32:
|
|||
|
||||
; map 0xB8000 (vga) to 0xC03B0000
|
||||
; 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 eax, boot_page_directory
|
||||
|
@ -221,8 +222,8 @@ common32:
|
|||
or eax, 0x80010000
|
||||
mov cr0, eax
|
||||
|
||||
push boot_structure
|
||||
push STPDBOOT_MAGIC
|
||||
mov eax, STPDBOOT_MAGIC
|
||||
mov ebx, boot_structure
|
||||
|
||||
mov eax, 0xC0000000
|
||||
jmp eax
|
||||
|
|
6
kernel/dev/vga_console.inc
Normal file
6
kernel/dev/vga_console.inc
Normal file
|
@ -0,0 +1,6 @@
|
|||
struc console
|
||||
{
|
||||
.buffer db 80*25 dup (?)
|
||||
.lineno db ?
|
||||
.colno db ?
|
||||
}
|
|
@ -21,13 +21,15 @@ db 32 dup(0)
|
|||
;;
|
||||
kmain:
|
||||
xchg bx, bx
|
||||
mov [0xC03B0000], dword 0x08690948
|
||||
mov [0xC03B0004], dword 0x05690648
|
||||
; TODO: interupt, vmm
|
||||
cmp eax, STPDBOOT_MAGIC
|
||||
jne .halt
|
||||
|
||||
KLOG_INIT
|
||||
;KLOG_INIT
|
||||
|
||||
KLOG "kernel alive"
|
||||
;KLOG "kernel alive"
|
||||
|
||||
.halt:
|
||||
hlt
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
klog_print_date:
|
||||
clc
|
||||
|
||||
ret
|
||||
|
||||
macro KLOG_INIT {
|
||||
}
|
||||
|
||||
macro KLOG msg {
|
||||
out 0xe9, al
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue