project 2 - how to compile os161?
TRANSCRIPT
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]
2
Did you carry out project 1 ?
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
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
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
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
7
8
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
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
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!
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
13
/cs161
Source Code Tree
/src /root
/kern /include /sys161 (bin)
/conf /compile
ASST0 (file) /ASST0 (dir)
makefile
Build the Tool Chain
%cd ~/cs161%tar vfxz cs161-binutils-1.4.tar%cd cs161-binutils-1.4%./toolbuild.sh
Build the Cross Compiler
%cd ~/cs161%tar vfxz cs161-gcc-1.4.tar%cd cs161-gcc-1.4%./toolbuild.sh
Build the Special gdb
%cd ~/cs161%tar vfxz cs161-gdb-1.4.tar%cd cs161-gdb-1.4%./toolbuild.sh
Build the sys161 Emulator
%cd ~/cs161%tar vfxz sys161-1.14.tar.gz%cd sys161-1.14%./configure mipseb%make%make install
A Tool for Code ReadingYou must learn how to use “grep” to improve your source code reading skill.
%grep –r “stack” .
%grep “stack” *.h
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
Building a Kernel
You must first configure your source code tree
%cd ~/cs161/src %./configure
Configure a Kernel for Project 2
You must first configure your source code tree
% cd ~/cs161/src/kern/conf % ./config ASST0
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
Building the User level utilities• Remember the path of the makefile
%cd ~/cs161/src %make
• Now you are ready to run your kernel …
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>
25