Skip to content

Commit 8785c91

Browse files
committed
Mapping vga regions
1 parent 5783d11 commit 8785c91

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/video_mode/vga_320x200.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ vga_map_frame_buffer_loop:
1919
mov [_p1 + ecx * 8], eax
2020

2121
add eax, 4096
22-
cmp eax, 0xa0000 + 320 * 200
22+
cmp eax, 0xbffff
2323
jl vga_map_frame_buffer_loop
2424

2525
ret

src/video_mode/vga_text_80x25.s

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ config_video_mode:
1111
.code32
1212

1313
vga_map_frame_buffer:
14-
mov eax, 0xb8000
14+
mov eax, 0xa0000
1515
or eax, (1 | 2)
16-
mov ecx, 0xb8000
16+
vga_map_frame_buffer_loop:
17+
mov ecx, eax
1718
shr ecx, 12
1819
mov [_p1 + ecx * 8], eax
20+
21+
add eax, 4096
22+
cmp eax, 0xbffff
23+
jl vga_map_frame_buffer_loop
24+
1925
ret
2026

2127
# print a string and a newline

0 commit comments

Comments
 (0)