From 05e1fedcc9cd30d1a34a65e640da45e980b4f859 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 19 Sep 2019 19:56:59 +0200 Subject: Moved source to kernel directory --- src/io/io.asm | 10 ---------- src/io/io.c | 21 --------------------- src/io/io.h | 12 ------------ 3 files changed, 43 deletions(-) delete mode 100644 src/io/io.asm delete mode 100644 src/io/io.c delete mode 100644 src/io/io.h (limited to 'src/io') diff --git a/src/io/io.asm b/src/io/io.asm deleted file mode 100644 index 6ab3707..0000000 --- a/src/io/io.asm +++ /dev/null @@ -1,10 +0,0 @@ -global shutdown -shutdown: - mov ax, 0x1000 - mov ax, ss - mov sp, 0xf000 - mov ax, 0x5307 - mov bx, 0x0001 - mov cx, 0x0003 - int 0x15 - ret \ No newline at end of file diff --git a/src/io/io.c b/src/io/io.c deleted file mode 100644 index 7bddb13..0000000 --- a/src/io/io.c +++ /dev/null @@ -1,21 +0,0 @@ -#include - -unsigned char receive(unsigned short port) { - unsigned char value; - __asm__ __volatile__ ("inb %1, %0" : "=a" (value) : "dN" (port)); - return value; -} - -void send(unsigned short port, unsigned char data) { - __asm__ __volatile__ ("outb %1, %0" : : "dN" (port), "a" (data)); -} - -void reboot() { - uint8_t good = 0x02; - while (good & 0x02) - good = receive(0x64); - send(0x64, 0xFE); - loop: - asm volatile ("hlt"); - goto loop; -} \ No newline at end of file diff --git a/src/io/io.h b/src/io/io.h deleted file mode 100644 index e00a5f0..0000000 --- a/src/io/io.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef MELVIX_IO_H -#define MELVIX_IO_H - -#include - -unsigned char receive(unsigned short port); - -void send(unsigned short port, unsigned char data); - -void reboot(); - -#endif -- cgit v1.2.3