SOI (Operating Systems) is a Computer Science course that I am currently enrolled in. The course focuses on modifying the Minix 2.0.3 source code. This repository contains my solutions to the assigned tasks, as well as additional challenges I created for myself.
- For the subtree consisting of the descendants of a process with a given PID: return the height of the subtree.
- For the same subtree: return the number of processes at the lowest level of the subtree.
- What if there is no process with the given PID?
- What if the process has no descendants?
Write library wrappers for task 1 syscalls.
Implement a scheduling algorithm that properly handles processes belonging to three different categories: interactive, compute-intensive, and background I/O-heavy.
- Should be processed using FIFO scheduling.
- Should be scheduled using round-robin, but only within their own group.
- Must have higher priority than compute-intensive processes.
- Has very high priority but short execution bursts.
- The student should select an appropriate scheduling method for this process type. (My choice was FIFO)
Implement a Linux-inspired sched_yield system call for processes scheduled using FIFO. The call should move the calling process to the end of the ready queue.
As part of the exercise on synchronization using semaphores, you are required to solve the following problem:
Two types of producers produce elements of type A and type B, respectively. An element is a structure with two fields:
- type (A/B)
- value (random number from 0–99)
The elements are then placed into two FIFO queues (one for type A elements and one for type B elements, queue size = 4).
Each producer produces 8 elements of a given type. The number of producers for both types is the same.
The consumer removes one element from each queue (type A and type B), then "processes" and deletes the elements.
- The consumer cannot remove an element from one queue without also removing an element from the other queue. It must wait until elements of both types are available in their respective queues.
- The consumer cannot block the queue of the first type while waiting for an element of the second type.
The solution must be implemented using shared memory and semaphores.
Task 4 is an extension of Task 3. Instead of using semaphores, the solution should be implemented using a monitor.
Implement the worst fit memory allocation algorithm in the MINIX memory manager (MM). Runtime switching between first fit and worst fit algorithms should be allowed. Provide a system call to inspect the current list of free memory blocks.
-
HOLE_MAP Returns information about the current list of free memory blocks maintained by the memory manager. The data includes pairs of block size and address, terminated by a zero-sized entry.
-
WORST_FIT Enables or disables the worst fit allocation algorithm:
1– enable worst fit0– restore default first fit
Implement a file system. The file system should be stored inside a single regular file, which acts as a virtual disk of fixed size.
- The virtual disk contains a single-level directory.
- Each directory entry stores at least:
- file name
- file size
- file allocation information on the virtual disk
- Create a virtual disk.
- Copy a file from the host file system to the virtual disk.
- Copy a file from the virtual disk to the host file system.
- Display the contents of the virtual disk directory.
- Delete a file from the virtual disk.
- Display a detailed disk usage map.