diff options
| author | Miguel <m.i@gmx.at> | 2018-10-11 02:14:52 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-10-11 02:14:52 +0200 |
| commit | 8b33f268b67455ded8d35f3c198425562173fa2e (patch) | |
| tree | 947e9b5503c0447f12f6d8d2c00c3b177dddef72 /interface | |
| parent | e2005fda57ea4da12754d67ba127b09508125395 (diff) | |
almost cross compliing c++
Diffstat (limited to 'interface')
| -rw-r--r-- | interface/crt0.s | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/interface/crt0.s b/interface/crt0.s index c24d2d9..65123b7 100644 --- a/interface/crt0.s +++ b/interface/crt0.s @@ -1,9 +1,12 @@ .global _start +.global myinit //temporary quickfix / test _start: -push %ebx -push %ecx +// ALIGN stack + +//push %ebx +//push %ecx //cmp $0,_impure_ptr //jne skipzero @@ -19,6 +22,7 @@ push %ecx //skipzero: +/* mov _impure_ptr,%eax mov $0xf5000000,%ebx @@ -30,19 +34,33 @@ add $4, %eax cmp $0xf5001000,%ebx jne copy +*/ + movl $0xf5000000, _impure_ptr -pop %ecx -pop %ebx +//call _init # environment adress was passed on stack pop %eax mov %eax, environ +pop %ecx +pop %ebx + +and $-16,%esp +sub $8,%esp + +push %ebx +push %ecx + # call main (argc and argv are on the stack) call main +// ALIGN stack +and $-16,%esp +sub $4,%esp + # push exit code and pass to _exit syscall push %eax call exit @@ -51,3 +69,7 @@ call exit .wait: hlt jmp .wait + +myinit: +call _init +ret |
