实验报告要求

从git server网站上取得ucore_lab后,进入目录labcodes/lab3,完成实验要求的各个练习。在实验报告中回答所有练习中提出的问题。在目录labcodes/lab3下存放实验报告,实验报告文档命名为lab3-学生ID.md。推荐用markdown格式。对于lab3中编程任务,完成编写之后,再通过git push命令把代码同步回git server网站。最后请一定提前或按时提交到git server网站。

注意有“LAB3”的注释,代码中所有需要完成的地方(challenge除外)都有“LAB3”和“YOUR CODE”的注释,请在提交时特别注意保持注释,并将“YOUR CODE”替换为自己的学号,并且将所有标有对应注释的部分填上正确的代码。

附录:正确输出的参考:

  1. $ make qemu
  2. (THU.CST) os is loading ...
  3. Special kernel symbols:
  4. entry 0xc010002c (phys)
  5. etext 0xc010962b (phys)
  6. edata 0xc0122ac8 (phys)
  7. end 0xc0123c10 (phys)
  8. Kernel executable memory footprint: 143KB
  9. memory management: default_pmm_manager
  10. e820map:
  11. memory: 0009f400, [00000000, 0009f3ff], type = 1.
  12. memory: 00000c00, [0009f400, 0009ffff], type = 2.
  13. memory: 00010000, [000f0000, 000fffff], type = 2.
  14. memory: 07efd000, [00100000, 07ffcfff], type = 1.
  15. memory: 00003000, [07ffd000, 07ffffff], type = 2.
  16. memory: 00040000, [fffc0000, ffffffff], type = 2.
  17. check_alloc_page() succeeded!
  18. check_pgdir() succeeded!
  19. check_boot_pgdir() succeeded!
  20. -------------------- BEGIN --------------------
  21. PDE(0e0) c0000000-f8000000 38000000 urw
  22. |-- PTE(38000) c0000000-f8000000 38000000 -rw
  23. PDE(001) fac00000-fb000000 00400000 -rw
  24. |-- PTE(000e0) faf00000-fafe0000 000e0000 urw
  25. |-- PTE(00001) fafeb000-fafec000 00001000 -rw
  26. --------------------- END ---------------------
  27. check_vma_struct() succeeded!
  28. page fault at 0x00000100: K/W [no page found].
  29. check_pgfault() succeeded!
  30. check_vmm() succeeded.
  31. ide 0: 10000(sectors), 'QEMU HARDDISK'.
  32. ide 1: 262144(sectors), 'QEMU HARDDISK'.
  33. SWAP: manager = fifo swap manager
  34. BEGIN check_swap: count 1, total 31992
  35. mm->sm_priv c0123c04 in fifo_init_mm
  36. setup Page Table for vaddr 0X1000, so alloc a page
  37. setup Page Table vaddr 0~4MB OVER!
  38. set up init env for check_swap begin!
  39. page fault at 0x00001000: K/W [no page found].
  40. page fault at 0x00002000: K/W [no page found].
  41. page fault at 0x00003000: K/W [no page found].
  42. page fault at 0x00004000: K/W [no page found].
  43. set up init env for check_swap over!
  44. write Virt Page c in fifo_check_swap
  45. write Virt Page a in fifo_check_swap
  46. write Virt Page d in fifo_check_swap
  47. write Virt Page b in fifo_check_swap
  48. write Virt Page e in fifo_check_swap
  49. page fault at 0x00005000: K/W [no page found].
  50. swap_out: i 0, store page in vaddr 0x1000 to disk swap entry 2
  51. write Virt Page b in fifo_check_swap
  52. write Virt Page a in fifo_check_swap
  53. page fault at 0x00001000: K/W [no page found].
  54. swap_out: i 0, store page in vaddr 0x2000 to disk swap entry 3
  55. swap_in: load disk swap entry 2 with swap_page in vadr 0x1000
  56. write Virt Page b in fifo_check_swap
  57. page fault at 0x00002000: K/W [no page found].
  58. swap_out: i 0, store page in vaddr 0x3000 to disk swap entry 4
  59. swap_in: load disk swap entry 3 with swap_page in vadr 0x2000
  60. write Virt Page c in fifo_check_swap
  61. page fault at 0x00003000: K/W [no page found].
  62. swap_out: i 0, store page in vaddr 0x4000 to disk swap entry 5
  63. swap_in: load disk swap entry 4 with swap_page in vadr 0x3000
  64. write Virt Page d in fifo_check_swap
  65. page fault at 0x00004000: K/W [no page found].
  66. swap_out: i 0, store page in vaddr 0x5000 to disk swap entry 6
  67. swap_in: load disk swap entry 5 with swap_page in vadr 0x4000
  68. check_swap() succeeded!
  69. ++ setup timer interrupts
  70. 100 ticks
  71. End of Test.
  72. kernel panic at kern/trap/trap.c:20:
  73. EOT: kernel seems ok.
  74. Welcome to the kernel debug monitor!!
  75. Type 'help' for a list of commands.