From a433f6525ba567d7ca0b4661c645cd804d55f456 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 6 Aug 2021 23:38:12 +0200 Subject: [PATCH 1/4] Cleanup --- src/bootloader.asm | 4 ---- src/pm/vga/print.asm | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/bootloader.asm b/src/bootloader.asm index 9815979..bcf841c 100644 --- a/src/bootloader.asm +++ b/src/bootloader.asm @@ -27,7 +27,3 @@ BOOT_DRIVE: db 0 ; Bootsector times 510-($-$$) db 0 dw 0xaa55 ; magic BIOS numbers - -; After bootsector -times 256 dw 0xEEEE -times 256 dw 0xAAAA diff --git a/src/pm/vga/print.asm b/src/pm/vga/print.asm index 4b8aac6..b183017 100644 --- a/src/pm/vga/print.asm +++ b/src/pm/vga/print.asm @@ -1,7 +1,7 @@ [bits 32] ; VGA base address: 0xb8000 -; Charpos = 0xb8000 + 2 * (row * 80 + col) +; Charpos = 0xb8000 + 2(row*80 + col) vga_print: pusha From 228c11149f781f495e5e1bb3f9528917d8d81eef Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Sun, 8 Aug 2021 19:11:56 +0200 Subject: [PATCH 2/4] Color test --- src/pm/vga/print.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pm/vga/print.asm b/src/pm/vga/print.asm index b183017..c440944 100644 --- a/src/pm/vga/print.asm +++ b/src/pm/vga/print.asm @@ -9,7 +9,7 @@ vga_print: vga_print_loop: mov al, [ebx] - mov ah, 0x0f + mov ah, 0x8f cmp al, ASCII_END je vga_print_return From a62189176e976c131fb73d787ed137967ca4f1a9 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Sun, 8 Aug 2021 19:16:56 +0200 Subject: [PATCH 3/4] Comments --- src/pm/vga/print.asm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pm/vga/print.asm b/src/pm/vga/print.asm index c440944..3aa23e5 100644 --- a/src/pm/vga/print.asm +++ b/src/pm/vga/print.asm @@ -8,17 +8,17 @@ vga_print: mov edx, VIDEO_MEM vga_print_loop: - mov al, [ebx] - mov ah, 0x8f + mov al, [ebx] ; Pointer to char + mov ah, 0x8f ; Color code - cmp al, ASCII_END - je vga_print_return + cmp al, ASCII_END ; Check if end of string + je vga_print_return ; If end then return - mov [edx], ax - inc ebx + mov [edx], ax ; Move charpos + inc ebx ; Increment to next add edx, 2 - jmp vga_print_loop + jmp vga_print_loop ; Loop back until end of string vga_print_return: popa From 397c272175811a810b78534db9215222115ec6f1 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Sun, 8 Aug 2021 19:23:45 +0200 Subject: [PATCH 4/4] Color buffer --- src/pm/vga/print.asm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pm/vga/print.asm b/src/pm/vga/print.asm index 3aa23e5..6d1031e 100644 --- a/src/pm/vga/print.asm +++ b/src/pm/vga/print.asm @@ -3,13 +3,15 @@ ; VGA base address: 0xb8000 ; Charpos = 0xb8000 + 2(row*80 + col) +vga_color_buf: db 0x0f ; Buffer to be changed so that we can choose colors! + vga_print: pusha mov edx, VIDEO_MEM vga_print_loop: mov al, [ebx] ; Pointer to char - mov ah, 0x8f ; Color code + mov ah, [vga_color_buf] ; Color code cmp al, ASCII_END ; Check if end of string je vga_print_return ; If end then return