my solution to lab 6

This commit is contained in:
winPond
2019-07-17 16:08:06 +08:00
parent 8147d99448
commit c62da1c86d
534 changed files with 60875 additions and 6513 deletions

View File

@@ -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.