This commit is contained in:
spikey 2024-02-18 11:50:47 -05:00
parent b6a53875be
commit 95d4ae7d76
3 changed files with 31 additions and 0 deletions

7
sys/include/kbd.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef KBD_H
#define KBD_H
u8 inb(u16);
s8 waitkey(void);
#endif

22
sys/kbd.c Normal file
View File

@ -0,0 +1,22 @@
#include <kbd.h>
static inline u8
inb(u16 port)
{
u8 ret;
__asm__ volatile ( "inb %w1, %b0"
: "=a"(ret)
: "Nd"(port)
: "memory");
return ret;
}
char
waitkey(void)
{
char k;
while ((k=inb(0x60))<128);
while (inb(0x60)>128);
return k;
}

View File

@ -10,5 +10,7 @@ sysinit(void)
vga_clearscreen();
vga_write("Starting omOS...", 16, 0x0F);
char thing = waitkey();
vga_write(&thing, 1, 0x1F);
memory_init();
}