From the time you first apply power to a processor until the time you shut it off, the program counter assumes a sequence of values
a0,a1,...,an−1
where each Ak is the address of some corresponding instruction Ik. Each transition from ak to AK+1 is called a control transfer. A sequence of such control transfers is called the flow of control, or control flow, of the processor.
프로세서에 전원을 공급하고 전원을 끌 때 까지, PC(Program Counter)는 아래와 같이 연속된 값을 갖는 것으로 생각할 수 있다.
a0,a1,...,an−1
Ak는 각각 IK의 주소에 해당한다. 이 때 Ak 에서 AK+1 의 전환은 '제어이동' 이라고 부른다.
The simplest kind of control flow is a “smooth” sequence where each IK and IK+1 are adjacent in memory. Typically, abrupt changes to this smooth flow, where IK+1 is not adjacent to IK, are caused by familiar program instructions such as jumps, calls, and returns.
가장 간단한 형태의 제어 흐름은 "점진적인" 순서로, IK IK+1가 메모리에 인접한 경우이다.
대게🦀, IK 와 IK+1가 인접하지 않은 갑작스러운 변화는 jumps나 calls 그리고 returns과 같은 프로그램 인스트럭션에 의해 일어난다.
Such instructions are necessary mechanisms that allow programs to react to changes in internal program state represented by program variables.
이러한 (jumps, calls and returns) 프로그램 변수들에 의한 내부 프로그램 상태 변화에 프로그램이 반응하도록 하기 위해 반드시 필요한 메커니즘이다.
But systems must also be able to react to changes in system state that are not captured by internal program variables and are not necessarily related to the execution of the program.
그러나, 시스템들은 내부 프로그램 변수에 의해 표시되지 않으며(내부 프로그램 변수에 의해 실행되지 않는을 뜻함), 프로그램의 실행과는 무관한 시스템 상태 변화에 대해서도 반응을 해야한다.
For example, a hardware timer goes off at regular intervals and must be dealt with. Packets arrive at the network adapter and must be stored in memory. Programs request data from a disk and then sleep until they are notified that the data are ready. Parent processes that create child processes must be notified when their children terminate.
예를 들어서,
1. 하드웨어 타이머는 일정 간격이 지나면 꺼져야 하며, 시스템이는 이를 반드시 처리해야 한다.
2. 패킷은 네트워크 어뎁터에 도달하고, 메모리에 저장되어야 한다.
3. 프로그램은 디스크로부터 데이터를 요청하고, 데이터가 준비 될 때 까지 sleep 상태에 있어야 한다.
4. 자식 프로세스를 생성한 부모 프로세스들은 자식프로세스가 종료 될 때 반드시 통보(Notification)을 받아야 한다. (마치 우리 앱 알람 받듯이!)
Modern systems react to these situations by making abrupt changes in the control flow. In general, we refer to these abrupt changes as exceptional control flow (ECF).
현대 시스템들은 제어 흐름에 '급진적 변화'를 만듦으로써 위의 예시와 같은 상황에 대응 합니다. 일반론적으로, 이러한 급진적인 변화들을 Exceptional control flow(ECF) 라고 부릅니다.
ECF occurs at all levels of a computer system. For example, at the hardware level, events detected by the hardware trigger abrupt control transfers to exception handlers.
ECF는 컴퓨터 시스템 레벨에서 발생합니다. 예를 들어 하드웨어 레벨에서는, 하드웨어 트리거에 의해 검출된 이벤트들은 급진적인 컨트를 흐름을 exception handlers에게 발생시킵니다.
-> 번역체라 말이 길다..!
1. 하드웨어 트리거가 이벤트들을 검출한다.
2. 하드웨어는 예외 처리기(Exception handler)로 제어 전달을 트리거 합니다.
At the operating systems level, the kernel transfers control from one user process to another via context switches. At the application level, a process can send a signal to another process that abruptly transfers control to a signal handler in the recipient. An individual program can react to errors by sidestepping the usual stack discipline and making nonlocal jumps to arbitrary locations in other functions.
운영체제 레벨에서는, 커널이 한 유저 프로세스의 제어를 Context Switch를 통해서 다른 곳으로 전달합니다.
앱(프로그램) 레벨에서는, 한 프로세스는 다른 프로세스로 신호를 보낼 수 있으며, 그 다른 프로세스 (another process)는 내부에 있는 신호 처리기로 급격한 제어 이동을 한다.
너무 난해해서 정리해봄!개별적인 프로그램들은 일반적인 스택 룰(규율)에 따라서 다른 함수의 랜덤 주소로 비논리적 점프를 통해서 에러에 대응할 수 있다.
영문해석이 참.. 난해해서 찾아본 결과
1. 에러 발생시, 일반적인 function call->return의 흐름을 타지 않고
2. 코드베이스의 에러 핸들링이 있는 위치로 '점프'한다
를 위와 같이 적어놓은 것이다!
Understanding ECF will help you understand important systems concepts. ECF is the basic mechanism that operating systems use to implement I/O, processes, and virtual memory. Before you can really understand these important ideas, you need to understand ECF.
ECF를 이해하는 것은 시스템 컨셉을 이해하는데 도움을 준다. ECF는 운영체제가 I/O 프로세스와 가상 메모리를 구현할 때 사용하는 기본적인 메커니즘이다. 이러한(가상 메모리 및 I/O 프로세스)것들을 이해하기 전에 ECF를 알아야 한다.
Understanding ECF will help you understand how applications interact with the operating system. Applications request services from the operating system by using a form of ECF known as a trap or system call.
ECF를 이해하는 것은 프로그램들이 운영체제와 어떻게 상호작용 하는지 알 수 있게 해준다. 프로그램들은 운영체제에 ECF 형식을 한 '트랩'이나 '시스템콜'을 요청한다.
For example, writing data to a disk, reading data from a network, creating a new process, and terminating the current process are all accomplished by application programs invoking system calls. Understanding the basic system call mechanism will help you understand how these services are provided to applications.
예를 들어서, 디스크에 데이터를 쓰는 것, 네트워크에서 데이터를 읽는 것, 새로운 프로세스를 만드는 것과 현재 프로세스를 종료하는 것 모두 다 프로그램이 System call을 함으로써 일어난다. 기본적인 시스템콜 동작원리를 이해하면 어떻게 이러한 서비스들이 프로그램에 제공되는지 이해하는 데 도움이 된다.
Understanding ECF will help you write interesting new application programs. The operating system provides application programs with powerful ECF mechanisms for creating new processes, waiting for processes to terminate, notifying other processes of exceptional events in the system, and detecting and responding to these events. If you understand these ECF mechanisms, then you can use them to write interesting programs such as Unix shells and Web servers.
운영체제는 새로운 프로세스들을 생성하거나, 프로세스들이 종료되는 것을 기다리거나, 다른 프로세스들의 시스템 내의 예외 이벤트를 알리는 것, 그리고 이러한 이벤트를 감지하고 반응하는 것에 대한 강력한 ECF 메커니즘을 제공합니다.
Understanding ECF will help you understand concurrency. ECF is a basic mechanism for implementing concurrency in computer systems. The following are all examples of concurrency in action: an exception handler that interrupts the execution of an application program; processes and threads whose exe- cution overlap in time; and a signal handler that interrupts the execution of an application program. Understanding ECF is a first step to understanding concurrency. We will return to study it in more detail in Chapter 12.
ECF를 이해하는 것은 동시성을 이해하는 것에 대해 도움이 됩니다. ECF는 컴퓨터 시스템 내에서 기본적인 동시성 메커니즘 구현입니다.
1. 프로그램의 예외처리기.
2. 실행 시간이 오버랩 되는 (거의동시에 실행되는) 스레드와 프로세스들
3. 프로그램의 실행을 인터럽트 하는 신호 처리기.
Up to this point in your study of systems, you have learned how applications interact with the hardware. This chapter is pivotal in the sense that you will begin to learn how your applications interact with the operating system.
현 시점까지, 우리는 프로그램이 어떻게 하드웨어와 상요작용 하는지에 대해 배웠다, 이번 장에서는 프로그램이 운영체제와 어떻게 사용작용 하는지 배울 것이다.
Interestingly, these interactions all revolve around ECF. We describe the various forms of ECF that exist at all levels of a computer system.
흥미롭게도, 이러한 상호작용은 모두 ECF를 중심으로 돌아간다. 우리는 컴퓨터 시스템 내의 모든 레벨에 대한 EFC를 다룰 것이다.