Project 2 - how to compile os161?
-
Upload
xiao-qin -
Category
Engineering
-
view
118 -
download
3
Transcript of Project 2 - how to compile os161?
![Page 1: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/1.jpg)
1
COMP 3500 Introduction to Operating Systems
Project 2 – An Introduction to OS/161Details
Dr. Xiao QinAuburn University
http://www.eng.auburn.edu/[email protected]
![Page 2: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/2.jpg)
2
Did you carry out project 1 ?
![Page 3: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/3.jpg)
Exercise 1 (Plickers) What is the yum command ?
A. A configuration software tool
B. A troubleshooting software tool
C. An automated uninstallation program
D. An automated update program
![Page 4: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/4.jpg)
Exercise 2 (Plickers) In the gdb debugger, typing character ‘n’ means:
A. ‘next’ - Step into the next function.
B. ‘new’ - Set a new breakpoint
C. ‘next’ - Continue to the next source line
D. ‘new’ – Create a new local variable
![Page 5: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/5.jpg)
Exercise 3 (Plickers) What does the following command do? #cvs -d /cs161_cvsroot init
A. Create a CVS root
B. Create a CVS repository
C. Delete a CVS root
D. Delete an initial CVS root
![Page 6: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/6.jpg)
Exercise 4 (Plickers) What does the following command do? %tar vfcz <group_ID>_project1.tgz .
A. Create a single compressed file for project 1
B. Uncompress files for project 1
C. Validate files of project 1
D. Install files of project 1
![Page 7: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/7.jpg)
7
![Page 8: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/8.jpg)
8
![Page 9: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/9.jpg)
Setting up PATH
• If you use bash, add the following line near the end of the ~/.bashrc file.
export PATH=~/cs161/bin:$PATH
• If you use tcsh, add the following line near the end of the ~/.cshrc file:
setenv PATH ~/cs161/bin:$PATH
$export PATH=~/cs161/bin:$PATH
![Page 10: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/10.jpg)
Setting up CVSROOT
• If you use bash, add the following line near the end of the ~/.bashrc file.
export CVSROOT=~/cs161/cvsroot
• If you use tcsh, add the following line near the end of the ~/.cshrc file:
setenv CVSROOT ~/cs161/cvsroot
%export CVSROOT=~/cs161/cvsroot
![Page 11: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/11.jpg)
Building blocks for OS/161Before building OS/161 from os161-1.10.tar.gz, you must first build the following items:
1. tool chain: cs161-binutils-1.4.tar2. cross compiler: cs161-gcc-1.4.tar3. special gdb: cs161-gdb-1.4.tar4. sys161 MIPS emulator: sys161-1.12.tar
The above sequential order is the required order for building!
![Page 12: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/12.jpg)
12
Linux: CentOS
Tool chain: cs161-binutils-1.4.tar
cross compiler: cs161-gcc-1.4.tar special gdb: cs161-gdb-1.4.tar
sys161 MIPS emulator: sys161-1.12.tar
OS/161: os161-1.10.tar.gz
Build a Software Framework for OS/161
![Page 13: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/13.jpg)
13
/cs161
Source Code Tree
/src /root
/kern /include /sys161 (bin)
/conf /compile
ASST0 (file) /ASST0 (dir)
makefile
![Page 14: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/14.jpg)
Build the Tool Chain
%cd ~/cs161%tar vfxz cs161-binutils-1.4.tar%cd cs161-binutils-1.4%./toolbuild.sh
![Page 15: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/15.jpg)
Build the Cross Compiler
%cd ~/cs161%tar vfxz cs161-gcc-1.4.tar%cd cs161-gcc-1.4%./toolbuild.sh
![Page 16: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/16.jpg)
Build the Special gdb
%cd ~/cs161%tar vfxz cs161-gdb-1.4.tar%cd cs161-gdb-1.4%./toolbuild.sh
![Page 17: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/17.jpg)
Build the sys161 Emulator
%cd ~/cs161%tar vfxz sys161-1.14.tar.gz%cd sys161-1.14%./configure mipseb%make%make install
![Page 18: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/18.jpg)
A Tool for Code ReadingYou must learn how to use “grep” to improve your source code reading skill.
%grep –r “stack” .
%grep “stack” *.h
![Page 19: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/19.jpg)
Exercise: Code Reading: An Example2. What bus/busses does OS/161 support?
You must search the source code using the most appropriate keywords
%cd ~/cs161/src/kern/arch/mips/mips%grep ‘bus’ *.c
![Page 20: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/20.jpg)
Building a Kernel
You must first configure your source code tree
%cd ~/cs161/src %./configure
![Page 21: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/21.jpg)
Configure a Kernel for Project 2
You must first configure your source code tree
% cd ~/cs161/src/kern/conf % ./config ASST0
![Page 22: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/22.jpg)
Building the Kernel for Project 2
The path of your makefile for project 2 is important
%cd ~/cs161/src/kern/compile/ASST0 %make depend %make %make install
![Page 23: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/23.jpg)
Building the User level utilities• Remember the path of the makefile
%cd ~/cs161/src %make
• Now you are ready to run your kernel …
![Page 24: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/24.jpg)
Running your newly built kernel• Remember where is your new kernel located
%cd ~/cs161/root %./sys161 kernel
• At the prompt, type p /sbin/poweroff <return>
![Page 25: Project 2 - how to compile os161?](https://reader031.fdocuments.in/reader031/viewer/2022012923/589975c91a28ab49478b77b5/html5/thumbnails/25.jpg)
25