Computer Science
-
Operating System - IPCComputer Science/Operating System 2022. 1. 12. 14:17
IPC IPC란? IPC는 Inter-Process Communication의 약자로 내부 프로세스 간 통신을 의미한다. 위 그림처럼 각각의 프로세스는 완전히 독립된 실행 객체이다. 서로 독립되어 있다는 것은 다른 프로세스의 영향을 받지 않는다는 장점이 있다. 하지만, 독립되어 있는 만큼 별도의 설비가 없이는 서로 간에 통신이 어렵다는 문제가 있다. 이러한 문제를 위해서 커널 영역에서 IPC라는 내부 프로세스 간 통신을 제공하게 되고, 프로세스는 커널이 제공하는 IPC 설비를 이용해서 프로세스 간 통신을 할 수 있다. IPC의 종류 1. PIPE(익명 PIPE) PIPE는 두 개의 프로세스를 연결하게 되고, 하나의 프로세스는 데이터를 쓰기만 하고, 다른 하나는 데이터를 읽기만 할 수 있다. 한쪽 방향으로..
-
Operating System - PCB & Context SwitchingComputer Science/Operating System 2022. 1. 11. 21:02
PCB Process Management Process Management란 CPU가 프로세스가 여러 개일 때, CPU 스케줄링을 통해 관리하는 것을 말한다. 이때, CPU는 각 프로세스들이 누군지 알아야 관리가 가능하다. 프로세스들의 특징을 갖고 있는 것을 Process Metadata라고 하며, Process Metadata가 가지고 있는 정보들은 다음과 같다. ㆍ Process ID ㆍ Process State ㆍ Process Priority ㆍ CPU Registers ㆍ Owner ㆍ CPU Usage ㆍ Memory Usage 이 메타데이터는 프로세서가 생성되면서 PCB(Process Control Block)라는 곳에 저장된다. PCB란? ㆍ PCB는 Process Control Block..
-
Operating System - 인터럽트(Interrupt)Computer Science/Operating System 2022. 1. 5. 17:50
인터럽트(Interrupt) 인터럽트란? ㆍ 프로그램을 실행하는 도중에 예기치 못한 상황이 발생할 경우 현재 실행 중인 작업을 즉시 중단하고, 발생된 상황에 대한 우선 처리가 필요함을 CPU에게 알리는 것이다. ㆍ 지금 수행 중인 일보다 더 중요한 일(입출력 처리, 우선순위 연산 등)이 발생하면, 그 일을 먼저 처리하고 나서 하던 일을 계속해야 한다. 인터럽트의 종류 ㆍ 인터럽트의 종류로는 외부 인터럽트, 내부 인터럽트, 소프트웨어 인터럽트가 존재한다. 외부 인터럽트 ㆍ 전원 이상 인터럽트(Power Fail Interrupt) : 정전, 파워 이상으로부터 발생한 인터럽트 ㆍ 기계 착오 인터럽트(Machine Check Interrupt) : CPU의 기능적인 오류로 인해 발생한 인터럽트 ㆍ 외부 신호 ..
-
Operating System - 프로세스 주소 공간Computer Science/Operating System 2022. 1. 5. 17:21
메모리 영역 ㆍ 프로그램이 CPU에 의해 실행되면, 프로세스가 생성되고 메모리에 프로세스의 주소 공간이 할당된다. ㆍ 프로세스 주소 공간에는 크게 Code, Data, Heap, Stack 영역이 존재한다. Code(Text) 영역 ㆍ 우리가 작성한 소스코드가 들어가는 부분이다. 즉, 실행할 프로그램의 코드가 저장되는 영역으로 Text 영역이라고도 부른다. ㆍ Code 영역은 실행 파일을 구성하는 명령어들이 올라가는 메모리 영역으로 함수, 제어문, 상수 등이 여기에 지정된다. ㆍ 컴파일 타임에 결정되고 중간에 코드를 바꿀 수 없게 Read-Only로 지정되어있다. Data 영역 ㆍ 프로그램의 전역 변수와 정적 변수가 저장되는 영역이다. 즉, 프로그램이 구동되는 동안 항상 접근 가능한 변수가 저장되는 영역..
-
Operating System - 프로세스 & 스레드Computer Science/Operating System 2022. 1. 4. 15:19
프로세스(Process) 프로그램(Program)이란? ㆍ 어떤 작업을 위해 실행할 수 있는 파일 프로세스(Process)란? ㆍ 컴퓨터에서 연속적으로 실행되고 있는 프로그램 ㆍ 메모리에 올라와 실행되고 있는 프로그램의 인스턴스 ㆍ 운영체제로부터 시스템 자원을 할당받는 작업의 단위 ㆍ 즉, 실행되는 프로그램을 의미 프로세스가 할당받는 시스템 자원 ㆍ CPU 시간 ㆍ 운영되기 위해 필요한 주소 공간 ㆍ Code, Data, Stack, Heap의 구조로 되어있는 독립된 메모리 영역 프로세스의 특징 ㆍ 프로세스는 각각 독립된 메모리 영역(Code, Data, Stack, Heap)을 할당받는다. ㆍ 기본적으로 프로세스당 최소 1개의 스레드(메인 스레드)를 가지고 있다. ㆍ 각 프로세스는 별도의 주소 공간에서..
-
Operating System - 운영체제Computer Science/Operating System 2022. 1. 3. 15:59
운영체제 운영체제란? ㆍ 일반적으로 하드웨어를 관리한다. ㆍ 응용 프로그램과 하드웨어 사이에서 인터페이스 역할을 하며, 시스템의 동작을 제어하는 시스템 소프트웨어로 정의한다. ㆍ 시스템의 자원과 동작을 관리하는 소프트웨어이다. 운영체제의 역할 프로세스 관리 운영체제에서 작동하는 응용 프로그램을 관리하는 기능이다. 어떤 의미에서는 프로세서(CPU)를 관리하는 것이라고 볼 수도 있다. 현재 CPU를 점유해야 할 프로세스를 결정하고, 실제로 CPU를 프로세스에 할당하며, 이 프로세스 간 공유 자원 접근과 통신 등을 관리하게 된다. 저장장치 관리 1차 저장장치에 해당하는 메인 메모리와 2차 저장장치에 해당하는 하드디스크, NAND 등을 관리하는 기능이다. 1차 저장장치(Main Memory) ㆍ 프로세스에 할당..