diff --git a/kern/Makefrag b/kern/Makefrag index 778e3b6..3638910 100644 --- a/kern/Makefrag +++ b/kern/Makefrag @@ -50,7 +50,8 @@ KERN_BINFILES := user/hello \ user/faultread \ user/faultreadkernel \ user/faultwrite \ - user/faultwritekernel + user/faultwritekernel \ + user/getc KERN_OBJFILES := $(patsubst %.c, $(OBJDIR)/%.o, $(KERN_SRCFILES)) KERN_OBJFILES := $(patsubst %.S, $(OBJDIR)/%.o, $(KERN_OBJFILES)) diff --git a/user/getc.c b/user/getc.c new file mode 100644 index 0000000..0af8d57 --- /dev/null +++ b/user/getc.c @@ -0,0 +1,9 @@ +#include + +void +umain(int argc, char **argv) +{ + char c; + while(!(c = sys_cgetc())); + cprintf("got character %c\n", c); +}