Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS4348

Projects from CS 4348 (Operating Systems)

Project 1 Memory/CPU Communication

The purpose of the project was to learn and mimic how a CPU processes instructions with the incorporation of two processes: one responsible for memory and another responsible for the CPU. While we are not necessarily creating a CPU or memory, we are mimicking the functions of them through a high-level language. In our mock CPU, we have a PC, SP, IR, AC, X, and Y register. These registers still serve the same purpose as they would in an actual CPU. The PC and SP registers are used to access indexes in memory, the IR holds instruction values, and the AC, X, and Y registers are used to store data. With our mock memory, we are making array with 2000 elements with the first half being dedicated for the user program and the second half being dedicated for the system code. The CPU makes sure we are not accessing system code when we should be accessing the user program. We also have a user stack that is at the end of the user program memory and a system stack that is at the end of the system memory. We also are including mock interrupts as well. There are two types: timer and a system call. The timer interrupts execute at 1000 and the system calls execute at 1500. The interrupts first save the user program’s SP and PC before proceeding. These behaviors that we are tasked with implementing are similar to the behaviors of a real CPU and memory. This project is essentially an application of the low-level concepts we learned.

Project 2 Semaphores/Threads

The purpose of this project was to apply our knowledge of coordinating threads with semaphores. In this program, we are trying to simulate patients visiting a doctor and we are coordinating their actions. The clinic to be simulated has doctors, each of which has their own nurse. Each doctor has an office of his or her own in which to visit patients. Patients will enter the clinic to see a doctor, which should be randomly assigned. Initially, a patient enters the waiting room and waits to register with the receptionist. Once registered, the patient sits in the waiting room until the nurse calls. The receptionist lets the nurse know a patient is waiting. The nurse directs the patient to the doctor’s office and tells the doctor that a patient is waiting. The doctor visits the patient and listens to the patient’s symptoms. The doctor advises the patient on the action to take. The patient then leaves. There are 5 types of characters involved: a receptionist, nurses, doctors, and patients. The program will ask for the number of doctors/nurses (range of 1-3) and the number of patients (range of 1-30). The program then creates one thread for the receptionist and the specified number of threads for the doctors/nurses and patients. Each thread is enumerated and prints out their corresponding actions.

Project 3 Job Algorithm Schedulers (FCFS, SPN, HRRN)

This program reads in a list of jobs from a tab-delimited text file named jobs.txt. The format of the text file should have one line for each job, where each line has a job name, a start time and a duration. The job name must be a letter from A-Z. The first job should be named A, and the remaining jobs should be named sequentially following the alphabet, so if there are five jobs, they are named A-E. The arrival times of these jobs should be in order. The jobs should be scheduled first using the FCFS scheduler, then scheduled again using the SPN scheduler, and once more using the HRRN scheduler.

About

Projects from CS 4348 (Operating Systems)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages