Simulation of Operating System Functions
I created a simulation of the 2-pass linker used in C compilers and simulations of 3 crucial operating system functions. OS-level simulations include process scheduling, resource allocation, and demand paging.
- Languages: C, Java
- Github : source code
In my first simulation, implemented a two-pass linker used in the C compiler. The linker processes the input twice. Pass one determines the base address for each module and the absolute address for each external symbol, storing the later in the symbol table it produces.Pass two uses the base addresses and the symbol table computed in pass one to generate the actual output by relocating relative addresses and resolving external references.
The second simulation focuses on process scheduling and was completed in Java. The purpose of the simulation was to see how the time required depends on the scheduling algorithm and the request patterns. The simulated scheduling algorithms include first come first serve, round robin, uniprogrammed, and shortest job first.
The third simulation performs OS-level resource allocation using both an optimistic resource manager and the banker’s algorithm of Dijkstra. The optimistic resource manager follows the simple principle: satisfy a request if possible, if not the task waits; when a release occurs, pending requests are satisfied in a FIFO manner.
The last simulation is a demand paging simulation used by memory management. The purpose of this simulation to see how the number of page faults depends on page size, program size, replacement algorithms, and job mix.