summaryrefslogtreecommitdiff
path: root/src/user/runtimes
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-01-24 12:00:11 -0500
committerBenji Dial <benji6283@gmail.com>2021-01-24 12:00:11 -0500
commitbce944d1498eaa3b6940ee234c863b3548a66b37 (patch)
treeea40c087ab4f0f236aee8d158cf68550f5209f72 /src/user/runtimes
parentca731aa747214919df7b3dfe3478dbe787ce5b68 (diff)
downloadportland-os-bce944d1498eaa3b6940ee234c863b3548a66b37.tar.gz
graphics!
Diffstat (limited to 'src/user/runtimes')
-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