The Lab project of OS course of University of Tehran at the fall of 2020. This project is written, maintained and edited by Sina Kamali, Amir Mahdi Mohamadian and Alireza Ebrahimi. Not all of the codes in this project belongs to us and the main code is recieved from the MIT-PDOS account.
xv6-ASAVersion is an operating system cloned from xv6 with some added features. Xv6 is a modern reimplementation of Sixth Edition Unix in ANSI C for multiprocessor x86 and RISC-V systems, developed in the summer of 2006 for MIT's operating systems course. xv6-ASAVersion is the result of lab projects of operating systems course at the University of Tehran.
The operating system's name is added to the boot message.
Copy all the text written on the current console line to the Clipboard.
Cut all the text written on the current console line and copy it to the Clipboard.
Paste the contents of the Clipboard.
Replace the current text on the console with contents of the Clipboard.
Clear the screen (terminal and CGA).
lcm
is a user-level program written in C language, and it has been added to the operating system user-level programs. The program receives up to eight inputs and calculates their least common multiple. The program stores its output in a text file called lcm_result.txt
. If the text file already exists, the output will be overwritten.
Example:
$ lcm 3 6 11 9
$ cat lcm_result.txt
198
In this system call, instead of retrieving arguments in the usual way (using stack), we use registers. This system call prints the digits of the given number in reverse on the console.
This system call counts the number of times a system call is used by each process and saves it. If the input argument is one, tracing of system calls begins. If the system call's argument is zero, this tracing will no longer be performed and will also clear all the information it has stored.
This system call takes a PID as an input and returns children's PIDs of the given PID.
syscalltest
is a user-level program written in C language, and it has been added to the operating system user-level programs. In order to be able to test system calls, you need to use this user-level program.
$ systest
Enter the number of a system call that you would like to test?
1. reverse_number(int number)
2. trace_syscalls(int state)
3. get_children(int parent_id)
Xv6 typically is ran using the QEMU emulator.
To build xv6 on an x86 ELF machine, like Linux, run:
make
On macOS, run:
make TOOLPREFIX=i386-elf-
To build everything and start QEMU with the CGA console (in a new window and the serial console in your terminal on an x86 ELF machine), like Linux, run:
make qemu
On macOS run:
make TOOLPREFIX=i386-elf- qemu
To exit, either close the CGA window or press ctrl + c
or ctrl + a
and then x
in your terminal.
Like above, but to start with only the serial console on an x86 ELF machine, like Linux, run:
make qemu-nox
On macOS, run:
make TOOLPREFIX=i386-elf- qemu-nox
To exit, press ctrl + a
and then x
.
The README.md file was contributed to the project by Sina Negarandeh