Process control daemon
Encyclopedia
Process Control Daemon is an open source
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

, light-weight system level process manager
Process management (computing)
Process management is an integral part of any modern day operating system . The OS must allocate resources to processes, enable processes to share and exchange information, protect the resources of each process from other processes and enable synchronisation among processes...

/controller for Embedded-Linux
Embedded Linux
Embedded Linux is the use of Linux in embedded computer systems such as mobile phones, personal digital assistants, media players, set-top boxes, and other consumer electronics devices, networking equipment, machine control, industrial automation, navigation equipment and medical instruments...

 based projects (such as consumer electronics and network devices).

This kind of a tool provides a complementary service for any Embedded Linux
Embedded Linux
Embedded Linux is the use of Linux in embedded computer systems such as mobile phones, personal digital assistants, media players, set-top boxes, and other consumer electronics devices, networking equipment, machine control, industrial automation, navigation equipment and medical instruments...

 driven product and is specialized for the needs of embedded products
Embedded system
An embedded system is a computer system designed for specific control functions within a larger system. often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. By contrast, a general-purpose computer, such as a personal...

. However, Embedded Linux distributions do not provide such a tool. Other similar tools which are available are not suited for embedded products in terms of compatibility, performance and limited hardware resources.

The PCD is a proven solution that already drives millions of devices in the world.

Background

The PCD project was designed and implemented by Hai Shalom, senior software engineer at Texas Instruments
Texas Instruments
Texas Instruments Inc. , widely known as TI, is an American company based in Dallas, Texas, United States, which develops and commercializes semiconductor and computer technology...

 Israel at the time, as part of his M.Sc. degree in Computer Science. The project was initiated due to a true need in one of Texas Instruments’ broadband solutions (ARM1176
ARM11
ARM11 is an ARM architecture 32-bit RISC microprocessor family which introduced the ARMv6 architectural additions. These include SIMD media instructions, multiprocessor support and a new cache architecture...

 Running MV-Linux Pro-5.00). The system was originally started with shell scripts, where the init process started the rcS script, and it started some other scripts. Due to the rapid development process of the system’s software, more processes
Process (computing)
In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system , a process may be made up of multiple threads of execution that execute instructions concurrently.A computer program is a...

 and tasks were added, and the scripts became too long, unreadable and hard to maintain. There was no efficient way to control the startup process
Linux startup process
The Linux startup process is the process of Linux-operating system initialization. It is in many ways similar to the BSD and other Unix style boot processes, from which it derives.-Overview of typical process:...

 of the system. Synchronizing inter-process dependency was difficult and determining the order of initialization required a lot of effort.

For example, a daemon
Daemon (computer software)
In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

 which listens on a socket
Unix domain socket
A Unix domain socket or IPC socket is a data communications endpoint for exchanging data between processes executing within the same host operating system. While similar in functionality to...

 must precede any clients that send data on this socket. With shell scripts, there is no efficient way to verify this condition. A service with a complex state machine that needs to be in a specific state before it is ready has no standard means to synchronize with its clients.

Monitoring the system’s health was another issue. There was no entity that monitored and controlled the processes in the system. Therefore, in case of a crash, the system became unstable or unusable until the crashed process was manually detected.

At that time, the runtime debugging capabilities were very limited. In case of a process crash, there was no debug information available, unless compiling a special version that supports low optimizations, debug symbols and a GDB server
Gdbserver
gdbserver is a computer program that makes it possible to remotely debug other programs. Running on the same system as the program to be debugged, it allows the GNU Debugger to connect from another system; that is, only the executable to be debugged needs to be resident on the target system, while...

.

Once PCD was integrated into the product, the final results showed reduced startup time and great improvements in the system’s robustness, reliability and availability. The Debugging and remote debugging capabilities were also improved due to the extended debug information which was available in case of a crash (Segmentation fault
Segmentation fault
A segmentation fault , bus error or access violation is generally an attempt to access memory that the CPU cannot physically address. It occurs when the hardware notifies an operating system about a memory access violation. The OS kernel then sends a signal to the process which caused the exception...

, bus error, or similar).

The project is still active and has been extended to support more embedded architectures
Embedded system
An embedded system is a computer system designed for specific control functions within a larger system. often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. By contrast, a general-purpose computer, such as a personal...

 and new features.

PCD Features in high-level

  • Start up the system in a synchronized and deterministic manner, according to a textual configuration file.
  • Control and monitor all the processes and services in the system.
  • Recover the system in case of errors or crashes, make it more reliable.
  • Provide useful and detailed debug information in case of a crash: Process details, registers dump and memory map.
  • Create a graphical representation of the system's processes.

PCD Configuration

The PCD needs to be configured with all the processes, daemons and tasks it controls. The configuration is done in runtime, using a simple, human readable configuration file (AKA PCD Script). Each process has its own rule block which describes it, defines its dependency in other rules, defines its details and what action to perform in case it fails. The rule blocks define the inter-process dependencies in the most deterministic manner, and as a result, the PCD builds a dependency tree out of this information. Once all rules are written, and a dependency tree is established, the PCD can startup the system in the most reliable way, and the boot time will be faster, comparing to script startup.
The PCD scripts can also be used in the host machine to generate a graphical representation of the system startup dependencies for better understanding it, and for documentation purposes, as can be seen in the following example:

Crash Recovery

Once of the big advantages of the PCD, is its debug capabilities and crash recovery abilities.
The PCD also implements a crash daemon that constantly monitors the system health, and performs a recovery action in case of a crash. This feature enhances the system's stability, robustness and availability.
The PCD also provides a lot of useful debug information that can help the developers and the test engineers to understand what happened. The debug information is displayed on the system's console, and can be stored in a non-volatile storage for later analysis. The detailed debug information includes all the process details, all signal details, a complete register dump (on supported architectures) and the process's address map.
This debug information is available anytime and everywhere (even in the field) and it does not require a special debug build.

PCD Licensing

The PCD Project is an Open-Source project, and it is licensed under the GNU Lesser General Public License
GNU Lesser General Public License
The GNU Lesser General Public License or LGPL is a free software license published by the Free Software Foundation . It was designed as a compromise between the strong-copyleft GNU General Public License or GPL and permissive licenses such as the BSD licenses and the MIT License...

 version 2.1, as published by the Free Software Foundation:
  • There are no purchase costs or royalty fees.
  • The source code is fully available.
  • High quality code due to extensive exposure.
  • The LGPL allows linking and mixing proprietary code with PCD safely. It is allowed to redistribute the PCD with any other software package, provided that the license terms are kept. Any changes or enhancements which are done on the PCD code must be returned to the community.
  • Continuous development: New features and other platforms are now supported.
  • Community support and bug fixes.
  • In case you need a new feature, either request it in the project tracker system, or join the PCD community and develop it, so other could also enjoy your productivity.

Reviews

The PCD Project received good reviews from software engineers and project managers who used it in their project; "PCD is a huge success in a project I am responsible for. It provides 4 major advantages: It simplifies the initialization code, it improves boot time, it reduces debugging effort (providing great crash logs), and improves the traditional WD implementation (monitoring all processes and act accordingly). All this translate to a better product and efficient development flow".

The PCD Project was presented in the ARM Technology Conference 2010, and received good feedback. "Things are getting a lot easier for software developers who want to use open source Linux in their real time embedded designs, particularly on the ARM architecture".

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK