Files
uiuc-ece391-mp3/syscalls/ece391hello.c
ece391staff 7fc79b62ed MP3 Release
2018-10-15 13:22:04 -05:00

25 lines
480 B
C

#include <stdint.h>
#include "ece391support.h"
#include "ece391syscall.h"
#define BUFSIZE 1024
int main ()
{
int32_t cnt;
uint8_t buf[BUFSIZE];
ece391_fdputs (1, (uint8_t*)"Hi, what's your name? ");
if (-1 == (cnt = ece391_read (0, buf, BUFSIZE-1))) {
ece391_fdputs (1, (uint8_t*)"Can't read name from keyboard.\n");
return 3;
}
buf[cnt] = '\0';
ece391_fdputs (1, (uint8_t*)"Hello, ");
ece391_fdputs (1, buf);
return 0;
}