RTOS 개요

공부기록·2023년 10월 13일
0
post-thumbnail

Overview


  • Real-time systems

    • 시스템 운영의 정확성은 논리적, 기능적 특성뿐 아니라 시간적 특성에도 연관이 있다.
    • 시간 제약 : deadline, period, execution time
  • Task classes

    • hard vs soft vs firm real-time tasks

    • periodic(loop) vs aperiodic(event 발생전까지 대기) tasks

    • critical(높은 priority) vs noncritical tasks



RTOS


  • 정의
    • Real-time system에서 사용되는 운영체제이다.
    • 매우 빠른 운영체제는 아니고 주어진 시간에 작업이 완료되는 것에 초첨을 맞춘 운영체제.
    • 자원 낭비보다 deadline이 우선적이며 공평성보다는 우선순위를 더 중요시 여긴다.
  • 요구사항
    • 예측가능하고 일정한 응답시간과 우선순위기반스케줄링과 deadline 기반 스케줄링을 지원한다.


Several Concepts


mulitasking

  • CPU를 효율적으로 사용하기위해 하나의 큰 응용프로그램을 논리적으로 나눈 개념이다.

Resource

  • Process와 Task가 이용하는 모든 요소로 I/O장치나 변수, 구조체, 배열 등이 될 수 있다.

Shared Resource

  • 하나 이상의 process나 task가 공통적으로 사용하는 resource이다.
  • 공유자원으로 인한 daedline miss가 일어나기도 한다.

Scheduler는 ready 상태의 task 중 어떤 task를 수행해야 할지 선택한다.

  • Priority-based scheduling을 주로 사용한다.

Non-preemptive Kernel


  • Interrupt(비동기적 이벤트)는 ISR이 처리하며 ISR은 인터럽트가 발생한 Task로 다시 돌아온다.
  • 장점
    • 인터럽트 지연시간이 짧다.
    • 세마포어르 사용해서 공유데이터를 보호할 필요가 줄어든다.
  • 단점
    • 실행중인 Task가 CPU를 자발적으로 양도해야하므로 우선순위의 Task의 태스크가 실행준비 상태가 되더라도 실제로 실행될 때를 기다려야 한다.
    • real-time이 보장되지않는다.
    • 우선순위 높은 task가 불필요하게 block된다.


Preemptive Kernel


  • CPU의 제어권은 항상 실행준비가 된 최상위 우선순위 Task에게 넘어간다.
  • ISR이 우선순위 높은 Task를 실행준비 상태로 만들면 ISR이 종료될 때 interrupt가 발생했던 task는 중단시키고 다른 우선순위가 가장 높은 task가 수행되도록한다.

Feasibility Analysis


  • 모든 task가 deadline을 만족하는지 분석한다.


Structure of real-tiem OS



Multitasking 기술

  • big loop, corooutine multitasking, interrupt-driven scheduling, multitasking executive

Task Scheduling

  • real-time : rate monotonic, earliest deadlint first

Mutual Exclusion

  • 공유자원 : critical section이 만들어진다.
  • 인터럽트와 스케쥴러를 비활성화 시킨다.
  • semaphore

Synchronizaion

  • 기술 : semaphores, event flag, message queue, mailbox



RTOS Summary

  • mulitasking
  • fast context switching
  • small size
  • fast processing of external interrupts
  • task scheduling can be enabled by external interrupts
  • simple command interperter
  • inter-task communication and synchronization
  • no memory protection: ther kernel and user execute in the same space
  • limited memory usage

0개의 댓글

관련 채용 정보