能进入用户态程序,但无法正确进行系统调用

This commit is contained in:
fslongjin
2022-04-10 23:53:07 +08:00
parent d78db8225c
commit c09c6d4e66
6 changed files with 19 additions and 10 deletions

View File

@ -106,7 +106,7 @@ Err_Code:
ENTRY(system_call)
// sysenter
sti;
hlt
subq $0x38, %rsp
cld;

View File

@ -168,7 +168,7 @@ void do_stack_segment_fault(struct pt_regs *regs, unsigned long error_code)
// 13 #GP 通用保护性异常
void do_general_protection(struct pt_regs *regs, unsigned long error_code)
{
hlt();
kerror("do_general_protection(13),\tError Code:%#18lx,\tRSP:%#18lx,\tRIP:%#18lx\n", error_code, regs->rsp, regs->rip);
if (error_code & 0x01)
printk_color(RED, BLACK, "The exception occurred during delivery of an event external to the program,such as an interrupt or an earlier exception.\n");