2 ComputerSystem Structures Computer System Operation IO Structure























- Slides: 23
2장 컴퓨터 시스템 구조 (Computer-System Structures) • • • 컴퓨터 시스템 연산 (Computer System Operation) 입출력 구조 (I/O Structure) 저장장치 구조 (Storage Structure) 저장장치 계층 (Storage Hierarchy) 하드웨어 보호 (Hardware Protection) 일반적인 시스템 구조 (General System Architecture) 2000 운영체제 2. 1 인천대학교 컴퓨터공학과 성미영
컴퓨터 시스템 연산 ~ • Bootstrap program (부트스트랩: 편상화의 손잡이 가죽) – 초기화 – load the OS – OS개시 (init process: wait for event) • • Bootstrap 완료후 event 기다림 • Interrupt 처리 절차 1. 하던 일 중단: return address 저장 2. Interrupt 종류 확인 T polling T vectored interrupt 3. 해당 interrupt의 service routine 실행 완료 4. 하던 일 다시 시작: return address부터 실행 Event – H/W generated interrupt (I/O 완료 event) -> signal to the CPU – S/W generated interrupt (trap) -> system call (monitor call) 2000 운영체제 2. 2 인천대학교 컴퓨터공학과 성미영
컴퓨터 시스템 연산 • Return address의 저장 1. memory 특정위치에 : 초기 컴퓨터 2. system stack에 : 최근 컴퓨터 • Interrupt vector – 장치번호로 인덱스된 포인터들의 배열 (a table of pointers indexed by a unique device number) • Interrupt 진행 중 새로운 interrupt오면 – disable : 기다림 – enable : 우선순위에 따라 처리 (sophisticated system) • OS는 interrupt-driven 이다. 2000 운영체제 2. 4 인천대학교 컴퓨터공학과 성미영
I/O Interrupts 기반 구조 • I/O 시작 – CPU가 device controller의 register들을 set – device controller 는 register 내용 검사하여 동작 개시 • I/O 끝 – device controller가 CPU에 interrupt • 종류 – 동기적(synchronous) I/O T user program이 I/O 완료를 기다림 T interrupt한 장치 쉽게 인식 – 비동기적(asynchronous) I/O T I/O완료를 기다리지 않고 user program으로 T I/O 완료를 기다리려면 wait 명령 또는 wait loop으로 다음 interrupt 까지 기다리게 할 수 있음 T simultaneous I/O 가능 • 동시에 many I/O requests의 처리 위해 – device-status table(장치 상태 테이블) 필요 (p 24 그림 2. 4) T type, address, state T list or chain(=linked list) 형태로 request등록(request list) – I/O interrupt -> OS가 device알아냄 -> I/O device table변경 2000 운영체제 2. 8 인천대학교 컴퓨터공학과 성미영
기억장치 구조 (Storage Structure) ~ • 기억장치 연산 – Load : main memory-> CPU의 register – Store : CPU -> memory • Von Neumann 구조의 명령 실행 사이클 – fetch : 명령 -> instruction register – decode – execute: 실행 후 결과를 register에 저장 • Main memory : direct-access storage device – ① too small – ② volatile • Secondary storage – ① extremely large – ② permanent 2000 운영체제 2. 13 인천대학교 컴퓨터공학과 성미영
기억장치의 계층구조 (Storage Hierarchy) • 계층 요소 – speed – cost – volatility • 캐싱 (caching) – 더 빠른 저장 장치에 정보를 복사 – main memory: a last cache for secondary storage • Caching (Cache memory) – 사용할 가능성이 많은 자료를 cache에 저장 – cache에 없으면 memory access – (예) index registers 등도 일종의 cache • 응집성과 일관성(Coherency and Consistency) – multitasking: variable copy들의 coherency 문제 – multiprocessor: local cache들의 coherency 문제 – distributed system에서의 coherency 문제: file copy들 + local cache들 의 coherency 문제 2000 운영체제 2. 16 인천대학교 컴퓨터공학과 성미영
하드웨어 보호 (Hardware Protection) • 이중 모드(Dual-Mode Operation) – mode bit T 1 -> user mode (사용자 모드) T 0 -> monitor mode (Supervisor mode, system mode, privileged mode) – H/W : mode bit(1 bit) – 특권명령(privileged instruction)의 사용 -> trap (모니터 모드에서만 동작해야 하는 명령) – interrupt 나 trap 생기면 monitor mode로 전환 Interrupt/fault monitor user set user mode 2000 운영체제 2. 18 인천대학교 컴퓨터공학과 성미영