#include #include #include #include #include #include #include #include #include void main(void) { debugprint(ANSIQ_SCR_CLR_ALL); debugprint(ANSIQ_CUR_SET(0, 0)); int32_t ioh = ioctl_openfile("base:/hello.txt", IOCTL_F_WRITE | IOCTL_F_READ | IOCTL_F_MAKE); char *text = "Hello from the filesystem"; ioctl_writefile(ioh, (const uint8_t *const)text, string_len(text), 0); char buf[0x100] = {0}; ioctl_readfile(ioh, (uint8_t *const)buf, string_len(text), 0); uprintf("FILE: %s\n", buf); ioctl_closefile(ioh); uprintf("Hello world using uprintf\n"); while(1) { int32_t kbchar; int32_t read = ipcpipe(1, 0, IPCPIPE_READ, (uint8_t *)&kbchar, sizeof(kbchar)); if (read > 0 && (kbchar >= 0x20 && kbchar <= 0x7F)) { uprintf("%c", (char)kbchar); } } for(;;); }