본문 바로가기
Development Solutions/Embedded System

RTOS 1 - Overview (RTOS 1 - 개요)

by Dev Diary Hub 2022. 8. 20.
반응형

RTOS 1 - Overview

RTOS 1 - 개요

 

(추천) Qt QML과 C++로 시작하는 크로스플랫폼 앱 개발 강의 - 입문편

https://inf.run/3XmSH

 

Qt QML과 C++로 시작하는 크로스플랫폼 앱 개발 - 입문편 강의 - 인프런

Qt QML과 C++를 사용하여 크로스플랫폼 애플리케이션 개발에 입문할 수 있습니다. 해당 강의에서는 윈도우 응용 프로그램 타겟으로 개발을 진행합니다., 강의 주제 📖 이 강의를 통해 참가자들은

www.inflearn.com

 

 

- RTOS

: 주어진 입력 조건을 정해진 시간 내에 처리하는 시스템

: Hard RTOS -> micro Controller / OS-II 를 주로 다룰 것임

: Soft RTOS -> 이번 글에선 다루지 않음

: GPOS가 최대 성능을 추구한다면, RTOS는 최소 응답시간을 추구 (위험 최소화)

: 태스크 단위 진행

: Reentrancy: 코드의 재진입성. 즉 중단 후 재실행해도 문제가 발생하지 않는 성질

: Priority Inversion: 높은 우선순위의 태스크가 낮은 우선순위 태스크의 실행 종료를 기다리는 상황. 보통 세마포어를 기다리면서 발생하는 현상

: Priority Inheritance: 높은 우선순위의 태크스가 Wait하는 동안 기다리게 만든 태스크의 우선순위를 임시로 높게 설정

 

- 펌웨어 기반 시스템과의 차이

: 펌웨어 기반: 응답시간이 백그라운드 실행 시간에 영향 받음 -> 시간 예측이 어려움

모든 태스크가 동일 우선순위를 가짐 -> 순차적으로 실행되므로 실행빈도 조절 어려움

: RTOS는 우선순위를 부여할 수 있으며 실시간 이벤트에 대한 응답시간 면에서 유리함

또한 유지보수가 용이하며 태스크 단위로 개발할 수 있어 분업에 용이함

반응형

- 태스크

: 우선순위가 높은 태스크부터 CPU 점유

: 선점형 커널

: 태스크는 TCB(Task Control Block)과 태스크 스택을 사용함

: 상태

- Ready(준비): 우선순위가 낮아서 CPU를 대기하는 상태

- Running(실행): CPU를 점유하고 있는 상태

- Waiting(이벤트 발생 대기): 이벤트를 대기하는 상태. 이벤트 발생시 Ready 상태로 전이

 

- 세마포어
: 공유자원을 접근하기 위한 Key
: 카운팅 세마포어와 바이너리 세마포어
 

- ITC

: MailBox

: Message Queue

: 전역변수(MuTex보장한다는 가정 하)

 

- 인터럽트
: 주변장치가 CPU에게 이벤트를 알리기 위해 사용
: 인터럽트 종료, 즉 ISR 종료 시점에 스케줄링 수행(선점형)
 
(
- RTOS

: A system that processes a given input condition within a set time

: Hard RTOS -> micro Controller / OS-II will be mainly dealt with

: Soft RTOS -> Not covered in this article

: GPOS pursues maximum performance, RTOS seeks minimum response time (minimize risk)

: Progress by task

: Reentrancy: The reentrant of code. In other words, no problem occurs even if re-executed after interruption.

: Priority Inversion: A situation in which a high-priority task is waiting for the low-priority task to finish executing. This usually happens while waiting for a semaphore.

: Priority Inheritance: Temporarily set the priority of the task that made it wait while the high-priority task waits



- Differences from firmware-based systems

: Firmware-based: Response time is affected by background execution time -> Time prediction is difficult

All tasks have the same priority -> Difficult to control execution frequency because they are executed sequentially

: RTOS can give priority and is advantageous in terms of response time to real-time events

In addition, maintenance is easy, and it can be developed in units of tasks, so it is easy to divide labor.



- Task

: Occupies CPU from tasks with higher priority

: preemptive kernel

: Task uses TCB (Task Control Block) and task stack

: situation

- Ready: Low priority and waiting for CPU

- Running: CPU is occupied

- Waiting: Waiting for an event. Transition to Ready state when an event occurs



- semaphore
: Key to access shared resources
: counting semaphores and binary semaphores

- ITC

: MailBox

: Message Queue

: Global variable (assuming MuTex is guaranteed)



- Interrupt
: Used by peripherals to notify CPU of events
: Scheduling is performed at the end of the interrupt, that is, at the end of the ISR (preemptive type)
)
 

 

 
반응형