21
kit Pintos overvi Operating System Proje 금금금금금금금

Kit Pintos overview Operating System Project 금오공과대학교

Embed Size (px)

Citation preview

Page 1: Kit Pintos overview Operating System Project 금오공과대학교

kit

Pintos overviewOperating System Project

금오공과대학교

Page 2: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

An instructional operating system Developed by Stanford university

A few of the source files are derived from code used in the MIT

OS course

A real OS for 80x86 architecture (c.f. nachos) Run on a regular IBM-compatible PC or an x86 simulator

The original structure and form was inspired by the

nachos

Written in C language

Introduce Pintos

Page 3: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

Environments Bochs

IA-32 emulator We will run Pintos on this emulator Bochs makes it easy to develop and debug Pintos projects

Linux + Bochs We will use Linux(Debian) machine

Page 4: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

Environments - Client SSH client

Official client : Putty Other clients : SecureCRT, Xshell, etc ...

X-window server (Local – Client) Official server : Xming Other servers : Xmanager, Cygwin-X, etc ...

Connect to experiment server Host : 'linda.kumoh.ac.kr' SSH with X11 forwarding

Page 5: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

Environments - Server Implemented in server – Recommend using this

x86 emulator Bochs : Ready on experiment server

You can get customized auto installation source from

experiment server

QEMU (Faster than Bochs)

Pintos utilities Build from pintos source code

Other basic utilities GCC compiler set, GDB, Perl

Page 6: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

Pintos set up linda.kumoh.ac.kr 접속

BOCHS 이미 설치되어 있음 . ( 서버에 BOCHS 재설치 하지 말 것 )

Pintos 압축 풀기 $tar zxvf pintos.tar.gz

Pintos 압축 푼 다음 $pintos/src/thread 로 이동

$make : 결과로 현재 디렉토리에 (src/thread) build 라는 디렉토리 생성됨

pintos 실행 $pintos/src/threads$ pintos –v -- run alarm-multiple

Page 7: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

Pintos set up

Page 8: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

Debug methods

printf() – Traditional log based debug

Assertion – Using ASSERT macro

Backtraces – Find location in source

GDB – Step-by-Step debugging Remote debugging to localhost (need 2 console)

Modifying Bochs – Debug Triple Faults

Page 9: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

Tags - 1 함수나 전역변수에 쉽게 이동할 수 있는 인덱스 파일 Vi 와 연동해서 사용할 수 있다 . Make `tags` file & set for VI

Page 10: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

Tags - 2 이동하고자 하는 함수나 전역변수에 캐롯을 두고 C

trl+] 바로 전 단계로 이동하고자 할 때는 Ctrl+T

Page 11: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

gdb - 1 Pintos 는 기존의 GDB 에 기능을 추가하여 편리한

스크립트를 함께 제공한다 .

--gdb 옵션과 함께 pintos 를 실행하며 , 또 다른 터미널의 build 디렉토리에서 pintos-gdb 를 실행한다 . $pintos --gdb --gdb-port=1234 –v -- run alarm-multiple

Gdb 의 사용법 참조 사이트 http://www.gnu.org/software/gdb/documentation/

Page 12: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

gdb - 2 Execute pintos with '--gdb' option user@linda:~/pintos/src/threads/build$ pintos --gdb -v --gdb-port=1234 -- run alarm-multiple

출력 화면

--gdb-Port=1234

포트 번호를 지정하여 디버깅

Page 13: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

gdb - 3 Execute gdb by pintos (In another terminal) user@linda:~/pintos/src/threads/build$ pintos-gdb kernel.o

gdb 화면

Page 14: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

gdb - 4 Connect to gdb session

(gdb) target remote localhost:1234 지정한 포트 번호

Setup break point (gdb) break run_test

Continue execution of code (It will pause at breakpoint) (gdb) continue

포트 번호 충돌 가능성이 존재하므로 netstat 명령으로 해당 포트의 오픈 여부를 확인

Page 15: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

gdb - 5

gdb 화면

출력 화면

Page 16: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

Version Control

Goal Cooperation development, Avoid version mixing,

Improve code shareablity, Solving conflicts, Management of change histories, Blame, Automatic daily build, etc ...

CVS and Subversion Keywords

Repository, Module, Import, Checkout, Revision, Commit, Update, Lock, Tag, Branch, Release

See more information on “Revision_control” in Wikipedia

Page 17: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

svn Compelling replacement for CVS in the open source

community Change set revision, Fast execution, Atomic commit,

Reduce network traffic, Configurable each Project, Easy to extends, Support many protocol, Clean source code, Similar usage with CVS

Ready on experiment server Support 'file' and 'svn+ssh' protocol Each team have to elect source manager

Recommend Microsoft Windows User to use 'tortoisesvn'(http://tortoisesvn.tigris.org/)

Page 18: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

svn Create svn directory

user@linda:~$ mkdir svn Create svn repository

user@linda:~$ svnadmin create svn/pintos Import module baseline

user@linda:~$ lspintos svn

user@linda:~$ svn import pintos file:///home/jkang/svn/pintos/(user@linda:~$ svn import pintos file://`pwd`/svn/pintos/) ...Adding pintos/src/examples/MakefileAdding pintos/src/examples/.cvsignoreCommitted revision 1.jkang@linda:~$

Page 19: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

svn Delete original source

user@linda:~$ lspintos svnuser@linda:~$ rm -rf pintosuser@linda:~$ lssvn

Checkout from repository user@linda:~$ svn checkout file://`pwd`/svn/pintos

pintos...A pintos/src/examples/MakefileA pintos/src/examples/.cvsignoreChecked out revision 1.user@linda:~$ lspintos svn

Page 20: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

svn Edit source code (Edit 'pintos/src/LICENSE' file) Commit

If change set has new files, must execute 'svn add' before commit

user@linda:~$ svn commit pintosSending pintos/src/LICENSETransmitting file data .Committed revision 2.user@linda:~$

Update (Different location and revision) user@linda:~$ svn update pintos

U pintos/src/LICENSEUpdated to revision 2.user@linda:~$

Page 21: Kit Pintos overview Operating System Project 금오공과대학교

Operating System Project - pintos overview

Thank you