1. 中断,异常,系统调用相同:
CPU自动压入:
ss 运行级别提升时需切换堆栈,因此多压入用户态的栈段ss,
esp 运行级别提升时需切换堆栈,因此多压入用户态的堆栈指针esp,
eflag
cs
eip
error code
程序压入部分压入如下寄存器:
es
ds
ebp
edi
esi
edx
ecx
ebx
但是压入的方法各不相同,见entry.S。#define SAVE_ALL,和pt_reg的关系?
a. 异常:
ENTRY(divide_error)
pushl$0 #no error code Wood: 当没有硬件错误码时,在栈中垫上一个空值。
pushl $do_divide_error # 压入返回地址
ALIGN
error_code:
pushl %ds
pushl %eax
xorl %eax, %eax
pushl %ebp
pushl %edi
pushl %esi
pushl %edx
decl %eax # eax = -1
pushl %ecx
CPU自动压入:
ss 运行级别提升时需切换堆栈,因此多压入用户态的栈段ss,
esp 运行级别提升时需切换堆栈,因此多压入用户态的堆栈指针esp,
eflag
cs
eip
error code
程序压入部分压入如下寄存器:
es
ds
ebp
edi
esi
edx
ecx
ebx
但是压入的方法各不相同,见entry.S。#define SAVE_ALL,和pt_reg的关系?
a. 异常:
ENTRY(divide_error)
pushl$0 #no error code Wood: 当没有硬件错误码时,在栈中垫上一个空值。
pushl $do_divide_error # 压入返回地址
ALIGN
error_code:
pushl %ds
pushl %eax
xorl %eax, %eax
pushl %ebp
pushl %edi
pushl %esi
pushl %edx
decl %eax # eax = -1
pushl %ecx