add some hints
This commit is contained in:
parent
a37b5511d0
commit
f1840b8b11
14
kern/trap.c
14
kern/trap.c
|
@ -59,14 +59,26 @@ static const char *trapname(int trapno)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// XYZ: write a function declaration here...
|
||||||
|
// e.g., void t_divide();
|
||||||
|
|
||||||
void
|
void
|
||||||
trap_init(void)
|
trap_init(void)
|
||||||
{
|
{
|
||||||
extern struct Segdesc gdt[];
|
extern struct Segdesc gdt[];
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* HINT
|
||||||
|
* Do something like this: SETGATE(idt[T_DIVIDE], 0, GD_KT, t_divide, 0);
|
||||||
|
* if your trap handler's name for divide by zero is t_device.
|
||||||
|
* Additionally, you should declare trap handler as a function
|
||||||
|
* to refer that in C code... (see the comment XYZ above)
|
||||||
|
*
|
||||||
|
*/
|
||||||
// LAB 3: Your code here.
|
// LAB 3: Your code here.
|
||||||
|
|
||||||
// Per-CPU setup
|
// Per-CPU setup
|
||||||
trap_init_percpu();
|
trap_init_percpu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,9 +47,15 @@
|
||||||
* Lab 3: Your code here for generating entry points for the different traps.
|
* Lab 3: Your code here for generating entry points for the different traps.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// HINT 1 : TRAPHANDLER_NOEC(t_divide, T_DIVIDE);
|
||||||
|
// Do something like this if there is no error code for the trap
|
||||||
|
// HINT 2 : TRAPHANDLER(t_dblflt, T_DBLFLT);
|
||||||
|
// Do something like this if the trap includes an error code..
|
||||||
|
// HINT 3 : READ Intel's manual to check if the trap includes an error code
|
||||||
|
// or not...
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lab 3: Your code here for _alltraps
|
* Lab 3: Your code here for _alltraps
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user