project 2 - how to compile os161?

25
1 COMP 3500 Introduction to Operating Systems Project 2 – An Introduction to OS/161 Details Dr. Xiao Qin Auburn University http://www.eng.auburn.edu/~xqin [email protected]

Upload: xiao-qin

Post on 13-Apr-2017

121 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Project 2 - how to compile os161?

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?

2

Did you carry out project 1 ?

Page 3: Project 2 - how to compile os161?

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?

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?

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?

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?

7

Page 8: Project 2 - how to compile os161?

8

Page 9: Project 2 - how to compile os161?

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?

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?

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?

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?

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?

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?

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?

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?

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?

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?

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?

Building a Kernel

You must first configure your source code tree

%cd ~/cs161/src %./configure

Page 21: Project 2 - how to compile os161?

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?

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?

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?

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?

25