Define and use a few more constants
This commit is contained in:
parent
9f7b7dd810
commit
a56ae53260
|
@ -156,7 +156,7 @@ static void _vga_cursor_set(VGAConsole * console, bool enabled,
|
||||||
/* disable the cursor if necessary */
|
/* disable the cursor if necessary */
|
||||||
if(data->cursor == false)
|
if(data->cursor == false)
|
||||||
return;
|
return;
|
||||||
data->bus->write8(data->bus, 0x3d4, 0x0a);
|
data->bus->write8(data->bus, 0x3d4, VGA_REGISTER_CURSOR_START);
|
||||||
data->bus->read8(data->bus, 0x3d5, &u8);
|
data->bus->read8(data->bus, 0x3d5, &u8);
|
||||||
data->bus->write8(data->bus, 0x3d5, u8 | 0x20);
|
data->bus->write8(data->bus, 0x3d5, u8 | 0x20);
|
||||||
}
|
}
|
||||||
|
@ -165,14 +165,17 @@ static void _vga_cursor_set(VGAConsole * console, bool enabled,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* position the cursor */
|
/* position the cursor */
|
||||||
data->bus->write8(data->bus, 0x3d4, 0x0f);
|
data->bus->write8(data->bus, 0x3d4,
|
||||||
|
VGA_REGISTER_CURSOR_LOCATION_LOW);
|
||||||
data->bus->write8(data->bus, 0x3d5, pos & 0xff);
|
data->bus->write8(data->bus, 0x3d5, pos & 0xff);
|
||||||
data->bus->write8(data->bus, 0x3d4, 0x0e);
|
data->bus->write8(data->bus, 0x3d4,
|
||||||
|
VGA_REGISTER_CURSOR_LOCATION_HIGH);
|
||||||
data->bus->write8(data->bus, 0x3d5, pos >> 8);
|
data->bus->write8(data->bus, 0x3d5, pos >> 8);
|
||||||
/* enable the cursor if necessary */
|
/* enable the cursor if necessary */
|
||||||
if(data->cursor == false)
|
if(data->cursor == false)
|
||||||
{
|
{
|
||||||
data->bus->write8(data->bus, 0x3d4, 0x0a);
|
data->bus->write8(data->bus, 0x3d4,
|
||||||
|
VGA_REGISTER_CURSOR_START);
|
||||||
data->bus->read8(data->bus, 0x3d5, &u8);
|
data->bus->read8(data->bus, 0x3d5, &u8);
|
||||||
data->bus->write8(data->bus, 0x3d5, u8 & ~0x20);
|
data->bus->write8(data->bus, 0x3d5, u8 & ~0x20);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,26 +9,30 @@
|
||||||
|
|
||||||
|
|
||||||
/* constants */
|
/* constants */
|
||||||
# define VGA_ADDRESS_BASE 0xb8000
|
# define VGA_ADDRESS_BASE 0xb8000
|
||||||
|
|
||||||
# define VGA_TEXT_COLUMNS 80
|
# define VGA_REGISTER_CURSOR_LOCATION_HIGH 0x0e
|
||||||
# define VGA_TEXT_ROWS 25
|
# define VGA_REGISTER_CURSOR_LOCATION_LOW 0x0f
|
||||||
|
# define VGA_REGISTER_CURSOR_START 0x0a
|
||||||
|
|
||||||
# define VGA_TEXT_COLOR_BLACK 0x00
|
# define VGA_TEXT_COLUMNS 80
|
||||||
# define VGA_TEXT_COLOR_BLUE 0x01
|
# define VGA_TEXT_ROWS 25
|
||||||
# define VGA_TEXT_COLOR_GREEN 0x02
|
|
||||||
# define VGA_TEXT_COLOR_CYAN 0x03
|
# define VGA_TEXT_COLOR_BLACK 0x00
|
||||||
# define VGA_TEXT_COLOR_RED 0x04
|
# define VGA_TEXT_COLOR_BLUE 0x01
|
||||||
# define VGA_TEXT_COLOR_MAGENTA 0x05
|
# define VGA_TEXT_COLOR_GREEN 0x02
|
||||||
# define VGA_TEXT_COLOR_BROWN 0x06
|
# define VGA_TEXT_COLOR_CYAN 0x03
|
||||||
# define VGA_TEXT_COLOR_LIGHT_GREY 0x07
|
# define VGA_TEXT_COLOR_RED 0x04
|
||||||
# define VGA_TEXT_COLOR_DARK_GREY 0x08
|
# define VGA_TEXT_COLOR_MAGENTA 0x05
|
||||||
# define VGA_TEXT_COLOR_LIGHT_BLUE 0x09
|
# define VGA_TEXT_COLOR_BROWN 0x06
|
||||||
# define VGA_TEXT_COLOR_LIGHT_GREEN 0x0a
|
# define VGA_TEXT_COLOR_LIGHT_GREY 0x07
|
||||||
# define VGA_TEXT_COLOR_LIGHT_CYAN 0x0b
|
# define VGA_TEXT_COLOR_DARK_GREY 0x08
|
||||||
# define VGA_TEXT_COLOR_LIGHT_RED 0x0c
|
# define VGA_TEXT_COLOR_LIGHT_BLUE 0x09
|
||||||
# define VGA_TEXT_COLOR_LIGHT_MAGENTA 0x0d
|
# define VGA_TEXT_COLOR_LIGHT_GREEN 0x0a
|
||||||
# define VGA_TEXT_COLOR_LIGHT_BROWN 0x0e
|
# define VGA_TEXT_COLOR_LIGHT_CYAN 0x0b
|
||||||
# define VGA_TEXT_COLOR_WHITE 0x0f
|
# define VGA_TEXT_COLOR_LIGHT_RED 0x0c
|
||||||
|
# define VGA_TEXT_COLOR_LIGHT_MAGENTA 0x0d
|
||||||
|
# define VGA_TEXT_COLOR_LIGHT_BROWN 0x0e
|
||||||
|
# define VGA_TEXT_COLOR_WHITE 0x0f
|
||||||
|
|
||||||
#endif /* !UKERNEL_DRIVERS_CONSOLE_VGA_H */
|
#endif /* !UKERNEL_DRIVERS_CONSOLE_VGA_H */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user