diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-06-15 21:42:55 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-06-15 21:42:55 +0200 |
commit | 7a2e9a06e2d57b738361419d131ed9ace9333c24 (patch) | |
tree | 3377b4794ecb4b70817b98a6a5348f5ad6b9c6c2 /src | |
parent | ab7e3f0739d11c4294cf331a07328d6d5aeb5a68 (diff) | |
download | abaos-7a2e9a06e2d57b738361419d131ed9ace9333c24.tar.gz abaos-7a2e9a06e2d57b738361419d131ed9ace9333c24.tar.bz2 |
added a clear screen method to graphics mode VGA driver
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/video/vga.c | 7 | ||||
-rw-r--r-- | src/drivers/video/vga.h | 1 | ||||
-rw-r--r-- | src/kernel/kernel.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/drivers/video/vga.c b/src/drivers/video/vga.c index 83b3578..c385bea 100644 --- a/src/drivers/video/vga.c +++ b/src/drivers/video/vga.c @@ -262,7 +262,10 @@ void vga_draw_rectangle( vga_t *vga, const int x, const int y, const int w, cons vga_set_pixel( vga, xx, yy, color ); } } -// memset( vga->mode.segment, get_color_index( color ), -// vga->mode.x * vga->mode.y ); } +void vga_clear_screen( vga_t *vga, const vga_color_t color ) +{ + memset( vga->mode.segment, get_color_index( color ), + vga->mode.x * vga->mode.y ); +} diff --git a/src/drivers/video/vga.h b/src/drivers/video/vga.h index 6f70afa..69b4591 100644 --- a/src/drivers/video/vga.h +++ b/src/drivers/video/vga.h @@ -62,5 +62,6 @@ vga_color_t vga_make_RGB( int R, int G, int B ); void vga_set_pixel( vga_t *vga, const int x, const int y, const vga_color_t color ); void vga_draw_rectangle( vga_t *vga, const int x, const int y, const int w, const int h, const vga_color_t color ); +void vga_clear_screen( vga_t *vga, const vga_color_t color ); #endif // VGA_H diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 9557745..6f94fb9 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -42,6 +42,7 @@ void kernel_main( void ) vga_text_init( &vga_text ); vga_text_set_color( &vga_text, VGA_TEXT_COLOR_LIGHT_GREY ); vga_text_set_background_color( &vga_text, VGA_TEXT_COLOR_BLACK ); + vga_text_clear_screen( &vga_text ); console_t console; console_init( &console ); @@ -106,8 +107,7 @@ void kernel_main( void ) driver_manager_activate_all( &driver_manager ); if( vga_set_mode( &vga, vga_make_mode( 320, 200, 8 ) ) ) { -// vga_set_pixel( &vga, 1, 1, vga_make_RGB( 0x00, 0x00, 0xA8 ) ); - vga_draw_rectangle( &vga, 0, 0, 320, 200, vga_make_RGB( 0x00, 0x00, 0xA8 ) ); + vga_clear_screen( &vga, vga_make_RGB( 0x00, 0x00, 0xA8 ) ); } // TODO: later, disable VGA text console in stdio and add the |