<<

실시간실시간 운영체계운영체계

(Real(Real--timetime OperatingOperating System)System)

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung 메카트로닉스메카트로닉스 시스템의시스템의 구성구성

Model of 기계 시스템 ECU

인터페이스 회로 인터페이스 회로 마이컴 시그널 컨디셔닝 (드라이빙 회로) ( )

액츄에이터 센서 (구동기)

기계 시스템

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung 메카트로닉스메카트로닉스 시스템의시스템의 구성구성

마이컴

Artificial Intelligence Robotics

DSP (Digital Signal Processing) Digital Control FSM (Finite State Machine)

Middle-ware

RTOS (Real- )

BSP (Board Support Package) Device drivers CSP (Chip Support Package)

Peripherals CPU

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

An operating system (OS) is a set of programs that manage hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system. A user cannot run an application program on the computer without an operating system, unless the application program is self .

management • • Device drivers • Networking (TCP/IP, UDP) • Security (Process/) • I/O

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

Components

With the aid of the and device drivers, the kernel provides the most basic level of control over all of the computer's hardware devices. It manages memory access for programs in the RAM, it determines which programs get access to which hardware resources, it sets up or resets the CPU's operating states for optimal operation at all times, and it organizes the data for long-term non-volatile storage with file systems on such media as disks, tapes, , etc. A or software driver is a allowing higher-level computer programs to interact with a hardware device. … Drivers are hardware-dependent and operating- system-specific.

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

Firmware In electronic systems and computing, firmware is a term often used to denote the fixed, usually rather small, programs and/or data structures that internally control various electronic devices. There are no strict boundaries between firmware and software, as both are quite loose descriptive terms. However, the term firmware was originally coined in order to contrast to higher level software which could be changed without replacing a hardware component, and firmware is typically involved with very basic low-level operations without which a device would be completely non-functional. Firmware is also a relative term, as most embedded devices contain firmware at more than one level.

A typical firmware-controlled device, a television remote control. Consumer products like this have been using firmware since the 1970s. http://en.wikipedia.org/wiki/Firmware

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

Types Multi-user vs. Single-user Multi-tasking vs. Single-tasking Multi-tasking can be of two types: pre-emptive or co-operative. In pre-emptive multitasking, the operating system slices the CPU time and dedicates one slot to each of the programs. -like operating systems such as Solaris and support pre-emptive multitasking. is achieved by relying on each process to give time to the other processes in a defined manner. Real-time Distributed Embedded Embedded operating systems are designed to be used in embedded computer systems. They are designed to operate on small machines like PDAs with less autonomy. They are able to operate with a limited number of resources.

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

RTOS (Real-time Operating System) A real-time operating system is a multitasking operating system that aims at executing real-time applications. Real-time operating systems often use specialized algorithms so that they can achieve a deterministic nature of behavior. The main objective of real-time operating systems is their quick and predictable response to events.

They have an -driven or time-sharing design and often aspects of both. An event- driven system switches between tasks based on their priorities or external events while time-sharing operating systems switch tasks based on clock interrupts. Event-driven  peripheral Time-sharing  clock interrupt

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

Multitasking In computing, multitasking is a method where multiple tasks, also known as processes, share common processing resources such as a CPU. In the case of a computer with a single CPU, only one task is said to be running at any point in time, meaning that the CPU is actively executing instructions for that task. Multitasking solves the problem by scheduling which task may be the one running at any given time, and when another waiting task gets a turn. The act of reassigning a CPU from one task to another one is called a . When context switches occur frequently enough the illusion of parallelism is achieved. Even on with more than one CPU (called multiprocessor machines), multitasking allows many more tasks to be run than there are CPUs.

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

Process state

The various process states, displayed in a state diagram, with arrows indicating possible transitions between states - as can be seen, some processes are stored in main memory, and some are stored in secondary (virtual) memory.

http://en.wikipedia.org/wiki/Process_states

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

Context switching A context switch is the computing process of storing and restoring the state (context) of a CPU so that execution can be resumed from the same point at a later time. This enables multiple processes to share a single CPU.

The context switch is an essential feature of a multitasking operating system. Context switches are usually computationally intensive and much of the design of operating systems is to optimize the use of context switches.

A context switch can mean a register context switch, a task context switch, a context switch, or a process context switch. What constitutes the context is determined by the processor and the operating system. Switching from one process to another requires a certain amount of time for doing the administration - saving and loading registers and memory maps, updating various tables and list etc.

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

Scheduling In computer science, a scheduling is the method by which threads, processes or data flows are given access to system resources (e.g. processor time, communications bandwidth). The main purposes of scheduling algorithms are to minimize resource starvation and to ensure fairness amongst the parties utilizing the resources. Scheduling deals with the problem of deciding which of the outstanding requests is to be allocated resources.

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [2][2]

A preemptive priority-based scheduler preempts the CPU when a task has a higher priority than the current task running. Thus, the kernel ensures that the CPU is always allocated to the highest priority task that is ready to run. This means that if a task- with a higher priority than that of the current task- becomes ready to run, the kernel immediately saves the current task's context, and switches to the context of the higher priority task. For example, in Figure 2-2, task t1 is preempted by higher-priority task t2, which in turn is preempted by t3. When t3 completes, t2 continues executing. When t2 completes execution, t1 continues executing.

Priority

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [2][2]

Multi-level controller

차량 거동 제어

Time Constance 높게 모터 토크 제어 작아짐 Priority .

모터 전류 제어

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

Interrupt latency In real-time operating systems, is the time between the generation of an interrupt by a device and the servicing of the device which generated the interrupt. For many operating systems, devices are serviced as soon as the device's interrupt handler is executed. Interrupt latency may be affected by interrupt controllers, interrupt masking, and the operating system's (OS) interrupt handling methods.

There is usually a trade-off between interrupt latency, throughput (the average rate of successful message delivery over a communication channel), and processor utilization.

Jitter in the interrupt latency can drastically affect the real-time schedulability of the system.

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung OperatingOperating SystemSystem [1][1]

Dependencies Understanding data dependencies is fundamental in implementing parallel algorithms. No program can run more quickly than the longest chain of dependent calculations (known as the critical path), since calculations that depend upon prior calculations in the chain must be executed in order.

Consistency models The consistency model defines rules for how operations on computer memory occur and how results are produced.

http://en.wikipedia.org/wiki/Parallel_computing

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung ReferencesReferences

1. “Operating system,” http://en.wikipedia.org/wiki/Operating_system 2. “2. Basic OS,” http://www-kryo.desy.de/documents/vxWorks/V5.5//guide/c- basic.html

E-mail: [email protected] http://web.yonsei.ac.kr/hgjung