RTOS 2 - uC/OS real-time kernel architecture
RTOS 2 - uC/OS 실시간 커널 구조
2022.08.20 - [Development Solutions/Embedded System] - RTOS 1 - Overview (RTOS 1 - 개요)
(추천) Qt QML과 C++로 시작하는 크로스플랫폼 앱 개발 강의 - 입문편
- uC/OS 특징
: 커널 코드의 대부분이 C 기반이라 이식하기 쉬움
: 선점형 스케줄링
: Real Time OS
: 우선순위를 이용한 멀티태스킹 지원
: 신뢰성과 안정성
: 인터럽트 관리(중첩, 일시정지: OSTaskSuspend(), 재개: OSTaskResume())
: 스택 체크, Mail Box, Mail Queue, Semaphore 등의 시스템 서비스 제공
: 같은 우선순위를 제공하지 않으므로, 라운드 로빈 기법 적용 불가
(
- uC/OS Features
: Most of the kernel code is C-based, so portability is easy.
: Preemptive Scheduling
: Real Time OS
: Multitasking support using priority
: Reliability and Stability
: Interrupt management (nested, pause: OSTaskSuspend(), resume: OSTaskResume())
: Provides system services such as stack check, Mail Box, Mail Queue, Semaphore, etc.
: Since the same priority is not provided, round robin technique cannot be applied.
- uC/OS task
: The task ID is the priority of the task. The lower this value, the higher the priority.
: Execute the task with the highest priority among the tasks in the Ready state
: ISR: Interrupt service routine executed by CPU after interrupt occurs
: TCB
: Task Control Block assigned to each task when creating a task
: OS_TCB resides in memory to manage task state
: Internal variable contained in TCB
: OSTCBStkPtr: A pointer to the task stack (the reason for placing the stack pointer argument as the topmost argument is to increase assembly language efficiency)
: OSTCBStat: Status display bit of task (ucos.c)
: OSTCBPrio: Priority of task
: OSTCBDly: The delay time of the task. To wait for an event to occur
: OSTCBX, OSTCBY, OSTCBBitX, OSTCBBitY: Used when a task is created or the priority is changed
OSTCBY = prio >> 3;
OSTCBX = prio & 0x07;
OSTCBBitY = 1 << OSTCBY;
OSTCBBitX = 1 << OSTCBX;
: OSTCBNext, OSTCBPrev: Link TCB in both directions
: OSTCBEventPtr: Pointer to the Event Control Block
: OSTaskCreate(): Create a task
: OSTaskDel(): delete task
: OSTaskDelReq(): Delete a task that occupies a shared resource (called by both the party requesting the deletion and the party to be deleted)
: OSTaskQuery(): Get task information
: OS_TCBInIt(): Creates a new TCB structure, sets it, and adds it to the TCBList
: Task Ready List: Manage Ready status tasks through OSRdyGrp and OSRdyTbl[]
: To find faster, find the OSTCBX and OSTCBY values using the Lookup Table containing the pre-calculated results, calculate the priority, and find the task with the highest priority among the Ready List, add it to the list, or remove it
: OS_Sched(): Executes the task with the highest priority
: Context Switch (implemented in os_cpu_a.asm): R4~R11 manual backup or restore through LDM command, R0~R3,R12,LR, PC,xPSR automatically backup or restore (PSP, process stack pointer)
: OSSchedLock(): Set a scheduling lock. Using the OSLockNesting variable
: OSSchedUnlock(): Unlock scheduling. (After OSLockNesting--, OSLockNesting==0 to unlock)
: Idle Task: A task automatically executed by the system when there is no task in the Ready state.
: Statistics Task: Calculating CPU utilization. The ratio of the total CPU execution count, excluding the count where the idle task is performed.
)
첨부 링크 (Attachment link)
본 게시글은 개인 공부용으로 작성하여 내용의 퀄리티가 부족할 수 있습니다.
(추천) Qt QML과 C++로 시작하는 크로스플랫폼 앱 개발 강의 - 입문편
'Development Solutions > Embedded System' 카테고리의 다른 글
RTOS 3 - ECB (0) | 2022.08.20 |
---|---|
RTOS 1 - Overview (RTOS 1 - 개요) (0) | 2022.08.20 |
ARM Cortex M3 Programming3 - Interrupts, NVIC, DMA (ARM Cortex M3 프로그래밍3 - 인터럽트, NVIC, DMA) (0) | 2022.08.20 |
ARM Cortex M3 Programming2 - Counters, Timers (ARM Cortex M3 프로그래밍2 - 카운터, 타이머) (0) | 2022.08.20 |
ARM Cortex M3 Programming1 - Overview, GPIO, UART Control (ARM Cortex M3 프로그래밍1 - 개요, GPIO, UART 제어) (0) | 2022.08.20 |