Download presentation
Presentation is loading. Please wait.
Published byAlaina Long Modified over 9 years ago
1
Nachos Lecture 2 Xiaorui Sun
2
Phase 2 You have got one machine (machine package) You have to implements the incomplete OS (userprog package) Run programs on MIPS!
3
userprog package UserKernel.java - a multiprogramming kernel. UserProcess.java - a user process; manages the address space, and loads a program into virtual memory. UThread.java - a thread capable of executing user MIPS code. SynchConsole.java - a synchronized console; makes it possible to share the machine's serial console among multiple threads.
4
Interrupt Handler Specification test/syscall.h File Management Syscall –Create/Open/Read/Write/Close/Unlink –Use Machine.stubFileSystem.java to access file files in the test directory –File Descriptor
5
Interrupt Handler Process Management Syscall –exit: terminate the current process immediately. –exec: execute the program stored in the specified file, with the specified arguments, in a new child process. –join: suspend execution of the current process until the child process specified by the processID argument has exited.
6
Memory Management No dynamic memory allocation needed You can allocate a fixed number of pages for the processe's stack, 8 pages should be sufficient. Pagetable in UserKernel
7
Memory Management Implement –UserProcess.readVirtualMemory –UserProcess.writeVirtualMemory –UserProcess.loadSections
8
Run programs Write source files(*.c) Compile source files into object files (*.o) Produce MIPS binary file (*.coff) Run it on your OS
9
Phase 3- Caching and Virtual Memory TLB –Machine.processor().readTLBEntry() –Machine.processor().writeTLBEntry() –Handle TLB miss
10
Memory Management Use a single global inverted page table Use swap file to save pages Implement lazy loading –Read/Write when necessary Design your memory management carefully and make it work efficiently The efficiency will be considered in the final score
11
Background process Run program –matmult & –…. Can your program run correctly?
12
Background process Criteria –Single matmult –matmult & + matmult –matmult & + matmult & –matmult & + matmult & + matmult & …
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.