Created clear_screen

pull/23/head
E. Almqvist 3 years ago
parent ba5590850e
commit 566516ca3c
  1. 6
      src/kernel/kernel.c
  2. 7
      src/kernel/lib/vga.c

@ -4,7 +4,7 @@ void main() {
// Do kernel stuff // Do kernel stuff
char* vidmem = (char*)0xb8000; char* vidmem = (char*)0xb8000;
*vidmem = 'X'; *vidmem = 'X';
for( int i = 0; i < 16; i++ ) {
println("C-Printing test!", 16); clear_screen();
} println("Kernel loaded.", 14);
} }

@ -9,6 +9,7 @@
// Memory // Memory
#define VIDEO_MEM (char*)0xb8000 #define VIDEO_MEM (char*)0xb8000
#define VIDEO_MEM_MAX (char*)0xb8fa0
// Global // Global
static int cursor_row = 0; static int cursor_row = 0;
@ -27,8 +28,10 @@ void putc(char c, unsigned int col, unsigned int row) {
/* /*
Graphics Functions Graphics Functions
*/ */
void clear_screen(unsigned int width = 640, unsigned int height = 480) { void clear_screen() {
for( char* c = VIDEO_MEM; c <= VIDEO_MEM_MAX; c += 2 ) {
*c = 0x20;
}
} }

Loading…
Cancel
Save