Upload
etoile
View
145
Download
5
Embed Size (px)
DESCRIPTION
[ 2014-1] 운영체제 Week 1 : 강의 소개 & Chap1. 컴퓨터 시스템. 담당교수 : 최 윤 정. [ 운영체제 ] 란. 기초 학문. 전공 필수. 시스템 소프트웨어의 핵심으로서 하드웨어의 효과적인 제어 와 함께 응용소프트웨어의 실행 을 위한 기반 소프트웨어 컴퓨터 시스템의 구조와 역할 , 운영방법 에 관한 기초 학문 CPU , 메모리 , 디스크 , 네트워크 자원 관리 및 제어 방법 시스템 보안 및 관리. [ 운영체제 ] 관련 분야의 예. - PowerPoint PPT Presentation
Citation preview
[2014-1] 운영체제
Week 1 : 강의 소개 & Chap1. 컴퓨터 시스템
담당교수 : 최 윤 정
1
[ 운영체제 ] 란
시스템 소프트웨어의 핵심으로서 하드웨어의 효과적인 제어와
함께 응용소프트웨어의 실행을 위한 기반 소프트웨어
컴퓨터 시스템의 구조와 역할 , 운영방법에 관한 기초학문
CPU , 메모리 , 디스크 , 네트워크 자원
관리 및 제어 방법
시스템 보안 및 관리
2
기초 학문전공 필수
[ 운영체제 ] 관련 분야의 예
3
H/W 설계 및 제어Embedded S/W
시스템 운용 및 자원관리
시스템 엔지니어응용 시스템 개발
Quiz 운영체제의 종류 . 아는 대로 모두 !
능숙하게 다룰 수 있는 OS 는 ?
개인용 PC 에 설치할 만한 OS 는 ?
서버용 컴퓨터라면 ?
왜 !!?
4
기능과 역할 보안 및 신뢰성
시스템 구축 및 사용 환경에 따라 선택되는 것이 좋다 .... 끝인가 ??
‘ 기본적인 것’에 대한 중요성을 인지하는 것
‘운영방침’을 이해하고 지키는 것은 모두 ,
대단히 중요합니다 .
그것이 사회시스템이든 정보시스템이든 ..
5
6
구성요소의 역할 및 기능을 간과하고 운영 규정을 무시했던 사례들 ..
7
자고 일어나면맨 땅에새로운건물 하나가지어지던 시절 …
1969 년 ..
서울에 ‘ 와우 아파트’가 지어집니다 .
8
산 비탈에 지어진아파트 , 그러나 ..
곧 무너집니다 .
원인은 …
‘ 부실공사’
철근 70 개 5개
처음부터‘ 지질검사’조차
하지 않았습니다 .
…….…왜 ..?
‘ 화강암석이니 단단하겠지 !’
9
1977 년 ..
전북 ‘이리역’이 폭발합니다 ..
1993 년 ..
서해훼리호가 침몰합니다 ..
10
1994 년 ..
성수대교
11
1995 년 ..
삼풍백화점
…
사망자 500 여명부상자 900 여명
12
그리고 2014 년…
13
어디서부터 ,
누가 ,
무엇이 잘 못 되었을까요 ?
설계 & 개발자 ..?
운영자… ?
사용자… ?
14
15
IPTV 3 사의
셋탑박스들
16
자원요소와 제한요소의 특성을 잘 이해한 후
주어진 환경에 맞게 설계하고
목적에 맞게 운영하고
활용한 예도 있습니다 ..
17
18
19
20
21
22
실습 Track - [리눅스 실습] 기본 커맨드 & 관리자 커맨드
script, vi, gcc 등의 툴
서버 설치 및 운용
이론 Track - [ 운영체제 ] 역할 및 구성 메모리 & 프로세스에 대한 이해
2 Tracks : 이론과 실습
23
강의 목표
학습 목표
Quiz 운영 방법
평가 방법
학습 목표 1
[ 운영체제 ] 이론 수업에서
컴퓨터 구성 요소와 기본적인 메커니즘을 정확하게 알아둡니다 . 실무적으로 .. 시간을 두고 넓고 깊게 이해할 수 있는 시간이 있습니다 .
S/W 개발시 or 다양한 Platform 의 특성에 따른 효율성과 최적화를
고려합니다 . h/w 특성 , 설계 구조
메모리들 , 처리속도 , 알고리즘 외적인 부분에서의 효율성 , 예 ) slide 43
주어진 문제와 개발 환경에 대한 ‘이해력’과 ‘통찰력’이 을 기를 것 . S/W 개발 및 운영 platform 대한 적응력 배양 : 여러 가지의 버그들 , 에러들
이후 진로를 위한 기반지식으로써의 의미를 부여할 것
24
필수 !!
바램 ^^
학습 목표 2
[ 운영체제 ] 실습 수업에서
리눅스 환경에서 기본적인 운영 / 관리커맨드를 능숙히 다룰 수 있도록
연습합니다 . 사용자 관리 및 화일관리
OS 자원 제어
기본 툴 활용 : VI, Gcc , 스크립트 등
시스템 보안 & 안정성을 위한 운영 방법의 이해와 적용
네트워크 및 병렬처리
각 오류 및 장애발생시 대처 노하우
25
필수 !!
바램 ^^
운영체제
운영체제 – 그림으로 배우는 구조 ( 개정판 ) , 구현회 , 한빛 출판사
리눅스
리눅스 커맨드라인 완벽 입문서, 윌리엄 E. 샤츠 주니어, BJ 퍼블릭
뇌를 자극하는 RedHat Fedora 서버 & 네트워크 , 우재남 , 한빛 출판사
서자룡의 Fedora 리눅스 그대로 따라하기 . 서자룡 , 혜지원
위와 관련된 도서가 있다면 참고하셔도 좋습니다 .
교재 안내
26
둘러보기
멋쟁이 사자처럼
다양한 색과 배경 , 무엇보다 열의 , 열정을 가진 사람들의 모임 . 전공자와 비전공자들과의 가치있는 소통 . 3 개월간 공부 , 2 개월간 서비스 개발 .. 어디까지 가능했을까 ?
지난 프로젝트들…
기본기 + 성실함 + 열정이 만났을 때 가능했던 일들 . 계획과 설계의 중요성 .! Http://home.konkuk.ac.kr/~cris/lectures.html
27
강의 운영 방법 1 Slide 23!
이론의 이해 vs. 실습 이론 학습 후 필요 시 퀴즈 / 확인 실습
실습 실 지정좌석제
시험 : 중간 + 기말 + 퀴즈
수업자료실 : http://café.daum.net/si.oop 강의 내용 및 게시판 : 질의 응답 및 실습시간 미션과제 제출용
28
과제 형태
조사 과제 : report 이론에 대하여 : 추가내용을 더 조사하고 정리하여 수업 전 제출합니다 .
실습 과제 1 : 지시에 따라 명령어
제한된 명령어와 연산자의 종류를 이용하여 ‘기능’을 구현함 . 조건 별 채점
실습 과제 2 : script 명령어 파일 ( 주석추가 하여 설명 ) + 실행 파일
source 화면 + 결과화면 출력하여 제출 ( 축소 후 1~2 장으로 ) source 화일와 실행화일은 수업게시판에 비밀글로 upload.
개인별 수행을 원칙으로 함 .
29
평가 방법 및 정책
실습 과제 1 : 개별 확인 및 평가 & 자동 평가시스템 과제 확인 시간 : 매 수업시간 마다 . 팀으로 수행하여 제출한 경우에도
반드시 개별적으로 tool 과 code 에 대한 모든 동작상태를 설명해야 합니다 .
실습 과제 결과 : 팀 혹은 개인당 3~5 분 정도의 양으로 정리하여 발표
과제 제출 마감 후 : -2점 / 1 일
중간 및 기말고사 후 필요 시 재시험
반영 비율
중간고사 : 30%, 기말고사 : 30% 퀴즈 및 과제물 : 20% 출석 및 수업참여도 : 20%
30
오늘의 실습 : 개발환경 setting 하기
개인 PC 에 Mini Linux 가상 에뮬레이터를 설치합니다 . MinGW 또는 Cigwin
http://sourceforge.net/projects/mingw/files/ 에서
Download mingw-get-inst-20110211.exe (575.4 KB)
vi 로 코딩해보기
내컴퓨터 - 속성 - 환경변수에 path추가
C:\MinGW\bin vi editor 사용하기 : vim
$ vim $ alias vi=‘vim’
compile $ gcc –o test test.c
31
vi 로 test.c 만들기
혹시 vi 를 잘 모른다면 아래 블로그를 참고해보세요 . http://blog.naver.com/withakiss?Redirect=Log&logNo=1500942002
73 http://alh84002.blog.me/110100365527 Edit mode , Command mode , Ex mode
$ vim test.c #include <stdio.h>
int main(void) { printf(“ Operation System! \n\n”);
}
$ gcc –o test test.c $ ./test
32
# 틈틈히 해야하는 과제
Linux 환경과 vi 에디터를 사용하여 익혀오세요
기본적인 쉘 명령어
vi 로 파일 생성하고 편집하기
방향키 : h(), j( 아래 ), k( 위 ), l()
입력 : i , I, a , A
저장 : w
종료 : q
저장없이 종료 : q!
찾기 , 바꾸기 등
자료를 제출할 필요는 없으나 틈틈히 수행하도록 합니다 .
33
Topics :
35
Carnegie Mellon
Curriculum
OperatingSystems Compilers
ProcessesMem. Mgmt
Networks
NetworkProtocols
Architecture EmbeddedSystems
C Programming
Databases
Data Reps.Memory Model
DigitalComputation
MachineCode Arithmetic
EmbeddedSystem Eng.
Foundation of Computer SystemsUnderlying principles for hardware, software, and networking
Execution ModelMemory System
System Programming
Carnegie Mellon
Course Perspective
Most Systems Courses are Builder-Centric Computer Architecture
Design pipelined processor Operating Systems
Implement large portions of operating system Compilers
Write compiler for simple language Networking
Implement and simulate network protocols
Carnegie Mellon
Course Perspective (Cont.)
Our Course is Programmer-Centric Purpose is to show how by knowing more about the
underlying system, one can be more effective as a programmer
Enable you to Write programs that are more reliable and efficient Incorporate features that require hooks into OS
E.g., concurrency, signal handlers
Abstraction vs. Reality Previous courses emphasize abstraction.
Abstraction Is Good But Don’t Forget Reality! Need to understand details of underlying implementations
Useful outcomes Become more effective programmers
Able to find and eliminate bugs efficiently Able to understand and tune for program performance
Prepare for later “systems” classes in CS & ECE Compilers, Operating Systems, Networks, Computer Architecture,
Embedded Systems....
39
Reality #1
Ints are not Integers, Floats are not Reals Is x2 ≥ 0 ?
40000 * 40000 = 1600000000 50000 * 50000 = ??
Is (x + y) + z = x + (y + z)? Unsigned & Signed Int’s: Yes! Float’s:
(1e20 + -1e20) + 3.14 --> 3.14 1e20 + (-1e20 + 3.14) --> ??
40
Carnegie MellonReality #2 : You’ve Got to Know
Assembly
Understanding assembly is key to machine-level execution model Behavior of programs in presence of bugs
High-level language models break down Tuning program performance
Understand optimizations done / not done by the compiler Understanding sources of program inefficiency
Implementing system software Compiler has machine code as target Operating systems must manage process state
Creating / fighting malware : x86 assembly is the language of choice!
Carnegie Mellon
Assembly Code Example Read-Time Stamp Counter(rdsc) Special 64-bit register in Intel-compatible machines Incremented every clock cycle Read with rdtsc instruction
Application Measure time (in clock cycles) required by procedure
double t;start_counter();P();t = get_counter();printf("P required %f clock cycles\n", t);
Carnegie Mellon
Code to Read Counter Write small amount of assembly code using GCC’s asm
facility Inserts assembly code into machine code generated by
compilerstatic unsigned cyc_hi = 0;static unsigned cyc_lo = 0;
/* Set *hi and *lo to the high and low order bits of the cycle counter. */void access_counter(unsigned *hi, unsigned *lo){ asm("rdtsc; movl %%edx,%0; movl %%eax,%1"
: "=r" (*hi), "=r" (*lo) :: "%edx", "%eax");
}
Reality #3: Memory Matters Random Access Memory Is an Unphysical
Abstraction Memory is not unbounded
It must be allocated and managed Many applications are memory dominated
Memory referencing bugs especially pernicious Effects are distant in both time and space
Memory performance is not uniform Cache and virtual memory effects can greatly affect program
performance Adapting program to characteristics of memory system can lead to
major speed improvements44
Carnegie Mellon
Memory Referencing Errors C and C++ do not provide any memory protection
Out of bounds array references Invalid pointer values Abuses of malloc/free
Can lead to nasty bugs Whether or not bug has any effect depends on system and compiler Action at a distance
Corrupted object logically unrelated to one being accessed Effect of bug may be first observed long after it is generated
How can I deal with this? Program in Java, Ruby or ML Understand what possible interactions may occur Use or develop tools to detect referencing errors (e.g. Valgrind)
Carnegie MellonMemory System Performance
Example
Hierarchical memory organization Performance depends on access patterns
Including how step through multi-dimensional array
void copyji(int src[2048][2048], int dst[2048][2048]){ int i,j; for (j = 0; j < 2048; j++) for (i = 0; i < 2048; i++) dst[i][j] = src[i][j];}
void copyij(int src[2048][2048], int dst[2048][2048]){ int i,j; for (i = 0; i < 2048; i++) for (j = 0; j < 2048; j++) dst[i][j] = src[i][j];}
Carnegie Mellon
The Memory Mountains1 s2 s3 s4 s5 s6 s7 s8 s9
s10
s11
s12
s13
s14
s15
s16
s32
s64
0
1000
2000
3000
4000
5000
6000
7000
64M 16
M 4M
1M
256K 64
K 16K 4K
Stride (x8 bytes)
Rea
d th
roug
hput
(MB
/s)
Size (bytes)
L1
L2
Mem
L3
copyij
copyji
Intel Core i72.67 GHz32 KB L1 d-cache256 KB L2 cache8 MB L3 cache
Carnegie Mellon
Reality #4
Computers do more than execute programs
They need to get data in and out I/O system critical to program reliability and performance
They communicate with each other over networks Many system-level issues arise in presence of network
Concurrent operations by autonomous processes Coping with unreliable media Cross platform compatibility Complex performance issues
Carnegie Mellon
Programs and Data
Topics Bits operations, arithmetic, assembly language
programs Representation of C control and data structures Includes aspects of architecture and compilers
Assignments L1 (datalab): Manipulating bits L2 (bomblab): Defusing a binary bomb L3 (buflab): Hacking a buffer bomb
Carnegie Mellon
The Memory Hierarchy
Topics Memory technology, memory hierarchy, caches, disks,
locality Includes aspects of architecture and OS
Assignments L4 (cachelab): Building a cache simulator and optimizing
for locality. Learn how to exploit locality in your programs.
Carnegie Mellon
Performance
Topics Co-optimization (control and data), measuring time on a
computer Includes aspects of architecture, compilers, and OS
Carnegie Mellon
Exceptional Control Flow Topics Hardware exceptions, processes, process control, Unix
signals, nonlocal jumps Includes aspects of compilers, OS, and architecture
Assignments L5 (proclab): Writing puzzles using processes and
signals. A first introduction to concurrency
Carnegie Mellon
Virtual Memory
Topics Virtual memory, address translation, dynamic storage
allocation Includes aspects of architecture and OS
Assignments L6 (malloclab): Writing your own malloc package
Get a real feel for systems programming
Carnegie Mellon
Networking, and Concurrency
Topics High level and low-level I/O, network programming Internet services, Web servers concurrency, concurrent server design, threads I/O multiplexing with select Includes aspects of networking, OS, and architecture
Assignments L7 (proxylab): Writing your own Web proxy
Learn network programming and more about concurrency and synchronization.
57