Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

second commit

commit the final version of last term
  • Loading branch information...
commit 79fb0db0e265ffa16c0261dffc3f583eb0400135 1 parent 6d024a8
@lqhl authored
Showing with 16,118 additions and 0 deletions.
  1. +6 −0 .classpath
  2. +17 −0 .project
  3. +12 −0 .settings/org.eclipse.jdt.core.prefs
  4. BIN  bin/nachos/ag/AutoGrader.class
  5. BIN  bin/nachos/ag/BasicTestGrader$ThreadHandler.class
  6. BIN  bin/nachos/ag/BasicTestGrader.class
  7. BIN  bin/nachos/ag/BoatGrader.class
  8. BIN  bin/nachos/ag/CoffGrader$1.class
  9. BIN  bin/nachos/ag/CoffGrader$2.class
  10. BIN  bin/nachos/ag/CoffGrader$EmbededConsole.class
  11. BIN  bin/nachos/ag/CoffGrader.class
  12. BIN  bin/nachos/ag/DonationGrader$1.class
  13. BIN  bin/nachos/ag/DonationGrader$2.class
  14. BIN  bin/nachos/ag/DonationGrader$3.class
  15. BIN  bin/nachos/ag/DonationGrader$4.class
  16. BIN  bin/nachos/ag/DonationGrader.class
  17. BIN  bin/nachos/ag/FilesysGrader.class
  18. BIN  bin/nachos/ag/JoinGrader$1.class
  19. BIN  bin/nachos/ag/JoinGrader.class
  20. BIN  bin/nachos/ag/LotteryGraderS$LotteryTreeNode.class
  21. BIN  bin/nachos/ag/LotteryGraderS.class
  22. BIN  bin/nachos/ag/PriorityGrader$1.class
  23. BIN  bin/nachos/ag/PriorityGrader.class
  24. BIN  bin/nachos/ag/PriorityGraderS1$1.class
  25. BIN  bin/nachos/ag/PriorityGraderS1$TreeNode.class
  26. BIN  bin/nachos/ag/PriorityGraderS1.class
  27. BIN  bin/nachos/ag/ThreadGrader1$Printer.class
  28. BIN  bin/nachos/ag/ThreadGrader1.class
  29. BIN  bin/nachos/ag/ThreadGrader2$a.class
  30. BIN  bin/nachos/ag/ThreadGrader2$b.class
  31. BIN  bin/nachos/ag/ThreadGrader2.class
  32. BIN  bin/nachos/ag/ThreadGrader3$PingTest.class
  33. BIN  bin/nachos/ag/ThreadGrader3.class
  34. BIN  bin/nachos/ag/ThreadGrader4$PingTest.class
  35. BIN  bin/nachos/ag/ThreadGrader4.class
  36. BIN  bin/nachos/ag/ThreadGrader5$a.class
  37. BIN  bin/nachos/ag/ThreadGrader5.class
  38. BIN  bin/nachos/ag/ThreadGrader6$a.class
  39. BIN  bin/nachos/ag/ThreadGrader6.class
  40. BIN  bin/nachos/ag/ThreadGrader7$a.class
  41. BIN  bin/nachos/ag/ThreadGrader7.class
  42. BIN  bin/nachos/ag/ThreadGrader8$a.class
  43. BIN  bin/nachos/ag/ThreadGrader8.class
  44. BIN  bin/nachos/ag/UserGrader1$1.class
  45. BIN  bin/nachos/ag/UserGrader1$2.class
  46. BIN  bin/nachos/ag/UserGrader1.class
  47. BIN  bin/nachos/ag/VMGrader$1.class
  48. BIN  bin/nachos/ag/VMGrader.class
  49. +3 −0  bin/nachos/ag/package.html
  50. BIN  bin/nachos/filesys/BitMap.class
  51. BIN  bin/nachos/filesys/File.class
  52. BIN  bin/nachos/filesys/FileStat.class
  53. BIN  bin/nachos/filesys/FilesysKernel.class
  54. BIN  bin/nachos/filesys/FilesysProcess$DescriptorManager.class
  55. BIN  bin/nachos/filesys/FilesysProcess.class
  56. BIN  bin/nachos/filesys/Folder.class
  57. BIN  bin/nachos/filesys/FolderEntry.class
  58. BIN  bin/nachos/filesys/FreeList.class
  59. BIN  bin/nachos/filesys/INode.class
  60. BIN  bin/nachos/filesys/RealFileSystem$PathResult.class
  61. BIN  bin/nachos/filesys/RealFileSystem.class
  62. BIN  bin/nachos/machine/ArrayFile.class
  63. BIN  bin/nachos/machine/AssertionFailureError.class
  64. BIN  bin/nachos/machine/Coff.class
  65. BIN  bin/nachos/machine/CoffSection.class
  66. BIN  bin/nachos/machine/Config.class
  67. BIN  bin/nachos/machine/Disk$1.class
  68. BIN  bin/nachos/machine/Disk.class
  69. BIN  bin/nachos/machine/DiskIntHandler.class
  70. BIN  bin/nachos/machine/FileSystem.class
  71. BIN  bin/nachos/machine/GraphicalConsole$1.class
  72. BIN  bin/nachos/machine/GraphicalConsole$2.class
  73. BIN  bin/nachos/machine/GraphicalConsole$3.class
  74. BIN  bin/nachos/machine/GraphicalConsole$4.class
  75. BIN  bin/nachos/machine/GraphicalConsole$5.class
  76. BIN  bin/nachos/machine/GraphicalConsole$6.class
  77. BIN  bin/nachos/machine/GraphicalConsole.class
  78. BIN  bin/nachos/machine/Interrupt$InterruptPrivilege.class
  79. BIN  bin/nachos/machine/Interrupt$PendingInterrupt.class
  80. BIN  bin/nachos/machine/Interrupt.class
  81. BIN  bin/nachos/machine/Kernel.class
  82. BIN  bin/nachos/machine/Lib.class
  83. BIN  bin/nachos/machine/Machine$1.class
  84. BIN  bin/nachos/machine/Machine$MachinePrivilege.class
  85. BIN  bin/nachos/machine/Machine.class
  86. BIN  bin/nachos/machine/MalformedPacketException.class
  87. BIN  bin/nachos/machine/NetworkLink$1.class
  88. BIN  bin/nachos/machine/NetworkLink$2.class
  89. BIN  bin/nachos/machine/NetworkLink$3.class
  90. BIN  bin/nachos/machine/NetworkLink$4.class
  91. BIN  bin/nachos/machine/NetworkLink.class
  92. BIN  bin/nachos/machine/OpenFile.class
  93. BIN  bin/nachos/machine/OpenFileWithPosition.class
  94. BIN  bin/nachos/machine/Packet.class
  95. BIN  bin/nachos/machine/Processor$Instruction.class
  96. BIN  bin/nachos/machine/Processor$Mips.class
  97. BIN  bin/nachos/machine/Processor$MipsException.class
  98. BIN  bin/nachos/machine/Processor$ProcessorPrivilege.class
  99. BIN  bin/nachos/machine/Processor.class
  100. BIN  bin/nachos/machine/SerialConsole.class
  101. BIN  bin/nachos/machine/StandardConsole$1.class
  102. BIN  bin/nachos/machine/StandardConsole$2.class
  103. BIN  bin/nachos/machine/StandardConsole.class
  104. BIN  bin/nachos/machine/Stats.class
  105. BIN  bin/nachos/machine/StubFileSystem$FileRemover.class
  106. BIN  bin/nachos/machine/StubFileSystem$StubOpenFile$1.class
  107. BIN  bin/nachos/machine/StubFileSystem$StubOpenFile.class
  108. BIN  bin/nachos/machine/StubFileSystem.class
  109. BIN  bin/nachos/machine/SynchDisk.class
  110. BIN  bin/nachos/machine/SynchDiskIntHandler.class
  111. BIN  bin/nachos/machine/TCB$1.class
  112. BIN  bin/nachos/machine/TCB$2.class
  113. BIN  bin/nachos/machine/TCB$TCBPrivilege.class
  114. BIN  bin/nachos/machine/TCB.class
  115. BIN  bin/nachos/machine/Timer$1.class
  116. BIN  bin/nachos/machine/Timer$2.class
  117. BIN  bin/nachos/machine/Timer.class
  118. BIN  bin/nachos/machine/TranslationEntry.class
  119. +3 −0  bin/nachos/machine/package.html
  120. BIN  bin/nachos/network/MailMessage.class
  121. BIN  bin/nachos/network/NetKernel$1.class
  122. BIN  bin/nachos/network/NetKernel.class
  123. BIN  bin/nachos/network/NetProcess.class
  124. BIN  bin/nachos/network/PostOffice$1.class
  125. BIN  bin/nachos/network/PostOffice$2.class
  126. BIN  bin/nachos/network/PostOffice$3.class
  127. BIN  bin/nachos/network/PostOffice.class
  128. +3 −0  bin/nachos/network/package.html
  129. BIN  bin/nachos/security/NachosSecurityManager$1.class
  130. BIN  bin/nachos/security/NachosSecurityManager$2.class
  131. BIN  bin/nachos/security/NachosSecurityManager$PrivilegeProvider.class
  132. BIN  bin/nachos/security/NachosSecurityManager.class
  133. BIN  bin/nachos/security/Privilege$InterruptPrivilege.class
  134. BIN  bin/nachos/security/Privilege$MachinePrivilege.class
  135. BIN  bin/nachos/security/Privilege$ProcessorPrivilege.class
  136. BIN  bin/nachos/security/Privilege$TCBPrivilege.class
  137. BIN  bin/nachos/security/Privilege.class
  138. +4 −0 bin/nachos/security/package.html
  139. BIN  bin/nachos/threads/Alarm$1.class
  140. BIN  bin/nachos/threads/Alarm$Waiter.class
  141. BIN  bin/nachos/threads/Alarm.class
  142. BIN  bin/nachos/threads/Boat$1.class
  143. BIN  bin/nachos/threads/Boat$2.class
  144. BIN  bin/nachos/threads/Boat.class
  145. BIN  bin/nachos/threads/Communicator$ThreadInfo.class
  146. BIN  bin/nachos/threads/Communicator.class
  147. BIN  bin/nachos/threads/Condition.class
  148. BIN  bin/nachos/threads/Condition2.class
  149. BIN  bin/nachos/threads/KThread$1.class
  150. BIN  bin/nachos/threads/KThread$2.class
  151. BIN  bin/nachos/threads/KThread$PingTest.class
  152. BIN  bin/nachos/threads/KThread.class
  153. BIN  bin/nachos/threads/Lock.class
  154. BIN  bin/nachos/threads/LotteryScheduler$LotteryQueue.class
  155. BIN  bin/nachos/threads/LotteryScheduler$LotteryThreadState.class
  156. BIN  bin/nachos/threads/LotteryScheduler.class
  157. BIN  bin/nachos/threads/PriorityScheduler$PriorityQueue.class
  158. BIN  bin/nachos/threads/PriorityScheduler$ThreadState.class
  159. BIN  bin/nachos/threads/PriorityScheduler.class
  160. BIN  bin/nachos/threads/ReadWriteLock.class
  161. BIN  bin/nachos/threads/RoundRobinScheduler$FifoQueue.class
  162. BIN  bin/nachos/threads/RoundRobinScheduler.class
  163. BIN  bin/nachos/threads/Scheduler.class
  164. BIN  bin/nachos/threads/Semaphore$PingTest.class
  165. BIN  bin/nachos/threads/Semaphore.class
  166. BIN  bin/nachos/threads/SynchList$PingTest.class
  167. BIN  bin/nachos/threads/SynchList.class
  168. BIN  bin/nachos/threads/ThreadQueue.class
  169. BIN  bin/nachos/threads/ThreadedKernel.class
  170. +3 −0  bin/nachos/threads/package.html
  171. BIN  bin/nachos/userprog/SynchConsole$1.class
  172. BIN  bin/nachos/userprog/SynchConsole$2.class
  173. BIN  bin/nachos/userprog/SynchConsole$File.class
  174. BIN  bin/nachos/userprog/SynchConsole.class
  175. BIN  bin/nachos/userprog/UThread$1.class
  176. BIN  bin/nachos/userprog/UThread.class
  177. BIN  bin/nachos/userprog/UserKernel$1.class
  178. BIN  bin/nachos/userprog/UserKernel.class
  179. BIN  bin/nachos/userprog/UserProcess$DescriptorManager.class
  180. BIN  bin/nachos/userprog/UserProcess.class
  181. +4 −0 bin/nachos/userprog/package.html
  182. BIN  bin/nachos/vm/ClockPagingManager.class
  183. BIN  bin/nachos/vm/LazyLoader$CodePage.class
  184. BIN  bin/nachos/vm/LazyLoader.class
  185. BIN  bin/nachos/vm/MemoryManager.class
  186. BIN  bin/nachos/vm/Page.class
  187. BIN  bin/nachos/vm/PageItem.class
  188. BIN  bin/nachos/vm/SecondChanceMemoryManager.class
  189. BIN  bin/nachos/vm/SwapFile.class
  190. BIN  bin/nachos/vm/SwapPage.class
  191. BIN  bin/nachos/vm/TLBManager.class
  192. BIN  bin/nachos/vm/VMKernel.class
  193. BIN  bin/nachos/vm/VMProcess.class
  194. +4 −0 bin/nachos/vm/package.html
  195. +7 −0 conf/proj1.conf
  196. +12 −0 conf/proj2.conf
  197. +12 −0 conf/proj3.conf
  198. +13 −0 conf/proj4.conf
  199. +1 −0  doc/USAGE
  200. +23 −0 doc/readme.txt
  201. BIN  nachos-disk.dat
  202. +14 −0 nachos.conf
  203. +14 −0 proj4.conf
  204. +312 −0 src/nachos/ag/AutoGrader.java
  205. +83 −0 src/nachos/ag/BasicTestGrader.java
  206. +182 −0 src/nachos/ag/BoatGrader.java
  207. +256 −0 src/nachos/ag/CoffGrader.java
  208. +107 −0 src/nachos/ag/DonationGrader.java
  209. +37 −0 src/nachos/ag/FilesysGrader.java
  210. +44 −0 src/nachos/ag/JoinGrader.java
  211. +82 −0 src/nachos/ag/LotteryGraderS.java
  212. +121 −0 src/nachos/ag/PriorityGrader.java
  213. +455 −0 src/nachos/ag/PriorityGraderS1.java
  214. +102 −0 src/nachos/ag/ThreadGrader1.java
  215. +139 −0 src/nachos/ag/ThreadGrader2.java
  216. +77 −0 src/nachos/ag/ThreadGrader3.java
  217. +74 −0 src/nachos/ag/ThreadGrader4.java
  218. +71 −0 src/nachos/ag/ThreadGrader5.java
  219. +79 −0 src/nachos/ag/ThreadGrader6.java
  220. +71 −0 src/nachos/ag/ThreadGrader7.java
  221. +78 −0 src/nachos/ag/ThreadGrader8.java
  222. +77 −0 src/nachos/ag/UserGrader1.java
  223. +76 −0 src/nachos/ag/VMGrader.java
  224. +3 −0  src/nachos/ag/package.html
  225. +188 −0 src/nachos/filesys/BitMap.java
  226. +168 −0 src/nachos/filesys/File.java
  227. +46 −0 src/nachos/filesys/FileStat.java
  228. +35 −0 src/nachos/filesys/FilesysKernel.java
  229. +236 −0 src/nachos/filesys/FilesysProcess.java
  230. +178 −0 src/nachos/filesys/Folder.java
  231. +20 −0 src/nachos/filesys/FolderEntry.java
  232. +102 −0 src/nachos/filesys/FreeList.java
  233. +196 −0 src/nachos/filesys/INode.java
  234. +438 −0 src/nachos/filesys/RealFileSystem.java
  235. +50 −0 src/nachos/machine/ArrayFile.java
  236. +169 −0 src/nachos/machine/Coff.java
  237. +255 −0 src/nachos/machine/CoffSection.java
  238. +320 −0 src/nachos/machine/Config.java
  239. +451 −0 src/nachos/machine/Disk.java
  240. +37 −0 src/nachos/machine/FileSystem.java
  241. +250 −0 src/nachos/machine/GraphicalConsole.java
  242. +274 −0 src/nachos/machine/Interrupt.java
  243. +46 −0 src/nachos/machine/Kernel.java
  244. +782 −0 src/nachos/machine/Lib.java
  245. +509 −0 src/nachos/machine/Machine.java
  246. +17 −0 src/nachos/machine/MalformedPacketException.java
  247. +381 −0 src/nachos/machine/NetworkLink.java
  248. +165 −0 src/nachos/machine/OpenFile.java
  249. +67 −0 src/nachos/machine/OpenFileWithPosition.java
  250. +129 −0 src/nachos/machine/Packet.java
  251. +1,279 −0 src/nachos/machine/Processor.java
  252. +49 −0 src/nachos/machine/SerialConsole.java
  253. +186 −0 src/nachos/machine/StandardConsole.java
  254. +98 −0 src/nachos/machine/Stats.java
  255. +272 −0 src/nachos/machine/StubFileSystem.java
  256. +140 −0 src/nachos/machine/SynchDisk.java
  257. +458 −0 src/nachos/machine/TCB.java
  258. +103 −0 src/nachos/machine/Timer.java
  259. +89 −0 src/nachos/machine/TranslationEntry.java
  260. +3 −0  src/nachos/machine/package.html
  261. +121 −0 src/nachos/network/MailMessage.java
  262. +120 −0 src/nachos/network/NetKernel.java
  263. +55 −0 src/nachos/network/NetProcess.java
  264. +140 −0 src/nachos/network/PostOffice.java
  265. +3 −0  src/nachos/network/package.html
  266. +380 −0 src/nachos/security/NachosSecurityManager.java
  267. +211 −0 src/nachos/security/Privilege.java
  268. +4 −0 src/nachos/security/package.html
  269. +92 −0 src/nachos/threads/Alarm.java
  270. +172 −0 src/nachos/threads/Boat.java
  271. +108 −0 src/nachos/threads/Communicator.java
  272. +115 −0 src/nachos/threads/Condition.java
  273. +81 −0 src/nachos/threads/Condition2.java
  274. +489 −0 src/nachos/threads/KThread.java
  275. +78 −0 src/nachos/threads/Lock.java
  276. +192 −0 src/nachos/threads/LotteryScheduler.java
  277. +346 −0 src/nachos/threads/PriorityScheduler.java
  278. +127 −0 src/nachos/threads/ReadWriteLock.java
  279. +84 −0 src/nachos/threads/RoundRobinScheduler.java
  280. +160 −0 src/nachos/threads/Scheduler.java
  281. +105 −0 src/nachos/threads/Semaphore.java
  282. +88 −0 src/nachos/threads/SynchList.java
  283. +99 −0 src/nachos/threads/ThreadQueue.java
  284. +77 −0 src/nachos/threads/ThreadedKernel.java
  285. +3 −0  src/nachos/threads/package.html
  286. +165 −0 src/nachos/userprog/SynchConsole.java
  287. +74 −0 src/nachos/userprog/UThread.java
  288. +151 −0 src/nachos/userprog/UserKernel.java
  289. +892 −0 src/nachos/userprog/UserProcess.java
  290. +4 −0 src/nachos/userprog/package.html
  291. +62 −0 src/nachos/vm/ClockPagingManager.java
  292. +89 −0 src/nachos/vm/LazyLoader.java
  293. +37 −0 src/nachos/vm/MemoryManager.java
  294. +13 −0 src/nachos/vm/Page.java
  295. +23 −0 src/nachos/vm/PageItem.java
  296. +59 −0 src/nachos/vm/SecondChanceMemoryManager.java
  297. +72 −0 src/nachos/vm/SwapFile.java
  298. +13 −0 src/nachos/vm/SwapPage.java
  299. +65 −0 src/nachos/vm/TLBManager.java
  300. +82 −0 src/nachos/vm/VMKernel.java
Sorry, we could not display the entire diff because too many files (305) changed.
View
6 .classpath
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
17 .project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>nachos</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
12 .settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Sat Oct 02 22:34:02 CST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
View
BIN  bin/nachos/ag/AutoGrader.class
Binary file not shown
View
BIN  bin/nachos/ag/BasicTestGrader$ThreadHandler.class
Binary file not shown
View
BIN  bin/nachos/ag/BasicTestGrader.class
Binary file not shown
View
BIN  bin/nachos/ag/BoatGrader.class
Binary file not shown
View
BIN  bin/nachos/ag/CoffGrader$1.class
Binary file not shown
View
BIN  bin/nachos/ag/CoffGrader$2.class
Binary file not shown
View
BIN  bin/nachos/ag/CoffGrader$EmbededConsole.class
Binary file not shown
View
BIN  bin/nachos/ag/CoffGrader.class
Binary file not shown
View
BIN  bin/nachos/ag/DonationGrader$1.class
Binary file not shown
View
BIN  bin/nachos/ag/DonationGrader$2.class
Binary file not shown
View
BIN  bin/nachos/ag/DonationGrader$3.class
Binary file not shown
View
BIN  bin/nachos/ag/DonationGrader$4.class
Binary file not shown
View
BIN  bin/nachos/ag/DonationGrader.class
Binary file not shown
View
BIN  bin/nachos/ag/FilesysGrader.class
Binary file not shown
View
BIN  bin/nachos/ag/JoinGrader$1.class
Binary file not shown
View
BIN  bin/nachos/ag/JoinGrader.class
Binary file not shown
View
BIN  bin/nachos/ag/LotteryGraderS$LotteryTreeNode.class
Binary file not shown
View
BIN  bin/nachos/ag/LotteryGraderS.class
Binary file not shown
View
BIN  bin/nachos/ag/PriorityGrader$1.class
Binary file not shown
View
BIN  bin/nachos/ag/PriorityGrader.class
Binary file not shown
View
BIN  bin/nachos/ag/PriorityGraderS1$1.class
Binary file not shown
View
BIN  bin/nachos/ag/PriorityGraderS1$TreeNode.class
Binary file not shown
View
BIN  bin/nachos/ag/PriorityGraderS1.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader1$Printer.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader1.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader2$a.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader2$b.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader2.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader3$PingTest.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader3.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader4$PingTest.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader4.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader5$a.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader5.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader6$a.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader6.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader7$a.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader7.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader8$a.class
Binary file not shown
View
BIN  bin/nachos/ag/ThreadGrader8.class
Binary file not shown
View
BIN  bin/nachos/ag/UserGrader1$1.class
Binary file not shown
View
BIN  bin/nachos/ag/UserGrader1$2.class
Binary file not shown
View
BIN  bin/nachos/ag/UserGrader1.class
Binary file not shown
View
BIN  bin/nachos/ag/VMGrader$1.class
Binary file not shown
View
BIN  bin/nachos/ag/VMGrader.class
Binary file not shown
View
3  bin/nachos/ag/package.html
@@ -0,0 +1,3 @@
+<body>
+Provides classes that can be used to automatically grade Nachos projects.
+</body>
View
BIN  bin/nachos/filesys/BitMap.class
Binary file not shown
View
BIN  bin/nachos/filesys/File.class
Binary file not shown
View
BIN  bin/nachos/filesys/FileStat.class
Binary file not shown
View
BIN  bin/nachos/filesys/FilesysKernel.class
Binary file not shown
View
BIN  bin/nachos/filesys/FilesysProcess$DescriptorManager.class
Binary file not shown
View
BIN  bin/nachos/filesys/FilesysProcess.class
Binary file not shown
View
BIN  bin/nachos/filesys/Folder.class
Binary file not shown
View
BIN  bin/nachos/filesys/FolderEntry.class
Binary file not shown
View
BIN  bin/nachos/filesys/FreeList.class
Binary file not shown
View
BIN  bin/nachos/filesys/INode.class
Binary file not shown
View
BIN  bin/nachos/filesys/RealFileSystem$PathResult.class
Binary file not shown
View
BIN  bin/nachos/filesys/RealFileSystem.class
Binary file not shown
View
BIN  bin/nachos/machine/ArrayFile.class
Binary file not shown
View
BIN  bin/nachos/machine/AssertionFailureError.class
Binary file not shown
View
BIN  bin/nachos/machine/Coff.class
Binary file not shown
View
BIN  bin/nachos/machine/CoffSection.class
Binary file not shown
View
BIN  bin/nachos/machine/Config.class
Binary file not shown
View
BIN  bin/nachos/machine/Disk$1.class
Binary file not shown
View
BIN  bin/nachos/machine/Disk.class
Binary file not shown
View
BIN  bin/nachos/machine/DiskIntHandler.class
Binary file not shown
View
BIN  bin/nachos/machine/FileSystem.class
Binary file not shown
View
BIN  bin/nachos/machine/GraphicalConsole$1.class
Binary file not shown
View
BIN  bin/nachos/machine/GraphicalConsole$2.class
Binary file not shown
View
BIN  bin/nachos/machine/GraphicalConsole$3.class
Binary file not shown
View
BIN  bin/nachos/machine/GraphicalConsole$4.class
Binary file not shown
View
BIN  bin/nachos/machine/GraphicalConsole$5.class
Binary file not shown
View
BIN  bin/nachos/machine/GraphicalConsole$6.class
Binary file not shown
View
BIN  bin/nachos/machine/GraphicalConsole.class
Binary file not shown
View
BIN  bin/nachos/machine/Interrupt$InterruptPrivilege.class
Binary file not shown
View
BIN  bin/nachos/machine/Interrupt$PendingInterrupt.class
Binary file not shown
View
BIN  bin/nachos/machine/Interrupt.class
Binary file not shown
View
BIN  bin/nachos/machine/Kernel.class
Binary file not shown
View
BIN  bin/nachos/machine/Lib.class
Binary file not shown
View
BIN  bin/nachos/machine/Machine$1.class
Binary file not shown
View
BIN  bin/nachos/machine/Machine$MachinePrivilege.class
Binary file not shown
View
BIN  bin/nachos/machine/Machine.class
Binary file not shown
View
BIN  bin/nachos/machine/MalformedPacketException.class
Binary file not shown
View
BIN  bin/nachos/machine/NetworkLink$1.class
Binary file not shown
View
BIN  bin/nachos/machine/NetworkLink$2.class
Binary file not shown
View
BIN  bin/nachos/machine/NetworkLink$3.class
Binary file not shown
View
BIN  bin/nachos/machine/NetworkLink$4.class
Binary file not shown
View
BIN  bin/nachos/machine/NetworkLink.class
Binary file not shown
View
BIN  bin/nachos/machine/OpenFile.class
Binary file not shown
View
BIN  bin/nachos/machine/OpenFileWithPosition.class
Binary file not shown
View
BIN  bin/nachos/machine/Packet.class
Binary file not shown
View
BIN  bin/nachos/machine/Processor$Instruction.class
Binary file not shown
View
BIN  bin/nachos/machine/Processor$Mips.class
Binary file not shown
View
BIN  bin/nachos/machine/Processor$MipsException.class
Binary file not shown
View
BIN  bin/nachos/machine/Processor$ProcessorPrivilege.class
Binary file not shown
View
BIN  bin/nachos/machine/Processor.class
Binary file not shown
View
BIN  bin/nachos/machine/SerialConsole.class
Binary file not shown
View
BIN  bin/nachos/machine/StandardConsole$1.class
Binary file not shown
View
BIN  bin/nachos/machine/StandardConsole$2.class
Binary file not shown
View
BIN  bin/nachos/machine/StandardConsole.class
Binary file not shown
View
BIN  bin/nachos/machine/Stats.class
Binary file not shown
View
BIN  bin/nachos/machine/StubFileSystem$FileRemover.class
Binary file not shown
View
BIN  bin/nachos/machine/StubFileSystem$StubOpenFile$1.class
Binary file not shown
View
BIN  bin/nachos/machine/StubFileSystem$StubOpenFile.class
Binary file not shown
View
BIN  bin/nachos/machine/StubFileSystem.class
Binary file not shown
View
BIN  bin/nachos/machine/SynchDisk.class
Binary file not shown
View
BIN  bin/nachos/machine/SynchDiskIntHandler.class
Binary file not shown
View
BIN  bin/nachos/machine/TCB$1.class
Binary file not shown
View
BIN  bin/nachos/machine/TCB$2.class
Binary file not shown
View
BIN  bin/nachos/machine/TCB$TCBPrivilege.class
Binary file not shown
View
BIN  bin/nachos/machine/TCB.class
Binary file not shown
View
BIN  bin/nachos/machine/Timer$1.class
Binary file not shown
View
BIN  bin/nachos/machine/Timer$2.class
Binary file not shown
View
BIN  bin/nachos/machine/Timer.class
Binary file not shown
View
BIN  bin/nachos/machine/TranslationEntry.class
Binary file not shown
View
3  bin/nachos/machine/package.html
@@ -0,0 +1,3 @@
+<body>
+Provides classes that implement the Nachos simulated machine.
+</body>
View
BIN  bin/nachos/network/MailMessage.class
Binary file not shown
View
BIN  bin/nachos/network/NetKernel$1.class
Binary file not shown
View
BIN  bin/nachos/network/NetKernel.class
Binary file not shown
View
BIN  bin/nachos/network/NetProcess.class
Binary file not shown
View
BIN  bin/nachos/network/PostOffice$1.class
Binary file not shown
View
BIN  bin/nachos/network/PostOffice$2.class
Binary file not shown
View
BIN  bin/nachos/network/PostOffice$3.class
Binary file not shown
View
BIN  bin/nachos/network/PostOffice.class
Binary file not shown
View
3  bin/nachos/network/package.html
@@ -0,0 +1,3 @@
+<body>
+Provides classes that allow Nachos processes to communicate over the network.
+</body>
View
BIN  bin/nachos/security/NachosSecurityManager$1.class
Binary file not shown
View
BIN  bin/nachos/security/NachosSecurityManager$2.class
Binary file not shown
View
BIN  bin/nachos/security/NachosSecurityManager$PrivilegeProvider.class
Binary file not shown
View
BIN  bin/nachos/security/NachosSecurityManager.class
Binary file not shown
View
BIN  bin/nachos/security/Privilege$InterruptPrivilege.class
Binary file not shown
View
BIN  bin/nachos/security/Privilege$MachinePrivilege.class
Binary file not shown
View
BIN  bin/nachos/security/Privilege$ProcessorPrivilege.class
Binary file not shown
View
BIN  bin/nachos/security/Privilege$TCBPrivilege.class
Binary file not shown
View
BIN  bin/nachos/security/Privilege.class
Binary file not shown
View
4 bin/nachos/security/package.html
@@ -0,0 +1,4 @@
+<body>
+Provides classes that can be used to protect the host system from malicious
+Nachos kernels.
+</body>
View
BIN  bin/nachos/threads/Alarm$1.class
Binary file not shown
View
BIN  bin/nachos/threads/Alarm$Waiter.class
Binary file not shown
View
BIN  bin/nachos/threads/Alarm.class
Binary file not shown
View
BIN  bin/nachos/threads/Boat$1.class
Binary file not shown
View
BIN  bin/nachos/threads/Boat$2.class
Binary file not shown
View
BIN  bin/nachos/threads/Boat.class
Binary file not shown
View
BIN  bin/nachos/threads/Communicator$ThreadInfo.class
Binary file not shown
View
BIN  bin/nachos/threads/Communicator.class
Binary file not shown
View
BIN  bin/nachos/threads/Condition.class
Binary file not shown
View
BIN  bin/nachos/threads/Condition2.class
Binary file not shown
View
BIN  bin/nachos/threads/KThread$1.class
Binary file not shown
View
BIN  bin/nachos/threads/KThread$2.class
Binary file not shown
View
BIN  bin/nachos/threads/KThread$PingTest.class
Binary file not shown
View
BIN  bin/nachos/threads/KThread.class
Binary file not shown
View
BIN  bin/nachos/threads/Lock.class
Binary file not shown
View
BIN  bin/nachos/threads/LotteryScheduler$LotteryQueue.class
Binary file not shown
View
BIN  bin/nachos/threads/LotteryScheduler$LotteryThreadState.class
Binary file not shown
View
BIN  bin/nachos/threads/LotteryScheduler.class
Binary file not shown
View
BIN  bin/nachos/threads/PriorityScheduler$PriorityQueue.class
Binary file not shown
View
BIN  bin/nachos/threads/PriorityScheduler$ThreadState.class
Binary file not shown
View
BIN  bin/nachos/threads/PriorityScheduler.class
Binary file not shown
View
BIN  bin/nachos/threads/ReadWriteLock.class
Binary file not shown
View
BIN  bin/nachos/threads/RoundRobinScheduler$FifoQueue.class
Binary file not shown
View
BIN  bin/nachos/threads/RoundRobinScheduler.class
Binary file not shown
View
BIN  bin/nachos/threads/Scheduler.class
Binary file not shown
View
BIN  bin/nachos/threads/Semaphore$PingTest.class
Binary file not shown
View
BIN  bin/nachos/threads/Semaphore.class
Binary file not shown
View
BIN  bin/nachos/threads/SynchList$PingTest.class
Binary file not shown
View
BIN  bin/nachos/threads/SynchList.class
Binary file not shown
View
BIN  bin/nachos/threads/ThreadQueue.class
Binary file not shown
View
BIN  bin/nachos/threads/ThreadedKernel.class
Binary file not shown
View
3  bin/nachos/threads/package.html
@@ -0,0 +1,3 @@
+<body>
+Provides classes that support a multithreaded kernel.
+</body>
View
BIN  bin/nachos/userprog/SynchConsole$1.class
Binary file not shown
View
BIN  bin/nachos/userprog/SynchConsole$2.class
Binary file not shown
View
BIN  bin/nachos/userprog/SynchConsole$File.class
Binary file not shown
View
BIN  bin/nachos/userprog/SynchConsole.class
Binary file not shown
View
BIN  bin/nachos/userprog/UThread$1.class
Binary file not shown
View
BIN  bin/nachos/userprog/UThread.class
Binary file not shown
View
BIN  bin/nachos/userprog/UserKernel$1.class
Binary file not shown
View
BIN  bin/nachos/userprog/UserKernel.class
Binary file not shown
View
BIN  bin/nachos/userprog/UserProcess$DescriptorManager.class
Binary file not shown
View
BIN  bin/nachos/userprog/UserProcess.class
Binary file not shown
View
4 bin/nachos/userprog/package.html
@@ -0,0 +1,4 @@
+<body>
+Provides classes that allow Nachos to load and execute single-threaded user
+programs in separate address spaces.
+</body>
View
BIN  bin/nachos/vm/ClockPagingManager.class
Binary file not shown
View
BIN  bin/nachos/vm/LazyLoader$CodePage.class
Binary file not shown
View
BIN  bin/nachos/vm/LazyLoader.class
Binary file not shown
View
BIN  bin/nachos/vm/MemoryManager.class
Binary file not shown
View
BIN  bin/nachos/vm/Page.class
Binary file not shown
View
BIN  bin/nachos/vm/PageItem.class
Binary file not shown
View
BIN  bin/nachos/vm/SecondChanceMemoryManager.class
Binary file not shown
View
BIN  bin/nachos/vm/SwapFile.class
Binary file not shown
View
BIN  bin/nachos/vm/SwapPage.class
Binary file not shown
View
BIN  bin/nachos/vm/TLBManager.class
Binary file not shown
View
BIN  bin/nachos/vm/VMKernel.class
Binary file not shown
View
BIN  bin/nachos/vm/VMProcess.class
Binary file not shown
View
4 bin/nachos/vm/package.html
@@ -0,0 +1,4 @@
+<body>
+Provides classes that allow Nachos processes to be demand paged, and to use a
+hardware TLB for address translation.
+</body>
View
7 conf/proj1.conf
@@ -0,0 +1,7 @@
+Machine.stubFileSystem = false
+Machine.processor = false
+Machine.console = false
+Machine.networkLink = false
+NachosSecurityManager.fullySecure = false
+ThreadedKernel.scheduler = nachos.threads.PriorityScheduler
+Kernel.kernel = nachos.threads.ThreadedKernel
View
12 conf/proj2.conf
@@ -0,0 +1,12 @@
+Machine.stubFileSystem = true
+Machine.processor = true
+Machine.console = true
+Machine.graphicalConsole = false
+Machine.networkLink = false
+Processor.usingTLB = false
+Processor.numPhysPages = 64
+NachosSecurityManager.fullySecure = false
+ThreadedKernel.scheduler = nachos.threads.RoundRobinScheduler #nachos.threads.LotteryScheduler
+Kernel.shellProgram = halt.coff #sh.coff
+Kernel.processClassName = nachos.userprog.UserProcess
+Kernel.kernel = nachos.userprog.UserKernel
View
12 conf/proj3.conf
@@ -0,0 +1,12 @@
+Machine.stubFileSystem = true
+Machine.processor = true
+Machine.console = true
+Machine.graphicalConsole = false
+Machine.networkLink = false
+Processor.usingTLB = true
+Processor.numPhysPages = 16
+NachosSecurityManager.fullySecure = false
+ThreadedKernel.scheduler = nachos.threads.LotteryScheduler
+Kernel.shellProgram = sh.coff
+Kernel.processClassName = nachos.vm.VMProcess
+Kernel.kernel = nachos.vm.VMKernel
View
13 conf/proj4.conf
@@ -0,0 +1,13 @@
+Machine.stubFileSystem = true
+Machine.processor = true
+Machine.console = true
+Machine.graphicalConsole = false
+Machine.networkLink = true
+Processor.usingTLB = true
+Processor.numPhysPages = 16
+NetworkLink.reliability = 1.0 # use 0.9 when you're ready
+NachosSecurityManager.fullySecure = false
+ThreadedKernel.scheduler = nachos.threads.RoundRobinScheduler
+Kernel.shellProgram = sh.coff
+Kernel.processClassName = nachos.network.NetProcess
+Kernel.kernel = nachos.network.NetKernel
View
1  doc/USAGE
@@ -0,0 +1 @@
+Put your project documents and generated javadoc here.
View
23 doc/readme.txt
@@ -0,0 +1,23 @@
+nachos readme - ���� 5080309105
+1����ɶ�
+ �����4��phase���������ݣ�
+ Phase 1: Build a thread system
+ Phase 2: Multiprogramming
+ Phase 3: Caching and Virtual Memory
+ Phase 5: File System
+2��filesys������
+ a. support absolute and relative path
+ b. support "." and ".."
+ c. support deletion of the current folder
+ d. support exclusive write and concurrent read
+ ģ��Java�е�ReadWriteLockʵ�ֵ�
+ e. ����Ŀ¼ֻ��һ��
+ f. ��ǰ����Ŀ¼��ɾ�������һ��Ŀ¼
+ g. ����symlink��Ŀ����м�飬symlinkָ���ļ�������Ч��
+3��bonus
+ ��2.a, 2.b, 2.c, 2.d
+4������
+ ϣ���ܹ��ڿ�ʼдÿ��phase��ʱ����ܵõ����Լ������������������ڷ��ִ���
+ ϣ����Լ�����Ϲ淶������ܹ�����һ��ط���ʶ�����
+ deadlineӦ����ǰһ�ܡ�
+
View
BIN  nachos-disk.dat
Binary file not shown
View
14 nachos.conf
@@ -0,0 +1,14 @@
+Machine.stubFileSystem = true
+Machine.processor = true
+Machine.console = true
+Machine.graphicalConsole = false
+Machine.networkLink = false
+Processor.usingTLB = true
+Processor.numPhysPages = 16
+NachosSecurityManager.fullySecure = false
+ThreadedKernel.scheduler = nachos.threads.PriorityScheduler
+Kernel.shellProgram = sh.coff
+Kernel.processClassName = nachos.filesys.FilesysProcess
+Kernel.kernel = nachos.filesys.FilesysKernel
+FilesysKernel.format = true
+Machine.realFileSystem = true
View
14 proj4.conf
@@ -0,0 +1,14 @@
+Machine.stubFileSystem = true
+Machine.processor = true
+Machine.console = true
+Machine.graphicalConsole = false
+Machine.networkLink = false
+Processor.usingTLB = true
+Processor.numPhysPages = 16
+NachosSecurityManager.fullySecure = false
+ThreadedKernel.scheduler = nachos.threads.PriorityScheduler
+Kernel.shellProgram = sh.coff
+Kernel.processClassName = nachos.filesys.FilesysProcess
+Kernel.kernel = nachos.filesys.FilesysKernel
+FilesysKernel.format = false
+Machine.realFileSystem = true
View
312 src/nachos/ag/AutoGrader.java
@@ -0,0 +1,312 @@
+// PART OF THE MACHINE SIMULATION. DO NOT CHANGE.
+
+package nachos.ag;
+
+import nachos.machine.*;
+import nachos.security.*;
+import nachos.threads.*;
+import java.util.Hashtable;
+import java.util.StringTokenizer;
+
+/**
+ * The default autograder. Loads the kernel, and then tests it using
+ * <tt>Kernel.selfTest()</tt>.
+ */
+public class AutoGrader
+{
+ /**
+ * Allocate a new autograder.
+ */
+ public AutoGrader ()
+ {
+ }
+
+ /**
+ * Start this autograder. Extract the <tt>-#</tt> arguments, call
+ * <tt>init()</tt>, load and initialize the kernel, and call <tt>run()</tt>.
+ *
+ * @param privilege
+ * encapsulates privileged access to the Nachos machine.
+ */
+ public void start (Privilege privilege)
+ {
+ Lib.assertTrue(this.privilege == null, "start() called multiple times");
+ this.privilege = privilege;
+
+ String[] args = Machine.getCommandLineArguments();
+
+ extractArguments(args);
+
+ System.out.print(" grader");
+
+ init();
+
+ System.out.print("\n");
+
+ kernel = (Kernel)Lib.constructObject(Config.getString("Kernel.kernel"));
+ kernel.initialize(args);
+
+ run();
+ }
+
+ private void extractArguments (String[] args)
+ {
+ String testArgsString = Config.getString("AutoGrader.testArgs");
+ if (testArgsString == null)
+ {
+ testArgsString = "";
+ }
+
+ for (int i = 0; i < args.length;)
+ {
+ String arg = args[i++];
+ if (arg.length() > 0 && arg.charAt(0) == '-')
+ {
+ if (arg.equals("-#"))
+ {
+ Lib.assertTrue(i < args.length, "-# switch missing argument");
+ testArgsString = args[i++];
+ }
+ }
+ }
+
+ StringTokenizer st = new StringTokenizer(testArgsString, ",\n\t\f\r");
+
+ while (st.hasMoreTokens())
+ {
+ StringTokenizer pair = new StringTokenizer(st.nextToken(), "=");
+
+ Lib.assertTrue(pair.hasMoreTokens(), "test argument missing key");
+ String key = pair.nextToken();
+
+ Lib.assertTrue(pair.hasMoreTokens(), "test argument missing value");
+ String value = pair.nextToken();
+
+ testArgs.put(key, value);
+ }
+ }
+
+ String getStringArgument (String key)
+ {
+ String value = (String)testArgs.get(key);
+ Lib.assertTrue(value != null, "getStringArgument(" + key
+ + ") failed to find key");
+ return value;
+ }
+
+ int getIntegerArgument (String key)
+ {
+ try
+ {
+ return Integer.parseInt(getStringArgument(key));
+ }
+ catch (NumberFormatException e)
+ {
+ Lib.assertNotReached("getIntegerArgument(" + key + ") failed: "
+ + "value is not an integer");
+ return 0;
+ }
+ }
+
+ boolean getBooleanArgument (String key)
+ {
+ String value = getStringArgument(key);
+
+ if (value.equals("1") || value.toLowerCase().equals("true"))
+ {
+ return true;
+ }
+ else if (value.equals("0") || value.toLowerCase().equals("false"))
+ {
+ return false;
+ }
+ else
+ {
+ Lib.assertNotReached("getBooleanArgument(" + key + ") failed: "
+ + "value is not a boolean");
+ return false;
+ }
+ }
+
+ long getTime ()
+ {
+ return privilege.stats.totalTicks;
+ }
+
+ void targetLevel (int targetLevel)
+ {
+ this.targetLevel = targetLevel;
+ }
+
+ void level (int level)
+ {
+ this.level++;
+ Lib.assertTrue(level == this.level,
+ "level() advanced more than one step: test jumped ahead");
+
+ if (level == targetLevel)
+ done();
+ }
+
+ private int level = 0, targetLevel = 0;
+
+ void done ()
+ {
+ System.out.print("\nsuccess\n");
+ privilege.exit(162);
+ }
+
+ private Hashtable<String, String> testArgs = new Hashtable<String, String>();
+
+ void init ()
+ {
+ }
+
+ void run ()
+ {
+ kernel.selfTest();
+ kernel.run();
+ kernel.terminate();
+ }
+
+ Privilege privilege = null;
+ Kernel kernel;
+
+ /**
+ * Notify the autograder that the specified thread is the idle thread.
+ * <tt>KThread.createIdleThread()</tt> <i>must</i> call this method before
+ * forking the idle thread.
+ *
+ * @param idleThread
+ * the idle thread.
+ */
+ public void setIdleThread (KThread idleThread)
+ {
+ }
+
+ /**
+ * Notify the autograder that the specified thread has moved to the ready
+ * state. <tt>KThread.ready()</tt> <i>must</i> call this method before
+ * returning.
+ *
+ * @param thread
+ * the thread that has been added to the ready set.
+ */
+ public void readyThread (KThread thread)
+ {
+ }
+
+ /**
+ * Notify the autograder that the specified thread is now running.
+ * <tt>KThread.restoreState()</tt> <i>must</i> call this method before
+ * returning.
+ *
+ * @param thread
+ * the thread that is now running.
+ */
+ public void runningThread (KThread thread)
+ {
+ privilege.tcb.associateThread(thread);
+ currentThread = thread;
+ }
+
+ /**
+ * Notify the autograder that the current thread has finished.
+ * <tt>KThread.finish()</tt> <i>must</i> call this method before putting the
+ * thread to sleep and scheduling its TCB to be destroyed.
+ */
+ public void finishingCurrentThread ()
+ {
+ privilege.tcb.authorizeDestroy(currentThread);
+ }
+
+ /**
+ * Notify the autograder that a timer interrupt occurred and was handled by
+ * software if a timer interrupt handler was installed. Called by the hardware
+ * timer.
+ *
+ * @param privilege
+ * proves the authenticity of this call.
+ * @param time
+ * the actual time at which the timer interrupt was issued.
+ */
+ public void timerInterrupt (Privilege privilege, long time)
+ {
+ Lib.assertTrue(privilege == this.privilege, "security violation");
+ }
+
+ /**
+ * Notify the autograder that a user program executed a syscall instruction.
+ *
+ * @param privilege
+ * proves the authenticity of this call.
+ * @return <tt>true</tt> if the kernel exception handler should be called.
+ */
+ public boolean exceptionHandler (Privilege privilege)
+ {
+ Lib.assertTrue(privilege == this.privilege, "security violation");
+ return true;
+ }
+
+ /**
+ * Notify the autograder that <tt>Processor.run()</tt> was invoked. This can
+ * be used to simulate user programs.
+ *
+ * @param privilege
+ * proves the authenticity of this call.
+ */
+ public void runProcessor (Privilege privilege)
+ {
+ Lib.assertTrue(privilege == this.privilege, "security violation");
+ }
+
+ /**
+ * Notify the autograder that a COFF loader is being constructed for the
+ * specified file. The autograder can use this to provide its own COFF loader,
+ * or return <tt>null</tt> to use the default loader.
+ *
+ * @param file
+ * the executable file being loaded.
+ * @return a loader to use in loading the file, or <tt>null</tt> to use the
+ * default.
+ */
+ public Coff createLoader (OpenFile file)
+ {
+ return null;
+ }
+
+ /**
+ * Request permission to send a packet. The autograder can use this to drop
+ * packets very selectively.
+ *
+ * @param privilege
+ * proves the authenticity of this call.
+ * @return <tt>true</tt> if the packet should be sent.
+ */
+ public boolean canSendPacket (Privilege privilege)
+ {
+ Lib.assertTrue(privilege == this.privilege, "security violation");
+ return true;
+ }
+
+ /**
+ * Request permission to receive a packet. The autograder can use this to drop
+ * packets very selectively.
+ *
+ * @param privilege
+ * proves the authenticity of this call.
+ * @return <tt>true</tt> if the packet should be delivered to the kernel.
+ */
+ public boolean canReceivePacket (Privilege privilege)
+ {
+ Lib.assertTrue(privilege == this.privilege, "security violation");
+ return true;
+ }
+
+ boolean hasArgument (String key)
+ {
+ return testArgs.get(key) != null;
+ }
+
+ private KThread currentThread;
+}
View
83 src/nachos/ag/BasicTestGrader.java
@@ -0,0 +1,83 @@
+package nachos.ag;
+
+import java.util.HashMap;
+import java.util.Map;
+import nachos.machine.Lib;
+import nachos.machine.Machine;
+import nachos.threads.KThread;
+import nachos.threads.ThreadedKernel;
+
+/**
+ * Some utilty functions for TestGrader
+ *
+ * @author Kang Zhang
+ */
+public abstract class BasicTestGrader extends AutoGrader
+{
+
+ Map<KThread, ThreadHandler> handlers = new HashMap<KThread, ThreadHandler>();
+ ThreadHandler currentHandler = null;
+
+ protected class ThreadHandler
+ {
+ KThread thread;
+ public boolean finished = false;
+
+ public ThreadHandler (KThread thread)
+ {
+ this.thread = thread;
+
+ handlers.put(thread, this);
+ }
+ }
+
+ protected ThreadHandler getThreadHandler (KThread thread)
+ {
+ ThreadHandler r = handlers.get(thread);
+
+ if (r == null)
+ r = new ThreadHandler(thread);
+ return r;
+ }
+
+ @Override
+ public void runningThread (KThread thread)
+ {
+ super.runningThread(thread);
+ ThreadHandler handler = getThreadHandler(thread);
+ currentHandler = handler;
+ }
+
+ @Override
+ public void finishingCurrentThread ()
+ {
+ super.finishingCurrentThread();
+ currentHandler.finished = true;
+ handlers.remove(currentHandler.thread);
+ }
+
+ protected ThreadHandler forkNewThread (Runnable threadContent)
+ {
+ return forkNewThread(threadContent, 1);
+ }
+
+ protected ThreadHandler forkNewThread (Runnable threadContent, int priority)
+ {
+ KThread thread = new KThread(threadContent);
+ ThreadHandler handler = getThreadHandler(thread);
+
+ thread.setName("TestThread");
+
+ boolean intStatus = Machine.interrupt().disable();
+ ThreadedKernel.scheduler.setPriority(thread, priority);
+ thread.fork();
+ Machine.interrupt().restore(intStatus);
+
+ return handler;
+ }
+
+ protected void assertTrue (boolean val, String errMsg)
+ {
+ Lib.assertTrue(val, errMsg);
+ }
+}
View
182 src/nachos/ag/BoatGrader.java
@@ -0,0 +1,182 @@
+package nachos.ag;
+
+import nachos.threads.Boat;
+import nachos.threads.KThread;
+import nachos.machine.Lib;
+
+/**
+ * Boat Grader
+ *
+ * @author crowwork
+ */
+public class BoatGrader extends BasicTestGrader {
+
+ /**
+ * BoatGrader consists of functions to be called to show that your solution
+ * is properly synchronized. This version simply prints messages to standard
+ * out, so that you can watch it. You cannot submit this file, as we will be
+ * using our own version of it during grading.
+ *
+ * Note that this file includes all possible variants of how someone can get
+ * from one island to another. Inclusion in this class does not imply that
+ * any of the indicated actions are a good idea or even allowed.
+ */
+ void run() {
+
+ final int adults = getIntegerArgument("adults");
+ final int children = getIntegerArgument("children");
+ Lib.assertTrue(adults >= 0 && children >= 0,
+ "number can not be negative");
+
+ this.startTest(adults, children);
+ done();
+ }
+
+ public void startTest(int adults, int children) {
+ this.adultsOahu = adults;
+ this.childrenOahu = children;
+ this.adultsMolokai = this.childrenMolokai = 0;
+
+ Boat.begin(this.adultsOahu, childrenOahu, this);
+ }
+
+ protected int adultsOahu, childrenOahu;
+ protected int adultsMolokai, childrenMolokai;
+
+ /**
+ */
+ protected void check(boolean value, String msg) {
+ Lib.assertTrue(value, msg);
+ }
+
+ /**
+ * all the passenger has been crossed
+ */
+ private void AllCrossed() {
+ check(adultsOahu == 0, "there are still " + adultsOahu
+ + " adults in Oahu");
+ check(childrenOahu == 0, "there are still " + childrenOahu
+ + " children in Oahu");
+ }
+
+ private void doYield() {
+ while (random.nextBoolean())
+ KThread.yield();
+ }
+
+ /*
+ * ChildRowToMolokai should be called when a child pilots the boat from Oahu
+ * to Molokai
+ */
+ public void ChildRowToMolokai() {
+ doYield();
+ check(childrenOahu > 0,
+ "no children in Oahu,invalid operation ChildRowToMolokai");
+ childrenOahu--;
+ childrenMolokai++;
+ // System.out.println("**Child rowing to Molokai.");
+ }
+
+ /*
+ * ChildRowToOahu should be called when a child pilots the boat from Molokai
+ * to Oahu
+ */
+ public void ChildRowToOahu() {
+ doYield();
+ check(childrenMolokai > 0,
+ "no children in Oahu , invalid operation ChildRowToOahu");
+ childrenOahu++;
+ childrenMolokai--;
+ // System.out.println("**Child rowing to Oahu.");
+ }
+
+ /*
+ * ChildRideToMolokai should be called when a child not piloting the boat
+ * disembarks on Molokai
+ */
+ public void ChildRideToMolokai() {
+ doYield();
+ check(childrenOahu > 0,
+ "no children in Molokai , invalid operation ChildRideToMolokai");
+ childrenOahu--;
+ childrenMolokai++;
+ // System.out.println("**Child arrived on Molokai as a passenger.");
+ }
+
+ /*
+ * ChildRideToOahu should be called when a child not piloting the boat
+ * disembarks on Oahu
+ */
+ public void ChildRideToOahu() {
+ doYield();
+ check(childrenMolokai > 0,
+ "no children in Molokai, invalid operation ChildRideToOahu");
+ childrenOahu++;
+ childrenMolokai--;
+ // System.out.println("**Child arrived on Oahu as a passenger.");
+ }
+
+ /*
+ * AdultRowToMolokai should be called when a adult pilots the boat from Oahu
+ * to Molokai
+ */
+ public void AdultRowToMolokai() {
+ doYield();
+ check(adultsOahu > 0,
+ " no adult in Oahu , invalid operation AdultRowToMolokai");
+ adultsOahu--;
+ adultsMolokai++;
+ // System.out.println("**Adult rowing to Molokai.");
+ }
+
+ /*
+ * AdultRowToOahu should be called when a adult pilots the boat from Molokai
+ * to Oahu
+ */
+ public void AdultRowToOahu() {
+ doYield();
+ check(adultsMolokai > 0,
+ "no adult in Molokai , invalid operation AdultRowToOahu");
+ adultsOahu++;
+ adultsMolokai--;
+ // System.out.println("**Adult rowing to Oahu.");
+ }
+
+ /*
+ * AdultRideToMolokai should be called when an adult not piloting the boat
+ * disembarks on Molokai
+ */
+ public void AdultRideToMolokai() {
+ Lib.assertNotReached("invalid operation AdultRideToMolokai");
+ // System.out.println("**Adult arrived on Molokai as a passenger.");
+ }
+
+ @Override
+ public void readyThread(KThread thread) {
+ if (thread==idleThread) {
+ ++idleReadyCount;
+ if (idleReadyCount > 1000)
+ AllCrossed();
+ }
+ else
+ idleReadyCount=0;
+ }
+
+ /*
+ * AdultRideToOahu should be called when an adult not piloting the boat
+ * disembarks on Oahu
+ */
+ public void AdultRideToOahu() {
+ Lib.assertNotReached("invalid operation AdultRideToOahu");
+ // System.out.println("**Adult arrived on Oahu as a passenger.");
+ }
+
+ @Override
+ public void setIdleThread(KThread thread){
+ thread=idleThread;
+ }
+
+ KThread idleThread;
+ java.util.Random random = new java.util.Random();
+ private static int idleReadyCount = 0;
+}
View
256 src/nachos/ag/CoffGrader.java
@@ -0,0 +1,256 @@
+package nachos.ag;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import nachos.machine.Lib;
+import nachos.machine.Machine;
+import nachos.machine.Processor;
+import nachos.machine.StandardConsole;
+import nachos.security.Privilege;
+import nachos.threads.Semaphore;
+
+/**
+ * @author Kang Zhang
+ *
+ */
+public class CoffGrader extends BasicTestGrader {
+
+ private static final int ActionDone = 0;
+
+ private static final int ActionFail = 1;
+
+ private static final int ActionP = 2;
+
+ private static final int ActionV = 3;
+
+ private static final int ActionRead = 4;
+
+ private static final int ActionStore = 5;
+
+ private static final int ActionRandom = 6;
+
+ private static final int ActionReadParameter = 7;
+
+ private static final int NumSemaphore = 20;
+
+ private static final int NumStoreValues = 20;
+
+ private static final int Num_Parameter = 4;
+
+ private static final String ParameterTag = "coffPar";
+
+ private static final String InputText = "input";
+
+ private static final String OutputText = "output";
+
+ private static final String QuietMode = "quiet";
+
+ private static final String MetricMode = "metric";
+
+ private static final String TestDirectory = "testRoot";
+
+ protected Semaphore[] semaphores;
+
+ protected int[] storeValues = new int[NumStoreValues];
+
+ protected ArrayList<Integer> params = new ArrayList<Integer>();
+
+ protected EmbededConsole embededConsole;
+
+ protected String testDirectory = null;
+ protected File testRoot = null;
+
+ protected boolean quietMode = false;
+
+ protected boolean metricMode = false;
+
+ @Override
+ protected void init() {
+ super.init();
+
+ Lib.debug('g', "Coffgrader initialize");
+
+ Arrays.fill(storeValues, 0);
+ embededConsole = new EmbededConsole(super.privilege);
+ super.privilege.machine.setConsole(embededConsole);
+
+ for( int i = 0 ; i < Num_Parameter ; i++){
+ if( hasArgument(ParameterTag+i) )
+ params.add(getIntegerArgument(ParameterTag + i));
+ else
+ break;
+ }
+
+ if( hasArgument(TestDirectory) )
+ testDirectory = getStringArgument(TestDirectory);
+
+ super.privilege.doPrivileged(new Runnable(){
+ public void run() {
+ if(testDirectory == null)
+ testRoot = new File(new File("").getAbsoluteFile().getParentFile(),"test");
+ else
+ testRoot = new File(testDirectory);
+ }
+ });
+
+ if(hasArgument(InputText))
+ embededConsole.in.append(loadFromFile(getStringArgument(InputText)));
+
+ if(hasArgument(OutputText))
+ embededConsole.out.append(loadFromFile(getStringArgument(OutputText)));
+
+ if(hasArgument(QuietMode))
+ quietMode = getBooleanArgument(QuietMode);
+
+ if(hasArgument(MetricMode))
+ metricMode = getBooleanArgument(MetricMode);
+
+
+ }
+
+ private FileReader fileReader = null;
+ /* load a file's content from your disk */
+ private String loadFromFile(final String fileName) {
+ super.privilege.doPrivileged(new Runnable(){
+ public void run() {
+ try {
+ fileReader = new FileReader(new File(testRoot,fileName));
+ } catch (FileNotFoundException e) {
+ fileReader = null;
+ }
+ }
+ });
+
+ Lib.assertTrue(fileReader != null,"Load file:"+fileName+" failed");
+
+ StringBuffer sb = new StringBuffer();
+ int b = -1;
+ try {
+ while((b = fileReader.read()) != -1){
+ sb.append((char)b);
+ }
+ fileReader.close();
+ } catch (IOException e) {
+ Lib.assertNotReached("File read/close error");
+ }
+
+ return sb.toString();
+ }
+
+ /* Hook on exception handler */
+ @Override
+ public boolean exceptionHandler(Privilege privilege) {
+ super.exceptionHandler(privilege);
+ Processor processor = Machine.processor();
+ int cause = processor.readRegister(Processor.regCause);
+
+ if (cause != Processor.exceptionSyscall
+ || processor.readRegister(Processor.regV0) != -1)
+ return true;
+
+ int result = handleTestSystemCall(processor
+ .readRegister(Processor.regA0), processor
+ .readRegister(Processor.regA1), processor
+ .readRegister(Processor.regA2), processor
+ .readRegister(Processor.regA3));
+ processor.writeRegister(Processor.regV0, result);
+ processor.advancePC();
+
+ return false;
+ }
+
+ /* Handle the test framework system call*/
+ protected int handleTestSystemCall(int type, int a0, int a1, int a2) {
+ switch (type) {
+ case ActionDone:
+ Lib.assertTrue(embededConsole.outputMatched,"Test failed, mismatched the output");
+ done();
+ Lib.assertNotReached(" Test has been ended");
+ break;
+ case ActionFail:
+ System.out.println("Test failed");
+ Machine.halt();
+ break;
+ case ActionP:
+ checkSemIndex(a0);
+ semaphores[a0].P();
+ break;
+ case ActionV:
+ checkSemIndex(a0);
+ semaphores[a0].V();
+ break;
+ case ActionRead:
+ checkStoreIndex(a0);
+ return storeValues[a0];
+ case ActionStore:
+ checkStoreIndex(a0);
+ storeValues[a0] = a1;
+ break;
+ case ActionRandom:
+ Lib.assertTrue(a0 > 0, "Invalid random range");
+ return Lib.random(a0);
+ case ActionReadParameter:
+ Lib.assertTrue(a0 >= 0 && a0 < params.size(),
+ "Invalid parameter index"+a0+" .Maybe exceed "+params.size()+" ?");
+ return params.get(a0);
+ default:
+ Lib.assertNotReached("Unknow system call. ("+type+")");
+ break;
+ }
+ return 0;
+ }
+
+ protected void checkSemIndex(int a0) {
+ Lib.assertTrue(a0 >= 0 && a0 < NumSemaphore,
+ "Invalid semaphone index:(" + a0 + ")");
+ }
+
+ protected void checkStoreIndex(int a0) {
+ Lib.assertTrue(a0 >= 0 && a0 < NumStoreValues, "Invalid store index:("
+ + a0 + ")");
+ }
+
+ @Override
+ protected void run() {
+ semaphores = new Semaphore[NumSemaphore];
+ for (int i = 0; i < NumSemaphore; i++)
+ semaphores[i] = new Semaphore(0);
+ super.run();
+ }
+
+ /* EmbededConsole, a modified console used to support standard console */
+ protected class EmbededConsole extends StandardConsole {
+ public StringBuffer in = new StringBuffer();
+
+ public StringBuffer out = new StringBuffer();
+
+ public boolean outputMatched = true;
+
+ private int inOffset = 0;
+
+ private int outOffset = 0;
+
+ public EmbededConsole(Privilege privilege) {
+ super(privilege);
+ }
+
+ protected int in() {
+ if (inOffset >= in.length())
+ return -1;
+ else
+ return in.charAt(inOffset++);
+
+ }
+
+ protected void out(int value) {
+ if( !quietMode )
+ super.out(value);
+ if(outOffset >= out.length() || out.charAt(outOffset++) != value)
+ outputMatched = false;
+
+ }
+ }
+}
View
107 src/nachos/ag/DonationGrader.java
@@ -0,0 +1,107 @@
+package nachos.ag;
+
+import nachos.machine.Machine;
+import nachos.threads.KThread;
+import nachos.threads.Lock;
+import nachos.threads.PriorityScheduler;
+import nachos.threads.ThreadedKernel;
+
+/**
+ * A grader for testing priority donation.
+ *
+ * @author Xiangru Chen
+ *
+ */
+public class DonationGrader extends BasicTestGrader
+{
+
+ @Override
+ public void run ()
+ {
+ assertTrue(ThreadedKernel.scheduler.getClass().getSimpleName().equals(
+ "PriorityScheduler"), "This grader needs priority scheduler.");
+
+ testLock();
+
+ testJoin();
+
+ done();
+ }
+
+ private void testLock ()
+ {
+ lock = new Lock();
+ lock.acquire();
+
+ boolean insStatus = Machine.interrupt().disable();
+ ThreadedKernel.scheduler.setPriority(lowPriority);
+
+ forkNewThread(new Runnable()
+ {
+ @Override
+ public void run ()
+ {
+ lock.acquire();
+ lock.release();
+ }
+ }, highPriority);
+
+ forkNewThread(new Runnable()
+ {
+ @Override
+ public void run ()
+ {
+ alwaysYield();
+ assertTrue(false, "Maybe error in your priority donation.");
+ }
+ }, midPriority);
+
+ Machine.interrupt().restore(insStatus);
+
+ alwaysYield();
+ lock.release();
+ }
+
+ private void testJoin ()
+ {
+ boolean insStatus = Machine.interrupt().disable();
+ ThreadedKernel.scheduler.setPriority(highPriority);
+
+ ThreadHandler low = forkNewThread(new Runnable()
+ {
+ @Override
+ public void run ()
+ {
+ alwaysYield();
+ }
+ }, lowPriority);
+
+ forkNewThread(new Runnable()
+ {
+ @Override
+ public void run ()
+ {
+ alwaysYield();
+ assertTrue(false, "Maybe error in your priority donation.");
+ }
+ }, midPriority);
+
+ Machine.interrupt().restore(insStatus);
+ low.thread.join();
+ }
+
+ private void alwaysYield ()
+ {
+ for (int i = 0; i < 10000; ++i)
+ {
+ KThread.yield();
+ }
+ }
+
+ private Lock lock = null;
+
+ public static final int highPriority = PriorityScheduler.priorityMaximum;
+ public static final int midPriority = PriorityScheduler.priorityMaximum - 1;
+ public static final int lowPriority = PriorityScheduler.priorityMaximum - 2;
+
+}
View
37 src/nachos/ag/FilesysGrader.java
@@ -0,0 +1,37 @@
+package nachos.ag;
+
+import nachos.filesys.FilesysKernel;
+
+/**
+ * @author Bo Tang
+ *
+ */
+public class FilesysGrader extends CoffGrader
+{
+ private static final int ActionGetDiskFreeSize = 22;
+
+ // Return the number of free sectors in your disk including swapFile sectors
+ private int getFreeSize ()
+ {
+ int swapSize = FilesysKernel.realFileSystem.getSwapFileSectors();
+ return FilesysKernel.realFileSystem.getFreeSize() + swapSize;
+ }
+
+ @Override
+ protected int handleTestSystemCall (int type, int a0, int a1, int a2)
+ {
+ switch (type)
+ {
+ case ActionGetDiskFreeSize:
+ return getFreeSize();
+ default:
+ return super.handleTestSystemCall(type, a0, a1, a2);
+ }
+ }
+
+ @Override
+ protected void init ()
+ {
+ super.init();
+ }
+}
View
44 src/nachos/ag/JoinGrader.java
@@ -0,0 +1,44 @@
+package nachos.ag;
+
+import nachos.threads.ThreadedKernel;
+
+/**
+ * A naive testgrader for join operation
+ *
+ * @author Kang Zhang
+ */
+public class JoinGrader extends BasicTestGrader
+{
+ @Override
+ void run ()
+ {
+ // check dependency
+ assertTrue(ThreadedKernel.alarm != null, "This test require alarm.");
+
+ final long waitTicks = getIntegerArgument("waitTicks");
+ long times = getIntegerArgument("times");
+
+ // check argument
+ assertTrue(times > 0, "invalid numThreads argument");
+ assertTrue(waitTicks > 0, "invalid waitTicks argument");
+
+ for (int i = 0; i < times; i++)
+ {
+
+ ThreadHandler handler = forkNewThread(new Runnable()
+ {
+ public void run ()
+ {
+ ThreadedKernel.alarm.waitUntil(waitTicks);
+ }
+ });
+
+ handler.thread.join();
+
+ assertTrue(handler.finished,
+ " join() returned but target thread is still running");
+ }
+
+ done();
+ }
+}
View
82 src/nachos/ag/LotteryGraderS.java
@@ -0,0 +1,82 @@
+package nachos.ag;
+
+import nachos.machine.Lib;
+import nachos.machine.Machine;
+import nachos.threads.KThread;
+import nachos.threads.ThreadedKernel;
+
+/**
+ * A grader for priority scheduling.
+ *
+ * @author Sangxia Huang
+ */
+public class LotteryGraderS extends PriorityGraderS1
+{
+
+ protected class LotteryTreeNode extends PriorityGraderS1.TreeNode
+ {
+
+ public LotteryTreeNode (int priority, TreeNode parent, ThreadHandler th)
+ {
+ super(priority, parent, th);
+ }
+
+ public int getPriority ()
+ {
+ return priority + currentDonate;
+ }
+
+ public void addChild (TreeNode c)
+ {
+ children.add(c);
+ c.parent = this;
+ c.time = Machine.timer().getTime();
+ currentDonate += c.getPriority();
+ if (parent != null)
+ parent.update();
+ }
+
+ public void update ()
+ {
+ int temp = 0;
+ for (TreeNode child : children)
+ temp += child.getPriority();
+ currentDonate = temp;
+ if (parent != null)
+ parent.update();
+ }
+
+ public void releaseChild (TreeNode x)
+ {
+ Lib.assertTrue(parent == null);
+ x.parent = null;
+ currentDonate -= x.getPriority();
+ children.remove(x);
+ }
+ }
+
+ public PriorityGraderS1.TreeNode getTreeNode (int priority, TreeNode parent,
+ ThreadHandler th)
+ {
+ return new LotteryTreeNode(priority, parent, th);
+ }
+
+ @Override
+ public int getRandomPriority ()
+ {
+ return Lib.random(10) + 1;
+ }
+
+ @Override
+ public void runningThread (KThread thread)
+ {
+ super.runningThread(thread, false);
+ }
+
+ @Override
+ public void assertCorrectScheduler ()
+ {
+ assertTrue(ThreadedKernel.scheduler.getClass().getSimpleName().equals(
+ "LotteryScheduler"), "This test need LotteryScheduler.");
+ }
+}
View
121 src/nachos/ag/PriorityGrader.java
@@ -0,0 +1,121 @@
+package nachos.ag;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import nachos.machine.Lib;
+import nachos.machine.Machine;
+import nachos.threads.KThread;
+import nachos.threads.PriorityScheduler;
+import nachos.threads.ThreadedKernel;
+
+/**
+ * A naive grader for priority scheduling.
+ *
+ * @author Xiangru Chen
+ */
+public class PriorityGrader extends BasicTestGrader
+{
+
+ Set<ThreadHandler> ready;
+ Set<ThreadHandler> handlers;
+ Map<ThreadHandler, Long> timeMap;
+
+ @Override
+ public void run ()
+ {
+ assertTrue(ThreadedKernel.scheduler instanceof PriorityScheduler,
+ "This test need PriorityScheduler.");
+
+ final long threads = getIntegerArgument("threads");
+ final long times = getIntegerArgument("times");
+ final long length = getIntegerArgument("length");
+