Skip to content

Commit

Permalink
+ user mode programs init files
Browse files Browse the repository at this point in the history
  • Loading branch information
mellotanica committed Nov 27, 2014
1 parent 5390974 commit 8dfee8d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
Binary file added facilities/crti.o
Binary file not shown.
37 changes: 37 additions & 0 deletions facilities/crti.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#this constant has to be set to a kernel-specific value
.equ TERMINATESYS, 18


# remember that $sp has to be set by kernel too

# useful constants

# This is the standard __start function for generic program
# activation: it loads r15 with starting address and
# at main() function return calls kernel TERMINATE service
# (a SYSCALL with r0 == TERMINATE)

.text
.global __start
.extern main

__start:
# $sp has to be set to correct value by kernel

SUB sp, sp, #16
STR fp, [sp], #12
MOV fp, sp

B main

MOV sp, fp
LDR fp, [sp], #12
ADD sp, sp, #16

# calls kernel TERMINATE service

MOV r0, #TERMINATESYS

SWI 8


4 changes: 3 additions & 1 deletion qarm.pro
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,6 @@ OTHER_FILES += \
icons/window_default-48.png \
icons/poweron.png \
install.sh \
default/uarm
default/uarm \
facilities/crti.o \
facilities/crti.s

0 comments on commit 8dfee8d

Please sign in to comment.