aboutsummaryrefslogtreecommitdiff
path: root/src/userspace/libc
diff options
context:
space:
mode:
Diffstat (limited to 'src/userspace/libc')
-rw-r--r--src/userspace/libc/stdio/putch.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/userspace/libc/stdio/putch.c b/src/userspace/libc/stdio/putch.c
index f87680e..2dad6dc 100644
--- a/src/userspace/libc/stdio/putch.c
+++ b/src/userspace/libc/stdio/putch.c
@@ -1,8 +1,22 @@
#include <syscall.h>
+int is_transmit_empty()
+{
+ u8 value;
+ asm volatile("inb %1, %0" : "=a"(value) : "Nd"(0x3f8 + 5));
+ return value & 0x20;
+}
+
void putch(char ch)
{
+ while (is_transmit_empty() == 0)
+ ;
+ asm volatile("outb %0, %1" ::"a"(ch), "Nd"(0x3f8));
+}
+
+/*void putch(char ch)
+{
// TODO: Implement framebuffer writing
//if (ch != 0)
//syscall_putch(ch);
-} \ No newline at end of file
+}*/ \ No newline at end of file