From 14b109ea24dc5cb1db948de57a2a44c80ef4622e Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Wed, 24 Mar 2021 15:36:54 -0500 Subject: modified: README.md modified: compiler/create_crosscompiler.sh deleted: notes modified: src/.gdb_history deleted: src/amd64_vol2.pdf modified: src/bootloader/bios_functions/bios_disk.asm modified: src/bootloader/bios_functions/print.asm modified: src/bootloader/bootloader.asm modified: src/bootloader/cpu_check.asm modified: src/bootloader/enter_kernel.asm deleted: src/bootloader/enter_kernel_backup modified: src/bootloader/gdt.asm deleted: src/bootloader/multicore.asm deleted: src/bootloader/notes new file: src/debug/gdbinit.gdb deleted: src/indigo_os modified: src/kernel/include/libc.h modified: src/kernel/include/paging.h modified: src/kernel/include/video.h modified: src/kernel/kernel.c modified: src/kernel/libs/acpi.c modified: src/kernel/libs/drivers/serial.c modified: src/kernel/libs/drivers/video.c modified: src/kernel/libs/libc.c modified: src/kernel/libs/page.c modified: src/link.ld modified: src/makefile new file: tools/README.md modified: tools/page/page.py --- src/bootloader/bios_functions/print.asm | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src/bootloader/bios_functions/print.asm') diff --git a/src/bootloader/bios_functions/print.asm b/src/bootloader/bios_functions/print.asm index d071cd9..303fa8f 100644 --- a/src/bootloader/bios_functions/print.asm +++ b/src/bootloader/bios_functions/print.asm @@ -1,25 +1,24 @@ -;TODO fix null problem, allow direct passes +;TODO fix null problem, allow passing value insted of pointer bios_print: -;push ax ; we need to use ax, so let's push it in case whoever called needs it pusha -mov ah, 0x0e ; tells bios we're in tty mode +mov ah, 0x0e .print_loop: -mov al, [bx] ; al is the char MEANT TO BE CX -cmp al, 0 ; compare the char we're about to print with null -je .fini ; if it is null, we gonna scoot the fuck outta here +mov al, [bx] +cmp al, 0 +je .fini test cx, cx ; if cx is zero, ascii, otherwise hex string jne .print_hex -int 0x10 ; bios call, actually prints the char +int 0x10 .print_hex_ret: -inc bx ; adds to the pointer -jmp .print_loop ; goes back to loop start +inc bx +jmp .print_loop .fini: -mov al, 0xd ; \r +mov al, 0xd int 0x10 -mov al, 0xa ; \n +mov al, 0xa int 0x10 popa ret @@ -32,7 +31,7 @@ int 0x10 mov al, 'x' int 0x10 -mov al, [bx] ; shift bits to get first nibble +mov al, [bx] shr al, 4 call .bios_print_nibble @@ -47,13 +46,13 @@ jmp .print_hex_ret .bios_print_nibble: -cmp al, 9 ; see if letter worthy +cmp al, 9 ja .print_hex_letter -add al, 0x30 ;'1' +add al, 0x30 int 0x10 ret .print_hex_letter: -add al, 0x57 ;'a' +add al, 0x57 int 0x10 ret -- cgit v1.2.3