diff options
author | Marvin Borner | 2020-08-05 18:28:26 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-05 18:28:26 +0200 |
commit | 4af62bb53676b7f721b46cabee78cac3a557e924 (patch) | |
tree | b9c7e615c3226d9822c22cdb6cdb326f379db73f /apps/root.c | |
parent | b7f59b28b380d55f9e7abd8e450f1f9c7f050221 (diff) |
Some proc things
Diffstat (limited to 'apps/root.c')
-rw-r--r-- | apps/root.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/apps/root.c b/apps/root.c deleted file mode 100644 index 097d0db..0000000 --- a/apps/root.c +++ /dev/null @@ -1,49 +0,0 @@ -// MIT License, Copyright (c) 2020 Marvin Borner - -#include <def.h> - -u32 strlen(const char *s) -{ - const char *ss = s; - while (*ss) - ss++; - return ss - s; -} - -u8 inb(u16 port) -{ - u8 value; - __asm__ volatile("inb %1, %0" : "=a"(value) : "Nd"(port)); - return value; -} - -void outb(u16 port, u8 data) -{ - __asm__ volatile("outb %0, %1" ::"a"(data), "Nd"(port)); -} - -int is_transmit_empty() -{ - return inb(0x3f8 + 5) & 0x20; -} - -void serial_put(char ch) -{ - while (is_transmit_empty() == 0) - ; - outb(0x3f8, (u8)ch); -} - -void serial_print(const char *data) -{ - for (u32 i = 0; i < strlen(data); i++) - serial_put(data[i]); -} - -void main() -{ - serial_print("root loaded\n"); - __asm__ volatile("int $0x80"); - while (1) { - }; -} |