mirror of
https://github.com/SmallPond/MIT6.828_OS.git
synced 2026-04-29 21:31:05 +08:00
LAB 4 IS DONE.
This commit is contained in:
11
lab/user/badsegment.c
Normal file
11
lab/user/badsegment.c
Normal file
@@ -0,0 +1,11 @@
|
||||
// program to cause a general protection exception
|
||||
|
||||
#include <inc/lib.h>
|
||||
|
||||
void
|
||||
umain(int argc, char **argv)
|
||||
{
|
||||
// Try to load the kernel's TSS selector into the DS register.
|
||||
asm volatile("movw $0x28,%ax; movw %ax,%ds");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user