feat(kernel): print klog to screen

This commit is contained in:
d0p1 🏳️‍⚧️ 2024-07-15 08:32:59 +02:00
parent f47382bd56
commit 6027655f3c
3 changed files with 16 additions and 4 deletions

View file

@ -75,7 +75,11 @@ cga_putc:
call cga_getpos call cga_getpos
mov [ebp-0x2], ax mov [ebp-0x2], ax
pop eax pop eax
cmp al, CR
jne @f
leave
ret
@@:
cmp al, LF cmp al, LF
jne @f jne @f
mov ax, [ebp-0x2] mov ax, [ebp-0x2]

View file

@ -67,8 +67,8 @@ kmain:
mov eax, SYSCALL_EXIT mov eax, SYSCALL_EXIT
int 0x42 int 0x42
mov al, 'X' ;mov al, 'X'
call cga_putc ;call cga_putc
call floppy_probe call floppy_probe

View file

@ -34,7 +34,9 @@ klog_print:
or al, al or al, al
jz @f jz @f
out dx, al out dx, al
;call klog_kput pusha
call cga_putc
popa
jmp @b jmp @b
@@: @@:
ret ret
@ -125,6 +127,9 @@ klog_print_hex:
.print_zero: .print_zero:
mov al, '0' mov al, '0'
out dx, al out dx, al
pusha
call cga_putc
popa
jmp .end jmp .end
.print_number: .print_number:
mov [esi], byte 0 mov [esi], byte 0
@ -170,6 +175,9 @@ klog:
mov al, '?' mov al, '?'
.putchar: .putchar:
out dx, al out dx, al
pusha
call cga_putc
popa
.next: .next:
inc esi inc esi
jmp .loop jmp .loop