Skip to content

kamali-sina/xv6-ASAVersion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 

Repository files navigation

xv6-ASAVersion

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.

Added Features

Part 1 (Introduction to XV6)

Boot Message

The operating system's name is added to the boot message.

ctrl + c

Copy all the text written on the current console line to the Clipboard.

ctrl + x

Cut all the text written on the current console line and copy it to the Clipboard.

ctrl + v

Paste the contents of the Clipboard.

ctrl + b

Replace the current text on the console with contents of the Clipboard.

ctrl + l

Clear the screen (terminal and CGA).

lcm

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

Part 2 (System Calls)

reverse_number(int n)

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.

trace_syscalls(int state)

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.

get_children(int parent_id)

This system call takes a PID as an input and returns children's PIDs of the given PID.

syscalltest

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)

How to use

Building and Running xv6

Xv6 typically is ran using the QEMU emulator.

Building xv6

To build xv6 on an x86 ELF machine, like Linux, run:

 make

On macOS, run:

make TOOLPREFIX=i386-elf-

Running xv6

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.

Aditional Contributions

The README.md file was contributed to the project by Sina Negarandeh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published