SlideShare a Scribd company logo
COMP 3500
Introduction to Operating Systems
Project 2 – Modifying OS/161
Dr. Xiao Qin
Auburn University
http://www.eng.auburn.edu/~xqin
xqin@auburn.edu
1
Modifying your kernel
• Create a new file
~/cs161/src/kern/main/hello.c
• Edit ~/cs161/src/kern/main/main.c
which calls the hello function
• Before reconfiguring and rebuilding your kernel, you
will need to edit
~/cs161/src/kern/conf/conf.kern
Your hello.c
3
A Compilation Error
4
Edit kern/conf/conf.kern
cd ~/cs161/src/kern/conf
vi conf.kern
/main.c #search main.c in
conf.kern see also line 374
Add the following line:
file main/hello.c
Create a header file: hello.h
6
Add #include <hello.h> into main.c
7
Configure your source code tree
8
cd ~/cs161/src
./configure
cd ~/cs161/src/kern/conf
./config ASST0
Why this is important?
When should you reconfigure OS161?
Build the ASST0 kernel.
9
cd ../compile/ASST0
make depend
make
make install Why this is important?
Build the user level utilties
10
cd ~/cs161/src
make
Run OS161
cd ~/cs161/root
./sys161 kernel
What do you expect?
11
COMP 3500
Introduction to Operating Systems
Project 2 – How to use grep?
Dr. Xiao Qin
Auburn University
http://www.eng.auburn.edu/~xqin
xqin@auburn.edu
12
A Tool for Code Reading
You must learn how to use “grep” to improve your source
code reading skill.
%grep –r “stack” .
%grep “stack” *.h
14
Exercise: Code Reading: An Example
2. 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
Attention!
Please note that missing package in CentOS 7 may cause the
installation errors. Please try the following command to install
the missing package prior to the tool installations.
yum install ncurses-devel
16
Why ncurses-devel?
Problem without ncurses-devel: While trying to configure
the cs161-gdb for Project 2, I am encountering a build error: "no
termcap library found".
Solution: yum install ncurses-devel
17
Compilation Errors
Problem: When I try to run make depend to make the kernel, I
get the following error:
/bin/sh: cs161-gcc: command not found
make: *** [depend] Error 127
Solution: Use ‘echo $PATH’ to check your $PATH.
export PATH=~/cs161/bin:$PATH
You may need to add that statement to your .bashrc file.
18

More Related Content

PDF
Project 2 How to modify os161: A Manual
PDF
Project 2 how to install and compile os161
PPTX
Project 2 - how to compile os161?
PPTX
Arch linux
PDF
Red Hat Enterprise Linux 8 Workshop
PDF
Quick and Solid - Baremetal on OpenStack | Rico Lin
ODP
Linux Kernel Crashdump
PDF
[방송통신대 컴퓨터과학과] UNIX 시스템 과제물 작성
Project 2 How to modify os161: A Manual
Project 2 how to install and compile os161
Project 2 - how to compile os161?
Arch linux
Red Hat Enterprise Linux 8 Workshop
Quick and Solid - Baremetal on OpenStack | Rico Lin
Linux Kernel Crashdump
[방송통신대 컴퓨터과학과] UNIX 시스템 과제물 작성

What's hot (20)

PDF
Linux boot process – explained
PPT
Linux command ppt
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
PDF
Como compilar el kernel de Opensuse 42.3
PDF
Git, CMake, Conan - How to ship and reuse our C++ projects?
PDF
Basic Cmake for Qt Users
 
PDF
U-Boot - An universal bootloader
PDF
Implementing Cloud-native apps on OCI
PPTX
Citrix Cloud - Architecture Diagrams.pptx
PDF
Kubernetes on Premise Practical Guide
PDF
Docker Presentation
PPTX
Linux basic commands
PDF
Board Bringup
PDF
Unix - An Introduction
PPTX
Bootloaders (U-Boot)
PDF
Docker Online Meetup #22: Docker Networking
PPT
Configuracion de una red punto a punto
PDF
[嵌入式系統] 嵌入式系統進階
PPT
Basic command ppt
PDF
systemd
Linux boot process – explained
Linux command ppt
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Como compilar el kernel de Opensuse 42.3
Git, CMake, Conan - How to ship and reuse our C++ projects?
Basic Cmake for Qt Users
 
U-Boot - An universal bootloader
Implementing Cloud-native apps on OCI
Citrix Cloud - Architecture Diagrams.pptx
Kubernetes on Premise Practical Guide
Docker Presentation
Linux basic commands
Board Bringup
Unix - An Introduction
Bootloaders (U-Boot)
Docker Online Meetup #22: Docker Networking
Configuracion de una red punto a punto
[嵌入式系統] 嵌入式系統進階
Basic command ppt
systemd
Ad

Viewers also liked (18)

PPTX
How to add system calls to OS/161
PPTX
Energy Efficient Data Storage Systems
PPTX
IPCCC 2012 Conference Program Overview
PPTX
An Active and Hybrid Storage System for Data-intensive Applications
PPTX
OS/161 Overview
PPTX
Reliability Analysis for an Energy-Aware RAID System
PPT
COMP2710 Software Construction: header files
PPTX
Nas'12 overview
PPTX
How to do research?
PPTX
Common grammar mistakes
PPTX
Why Major in Computer Science and Software Engineering at Auburn University?
PPTX
Thermal modeling and management of cluster storage systems xunfei jiang 2014
PPTX
Surviving a group project
PPT
COMP2710: Software Construction - Linked list exercises
PPTX
Data center specific thermal and energy saving techniques
PPTX
Understanding what our customer wants-slideshare
PPTX
Performance Evaluation of Traditional Caching Policies on a Large System with...
PPTX
HDFS-HC2: Analysis of Data Placement Strategy based on Computing Power of Nod...
How to add system calls to OS/161
Energy Efficient Data Storage Systems
IPCCC 2012 Conference Program Overview
An Active and Hybrid Storage System for Data-intensive Applications
OS/161 Overview
Reliability Analysis for an Energy-Aware RAID System
COMP2710 Software Construction: header files
Nas'12 overview
How to do research?
Common grammar mistakes
Why Major in Computer Science and Software Engineering at Auburn University?
Thermal modeling and management of cluster storage systems xunfei jiang 2014
Surviving a group project
COMP2710: Software Construction - Linked list exercises
Data center specific thermal and energy saving techniques
Understanding what our customer wants-slideshare
Performance Evaluation of Traditional Caching Policies on a Large System with...
HDFS-HC2: Analysis of Data Placement Strategy based on Computing Power of Nod...
Ad

Similar to Project 2 how to modify OS/161 (20)

PPTX
Building a linux kernel
PDF
Getting started-with-zend-framework
PPTX
Installing Hortonworks Hadoop for Windows
PDF
From A to Z-itrix: Setting up the most stable and fastest HCL Notes client on...
DOCX
Oracle forms and reports 11g installation on linux
PDF
Oracle business intelligence enterprise edition 11g
PDF
Von A bis Z-itrix: Installieren Sie den stabilsten und schnellsten HCL Notes-...
PDF
All About ExpressionEngine 2
DOCX
Adding System Call to Kernel
PPT
Autoconf&Automake
PPTX
578781850-RHSA-1-Chapte578781850-RHSA-1-Chapter-4r-4.pptx
PDF
Kernel Recipes 2019 - Kernel documentation: past, present, and future
PDF
StdAfx.h for Novices
PPTX
DevOpsDays InSpec Workshop
DOC
PPT
PPT
UnixShells.pptfhfehrguryhdruiygfjtfgrfjht
PPT
UnixShells.ppt
PDF
Hex file creation using Keil uVision
PPTX
Makefile for python projects
Building a linux kernel
Getting started-with-zend-framework
Installing Hortonworks Hadoop for Windows
From A to Z-itrix: Setting up the most stable and fastest HCL Notes client on...
Oracle forms and reports 11g installation on linux
Oracle business intelligence enterprise edition 11g
Von A bis Z-itrix: Installieren Sie den stabilsten und schnellsten HCL Notes-...
All About ExpressionEngine 2
Adding System Call to Kernel
Autoconf&Automake
578781850-RHSA-1-Chapte578781850-RHSA-1-Chapter-4r-4.pptx
Kernel Recipes 2019 - Kernel documentation: past, present, and future
StdAfx.h for Novices
DevOpsDays InSpec Workshop
UnixShells.pptfhfehrguryhdruiygfjtfgrfjht
UnixShells.ppt
Hex file creation using Keil uVision
Makefile for python projects

More from Xiao Qin (9)

PPTX
How to apply for internship positions?
PPTX
How to write research papers? Version 5.0
PDF
Making a competitive nsf career proposal: Part 2 Worksheet
PDF
Making a competitive nsf career proposal: Part 1 Tips
PPTX
Auburn csse faculty orientation
PPTX
Auburn CSSE graduate student orientation
PPTX
CSSE Graduate Programs Committee: Progress Report
PDF
P#1 stream of praise
PPT
Reliability Modeling and Analysis of Energy-Efficient Storage Systems
How to apply for internship positions?
How to write research papers? Version 5.0
Making a competitive nsf career proposal: Part 2 Worksheet
Making a competitive nsf career proposal: Part 1 Tips
Auburn csse faculty orientation
Auburn CSSE graduate student orientation
CSSE Graduate Programs Committee: Progress Report
P#1 stream of praise
Reliability Modeling and Analysis of Energy-Efficient Storage Systems

Recently uploaded (20)

PPTX
Construction Project Organization Group 2.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
Welding lecture in detail for understanding
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
additive manufacturing of ss316l using mig welding
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Geodesy 1.pptx...............................................
DOCX
573137875-Attendance-Management-System-original
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Construction Project Organization Group 2.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Arduino robotics embedded978-1-4302-3184-4.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Welding lecture in detail for understanding
bas. eng. economics group 4 presentation 1.pptx
Sustainable Sites - Green Building Construction
CYBER-CRIMES AND SECURITY A guide to understanding
additive manufacturing of ss316l using mig welding
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Geodesy 1.pptx...............................................
573137875-Attendance-Management-System-original
Foundation to blockchain - A guide to Blockchain Tech
UNIT 4 Total Quality Management .pptx
OOP with Java - Java Introduction (Basics)
Model Code of Practice - Construction Work - 21102022 .pdf
Operating System & Kernel Study Guide-1 - converted.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...

Project 2 how to modify OS/161

  • 1. COMP 3500 Introduction to Operating Systems Project 2 – Modifying OS/161 Dr. Xiao Qin Auburn University http://www.eng.auburn.edu/~xqin xqin@auburn.edu 1
  • 2. Modifying your kernel • Create a new file ~/cs161/src/kern/main/hello.c • Edit ~/cs161/src/kern/main/main.c which calls the hello function • Before reconfiguring and rebuilding your kernel, you will need to edit ~/cs161/src/kern/conf/conf.kern
  • 5. Edit kern/conf/conf.kern cd ~/cs161/src/kern/conf vi conf.kern /main.c #search main.c in conf.kern see also line 374 Add the following line: file main/hello.c
  • 6. Create a header file: hello.h 6
  • 7. Add #include <hello.h> into main.c 7
  • 8. Configure your source code tree 8 cd ~/cs161/src ./configure cd ~/cs161/src/kern/conf ./config ASST0 Why this is important? When should you reconfigure OS161?
  • 9. Build the ASST0 kernel. 9 cd ../compile/ASST0 make depend make make install Why this is important?
  • 10. Build the user level utilties 10 cd ~/cs161/src make Run OS161 cd ~/cs161/root ./sys161 kernel
  • 11. What do you expect? 11
  • 12. COMP 3500 Introduction to Operating Systems Project 2 – How to use grep? Dr. Xiao Qin Auburn University http://www.eng.auburn.edu/~xqin xqin@auburn.edu 12
  • 13. A Tool for Code Reading You must learn how to use “grep” to improve your source code reading skill. %grep –r “stack” . %grep “stack” *.h
  • 14. 14
  • 15. Exercise: Code Reading: An Example 2. 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
  • 16. Attention! Please note that missing package in CentOS 7 may cause the installation errors. Please try the following command to install the missing package prior to the tool installations. yum install ncurses-devel 16
  • 17. Why ncurses-devel? Problem without ncurses-devel: While trying to configure the cs161-gdb for Project 2, I am encountering a build error: "no termcap library found". Solution: yum install ncurses-devel 17
  • 18. Compilation Errors Problem: When I try to run make depend to make the kernel, I get the following error: /bin/sh: cs161-gcc: command not found make: *** [depend] Error 127 Solution: Use ‘echo $PATH’ to check your $PATH. export PATH=~/cs161/bin:$PATH You may need to add that statement to your .bashrc file. 18