xv6-65oo2/kernel/entry.S

27 lines
695 B
ArmAsm
Raw Normal View History

2019-05-31 13:45:59 +00:00
# qemu -kernel starts at 0x1000. the instructions
# there seem to be provided by qemu, as if it
# were a ROM. the code at 0x1000 jumps to
# 0x80000000, the _start function here,
# in machine mode. each CPU starts here.
2019-05-31 13:45:59 +00:00
.section .data
.globl stack0
.section .text
2019-07-23 18:31:12 +00:00
.globl start
2019-05-31 13:45:59 +00:00
.section .text
.globl _entry
_entry:
2019-06-05 15:42:03 +00:00
# set up a stack for C.
# stack0 is declared in start.c,
# with a 4096-byte stack per CPU.
# sp = stack0 + (hartid * 4096)
2019-05-31 13:45:59 +00:00
la sp, stack0
2019-06-05 15:42:03 +00:00
li a0, 1024*4
csrr a1, mhartid
addi a1, a1, 1
mul a0, a0, a1
add sp, sp, a0
2019-07-23 18:31:12 +00:00
# jump to start() in start.c
call start
2019-05-31 13:45:59 +00:00
junk:
j junk