Posts Tagged ‘standards’

Programming as Profession

Wednesday, January 14th, 2009 Michael Barr

Doing my daily reading around the embedded systems press, I happened across this gem in an article by Jim Turley:

Programming is often treated as a creative endeavor, undertaken by spirited and talented artistes who cannot or should not be shackled to convention, regulations, or reasonable hygiene. Get over it. Programming is a job like any other, and an employer’s responsibility is to ship a profitable product, not coddle and babysit self-indulgent hackers.

I couldn’t agree with Jim more. It is especially unfortunate when a lack of professionalism shows itself in the realm of embedded systems, such as medical devices, that put human lives at risk. I regret to inform the reader that from Netrino‘s vantage point as consultants we see everyday the train wreck that results from poorly managed and unprofessional programmers working in the embedded systems space.

You need a license from the state to to be a barber. To write embedded software, you simply need to be able to spell ‘C’. But I’m on a mission to change that.

Making Java Real

Saturday, March 30th, 2002 Michael Barr

Embedded processors span a wide range, from tiny 4-bit microcontrollers all the way up to 64-bit current sinks. Both chips and cores find themselves employed in systems with varying degrees of real-time requirements. In the middle of these spectrums, and most typical of today’s embedded designs, are the many soft-real time systems built around 32-bit processors. These are precisely the systems that should benefit from the recent completion of the Real-Time Specification for Java (RTSJ).

Having spent too much time in my career debugging silly typos because of C’s weak syntax rules; porting pieces of code from one RTOS’s threading API to another; keeping track of compiler differences related to the size of primitive data types and the order of bitfields; and trying to learn all the ins and outs of C++’s overly-complex brand of OOP, I was taken with Java right from my first encounter with the language, in 1996. When I attended a discussion about making Java suitable for real-time use about a year later, at the National Institute of Standards and Technology (NIST), I learned I wasn’t the only embedded programmer who’d taken a liking to this new language.

Of course, the reason we were all drawn to that discussion was because Java was decidedly not ready for real-time. As the Java language had moved out of its R&D origins at Sun and become popular with Web and enterprise application developers, its standard libraries had grown appreciably and its basic definition had become far too loose. For example, the built-in priority-based threading API, which should have proved useful as a basis for real-time software, had by then been dumbed down to the point that even those the few scheduling rules weren’t enforced by most JVM (Java Virtual Machine) implementations.

A result of that initial NIST meeting, and several working group sessions that followed, was the consensus document “Requirements for Real-Time Extensions for the Java Platform”. This document captured the opinions of experts at more than fifty companies and organizations (as well as the Department of Defense, which was seeking alternatives to Ada) on the subject of real-time software. It ended by stating a baker’s dozen goals, plus derived requirements, for any eventual real-time Java specification.

Last November, the real-time Java spec we hoped for then became a reality. So many folks wanted to see a real-time version of Java, in fact, that the RTSJ was the very first effort (JSR-001) to come out of the Java Community Process. (Even the language’s creator, James Gosling, signed up to help out.) Led by IBM, the work of the so-called Real-Time Java Experts Group resulted in a specification that describes how a real-time Java Virtual Machine must behave, a reference implementation, and a testing compatibility kit.

Among other things, the RTSJ addresses scheduling, synchronization, and garbage collection. For good measure, it adds a standardized way to peek and poke physical memory (and, thereby, memory-mapped peripheral status and control registers) and high-resolution timers to the Java libraries. By setting only a minimum standard in many areas, it also leaves the door open for advanced/alternative real-time schedulers to be offered by competing implementers.

I want to take this opportunity to thank all of those who have rolled up their sleeves and brought us closer to real-time Java. Your efforts have been worthwhile and the results look promising. Keep up the good work.

Unfortunately, we’re not done yet. The effort to bring Java to a wide range of embedded systems must include developing small (50-100KB) JVM/RTOS combinations that are compatible with RTSJ. Something along the lines of a real-time version of Sun’s KVM ought to do the trick. I’m confident we’re getting close to that final solution.

Open Source Embedded Software

Wednesday, September 12th, 2001 Michael Barr

Magazines like Embedded Systems Programming are founded on the ideal that the free flow of information between technological peers, even at competing organizations, benefits everyone. This is a view shared by the proponents of open source software. Whether it’s an operating system, a memory test suite, or simply a useful design paradigm, why should any one of us reinvent what has already been invented (and tested) by others in our profession?

Certainly, there are exceptional projects with exceptional needs. In such cases, invention of new techniques and technologies cannot be avoided. We can’t always combine existing components into a useful whole. However, such exceptional cases are rare. To take an example from childhood, you can build quite a lot of neat things with a basic set of Lego’s, but a “spaceship windshield” is a one-of-a-kind part for one-of-a-kind projects.

Most of the time, though, we’re all using the same basic components. Processors, operating systems, device drivers, and other building blocks are transferable from one company or project to another. Once developed, a technology or technique is, in fact, most valuable when it is shared with others. This benefits the creators too, as others may strengthen the component by finding and fixing flaws. This is the academic model of development, transferred to the commercial marketplace.

Unfortunately, there are many roadblocks to such openness. I recently ran into one of these when I tried to arrange a new point/counterpoint discussion. As envisioned, the debate would have addressed the differences in thinking and approach between two competing groups working toward real-time Java. A technological leader of each group was willing to participate and both thought this open debate would be a good way to uncover any flaws in one or both approaches. It might even have helped to bring the two groups together, if they found a high degree of overlap.

Plans for the debate were put on hold, though, after non-technical people on both sides expressed concern. It seems both groups are jockeying for position in the marketplace; both hope their approach will become the de facto standard for real-time Java. Though both groups acknowledge the need for open debate in the discussion of technology that could risk human lives and are conducting their own meetings publicly, they remain unwilling to debate each other.

In addition to the feeling of frustration at the intrusion of non-technical issues and people into what should have been a purely technical discussion, I also have a feeling of dread. I suspect that progress toward a real-time Java standard will be slowed (or doomed to failure) as a result of the lack of discussion. How can either of two competing solutions to the same problem be adopted as a standard without such a debate occurring first? What are those of us outside the two groups to think if these two large self-proclaimed “expert groups” cannot achieve a common standard on their own?

As the open-source movement has caught on in recent years, there have been more and more attempts to create semi-proprietary “open” standards groups. Sun’s Java Community Process, which is behind one of the two real-time Java groups, is a prime example. But it’s not at all clear that today’s “open” standards groups are anything more than the old proprietary standards, disguised.

NOTE: this article originally published on 12/6/00.