trapasm.s

来自「美国mit操作系统课程所用的一个教学操作系统xv6」· S 代码 · 共 39 行

S
39
字号
.text.set SEG_KDATA_SEL, 0x10   # selector for SEG_KDATA  # vectors.S sends all traps here..globl alltrapsalltraps:  # Build trap frame.  pushl %ds  pushl %es  pushal    # Set up data segments.  movl $SEG_KDATA_SEL, %eax  movw %ax,%ds  movw %ax,%es  # Call trap(tf), where tf=%esp  pushl %esp  call trap  addl $4, %esp  # Return falls through to trapret....globl traprettrapret:  popal  popl %es  popl %ds  addl $0x8, %esp  # trapno and errcode  iret  # A forked process switches to user mode by calling  # forkret1(tf), where tf is the trap frame to use..globl forkret1forkret1:  movl 4(%esp), %esp  jmp trapret

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?