OS) Chapter 2. Operating-System Structure

Operating System Structures

OS Services : OSprogramuser에게 programservice의 실행을 위한 환경을 제공한다.
-       User interface – 거의 모든 operating systemuser interface를 갖고 있다. (UI) : Command-Line (CLI), Graphics User Interface (GUI), Batch

-       Program execution – systemprogrammemory로 불러들이고, 프로그램을 실행시키는 데 필요하다.

-       I/O operation - file이나 I/O device를 포함하는 running programI/O를 필요로 한다.

-       File-System manipulation – filedirectory를 읽고 쓰며, 그들을 만들고 삭제하고, 찾으며, 그 정보를 나열하고, 접근 권한에 대해 제어할 프로그램이 필요하다.

-       Communication – Processesnetwork를 넘어 computer들과 같은 computer에서 information을 교환한다. -> 그 정보는 shard memorymessage passing을 이용하여 진행된다.

-       Error detection – OS는 가능한 error들을 감지하는 능력을 필요로 한다.

-       Resource Allocation – 만약 복수의 user나 복수의 job들이 병렬적으로 resource를 사용한다며 그들에게 맞게 할당되어야 한다.

-       Accounting – usercomputer resource를 얼마나 , 어떠한 종류를 사용하는지 정보를 얻어낸다.

-       Protection and security – system resource에 대한 모든 접근은 제어되어야만 하며, outsider로부터 system은 무효한 접근 시도로부터 오는 외부 I/O device로부터 보호해야 한다.




User Operating System Interface

-       CLI or command interpreter는 직접적인 command entry를 수행한다.

n  kernel에서 시행되기도 하며, 가끔은 프로그램에 의해 시행됨.

n  Shells: Shell은 보다 user level에서 진행되는 program으로 전적으로 user interface에 맞게 hardwareI/Ocontrol한다. (kernel같은 경우에는 hardware적으로 I/O를 제어함. UserShell을 통해서 hardware를 제어하는데 명령하고, 이는 kernel 상으로 전달되어 kernel이 직접적인 hardware에 대한 명령을 수행한다.)

-       Graphics User interfaces

n  User에게 익숙한 desktop과 같은 interface 구축. 많은 시스템이 CLIGUI Interface를 둘 다 구축.

System Calls : OS에 의해 제공되는 service를 위한 programming interface이다. 대부분 직접적인system call 사용보다는 high-level Application Programming Interface(API)를 통한 프로그램에 의해 접근된다.

Types of System Calls
-       Process control : Debugger, single step execution, Locks
-       File management
-       Device Management
-       Information maintenance
-       Communications : Message passing model to host name or process name, Shared-memory model
-       Protection





System Programs: 프로그램 개발과 실행에 필요한 편리한 환경을 제공한다. (ex) File manipulation, Status information, Programming Language Support, Program Loading and execution, Communications, Background services, Application programs.

Practice Exercises

2.1 System Call의 목적은 무엇인가?
System calluser-level processOSservice를 요청하도록 한다.

2.2 Process management에서 OS5가지 주 목적
1. System ProcessUser process의 생성과 삭제
2. Process의 요구와 재개
3. Process 동기화의 mechanism 제공
4. Process Communicationmechanism 제공
5. Deadlock handlingmechanism 제공

2.3 Memory management에서 OS의 세 가지 주 역할
1. 어떤 메모리가 사용되고 있고, 누구에 의해 사용되고 있는지 기록
2. 메모리 공간이 사용 가능할 때, 메모리에 어떤 processload시킬건지 결정함.
3. 메모리 공간을 필요할 때마다 할당, 비할당시킨다.

2.4 2차 저장장치에서의 OS의 세 가지 주 역할
1. Free space 관리 2. 저장장소 할당 3. Disk Scheduling

2.5 Command Interpreter의 목적이 무엇이고 왜 Kernel과 동떨어져서 사용하나?
Command InterpreterUser-level에서, 혹은 file로부터 command를 불러들여 그것을 실행시키며, 이는 대다수가 system call로 전환된다. Kernel-level에서 User가 접근할 필요 없이 System call을 이용하여 UserI/OHardware에 접근하기에 쉽게 하기 위해 Kernel과 분리해서 사용한다.

2.6 새로운 process를 실행하기 위해 command interpreter 혹은 shell에 의해 어떠한 system call이 실행되어 하는가?
Fork() function by an exec system.

2.7 System program의 목적은 무엇인가
System program은 유용한 system callbundle이라고 생각할 수 있다. System programuser가 일반적인 문제를 풀기 위한 program을 직접 짤 필요 없이 기본적인 기능을 제공한다.

2.8 System design에서 layered approach의 큰 장점은 무엇이며 단점은 무엇인가?
오직 제한적인 section만 건들이면 되기 때문에 debuggingmodification이 쉽다. Data가 특정 module이나 layer에 제한되어야만 하기 때문에 그것에 영향을 끼치는 bug들이 있다.

2.9 OS가 제공하는 5가지의 서비스를 적고, 유저들에게 어떻게 편리성을 제공하는 지 설명하라. 어떠한 케이스에서 이러한 serviceuser level에서 제공하는 것이 불가능한지 설명하여라.
1) Program execution: OSfilecontents를 불러들여 memoryload시키고, 그것을 실행한다. User-level program CPU 시간이 올바르게 할당되었는지 확인할 수 없다.

2) I/O operation: Disk, tape, serial line, 다른 device들은 매우 낮은 단계에서 communicate되어야 한다. 시스템이 요구를 devicecontroller에 특이적인 command로 전환하는 반면, 유저는 오직 device를 지정하고, 그것을 실행시키기 위한 operation을 지정할 수 있다.

3) File-system manipulation: 파일 생성, 삭제, 할당 그리고 user가 시행시킬 수 없는 것들에는 많은 detail이 있다. Disk 공간의 block들은 file에 의해 사용되거나 유지된다. 파일을 삭제하는 것은 name file에 대한 정보를 삭제하는 것과 할당 받은 blockfree시키는 것이 필요하다. File access등을 보정하는 protection도 필요하다. User program에서는 protection을 보장받거나 오직 free block을 할당시키거나 file deletion에서 block을 비할당시키는 것을 신뢰할 수 없다.

4) Communications: system 사이에 Message passing message를 정보의 packet으로 전환하는 과정이 필요하고, network controller에게 보내야 하며, communication medium을 통해 보내져야 하며, destination system에서 수용되어야 한다. Packet orderingdata correction이 이루어져야 한다. User program에서는 network device에 들어갈 access가 없고, 다른 process로부터 packet을 받을 access 권한이 없다.

5) Error detection: Error 검증은 hardwaresoftware level에서 일어난다. Hardware level에서 모든 데이터 송신에서 데이터 손실이 일어나지 않았는지 검사 받아야만 한다. 미디어 상의 모든 데이터들은 media가 쓰여지는 도중에 변하지 않았는지 확인해야만 한다. Software level에서 mediadataconsistency를 위해 확인되어야만 한다. 예를 들어 디바이스에서 allocatedunallocatedstorage block이 전체 numbermatching이 되는지 확인해야만 한다. Error는 종종 process와는 독립적이므로, 그곳에는 error의 모든 type을 다루는 globalprogram이 존재해야만 한다.


댓글

가장 많이 본 글