summaryrefslogtreecommitdiff
path: root/userspace/sys
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/sys')
-rw-r--r--userspace/sys/Makefile1
-rw-r--r--userspace/sys/crt0.S9
-rw-r--r--userspace/sys/syscalls.c11
3 files changed, 9 insertions, 12 deletions
diff --git a/userspace/sys/Makefile b/userspace/sys/Makefile
index 374d490..9917d90 100644
--- a/userspace/sys/Makefile
+++ b/userspace/sys/Makefile
@@ -12,6 +12,7 @@ library_install: all
cp /home/miguel/temp/sysroot/usr/lib/libc.a .
ar x libc.a
rm libc.a
+# rm lib_a-environ.o
cp temp/sys*.o .
ar rs libc.a *.o
mv libc.a /home/miguel/temp/sysroot/usr/lib/libc.a
diff --git a/userspace/sys/crt0.S b/userspace/sys/crt0.S
index 33e5d32..025c21b 100644
--- a/userspace/sys/crt0.S
+++ b/userspace/sys/crt0.S
@@ -1,14 +1,15 @@
.global _start
-.extern main
-.extern exit
-
_start:
+pop %eax
+mov %eax, environ
+
call main
+push environ
push %eax
-call _exit
+call _exit2
# this should never be reached anyway!
.wait:
diff --git a/userspace/sys/syscalls.c b/userspace/sys/syscalls.c
index 25c48b0..9456ea4 100644
--- a/userspace/sys/syscalls.c
+++ b/userspace/sys/syscalls.c
@@ -1,15 +1,10 @@
#include "kernel/syscalls.h"
-/*
-char *__env3[]={0};
-char *__env1[]={"a=10","b=20"};
-char *__env2[]={"dupa=test2"};
-char **environ={__env1,__env2,__env3};
-*/
+char **environ;
-void _exit(int ret)
+void _exit2(int ret,char **environ)
{
- return syscall(SYSCALL_EXIT,ret,0,0);
+ return syscall(SYSCALL_EXIT,ret,environ,0);
}
// generic syscall interface!