vga_textmode: Replace BIOS calls to enable and disable hardware cursor with direct VGA port IO
This commit is contained in:
parent
19ecfe9c1e
commit
385af687b3
@ -173,22 +173,22 @@ void init_vga_textmode(size_t *_rows, size_t *_cols, bool managed) {
|
||||
*_rows = VD_ROWS;
|
||||
*_cols = VD_COLS / 2;
|
||||
|
||||
struct rm_regs r;
|
||||
// VGA cursor code taken from: https://wiki.osdev.org/Text_Mode_Cursor
|
||||
|
||||
if (!managed) {
|
||||
text_disable_cursor();
|
||||
r = (struct rm_regs){0};
|
||||
r.eax = 0x0200;
|
||||
rm_int(0x10, &r, &r);
|
||||
r = (struct rm_regs){0};
|
||||
r.eax = 0x0100;
|
||||
r.ecx = 0x0607;
|
||||
rm_int(0x10, &r, &r);
|
||||
|
||||
outb(0x3d4, 0x0a);
|
||||
outb(0x3d5, (inb(0x3d5) & 0xc0) | 14);
|
||||
outb(0x3d4, 0x0b);
|
||||
outb(0x3d5, (inb(0x3d5) & 0xe0) | 15);
|
||||
outb(0x3d4, 0x0f);
|
||||
outb(0x3d5, 0);
|
||||
outb(0x3d4, 0x0e);
|
||||
outb(0x3d5, 0);
|
||||
} else {
|
||||
r = (struct rm_regs){0};
|
||||
r.eax = 0x0100;
|
||||
r.ecx = 0x2706;
|
||||
rm_int(0x10, &r, &r);
|
||||
outb(0x3d4, 0x0a);
|
||||
outb(0x3d5, 0x20);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ static const char CONVERSION_TABLE[] = "0123456789abcdef";
|
||||
void e9_putc(char c) {
|
||||
if (stivale2_print != NULL)
|
||||
stivale2_print(&c, 1);
|
||||
asm volatile ("outb %0, %1" :: "a" (c), "Nd" (0xe9) : "memory");
|
||||
//asm volatile ("outb %0, %1" :: "a" (c), "Nd" (0xe9) : "memory");
|
||||
}
|
||||
|
||||
void e9_print(const char *msg) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
DEFAULT_ENTRY=1
|
||||
TIMEOUT=3
|
||||
GRAPHICS=yes
|
||||
#GRAPHICS=yes
|
||||
MENU_FONT=boot:///boot/font.bin
|
||||
VERBOSE=yes
|
||||
|
||||
|
@ -12,7 +12,7 @@ struct stivale_header header = {
|
||||
.framebuffer_bpp = 0,
|
||||
.framebuffer_width = 0,
|
||||
.framebuffer_height = 0,
|
||||
.flags = 1 | (1 << 3),
|
||||
.flags = (1 << 3),
|
||||
.entry_point = (uint64_t)(uintptr_t)stivale_main
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user