did some restructuring, got multitasking almost working
This commit is contained in:
@@ -26,10 +26,10 @@ enum vga_color {
|
||||
VGA_COLOR_WHITE = 15,
|
||||
};
|
||||
|
||||
size_t terminal_row;
|
||||
size_t terminal_column;
|
||||
uint8_t terminal_color;
|
||||
uint16_t* terminal_buffer = (uint16_t*)VGA_MEMORY;
|
||||
static size_t terminal_row;
|
||||
static size_t terminal_column;
|
||||
static uint8_t terminal_color;
|
||||
static uint16_t* terminal_buffer = (uint16_t*)VGA_MEMORY;
|
||||
|
||||
static inline uint8_t vga_entry_color(enum vga_color fg, enum vga_color bg)
|
||||
{
|
||||
@@ -41,8 +41,7 @@ static inline uint16_t vga_entry(unsigned char uc, uint8_t color)
|
||||
return (uint16_t) uc | (uint16_t) color << 8;
|
||||
}
|
||||
|
||||
void vga_initialize()
|
||||
{
|
||||
void vga_init() {
|
||||
terminal_row = 0;
|
||||
terminal_column = 0;
|
||||
terminal_color = vga_entry_color(VGA_COLOR_LIGHT_GREY, VGA_COLOR_BLACK);
|
||||
@@ -55,8 +54,7 @@ void vga_initialize()
|
||||
}
|
||||
}
|
||||
|
||||
void vga_putchar(char c)
|
||||
{
|
||||
void vga_putchar(char c) {
|
||||
if (c == '\n') {
|
||||
terminal_row++;
|
||||
terminal_column = 0;
|
||||
@@ -77,9 +75,4 @@ void vga_putchar(char c)
|
||||
if (++terminal_row == VGA_HEIGHT)
|
||||
terminal_row = 0;
|
||||
}
|
||||
}
|
||||
|
||||
print_stream_t vga_print_stream = {
|
||||
.putchar = vga_putchar,
|
||||
.trunc = vga_initialize,
|
||||
};
|
||||
}
|
||||
7
kernel/drivers/vga/vga.h
Normal file
7
kernel/drivers/vga/vga.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef DVGA_H
|
||||
#define DVGA_H
|
||||
|
||||
void vga_init();
|
||||
void vga_putchar(char c);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user