diff --git a/src/font.asm b/src/font.asm new file mode 100644 index 0000000..e97def8 --- /dev/null +++ b/src/font.asm @@ -0,0 +1,38 @@ +;; Thank you Terminus for letting us use this font under SIL licence +kfont: +; controlchars +times 31 db 0x00000000000000000000000000000000 +; space +db 11000000b +db 10000000b +db 00000000b +db 00000000b +db 00000000b +db 00000001b +db 00000001b +db 00000001b +db 00000001b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b +db 00000001b +db 00000011b +; ! +db 00000000b +db 00000000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00011000b +db 00000000b +db 00011000b +db 00011000b +db 00000000b +db 00000000b +db 00000000b +db 00000000b diff --git a/src/framebuffer.asm b/src/framebuffer.asm index 5204798..d25ba38 100644 --- a/src/framebuffer.asm +++ b/src/framebuffer.asm @@ -42,3 +42,60 @@ putpixel: pop ebp ret + +; char, x, y +putchar: + push ebp + mov ebp, esp + push eax + push ebx + push ecx + push edx + + ; skip non printable + mov eax, [ebp+8] ;char + cmp eax, 0x20 + jl .unprintable + cmp eax, 0x7e + jg .unprintable + + mov ecx, 16 + mul ecx + mov esi, [kfont+eax] + + mov ebx, [ebp+12] ;x + mov edx, [ebp+16] ;y + + cld + xor eax, eax +.loop: + lodsb ; load font row to al + mov ah, 0 +.loop2: + shl al + jnc .blankpix + ; draw a pixel + push 0xff + push edx ;x + push ecx ;y +.blankpix: + inc ah + cmp ah, 8 + je .loop + + +.done: + pop edx + pop ecx + pop ebx + pop eax + pop ebp + ret +.unprintable: + push .unprintablemsg + call serialwrite + add esp, 4 + jmp .done +.unprintablemsg: db 10,"Err: Unprintable char not handled!", 0 + +include "src/font.asm" diff --git a/src/start32.asm b/src/start32.asm index f8e5d36..25342cb 100644 --- a/src/start32.asm +++ b/src/start32.asm @@ -133,6 +133,12 @@ rOSkalogodraw: jne .loop .done: +push byte 0x21 +push byte 0x21 +push byte 0x21 +call putchar +add esp, 3*4 + jmp hang hang: