Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct __attribute__((packed)) VideoChar { char c; char color; };
- char* video = (char*) 0xb8000;
- int x = 0;
- int y = 0;
- void clearScreen(void)
- {
- for(int i = 0; i <= 2000; i++)
- {
- video[i * 2] = ' ';
- video[i * 2 + 1] = 0x00;
- }
- }
- void puts(const char * string)
- {
- for (int i = 0; string[i] != 0; i++)
- {
- VideoChar vchar;
- vchar.c = string[i];
- vchar.color = 0x0f;
- video[x + 80 * y] = vchar;
- x++;
- }
- }
- void putc(char c)
- {
- VideoChar vchar;
- vchar.c = string[i];
- vchar.color = 0x0f;
- video[x + 80 * y] = c;
- x++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement