thing
This commit is contained in:
parent
b6a53875be
commit
95d4ae7d76
7
sys/include/kbd.h
Normal file
7
sys/include/kbd.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef KBD_H
|
||||
#define KBD_H
|
||||
|
||||
u8 inb(u16);
|
||||
s8 waitkey(void);
|
||||
|
||||
#endif
|
22
sys/kbd.c
Normal file
22
sys/kbd.c
Normal 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;
|
||||
}
|
@ -10,5 +10,7 @@ sysinit(void)
|
||||
vga_clearscreen();
|
||||
vga_write("Starting omOS...", 16, 0x0F);
|
||||
|
||||
char thing = waitkey();
|
||||
vga_write(&thing, 1, 0x1F);
|
||||
memory_init();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user