Add a getc program
This commit is contained in:
parent
74b1c2c69d
commit
03b296f7e1
|
@ -50,7 +50,8 @@ KERN_BINFILES := user/hello \
|
||||||
user/faultread \
|
user/faultread \
|
||||||
user/faultreadkernel \
|
user/faultreadkernel \
|
||||||
user/faultwrite \
|
user/faultwrite \
|
||||||
user/faultwritekernel
|
user/faultwritekernel \
|
||||||
|
user/getc
|
||||||
|
|
||||||
KERN_OBJFILES := $(patsubst %.c, $(OBJDIR)/%.o, $(KERN_SRCFILES))
|
KERN_OBJFILES := $(patsubst %.c, $(OBJDIR)/%.o, $(KERN_SRCFILES))
|
||||||
KERN_OBJFILES := $(patsubst %.S, $(OBJDIR)/%.o, $(KERN_OBJFILES))
|
KERN_OBJFILES := $(patsubst %.S, $(OBJDIR)/%.o, $(KERN_OBJFILES))
|
||||||
|
|
9
user/getc.c
Normal file
9
user/getc.c
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#include <inc/lib.h>
|
||||||
|
|
||||||
|
void
|
||||||
|
umain(int argc, char **argv)
|
||||||
|
{
|
||||||
|
char c;
|
||||||
|
while(!(c = sys_cgetc()));
|
||||||
|
cprintf("got character %c\n", c);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user