Nucleus PLUS is in the United StatesSource codeThe new-generation embedded operating system launched by the operating system vendor ATI is a preemptive real-time multi-task operating system kernel with 95%CodeIt is easy to transplant to various processor families using ansi c. From the implementation perspective, unlike traditional embedded development, Nucleus PLUS is linked to the target application in the form of a function library.ProgramForm the executable target code, download it to the target board or burn it to Rom/Flash ROM for execution. The core of the Nucleus PLUS occupies about 20 K space in a typical CISC architecture, and about 40 K space in a typical RISC architecture. Its core data structure occupies K Bytes space. With its real-time response, preemptive, multi-tasking, and open source code features, Nucleus PLUS is available in communications, defense, industrial control, aviation/aerospace, railway, network, POs, automated control, smart home appliances, and other fields. is widely used.
Nucleus PLUS kernel technology
ATI uses a method called software components. A software component is a non-independent application that executes one or more C/Assembly source files for a specific purpose or purpose. Each component provides a defined external interface, components must be used through external interfaces. Accessing the global data structure in a component is forbidden. With the component method, software components are easy to update and reuse. The Nucleus PLUS Software Component is usually composed of include header files defining data types, constants, and external interfaces, and one or more C/Assembly source files. The following 16 components are provided: task control management, memory management, timer management, interrupt, system diagnosis, and I/O Driver Management,
Nucleus PLUS kernel:
Common service component (CS)
Initialization component (in)
Tread control component (TC)
Timer component (Ti)
Mailbox component (MB)
Pipe component (PI)
Semaphore component (SM)
Event flag component (EV)
Partition component (pm)
Queue component (QM)
Dynamic Memory component (DM)
I/O component (I/O)
History component (HI)
Error component (ER)
License component (Li)
Release component (RL)
Where:
* In: initializes the Nucleus PLUS system.
* TC: Manages preemptible real-time tasks and hisr operations of the Nucleus PLUS.
* Cs: Provides the Nucleus PLUS component of other devices with a link list.
* TM: manages all the Nucleus PLUS timer devices. The basic timing unit of Nucleus PLUS is a tick, which is equivalent to a hardware timer interruption.
* MB: responsible for managing all the Nucleus PLUS mailbox Devices
* QM: manages all the Nucleus PLUS queue devices.
* Pi: responsible for managing all the Nucleus PLUS Pipe Equipment
* SM: responsible for managing all the Nucleus PLUS semaphores
* Ev: manages all the Nucleus PLUS event group devices.
* Pm: manages all the core plus partition memory.
* DM: manages all the core plus dynamic memory.
* I/O: responsible for managing all the core plus inputs/outputs
* Hi: responsible for managing the historical devices of Nucleus PLUS
* Er: responsible for managing all the errors in the Nucleus PLUS system.
* Li: responsible for license management of Nucleus PLUS
* RL: Responsible for Version Management of Nucleus PLUS
Other functions of Nucleus PLUS
In addition to its powerful kernel, Nucleus PLUS also provides software packages for Internet, TCP/IP, Web browsers, graphics, and file systems.
Nucleus PLUS Development
1. customized for Nucleus PLUS
The core plus can also be tailored and customized based on the needs of the target board to generate an operating system suitable for the target system, as little as possible to occupy the system memory. After the OS is customized, link it to the target application to become part of the target application. On the target board of a typical CISC architecture, it occupies about 20 KB of space, while on the target board of the RISC architecture, it occupies about 40 kb of space. Generally, Nucleus PLUS is sufficient for most embedded applications. ATI provides a program named build_li.bat or plus. bat batch files. You can delete the modules, change related options or switches, and execute this file to generate the target-related operating system, that is, a customized operating system is generated according to system requirements. Note that the content of the batch processing file is related to the development tool.
2. Development Solution
Synus plus can be combined with paradigm, SDS, and ATI multi-task debugger to form a powerful integrated development environment, use the appropriate Compiler (Borland C/C ++ compiler, Turbo C/C ++ compiler, or Microsoft C/C ++ compiler) and dynamic link library and various underlying driver software can meet the needs of embedded application development.
3. Development Process
UseTo develop embedded applications, follow these steps:
* If necessary, modify the low-level system initialization file. int to meet the needs of the target board. Such as interrupt vector, I/O address, and clock frequency.
* Define the application _ initialize () function. This function is executed before the system is started. Note that the header file of nucleus. H should be included in the target application to take advantage of the services of Nucleus PLUS.
* Define application tasks. If you call the service of Nucleus PLUS, You need to include nucleus. h.
* Compile/compile all application software and contain the system's low-level initialization file. Int.
* Link. int and all application target files, the file of the Nucleus PLUS library, and related development tool libraries.
* Download or burn the generated final target code to the target board for execution.
4. initialize Nucleus PLUS
Nucleus PLUS has three levels of initialization: System Low-Level Initialization int-Initialize (), system advanced initialization inc-Initialize (), and application initialization application_initialize (), after initialization, the task scheduling cycle of Nucleus PLUS is entered. The initialization function tasks are shown in table 1.
Int_initialize ()
Inc_initialize ()
Application_initialize ()
5. nucleus mnt
Nucleus us MNT is designed for software developers to build a Prototyping Environment for the embedded applications of Nucleus PLUS under Win95/NT. It is implemented through two libraries, that is, the database for the target environment and the database for the Win95/NT development environment. During development, the application code remains unchanged. Instead, the MNT library is replaced and the Cross-Development Toolkit is used to reconstruct the executable target code in the target environment.
6. Development considerations
Embedded Development has special features in terms of memory requirements and task management. Therefore, you should pay extra attention to the following aspects in development,
* Task famine
The assignment of task priorities should be reasonable. Otherwise, some tasks in the system will be constantly running, and other tasks will never be run, resulting in famine.
* Deadlock
The distribution of system resources should be reasonable. Otherwise, two or more tasks will be suspended infinitely to compete for a system resource.
* Memory
* Memory leakage
In the memory allocation process, try to avoid fragments and pay attention to timely collection.
* Memory saving
* By default, Nucleus PLUS is in the advanced initialization function inc_initialize. When other functions are called to initialize the data structure of all features provided by the function, some feature user target applications may not be used. To this end, remove unnecessary function calls.
* Change the nu_max_lisrs size in nucleus. H. It defines the maximum number of Interrupt vectors of the target processor.
* Change the size of tc_priorities in tc_defs.h. It defines the priority level of a task. Nucleus PLUS supports 256 priorities.
* Hisr stack sharing.
* The query table tcd_lowest_set_bit Ram copy is not allowed in the TCM. C.
* Use a smaller int option.
Conclusion
Due to its modular, reliable, reusable, open, easy-to-use, and secure features, Nucleus PLUS has become an ideal platform for embedded application development, especially in areas related to national economy and livelihood, such as aviation/aerospace, military, and national defense.