没有合适的资源?快使用搜索试试~ 我知道了~
FreeRTOS textbook
4星 · 超过85%的资源 需积分: 9 37 下载量 29 浏览量
2014-02-12
04:59:01
上传
评论 2
收藏 360KB PDF 举报
温馨提示
试读
8页
FreeRTOS不可多得的另一个好教材,FreeRTOS是一个相对较小的应用程序。最小化的FreeRTOS内核仅包括3个(.c)文件和少数头文件,总共不到9000行代码,还包括了注释和空行。一个典型的编译后(二进制)代码映像小于10KB。 FreeRTOS的代码可以分解为三个主要区块:任务,通讯,和硬件接口。
资源推荐
资源详情
资源评论
FreeRTOS
Christopher Svec
FreeRTOS (pronounced "free-arr-toss") is an open source real-time operating system (RTOS) for embedded systems. FreeRTOS supports many different
architectures and compiler toolchains, and is designed to be "small, simple, and easy to use".
FreeRTOS is under active development, and has been since Richard Barry started work on it in 2002. As for me, I'm not a developer of or contributor to FreeRTOS,
I'm merely a user and a fan. As a result, this chapter will favor the "what" and "how" of FreeRTOS's architecture, with less of the "why" than other chapters in this
book.
Like all operating systems, FreeRTOS's main job is to run tasks. Most of FreeRTOS's code involves prioritizing, scheduling, and running user-defined tasks. Unlike all
operating systems, FreeRTOS is a real-time operating system which runs on embedded systems.
By the end of this chapter I hope that you'll understand the basic architecture of FreeRTOS. Most of FreeRTOS is dedicated to running tasks, so you'll get a good look
at exactly how FreeRTOS does that.
If this is your first look under the hood of an operating system, I also hope that you'll learn the basics about how any OS works. FreeRTOS is relatively simple,
especially when compared to Windows, Linux, or OS X, but all operating systems share the same basic concepts and goals, so looking at any OS can be instructive
and interesting.
3.1. What is "Embedded" and "Real-Time"?
"Embedded" and "real-time" can mean different things to different people, so let's define them as FreeRTOS uses them.
An embedded system is a computer system that is designed to do only a few things, like the system in a TV remote control, in-car GPS, digital watch, or pacemaker.
Embedded systems are typically smaller and slower than general purpose computer systems, and are also usually less expensive. A typical low-end embedded
system may have an 8-bit CPU running at 25MHz, a few KB of RAM, and maybe 32KB of flash memory. A higher-end embedded system may have a 32-bit CPU
running at 750MHz, a GB of RAM, and multiple GB of flash memory.
Real-time systems are designed to do something within a certain amount of time; they guarantee that stuff happens when it's supposed to.
A pacemaker is an excellent example of a real-time embedded system. A pacemaker must contract the heart muscle at the right time to keep you alive; it can't be
too busy to respond in time. Pacemakers and other real-time embedded systems are carefully designed to run their tasks on time, every time.
3.2. Architecture Overview
FreeRTOS is a relatively small application. The minimum core of FreeRTOS is only three source ( .c ) files and a handful of header files, totalling just under 9000
lines of code, including comments and blank lines. A typical binary code image is less than 10KB.
FreeRTOS's code breaks down into three main areas: tasks, communication, and hardware interfacing.
Tasks: Almost half of FreeRTOS's core code deals with the central concern in many operating systems: tasks. A task is a user-defined C function with a given
priority. t asks.c and task.h do all the heavy lifting for creating, scheduling, and maintaining tasks.
Communication: Tasks are good, but tasks that can communicate with each other are even better! Which brings us to the second FreeRTOS job:
communication. About 40% of FreeRTOS's core code deals with communication. queue.c and queue.h handle FreeRTOS communication. Tasks and interrupts
use queues to send data to each other and to signal the use of critical resources using semaphores and mutexes.
The Hardware Whisperer: The approximately 9000 lines of code that make up the base of FreeRTOS are hardware-independent; the same code runs
whether FreeRTOS is running on the humble 8051 or the newest, shiniest ARM core. About 6% of FreeRTOS's core code acts a shim between the hardware-
independent FreeRTOS core and the hardware-dependent code. We'll discuss the hardware-dependent code in the next section.
Hardware Considerations
The hardware-independent FreeRTOS layer sits on top of a hardware-dependent layer. This hardware-dependent layer knows how to talk to whatever chip
architecture you choose. Figure 3.1 shows FreeRTOS's layers.
Figure 3.1: FreeRTOS software layers
FreeRTOS ships with all the hardware-independent as well as hardware-dependent code you'll need to get a system up and running. It supports many compilers
(CodeWarrior, GCC, IAR, etc.) as well as many processor architectures (ARM7, ARM Cortex-M3, various PICs, Silicon Labs 8051, x86, etc.). See the FreeRTOS
website for a list of supported architectures and compilers.
FreeRTOS is highly configurable by design. FreeRTOS can be built as a single CPU, bare-bones RTOS, supporting only a few tasks, or it can be built as a highly
functional multicore beast with TCP/IP, a file system, and USB.
conve rte d by We b2P DFC onvert.com
资源评论
- news_howardz2016-03-26freertos的简要介绍
- emonzhu12014-07-06值得一看,比较基础,谢谢
纯黑老白
- 粉丝: 29
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功