Add a getc program

This commit is contained in:
Danila Fedorin 2019-04-25 19:58:37 -07:00
parent 74b1c2c69d
commit 03b296f7e1
2 changed files with 11 additions and 1 deletions

View File

@ -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
View 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);
}