git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: use a more decent physical memory map
[lunaix-os.git]
/
lunaix-os
/
kernel
/
tty
/
tty.c
diff --git
a/lunaix-os/kernel/tty/tty.c
b/lunaix-os/kernel/tty/tty.c
index 4c9631cefdeed0312a9d7a0d18de972ec06d3da2..6f988552822e239af0d7903b3b71a12606c19816 100644
(file)
--- a/
lunaix-os/kernel/tty/tty.c
+++ b/
lunaix-os/kernel/tty/tty.c
@@
-1,11
+1,11
@@
-#include <hal/io.h>
#include <klibc/string.h>
#include <klibc/string.h>
-#include <lunaix/common.h>
#include <lunaix/spike.h>
#include <lunaix/tty/console.h>
#include <lunaix/tty/tty.h>
#include <stdint.h>
#include <lunaix/spike.h>
#include <lunaix/tty/console.h>
#include <lunaix/tty/tty.h>
#include <stdint.h>
+#include <sys/port_io.h>
+
vga_attribute* tty_vga_buffer;
vga_attribute tty_theme_color = VGA_COLOR_BLACK;
vga_attribute* tty_vga_buffer;
vga_attribute tty_theme_color = VGA_COLOR_BLACK;
@@
-26,11
+26,11
@@
tty_init(void* vga_buf)
tty_clear();
tty_clear();
-
io_outb
(0x3D4, 0x0A);
-
io_outb(0x3D5, (io_inb
(0x3D5) & 0xC0) | 13);
+
port_wrbyte
(0x3D4, 0x0A);
+
port_wrbyte(0x3D5, (port_rdbyte
(0x3D5) & 0xC0) | 13);
-
io_outb
(0x3D4, 0x0B);
-
io_outb(0x3D5, (io_inb
(0x3D5) & 0xE0) | 15);
+
port_wrbyte
(0x3D4, 0x0B);
+
port_wrbyte(0x3D5, (port_rdbyte
(0x3D5) & 0xE0) | 15);
}
void
}
void
@@
-40,10
+40,10
@@
tty_set_cursor(u8_t x, u8_t y)
x = y = 0;
}
u32_t pos = y * TTY_WIDTH + x;
x = y = 0;
}
u32_t pos = y * TTY_WIDTH + x;
-
io_outb
(0x3D4, 14);
-
io_outb
(0x3D5, pos / 256);
-
io_outb
(0x3D4, 15);
-
io_outb
(0x3D5, pos % 256);
+
port_wrbyte
(0x3D4, 14);
+
port_wrbyte
(0x3D5, pos / 256);
+
port_wrbyte
(0x3D4, 15);
+
port_wrbyte
(0x3D5, pos % 256);
}
void
}
void