summaryrefslogtreecommitdiff
path: root/src/user/runtimes/c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/runtimes/c')
-rw-r--r--src/user/runtimes/c/elf.ld1
-rw-r--r--src/user/runtimes/c/pcrt.asm (renamed from src/user/runtimes/c/entry.asm)11
2 files changed, 8 insertions, 4 deletions
diff --git a/src/user/runtimes/c/elf.ld b/src/user/runtimes/c/elf.ld
index f321be2..3e9a034 100644
--- a/src/user/runtimes/c/elf.ld
+++ b/src/user/runtimes/c/elf.ld
@@ -11,6 +11,7 @@ SECTIONS {
.__pcrt_before_main : {
__pcrt_before_main_start = .;
*(.__pcrt_before_main)
+ *(.init_array)
__pcrt_before_main_end = .;
}
diff --git a/src/user/runtimes/c/entry.asm b/src/user/runtimes/c/pcrt.asm
index bba8060..85c898c 100644
--- a/src/user/runtimes/c/entry.asm
+++ b/src/user/runtimes/c/pcrt.asm
@@ -2,6 +2,8 @@ bits 32
global __pcrt_entry
global __pcrt_quit
+global calling_task
+global stdio_task
extern main
extern __pcrt_before_main_start
@@ -11,7 +13,8 @@ extern __pcrt_before_quit_end
section .text
__pcrt_entry:
- mov esp, stack
+ mov dword [calling_task], esi
+ mov dword [stdio_task], edi
push edx
mov ebx, __pcrt_before_main_start
@@ -37,6 +40,6 @@ __pcrt_quit:
.end_task:
int 0x38
-section .stack nobits alloc noexec write align=16
-resb 4096
-stack: \ No newline at end of file
+section .bss
+calling_task resd 1
+stdio_task resd 1 \ No newline at end of file