summaryrefslogtreecommitdiff
path: root/userspace
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-20 02:02:28 +0200
committerMiguel <m.i@gmx.at>2018-09-20 02:02:28 +0200
commit631fdbefc89a6202c5b8e2bf0e15a6ca7df809ef (patch)
treed0cd13fcb6590c6d3bf88193ca344521ee3e3e78 /userspace
parent1e08b64b43bf9c50b644da3f76d5a8bcc73f62da (diff)
newlib and pipes
Diffstat (limited to 'userspace')
-rw-r--r--userspace/Makefile1
-rw-r--r--userspace/crt0.s2
-rw-r--r--userspace/fd.c9
-rw-r--r--userspace/nonl.c15
-rw-r--r--userspace/sysfs_write.c2
5 files changed, 27 insertions, 2 deletions
diff --git a/userspace/Makefile b/userspace/Makefile
index d39f15f..b3c962b 100644
--- a/userspace/Makefile
+++ b/userspace/Makefile
@@ -45,6 +45,7 @@ ext2.img: $(PROGS)
@mkdir -p mnt/bin
@mkdir -p mnt/doc/test
@mkdir -p mnt/sys # mountpoint for sysfs
+ @mkdir -p mnt/pipes # mountpoint for pipes
@cp test.txt mnt/doc/test/
@cp $(PROGS) mnt/bin
@cp fonts/binfont.bin mnt/
diff --git a/userspace/crt0.s b/userspace/crt0.s
index 9ef2a67..26ad47c 100644
--- a/userspace/crt0.s
+++ b/userspace/crt0.s
@@ -31,7 +31,7 @@ call main
# push exit code and pass to _exit syscall
push %eax
-call _exit
+call exit
# this should never be reached!
.wait:
diff --git a/userspace/fd.c b/userspace/fd.c
new file mode 100644
index 0000000..09cb28e
--- /dev/null
+++ b/userspace/fd.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+#include <unistd.h>
+
+int main()
+{
+ dup(stdout);
+ printf("dup\n");
+
+}
diff --git a/userspace/nonl.c b/userspace/nonl.c
new file mode 100644
index 0000000..3940453
--- /dev/null
+++ b/userspace/nonl.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+void atex()
+{
+ printf("atex\n");
+}
+int main()
+{
+ printf("nonextline");
+// fflush(stdout);
+
+// atexit(&atex);
+ return EXIT_SUCCESS;
+}
diff --git a/userspace/sysfs_write.c b/userspace/sysfs_write.c
index b35f063..9f91632 100644
--- a/userspace/sysfs_write.c
+++ b/userspace/sysfs_write.c
@@ -5,5 +5,5 @@ int main()
uint32_t data=0xaabbccdd;
fwrite(&data,4,1,f);
// fclose(f); // not automatically by newlib?
- fflush(f);
+// fflush(f);
}