📄 why_use_uclinux.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="level1"><div class="li"><span class="li"><a href="#motivation_of_using_a_kernel" class="toc">Motivation of using a Kernel</a></span></div><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#rapid_application_development" class="toc">Rapid Application Development</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#debugged_control_structures" class="toc">Debugged Control Structures</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#code_reuse" class="toc">Code Reuse</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#hardware_abstraction" class="toc">Hardware Abstraction</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#partitioning_an_application" class="toc">Partitioning an Application</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#scheduling" class="toc">Scheduling</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#priorities" class="toc">Priorities</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#preemption" class="toc">Preemption</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#application_and_hardware_interaction" class="toc">Application and Hardware Interaction</a></span></div></li></ul></li><li class="level1"><div class="li"><span class="li"><a href="#downsides_of_using_a_kernel" class="toc">Downsides of using a kernel</a></span></div></li></ul></div></div><h1><a name="motivation_of_using_a_kernel" id="motivation_of_using_a_kernel">Motivation of using a Kernel</a></h1><div class="level1"><p> All applications require control code as support for the algorithms that are often thought of as the “real” program. The algorithms require data to be moved to and/or from peripherals, and many algorithms consist of more than one functional block. For some systems, this control code may be as simple as a “superloop” blindly processing data that arrives at a constant rate. However, as processors become more powerful, considerably more sophisticated control may be needed to realize the processor鈥檚 potential, to allow the processor to absorb the required functionality of previously supported chips, and to allow a single processor to do the work of many. The following sections provide an overview of some of the benefits of using a kernel on a processor.</p></div><!-- SECTION [1-807] --><h2><a name="rapid_application_development" id="rapid_application_development">Rapid Application Development</a></h2><div class="level2"><p> The use of uClinux kernel allows rapid development of applications compared to creating all of the control code required by hand. An application or algorithm can be created and debugged on an x86 PC using powerful desktop debugging tools, and using standard programming interface to device drivers. Moving this code base to uClinux kernel running on the Blackfin is trivial because the device driver model is exactly the same. Opening an audio device on the x86 Desktop is done in exactly the same was as on a uClinux/Blackfin system. This allows you to concentrate on the algorithms and the desired control flow rather than on the implementation details. The uClinux kernel and applications supports the use of C, C++, and assembly language. You are encouraged to develop code that is highly readable and maintainable, yet retaining the option of hand optimizing if necessary.</p></div><!-- SECTION [808-1729] --><h2><a name="debugged_control_structures" id="debugged_control_structures">Debugged Control Structures</a></h2><div class="level2"><p>Debugging a traditional hand coded application can be laborious because development tools (compiler, assembler, and linker among others) are not aware of the architecture of the target application and the flow of control that results. Debugging complex applications is much easier when instantaneous snapshots of the system state and statistical run time data are clearly presented by the tools. To help offset the difficulties in debugging software, the uClinux kernel has been tested with the same tests that many Desktop distributions use before releasing a Linux kernel. This ensure that the kernel is as bug free as possible.</p></div><!-- SECTION [1730-2401] --><h2><a name="code_reuse" id="code_reuse">Code Reuse</a></h2><div class="level2"><p>Many programmers begin a new project by writing the infrastructure portions that transfers data to, from, and between algorithms. This necessary control logic usually is created from scratch by each design team and infrequently reused on subsequent projects. The uClinux kernel provides much of this functionality in a standard, portable and reusable manner. Furthermore, the kernel and its tight integration with the GNU development and debug tools are designed to promote good coding practice and organization by partitioning large applications into maintainable and comprehensible blocks. By isolating the functionality of subsystems, the kernel helps to prevent the morass all too commonly found in systems programming. The kernel is designed specifically to take advantage of commonality in user applications and to encourage code reuse. Each thread of execution is created from a user-defined template, either at boot time or dynamically by another thread. Multiple threads can be created from the same template, but the state associated with each created instance of the thread remains unique. Each thread template represents a complete encapsulation of an algorithm that is unaware of other threads in the system unless it has a direct dependency.</p></div><!-- SECTION [2402-3681] --><h2><a name="hardware_abstraction" id="hardware_abstraction">Hardware Abstraction</a></h2><div class="level2"><p> In addition to a structured model for algorithms, the uClinux kernel provides a hardware abstraction layer. Presented programming interfaces allow you to write most of the application in a platform independent, high-level language (C or C++). The uClinux Application Programming Interface (<acronym title="Application Programming Interface">API</acronym>) is identical for all processors which support Linux or uClinux, allowing code to be easily ported to a different processor core. When porting an application to a new platform, programmers must only address the areas necessarily specific to a particular processor - normally device drivers. The uClinux architecture identifies a crisp boundary around these subsystems and supports the traditionally difficult development with a clear programming framework and code generation. Common devices can use the same driver interface (for example a serial port driver may be specific for a certain hardware, but the application ↔ serial port driver interface should be exactly the same, providing a well defined hardware abstraction, and making application development faster).</p></div><!-- SECTION [3682-4782] --><h2><a name="partitioning_an_application" id="partitioning_an_application">Partitioning an Application</a></h2><div class="level2"><p>A uClinux application or thread is an encapsulation of an algorithm and its associated data. When beginning a new project, use this notion of a application or thread to leverage the kernel architecture and to reduce the complexity of your system. Since many algorithms may be thought of as being composed of 鈥渟ub algorithm鈥
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -