ADuC831电子系统设计――基于RTX51实时操作系统程序设计基础课件

上传人:我*** 文档编号:144988476 上传时间:2020-09-15 格式:PPT 页数:35 大小:1.06MB
返回 下载 相关 举报
ADuC831电子系统设计――基于RTX51实时操作系统程序设计基础课件_第1页
第1页 / 共35页
ADuC831电子系统设计――基于RTX51实时操作系统程序设计基础课件_第2页
第2页 / 共35页
ADuC831电子系统设计――基于RTX51实时操作系统程序设计基础课件_第3页
第3页 / 共35页
ADuC831电子系统设计――基于RTX51实时操作系统程序设计基础课件_第4页
第4页 / 共35页
ADuC831电子系统设计――基于RTX51实时操作系统程序设计基础课件_第5页
第5页 / 共35页
点击查看更多>>
资源描述

《ADuC831电子系统设计――基于RTX51实时操作系统程序设计基础课件》由会员分享,可在线阅读,更多相关《ADuC831电子系统设计――基于RTX51实时操作系统程序设计基础课件(35页珍藏版)》请在金锄头文库上搜索。

1、电子系统设计基于RTX51实时操作系统程序设计基础,实时操作系统概述,一、实时操作系统概述,操作系统是一种管理计算机硬件的程序,为应用程序提供了基本的运行条件,在计算机用户和计算机硬件之间扮演着中介的角色。,The operating system (OS) is the main program that controls how your computer system functions. The OS manages the computers hardware, including the processor, memory, and storage devices, as well

2、 as peripheral devices. It is responsible for the management, scheduling, and interaction of tasks. Your first interaction with the OS is the user interface.,Four categories: Real-Time (RTOS) Single-User, Single-Task Single-User, Multitask Multiuser,What the OS Does,Provides user interface Manages t

3、he CPU Manages memory and storage Manages hardware and peripheral devices Coordinates application software with the CPU,The operating systems provides a way for the user to interact with the computer, manages the processor (CPU), manages the memory and storage, manages the computer systems hardware

4、and peripheral devices, and provides a consistent means for software applications to work with the CPU.,The User Interface,Enables you to interact with the computer Types of interfaces: Command-driven interface Menu-driven interface Graphical user interface (GUI),Processor Management,Controls the ti

5、ming of events the processor works on Interrupts Interrupt handler Interrupt table Stack,Memory and Storage Management,The operating system allocates space in RAM for instructions and data,Hardware and Peripheral Device Management,Device drivers Programs that enable the operating system to communica

6、te with peripheral devices Provided by the manufacturer of the device Plug and Play Hardware and software standard Facilitates the installation of new hardware,File Management,The operating system provides an organizational structure for the computers contents Hierarchical structure of directories D

7、rives Folders Subfolders Files,Real-Time Operating Systems,Real-Time Operating Systems,实时系统指系统的计算正确性不仅取决于计算的逻辑正确性,还取决于产生结果的时间。,一个实时操作系统面对外界环境发生的变化(包括时间的消逝)时,必须确定性地保证在满足时间要求的情况下予以正确的反应处理。, Multiple events handled by a single processor Events may occur simultaneously Processor must handle multiple, of

8、ten competing events Wide range of RTOS systems,Systems with a specific purpose and a certain result Uses include: Industrial machines Robotic equipment Automobiles Video game consoles Home appliances,Real-Time Operating Systems,Real-Time Operating Systems,A task is a program running on the CPU core

9、 of a microcontroller.,1、Task,A real-time operating system allows the execution of multiple tasks on a single CPU. All tasks execute as if they completely owned the entire CPU.,Without a multitasking kernel (an RTOS), only one task can be executed by the CPU at a time. This is called a single-task s

10、ystem.,Real-Time Operating Systems,a、Single-task systems (superloop),A superloop application is basically a program that runs in an endless loop, calling OS functions to execute the appropriate operations (task level). No real-time kernel is used, so interrupt service routines (ISRs) must be used fo

11、r real-time parts of the software or critical operations (interrupt level). This type of system is typically used in small, uncomplex systems or if real-time behavior is not critical.,Real-Time Operating Systems,void main (void) int counter = 0; while (1) /* repeat forever */ check_serial_io (); /*

12、check for serial input */ process_serial_cmds (); /* process serial input */ check_kbd_io (); /* check for keyboard input */ process_kbd_cmds (); /* process keyboard input */ adjust_ctrlr_parms (); /* adjust the controller */ counter+; /* increment counter */ ,b、COOPERATIVE MULTITASKING,Real-Time Op

13、erating Systems,Cooperative multitasking expects cooperation of all tasks. Tasks can only be suspended by calling a function of the operating system. If they do not, the system “hangs”, which means that other tasks have no chance of being executed by the CPU while the first task is being carried out

14、.,Real-Time Operating Systems,Real-Time Operating Systems,c、PREEMPTIVES MULTITASKING,A real-time operating system needs a regular timer-interrupt to interrupt tasks at defined times and to perform task-switches if necessary. The highestpriority task in the READY state is therefore always executed, w

15、hether it is an interrupted task or not. If an ISR makes a higher priority task ready, a task switch will occur and the task will be executed before the interrupted task is returned to.,Real-Time Operating Systems,Real-Time Operating Systems,1、Scheduling,There are different algorithms that determine

16、 which task to execute, called schedulers.,All schedulers have one thing in common: they distinguish between tasks that are ready to be executed (in the READY state) and the other tasks that are suspended for any reason (delay, waiting for mailbox, waiting for semaphore, waiting for event, and so on). The scheduler selects one of the tasks in the READY state and activates it (executes the program of this task). The task which is currently executing is referred to as the active task.,Real-Time O

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > PPT模板库 > PPT素材/模板

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号