Skip to content

Mateusz1223/SOI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SOI

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.

Task 1

Implement two system calls:

  • 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.

Cases to handle:

  • What if there is no process with the given PID?
  • What if the process has no descendants?

Personal Challenge 1

Write library wrappers for task 1 syscalls.

Task 2

Modify scheduling algorithm

Implement a scheduling algorithm that properly handles processes belonging to three different categories: interactive, compute-intensive, and background I/O-heavy.

Process Types and Requirements

1. Compute-intensive Processes

  • Should be processed using FIFO scheduling.

2. Interactive Processes

  • Should be scheduled using round-robin, but only within their own group.
  • Must have higher priority than compute-intensive processes.

3. I/O-heavy 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)

Personal Challenge 2

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.

Task 3

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

Task 4 is an extension of Task 3. Instead of using semaphores, the solution should be implemented using a monitor.

Task 5

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.

Implemented System Calls

  • 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 fit
    • 0 – restore default first fit

Task 6

Implement a file system. The file system should be stored inside a single regular file, which acts as a virtual disk of fixed size.

File System Design

  • 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

Supported Operations

  • 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.

About

SOI (Operating Systems) is a Computer Science course I took at University. 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 defined.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors