From fe8a45a19edcd6693b47cb7f034d400f0610332f Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 22 Mar 2015 14:35:59 -0700 Subject: Write with attr --- src/kernel/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/kernel') diff --git a/src/kernel/main.c b/src/kernel/main.c index d7965e2..ec18738 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -2,14 +2,15 @@ __asm__(".code16gcc\n"); void vga_graphics_write_at_offset(char, short); void vga_graphics_write(char); +void vga_graphics_write_with_attr(char, char); void vga_graphics_write_str(char*); static short CURSOR_LOC = 0; void _start() { - vga_graphics_write('a'); - vga_graphics_write('/'); - vga_graphics_write('b'); + vga_graphics_write_with_attr('a', 1); + vga_graphics_write_with_attr('/', 2); + vga_graphics_write_with_attr('b', 3); char foo[] = "hello how are you"; vga_graphics_write_str(foo); while(1) { } @@ -21,6 +22,11 @@ void vga_graphics_write_str(char* str) { } } +void vga_graphics_write_with_attr(char value, char attr) { + vga_graphics_write_at_offset(value, CURSOR_LOC++); + vga_graphics_write_at_offset(attr, CURSOR_LOC++); +} + void vga_graphics_write(char value) { vga_graphics_write_at_offset(value, CURSOR_LOC); CURSOR_LOC += 2; -- cgit v1.1