| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
In this project, some features are added to the xv6 operating system (x86 architecture).
The following message is displayed when the system boots up:
Group 1:
- Saman Eslami Nazari : 810199375
- Pasha Barahimi : 810199385
- Misagh Mohaghegh : 810199484
The following keyboard shortcuts are added to the console:
Also, the following features are added to the console though they were not required in the task:
A prime_numbers program is added to the system.
This program finds the prime numbers in the range $[a, b]$.
The program is called as follows:
prime_numbers a b
The result is then printed in the prime_numbers.txt file.
The find_largest_prime_factor system call is added to the system.
This system call finds the largest prime factor of a given number.
The system call is called as follows:
int find_largest_prime_factor(void);The parameter (an integer) should be passed in the ebx register.
int change_file_size(char *path, int size);void get_callers(void);int get_parent_pid(void);An MLFQ scheduler is added to the system.
The scheduler has 3 queues with the first one having the highest priority.
The following queueing policies are used:
All processes are started in the second queue (except the init and sh processes).
If a runnable process has not been executed for 8000 ticks, it is moved to the first queue.
The following system calls are added to the system:
int change_scheduling_queue(int pid, int queue);int set_lottery_tickets(int pid, int tickets);int set_bjf_params_process(int pid, float priority_ratio, float arrival_time_ratio, float executed_cycles_ratio);int set_bjf_params_system(float priority_ratio, float arrival_time_ratio, float executed_cycles_ratio);void print_process_info(void);All of the aforementioned system calls are accessible using the schedule user program:
usage: schedule command [arg...]
Commands and Arguments:
info
set_queue <pid> <new_queue>
set_tickets <pid> <tickets>
set_process_bjf <pid> <priority_ratio> <arrival_time_ratio> <executed_cycle_ratio>
set_system_bjf <priority_ratio> <arrival_time_ratio> <executed_cycle_ratio>
set_priority_bjf <pid> <priority>
As xv6 does not support threads, semaphores can only be used among processes.
As a result, an array of 5 semaphores is implemented in the system.
The following system calls are added to the system:
int sem_init(int index, int value);int sem_acquire(int index);int sem_release(int index);The dining_philosophers simulation is implemented using the array of semaphores.
To prevent deadlock, all the philosophers with even IDs pick up the left fork first and then the right fork. The philosophers with odd IDs pick up the right fork first and then the left fork.
The simulation is started as follows:
dining_philosophers
| Back | FazBrowse Home | New Git URL |