Pintos overvie Operating System Project kit Introduce Pintos

  • Slides: 21
Download presentation
Pintos overvie Operating System Project kit 금오공과대학교

Pintos overvie Operating System Project kit 금오공과대학교

Introduce Pintos n An instructional operating system ¨ Developed by Stanford university n A

Introduce Pintos n An instructional operating system ¨ Developed by Stanford university n A few of the source files are derived from code used in the MIT OS course ¨ A real OS for 80 x 86 architecture (c. f. nachos) n Run on a regular IBM-compatible PC or an x 86 simulator ¨ The original structure and form was inspired by the nachos ¨ Written in C language Operating System Project - pintos overview

Environments n Bochs IA-32 emulator ¨ We will run Pintos on this emulator ¨

Environments n Bochs IA-32 emulator ¨ We will run Pintos on this emulator ¨ Bochs makes it easy to develop and debug Pintos projects ¨ n Linux + Bochs ¨ We will use Linux(Debian) machine Operating System Project - pintos overview

Environments - Client n SSH client Official client : Putty ¨ Other clients :

Environments - Client n SSH client Official client : Putty ¨ Other clients : Secure. CRT, Xshell, etc. . . ¨ n X-window server (Local – Client) Official server : Xming ¨ Other servers : Xmanager, Cygwin-X, etc. . . ¨ n Connect to experiment server ¨ Host : 'linda. kumoh. ac. kr' ¨ SSH with X 11 forwarding Operating System Project - pintos overview

Environments - Server n Implemented in server – Recommend using this n x 86

Environments - Server n Implemented in server – Recommend using this n x 86 emulator ¨ Bochs : Ready on experiment server n You can get customized auto installation source from experiment server ¨ n Pintos utilities ¨ n QEMU (Faster than Bochs) Build from pintos source code Other basic utilities ¨ GCC compiler set, GDB, Perl Operating System Project - pintos overview

Pintos set up n linda. kumoh. ac. kr 접속 ¨ n Pintos 압축 풀기

Pintos set up n linda. kumoh. ac. kr 접속 ¨ n Pintos 압축 풀기 ¨ n BOCHS 이미 설치되어 있음. (서버에 BOCHS 재설치 하지 말 것) $tar zxvf pintos. tar. gz Pintos 압축 푼 다음 ¨ $pintos/src/thread 로 이동 ¨ $make : 결과로 현재 디렉토리에 (src/thread) build라는 디 렉토리 생성됨 n pintos 실행 ¨ $pintos/src/threads$ pintos –v -- run alarm-multiple Operating System Project - pintos overview

Pintos set up Operating System Project - pintos overview

Pintos set up Operating System Project - pintos overview

Debug methods n printf() – Traditional log based debug n Assertion – Using ASSERT

Debug methods n printf() – Traditional log based debug n Assertion – Using ASSERT macro n Backtraces – Find location in source n GDB – Step-by-Step debugging ¨ n Remote debugging to localhost (need 2 console) Modifying Bochs – Debug Triple Faults Operating System Project - pintos overview

Tags - 1 n n n 함수나 전역변수에 쉽게 이동할 수 있는 인덱스 파일

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

gdb - 1 n Pintos는 기존의 GDB에 기능을 추가하여 편리한 스크 립트를 함께 제공한다.

gdb - 1 n Pintos는 기존의 GDB에 기능을 추가하여 편리한 스크 립트를 함께 제공한다. n --gdb 옵션과 함께 pintos 를 실행하며, 또 다른 터미 널의 build 디렉토리에서 pintos-gdb를 실행한다. ¨ n $pintos --gdb-port=1234 –v -- run alarmmultiple Gdb의 사용법 참조 사이트 http: //www. gnu. org/software/gdb/documentation/ Operating System Project - pintos overview

gdb - 2 n n Execute pintos with '--gdb' option user@linda: ~/pintos/src/threads/build$ pintos --gdb

gdb - 2 n n Execute pintos with '--gdb' option user@linda: ~/pintos/src/threads/build$ pintos --gdb -v --gdb-port=1234 -- run alarm-multiple --gdb-Port=1234 포트 번호를 지정하여 디버깅 출력 화면 Operating System Project - pintos overview

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

gdb - 3 n n Execute gdb by pintos (In another terminal) user@linda: ~/pintos/src/threads/build$ pintos-gdb kernel. o gdb 화면 Operating System Project - pintos overview

gdb - 4 n n n Connect to gdb session ¨ (gdb) target remote

gdb - 4 n n n 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 명령으로 해당 포트의 오픈 여부를 확인 Operating System Project - pintos overview

gdb - 5 gdb 화면 출력 화면 Operating System Project - pintos overview

gdb - 5 gdb 화면 출력 화면 Operating System Project - pintos overview

Version Control n Goal ¨ n n CVS and Subversion Keywords ¨ n Cooperation

Version Control n Goal ¨ n n CVS and Subversion Keywords ¨ n Cooperation development, Avoid version mixing, Improve code shareablity, Solving conflicts, Management of change histories, Blame, Automatic daily build, etc. . . Repository, Module, Import, Checkout, Revision, Commit, Update, Lock, Tag, Branch, Release See more information on “Revision_control” in Wikipedia Operating System Project - pintos overview

svn n Compelling replacement for CVS in the open source community ¨ n Change

svn n Compelling replacement for CVS in the open source community ¨ n 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 ¨ n Recommend Microsoft Windows User to use 'tortoisesvn' (http: //tortoisesvn. tigris. org/) Operating System Project - pintos overview

svn n Create svn directory ¨ n Create svn repository ¨ n user@linda: ~$

svn n Create svn directory ¨ n Create svn repository ¨ n user@linda: ~$ mkdir svn user@linda: ~$ svnadmin create svn/pintos Import module baseline user@linda: ~$ ls pintos svn ¨ user@linda: ~$ svn import pintos file: ///home/jkang/svn/pintos/ (user@linda: ~$ svn import pintos file: //`pwd`/svn/pintos/) ¨ . . . Adding pintos/src/examples/Makefile Adding pintos/src/examples/. cvsignore Committed revision 1. jkang@linda: ~$ Operating System Project - pintos overview

svn n Delete original source ¨ n user@linda: ~$ ls pintos svn user@linda: ~$

svn n Delete original source ¨ n user@linda: ~$ ls pintos svn user@linda: ~$ rm -rf pintos user@linda: ~$ ls svn Checkout from repository ¨ user@linda: ~$ svn checkout file: //`pwd`/svn/pintos. . . A pintos/src/examples/Makefile A pintos/src/examples/. cvsignore Checked out revision 1. user@linda: ~$ ls pintos svn Operating System Project - pintos overview

svn n n Edit source code (Edit 'pintos/src/LICENSE' file) Commit If change set has

svn n n 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 pintos Sending pintos/src/LICENSE Transmitting file data. Committed revision 2. user@linda: ~$ ¨ n Update (Different location and revision) ¨ user@linda: ~$ svn update pintos U pintos/src/LICENSE Updated to revision 2. user@linda: ~$ Operating System Project - pintos overview

Thank you Operating System Project - pintos overview

Thank you Operating System Project - pintos overview