feature article
Subscribe Now

Getting Performance with Memory Protection in Real-time Windows Systems

Development using Ring 3 provides the benefit of memory protection from the application, which aids in debugging the application by letting the hardware catch common programming errors. This enables rapid development, because in many cases, only the application will crash upon hitting a bug. With the operating system running, the application can be restarted and the debugging can be continued – resulting in a quick test, debug and fix cycle.

However, this does not hold true during deployment. A real-time system, by its very nature, requires the application and the operating system to be fully functioning and stable. The risk of damage to the operating system when an application faults is too large to rely on merely restarting the application – therefore the entire system should be restarted. An application is typically controlling and monitoring other systems. If it crashes, what happens to the other systems?

Most real-time systems require access to external sensors or other systems. During deployment, this leads to applications running in Ring 3 indirectly controlling Ring 0 software in order to access hardware. Because this use of Ring 0 software happens outside of the core application development, it is open to programming errors due to misunderstanding the details of the software interfaces used. An example of this problem is commonly seen in the many security holes reported in the press about software containing the “buffer overflow” problem. However, security holes are not the only issue with the Ring 3 deployment model. With no direct access to hardware, deployment in Ring 3 leaves the system susceptible to a number of outcomes that can cause it to fall short of its requirements as a reliable real-time application, including:

• A performance penalty caused by the memory protection
• Additional time to tune for performance with no guaranteed outcome
• Unexpected loss of memory protection for any low-level calls
• Lack of scalability within a single system

When an application is designed and debugged in Ring 3, it still requires real-time performance for deployment. Keeping the application in the Windows application space (Ring 3) to maintain memory protection, oftenresults in losing a significant level of real-time performance and predictability, which are critical features of any real-time system. Furthermore, if an application is already deployed in Ring 3 and the developer tries to increase performance, the memory protection assumed by the software will be lost – instantly negating the benefits of Ring 3 development. Few software developers would be happy to see their product fail or be late to market because of poor coding methods.

One of the few certainties of software based products is that features will continue to be added over time. With the Ring 3 approach, each new feature may require retuning the whole application to keep the minimal performance. And in most cases, the added cost of distributed processing with additional hardware dictates that scalability cannot be achieved in Ring 3 deployments. Support for complex applications requiring servicing of interrupts in the 30KHz range is not possible in a single platform.

But, by using the proper development and deployment techniques, system designers can leverage the benefits of Ring 3 and Ring 0 and deploy with high system predictability and hard real-time determinism. So while the degraded performance of deployment in Ring 3 might fall within a developer’s minimum performance requirements in some cases, it is easily possible to maintain optimized performance by deploying the debugged application in the Ring 0 kernel mode. 

The benefits of kernel mode deployment are clear. This architecture provides the flexibility and performance to guarantee that the deployed application meets product requirements while enabling system scalability. Simply put, taking advantage of the protection mechanisms in Ring 3 during development and then moving to Ring 0 to achieve optimal performance for deployment, is a superior design practice.

The Ring 0 deployment architecture technique allows the developer to:

• Develop in Ring 3 and deploy in Ring 0
• Ensure deterministic and predictable performance
• Integrate application and system scalability
• Support highly demanding applications with 30KHz sustained sample rates
• Rapidly move from prototype to production

Conclusions

• Memory protection leveraged by running in Ring 3 in the development stage is unnecessary for deployment. The reason for this is that memory protection functions by trapping a fault, halting the application. But at deployment, a down system is a down system.

• Keeping the application in the Windows application space (Ring 3) to obtain memory protection often results in losing a significant level of real-time performance and scalability.

• The ability to take advantage of the protection mechanisms in Ring 3 during development and then move to Ring 0 when appropriate to achieve optimal performance and scalability for deployment and the RTX Ring 0 architecture is the superior design solution.

Leave a Reply

featured blogs
Apr 19, 2024
In today's rapidly evolving digital landscape, staying at the cutting edge is crucial to success. For MaxLinear, bridging the gap between firmware and hardware development has been pivotal. All of the company's products solve critical communication and high-frequency analysis...
Apr 18, 2024
Are you ready for a revolution in robotic technology (as opposed to a robotic revolution, of course)?...
Apr 18, 2024
See how Cisco accelerates library characterization and chip design with our cloud EDA tools, scaling access to SoC validation solutions and compute services.The post Cisco Accelerates Project Schedule by 66% Using Synopsys Cloud appeared first on Chip Design....

featured video

MaxLinear Integrates Analog & Digital Design in One Chip with Cadence 3D Solvers

Sponsored by Cadence Design Systems

MaxLinear has the unique capability of integrating analog and digital design on the same chip. Because of this, the team developed some interesting technology in the communication space. In the optical infrastructure domain, they created the first fully integrated 5nm CMOS PAM4 DSP. All their products solve critical communication and high-frequency analysis challenges.

Learn more about how MaxLinear is using Cadenceā€™s Clarity 3D Solver and EMX Planar 3D Solver in their design process.

featured chalk talk

FleClear: TDKā€™s Transparent Conductive Ag Film
Sponsored by Mouser Electronics and TDK
In this episode of Chalk Talk, Amelia Dalton and Chris Burket from TDK investigate the what, where, and how of TDKā€™s transparent conductive Ag film called FleClear. They examine the benefits that FleClear brings to the table when it comes to transparency, surface resistance and haze. They also chat about how FleClear compares to other similar solutions on the market today and how you can utilize FleClear in your next design.
Feb 7, 2024
10,178 views