- sys.c contains syscall implementations.
- syscall_table.S contains syscall names and numbers.
- unistd.h contains syscall numbers for user.
- sem.h has cs1550 semaphore implementation
- test.c is the test driver.
- config is the Linux config file.
- build.sh is the script for adding cs1550 syscalls to Linux.
- boot.sh is the script for booting Qemu VM.
Login to thoth:
Navigate to your dedicated directory:
- cd /u/OSLab/PITT_ID
Clone the cs1550 repo:
- git clone https://github.com/hmofrad/CS1550
Navigate to project 1 dir:
- cd CS1550/project1
Copy the linux-2.6.23.1.tar.bz file to your local space under /u/OSLab/PITT_ID:
- cp /u/OSLab/original/linux-2.6.23.1.tar.bz2 .
Extract
- tar xfj linux-2.6.23.1.tar.bz2
Copy the .config file
- cp /u/OSLab/original/.config linux-2.6.23.1/
Copy sys.c that contains the cs1550_up and cs1550_down implementations
- cp sys.c linux-2.6.23.1/kernel/sys.c
Copy system call table
- cp syscall_table.S linux-2.6.23.1/arch/i386/kernel/syscall_table.S
Copy unistd.h that contains syscall names along with syscall number
- cp unistd.h linux-2.6.23.1/include/asm/unistd.h
Change into linux-2.6.23.1/ directory
- cd linux-2.6.23.1
Build
- make ARCH=i386 bzImage
Navigate to project1 directory
- cd ..
Building the test program
- gcc -m32 -o test -I linux-2.6.23.1/include/ test.c
Download the Qemu emulator on your laptop:
- Windows: https://github.com/hmofrad/CS1550/blob/master/project1/qemu_win.zip
- Mac os: https://github.com/hmofrad/CS1550/blob/master/project1/qemu_mac.zip
Extract and launch Qemu VM:
- Windows: qemu/qemu-win.bat
- Mac OS: qemu-test/start.sh
Login to Qemu VM:
- Username: root
- Password: root
Use scp to download the kernel to a home directory:
- scp [email protected]:/u/OSLab/PITT_ID/CS1550/project1/linux-2.6.23.1/arch/i386/boot/bzImage .
- scp [email protected]:/u/OSLab/PITT_ID/CS1550/project1/linux-2.6.23.1/System.map .
Copy kernel files
- cp bzImage /boot/bzImage-devel
- cp System.map /boot/System.map-devel
Boot from modified kernel
- lilo
Reboot Qemu VM:
- reboot
Select Linux (devel) from boot loader menu
- Hit enter
Download the test binary:
- scp [email protected]:/u/OSLab/PITT_ID/CS1550/project1/test .
Run the test binary:
- ./test
Windows users can use Ctrl + Alt to exit the Qemu VM
Script for adding cs1550 syscalls to Linux (compatible with linux-2.6.23.1).
Login to thoth:
Navigate to your dedicated directory:
- cd /u/OSLab/PITT_ID
Clone the cs1550 repo:
- git clone https://github.com/hmofrad/CS1550
Navigate to project 1 dir:
- cd CS1550/project1
Give execute permission to the build.sh script:
- chmod +x build.sh
Run the script:
- ./build.sh
Script for booting Qemu VM. Should be executed inisde the Qemu.
Download the Qemu emulator on your laptop:
- Windows: https://github.com/hmofrad/CS1550/blob/master/project1/qemu_win.zip
- Mac os: https://github.com/hmofrad/CS1550/blob/master/project1/qemu_mac.zip
Extract and launch Qemu VM:
- Windows: qemu/qemu-win.bat
- Mac OS: qemu-test/start.sh
Login to Qemu VM:
- Username: root
- Password: root
login to the Qemu and copy boot.sh script from thoth:
- scp [email protected]:/u/OSLab/PITT_ID/cs1550/project1/boot.sh .
In Qemu, change the scp target directory of boot.sh based on your working directory on thoth:
- scp [email protected]:$WORKING_DIR/...
Give execute permission to the script:
- chmod +x boot.sh
Run the script:
- ./boot.sh PITT_ID WORKING_DIR (e.g. ./boot.sh moh18 /u/OSLab/moh18/cs1550/project1)
Reboot Qemu VM:
- reboot
Select Linux (devel) from boot loader menu:
- Hit enter
Run test binary:
- ./test
Note: Additional test cases can be fount under test_cases folder.
Note: Please visit Courseweb for a detailed version of project instructions PDF file.