?? exception.cpp
字號:
/*
* Copyright (C) 2004, Thejesh AP. All rights reserved.
*/
#include <sys\types.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <dirent.h>
#include <jazmyn\exceptions.h>
#include <drivers\console.h>
#include <drivers\keyboard.h>
#include <jazmyn\desc.h>
#include <mm\heap.h>
#include <mm\memory.h>
#include <fs\file_sys.h>
#include <jazmyn\process.h>
#include <jazmyn\i386.h>
#include <jazmyn\gdt.h>
extern process *curr_proc;
extern GDT _gdt;
void (*exception[17])() = {
divide_error,
single_step,
NMI_error,
break_point,
overflow,
bound_error,
invalid_opcode,
no_coprocessor,
double_fault,
coprocessor_overflow,
invalid_TSS,
no_segment,
stack_exception,
general_protection,
page_fault,
unknown_error,
coprocessor_error
};
void divide_error()
{
cout<<"Divide error";
}
void single_step()
{
cout<<"Single step";
}
void NMI_error()
{
cout<<"NMI error";
}
void break_point()
{
cout<<"Break point";
}
void overflow()
{
cout<<"Overflow error";
}
void bound_error()
{
cout<<"Bound error";
}
void invalid_opcode()
{
cout<<"Invalid opcode";
}
void no_coprocessor()
{
cout<<"No coprocessor";
}
void double_fault()
{
cout<<"Double fault";
}
void coprocessor_overflow()
{
cout<<"Coprocessor overflow";
}
void invalid_TSS()
{
cout<<"Invalid TSS";
}
void no_segment()
{
cout<<"Segment not present";
}
void stack_exception()
{
cout<<"Stack exception";
}
void general_protection()
{
cout<<"General protection fault";
curr_proc->_m.show_tss();
cout<<"TR :"<<STR()<<endl;
cout<<"ldt:"<<SLDT()<<endl;
curr_proc->_m.show_ldt();
while(1);
}
void page_fault()
{
cout<<"Page fault";
}
void unknown_error()
{
cout<<"Unknown error";
}
void coprocessor_error()
{
cout<<"Coprocessor error";
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -