From 8785c912e458cfdc1a626881d3a9ab5fc278c753 Mon Sep 17 00:00:00 2001 From: Ryan Kennedy Date: Fri, 13 Mar 2020 11:45:04 -0500 Subject: [PATCH 1/2] Mapping vga regions --- src/video_mode/vga_320x200.s | 2 +- src/video_mode/vga_text_80x25.s | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/video_mode/vga_320x200.s b/src/video_mode/vga_320x200.s index e052defb..1a8a1a96 100644 --- a/src/video_mode/vga_320x200.s +++ b/src/video_mode/vga_320x200.s @@ -19,7 +19,7 @@ vga_map_frame_buffer_loop: mov [_p1 + ecx * 8], eax add eax, 4096 - cmp eax, 0xa0000 + 320 * 200 + cmp eax, 0xbffff jl vga_map_frame_buffer_loop ret diff --git a/src/video_mode/vga_text_80x25.s b/src/video_mode/vga_text_80x25.s index 07208768..c357f12f 100644 --- a/src/video_mode/vga_text_80x25.s +++ b/src/video_mode/vga_text_80x25.s @@ -11,11 +11,17 @@ config_video_mode: .code32 vga_map_frame_buffer: - mov eax, 0xb8000 + mov eax, 0xa0000 or eax, (1 | 2) - mov ecx, 0xb8000 +vga_map_frame_buffer_loop: + mov ecx, eax shr ecx, 12 mov [_p1 + ecx * 8], eax + + add eax, 4096 + cmp eax, 0xbffff + jl vga_map_frame_buffer_loop + ret # print a string and a newline From 1eaedc117a5ffe39179bc51d8f9c5d52d109e548 Mon Sep 17 00:00:00 2001 From: RKennedy9064 Date: Sat, 14 Mar 2020 11:37:05 -0500 Subject: [PATCH 2/2] Apply suggestions from code review Co-Authored-By: Philipp Oppermann --- src/video_mode/vga_320x200.s | 2 +- src/video_mode/vga_text_80x25.s | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_mode/vga_320x200.s b/src/video_mode/vga_320x200.s index 1a8a1a96..17d4a743 100644 --- a/src/video_mode/vga_320x200.s +++ b/src/video_mode/vga_320x200.s @@ -19,7 +19,7 @@ vga_map_frame_buffer_loop: mov [_p1 + ecx * 8], eax add eax, 4096 - cmp eax, 0xbffff + cmp eax, 0xc0000 jl vga_map_frame_buffer_loop ret diff --git a/src/video_mode/vga_text_80x25.s b/src/video_mode/vga_text_80x25.s index c357f12f..0ddb0d6f 100644 --- a/src/video_mode/vga_text_80x25.s +++ b/src/video_mode/vga_text_80x25.s @@ -19,7 +19,7 @@ vga_map_frame_buffer_loop: mov [_p1 + ecx * 8], eax add eax, 4096 - cmp eax, 0xbffff + cmp eax, 0xc0000 jl vga_map_frame_buffer_loop ret