mirror of
https://github.com/usatiuk/ficus.git
synced 2025-10-29 08:37:51 +01:00
rename hello to init
This commit is contained in:
34
src/test/init.c
Normal file
34
src/test/init.c
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "syscalls_interface.h"
|
||||
|
||||
|
||||
__attribute__((unused)) void _start() {
|
||||
// putchar('h');
|
||||
// putchar('i');
|
||||
// putchar('\n');
|
||||
uint64_t test123 = open("/test123", O_CREAT | O_RDWR);
|
||||
const char *teststr = "test str";
|
||||
write(test123, teststr, 9);
|
||||
close(test123);
|
||||
|
||||
test123 = open("/test123", O_RDONLY);
|
||||
char buf[123];
|
||||
read(test123, buf, 9);
|
||||
|
||||
putchar('\n');
|
||||
for (int i = 0; i < 8; i++) {
|
||||
putchar(buf[i]);
|
||||
}
|
||||
putchar('\n');
|
||||
|
||||
while (1) {
|
||||
// putchar('h');
|
||||
// putchar('i');
|
||||
putchar('\n');
|
||||
char read = readchar();
|
||||
if (read == 'm') print_mem();
|
||||
if (read == 't') print_tasks();
|
||||
putchar('\n');
|
||||
putchar(read);
|
||||
// sleep(100000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user