diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-11-22 18:42:35 +0100 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-11-22 18:42:35 +0100 |
| commit | 5c8c67810a9df8fdcd7ca286cb2266d5d3536309 (patch) | |
| tree | 6abd9aaa6ace18ef86bfbf3228e5f28a9c9a773b /userspace | |
| parent | eca57656bfb384583c1c4b34de46cde6b36d6694 (diff) | |
Passing params to main()
Diffstat (limited to 'userspace')
| -rw-r--r-- | userspace/simple.c | 11 | ||||
| -rw-r--r-- | userspace/sys/Makefile | 3 | ||||
| -rw-r--r-- | userspace/sys/crt0.S | 7 |
3 files changed, 8 insertions, 13 deletions
diff --git a/userspace/simple.c b/userspace/simple.c index fa809a8..01d46e8 100644 --- a/userspace/simple.c +++ b/userspace/simple.c @@ -1,15 +1,14 @@ int main(int argc, char **argv) { - int i; - for(i=0;i<5;i++) + int i; + printf("argv: 0x%08X\n",argv); + for(i=0;i<argc;i++) { - - puts("dupa"); - + printf("param %i: %08X: %s\n",i,argv[i],argv[i]); } + puts("bye"); - return 0; } diff --git a/userspace/sys/Makefile b/userspace/sys/Makefile new file mode 100644 index 0000000..7dde55a --- /dev/null +++ b/userspace/sys/Makefile @@ -0,0 +1,3 @@ +CC=i686-foolos-gcc +clean: + -rm *.o diff --git a/userspace/sys/crt0.S b/userspace/sys/crt0.S index 48eadd9..33e5d32 100644 --- a/userspace/sys/crt0.S +++ b/userspace/sys/crt0.S @@ -5,15 +5,8 @@ _start: -push $0 -call sbrk - -#push $[_BSS_END_] -#call sbrk - call main - push %eax call _exit |
