Browse Source

update prog0

master
Mathieu Serandour 6 months ago
parent
commit
f2f1d904fe
  1. 27
      programs/prog0.c

27
programs/prog0.c

@ -1,4 +1,4 @@
#include <unistd.h>
int x = 8;
const char* rodata = " zefgrbefvzegr ";
@ -9,9 +9,28 @@ int fibo(int v) {
if(v < 2)
return v;
else
return fibo(v - 1);
return fibo(v - 1) + fibo(v - 2);
}
int f(int x) {
return x+1;
}
int _start(int argc, char** argv) {
return 2;
const char* string = "hello world from userspace!\n";
int _start() {
int fd = open("/dev/term", 0,0);
if(fd == -1)
*(int*)0 = 0;
write(fd, string, strlen(string));
write(fd, string, strlen(string));
close(fd);
for(;;);
}
Loading…
Cancel
Save