omos-tcnj2024/sys/kbd.c

23 lines
314 B
C
Raw Normal View History

2024-02-18 17:50:47 +01:00
#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;
}