update name of code to labcodes
This commit is contained in:
24
labcodes/lab8/user/libs/initcode.S
Normal file
24
labcodes/lab8/user/libs/initcode.S
Normal file
@@ -0,0 +1,24 @@
|
||||
.text
|
||||
.globl _start
|
||||
_start:
|
||||
# set ebp for backtrace
|
||||
movl $0x0, %ebp
|
||||
|
||||
# load argc and argv
|
||||
movl (%esp), %ebx
|
||||
lea 0x4(%esp), %ecx
|
||||
|
||||
|
||||
# move down the esp register
|
||||
# since it may cause page fault in backtrace
|
||||
subl $0x20, %esp
|
||||
|
||||
# save argc and argv on stack
|
||||
pushl %ecx
|
||||
pushl %ebx
|
||||
|
||||
# call user-program function
|
||||
call umain
|
||||
1: jmp 1b
|
||||
|
||||
|
||||
Reference in New Issue
Block a user