Posts

Showing posts with the label PintOS series

Pintos : Series : Part 4 : Final

Image
In this blog post, we will be done with our Pintos Project #1 and this Pintos Series AlhumdullillAllah. so let's start... In the previous posts of this series, we have looked at the problem that is of busy waiting. To solve this problem I took help from code written by other people on Github,  so to learn it deeper you can get to look at this code, by Muhammad Zaheer  .  The basic modification is done in two files i.e. timer.c and thread.h;       ALARM CLOCK IMPLEMENTAIONS      ========================== Changes in timer.c:   - A global list of sleeping threads is created as: -static struct list sleep_list; Changes in thread.h:   - For keeping track of a sleeping thread when woken up, we declared: -int64_t sleep_time;   - When a thread calls timer_sleep(), it gets into the sleep list as: -struct list_elem sleep_list_elem Algorithms Used ...

Pintos : Series : Part3 : Project 1 : Alarm Clock

Image
The PintOS project has 27 test cases that we need to pass. In the first project we are just going for the five test cases related to alarm clock that are as under: alarm_multiple alarm_single alarm_simultaneous alarm_negative alarm_zero But before jumping into the code, let's first understand the basic structure of PintOS and how it runs. Consider the following diagram: Here QEMU is an emulator on which pintOS runs. Test cases are the processes that we run on the PintOS (Operating System). So we only need to modify the PintOS code, we are not allowed to make any change to the test cases code as this would be a cheating. When you open up the PintOS directory, in tests/threads/tests.c all the test cases are declared. And in the tests/threads/ directory you can observe files with the extension " .ck " and " .c ". So the " test_Name.c " files are the files in which test cases are defined, while " test_Name.ck " file...

PintOS : Series : Part 2

Image
I hope you have installed PintOS . Now it's time to move forward... In the first assignment we need to check and pass first six test cases of alarm. These are as under: alarm-single alarm-multiple alarm-simultaneous alarm-priority alarm-negative alarm-zero You will find them in " /tests/threads " directory. You need to make changes to " timer_sleep() " function in " timer.c " file under " devices " directory, to pass these tests. But first you should start learning from : here also I have a paper :  here After reading and understanding the reading material, you will be able to start coding! (exceptional cases are always there...) I also need to read it first, so I will let you know more later (after understanding it fully..) So, let's jump right into it (I mean let's start reading!)