mirror of
https://github.com/SmallPond/MIT6.828_OS.git
synced 2026-04-30 05:41:08 +08:00
my solution to lab 6
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
#include <kern/picirq.h>
|
||||
#include <kern/cpu.h>
|
||||
#include <kern/spinlock.h>
|
||||
#include <kern/time.h>
|
||||
#include <kern/pci.h>
|
||||
|
||||
static void boot_aps(void);
|
||||
|
||||
@@ -41,6 +43,10 @@ i386_init(void)
|
||||
// Lab 4 multitasking initialization functions
|
||||
pic_init();
|
||||
|
||||
// Lab 6 hardware initialization functions
|
||||
time_init();
|
||||
pci_init();
|
||||
|
||||
// Acquire the big kernel lock before waking up APs
|
||||
// Your code here:
|
||||
lock_kernel();
|
||||
@@ -50,14 +56,18 @@ i386_init(void)
|
||||
// Start fs.
|
||||
ENV_CREATE(fs_fs, ENV_TYPE_FS);
|
||||
|
||||
#if !defined(TEST_NO_NS)
|
||||
// Start ns.
|
||||
ENV_CREATE(net_ns, ENV_TYPE_NS);
|
||||
#endif
|
||||
|
||||
#if defined(TEST)
|
||||
// Don't touch -- used by grading script!
|
||||
ENV_CREATE(TEST, ENV_TYPE_USER);
|
||||
#else
|
||||
// Touch all you want.
|
||||
ENV_CREATE(user_icode, ENV_TYPE_USER);
|
||||
|
||||
|
||||
//ENV_CREATE(user_sched, ENV_TYPE_USER);
|
||||
ENV_CREATE(user_yield, ENV_TYPE_USER);
|
||||
#endif // TEST*
|
||||
|
||||
// Should not be necessary - drains keyboard because interrupt has given up.
|
||||
|
||||
Reference in New Issue
Block a user