diff options
author | Robert Morris <rtm@csail.mit.edu> | 2019-06-11 09:57:14 -0400 |
---|---|---|
committer | Robert Morris <rtm@csail.mit.edu> | 2019-06-11 09:57:14 -0400 |
commit | 5753553213df8f9de851adb68377db43faecb91f (patch) | |
tree | 3b629ff54897fca414146677532cb459a2ed11ba /kernel/entry.S | |
parent | 91ba81110acd3163f7de3580b677eece0c57f5e7 (diff) | |
download | xv6-labs-5753553213df8f9de851adb68377db43faecb91f.tar.gz xv6-labs-5753553213df8f9de851adb68377db43faecb91f.tar.bz2 xv6-labs-5753553213df8f9de851adb68377db43faecb91f.zip |
separate source into kernel/ user/ mkfs/
Diffstat (limited to 'kernel/entry.S')
-rw-r--r-- | kernel/entry.S | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kernel/entry.S b/kernel/entry.S new file mode 100644 index 0000000..b3d2c55 --- /dev/null +++ b/kernel/entry.S @@ -0,0 +1,25 @@ + # 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 + # 0x8000000, the _start function here, + # in machine mode. +.section .data +.globl stack0 +.section .text +.globl mstart +.section .text +.globl _entry +_entry: + # set up a stack for C. + # stack0 is declared in start, + # with 4096 bytes per CPU. + la sp, stack0 + li a0, 1024*4 + csrr a1, mhartid + addi a1, a1, 1 + mul a0, a0, a1 + add sp, sp, a0 + # jump to mstart() in start.c + call mstart +junk: + j junk |