News for hackers. Stuff that matters.
Re:Toyota's killer firmware: Bad design and its consequences... by cpeterso on Sunday April 26, 2015 @01:05AM (#9440611)
How much code reuse is there between the firmware in a manufacturer's different car models? I'm surprised there isn't a consortium (like Symbian was) to create a standard firmware kernel to share the benefits (and costs) of testing and auditing the code.

I'm also surprised C is still so commonly used for mission critical software. I understand that C is familiar, has many static analysis tools (to make up for the language's deficiencies), and has a straight-forward translation from C to object code (though only when using simple optimizations). For example, if MISRA-C's coding guidelines disallow recursion, why not design a language that only supports DAG function dependencies?

Re:Toyota's killer firmware: Bad design and its consequences... by agoetz on Sunday April 26, 2015 @10:52AM (#9441946)
OSEK is a an industry standard rtos that is used by almost all automotive players. It is specifically designed for use in the automotive environment. Toyota actually claimed to use an OSEK compliant rtos, but it later surfaced in this lawsuit that they had written their own implementation that was never certified by an outside organization. OSEK is in the process of being superseded by AUTOSAR, which defines much more than just the os, and included a large hal that allows for plug and play middleware libraries. Unfortunately it isn't economical for every ecu to make use of AUTOSAR: it has heavy resource requirements (> 2Mbyte RAM) and so many applications don't use it.

Also on the horizon is ISO26262, which mandates quality assurance for automotive embedded code in the form of paper trails. Unfortunately due to the huge amount of work required by the standard, some automakers are choosing to ignore it and hope it doesn't become mandatory.

Re:Toyota's killer firmware: Bad design and its consequences... by cpeterso on Sunday April 26, 2015 @01:11PM (#9442436)
Thanks! I'll read more about OSEK and AUTOSAR.
Re:Toyota's killer firmware: Bad design and its consequences... by tracker1 on Sunday April 26, 2015 @03:45AM (#9440908)
I'm honestly surprised that this kind of thing is running ANY OS, and not direct hardware control paths. Let alone the fact that they didn't use FB ECC ram... that's even before going down the path of code quality. Not having a safety case for a hardware off or powerdown state... though if they had such a thing, odds are it would have been botched worse than the system to begin with.

Personally, I could never handle the stress of designing or building something like this... I worked in a security software team for a bank for a year, that was about as far as I can get in terms of job stress. Just the same, it seems to me some of these choices were clearly rookie level mistakes that shouldn't have been put in production to control motor vehicles.

I also agree, that it would really make more sense for car mfgs to get together to form some standards for production and core controls. If they're determined to use an actual OS, then it better damned well be the most thoroughly tested OS, running on certified hardware, with certified controls in place.

If you mess up the code in a number of places, people don't die... Tasks that control fast moving and/or heavy machinery, medical devices, etc should have very tight controls in place.... this is the kind of situation where software is and should be treated like an engineering discipline. Most of the time it's more of a craft, this isn't one of them.

Re:Toyota's killer firmware: Bad design and its consequences... by jacquesm on Sunday April 26, 2015 @03:02AM (#9440817)
> I'm also surprised C is still so commonly used for mission critical software.

If you're surprised at that then you probably have not seen much of the embedded world where (gasp!) assembler is still in use and C is considered a 'high level' language.

Re:Toyota's killer firmware: Bad design and its consequences... by fnordfnordfnord on Sunday April 26, 2015 @09:55AM (#9441751)
A java programmer acquaintance of mine calls C "portable assembly language".
Re:Toyota's killer firmware: Bad design and its consequences... by henk53 on Sunday April 26, 2015 @10:30AM (#9441873)
It's not that far from the truth. C was designed to be very close to the machine and allows mixing in of inline assembly.

This latter feature is almost unthinkable in what most people would call high level languages today (Java, C#, Swift, etc).

For better or worse, Java is increasingly being used in embedded scenarios. Blu-ray players are a prime example, but televisions, settop boxes of various kinds also use Java these days.

Re:Toyota's killer firmware: Bad design and its consequences... by donarb on Sunday April 26, 2015 @01:39PM (#9442529)
Java, originally called Oak, was created specifically for programming settop boxes for cable TV.
Re:Toyota's killer firmware: Bad design and its consequences... by pron on Sunday April 26, 2015 @10:00AM (#9441763)
There have been languages designed for verifiably safe, hard realtime operations. The most interesting one among them is probably Esterel[1] (that compiles to C or even VHDL/Verilog), though I think the language has mostly been supplanted by graphical representations[2]. I believe that such development environments (and other relatively expensive ones like Ada and realtime Java) are mostly used in aviation/defense. I don't know whether it's due to tradition or cost.

[1]: http://en.wikipedia.org/wiki/Esterel

[2]: http://www.esterel-technologies.com/products/scade-suite/

Re:Toyota's killer firmware: Bad design and its consequences... by pjmlp on Sunday April 26, 2015 @03:22AM (#9440861)
We have to thank such developers for the rise of Ada in High Integrity Computing Systems, outside its original military domain.
Re:Toyota's killer firmware: Bad design and its consequences... by nmrm on Sunday April 26, 2015 @01:11AM (#9440622)
I believe that when the recalls occurred, at least several models of Toyota/Lexus cars were affected.

Ultimately, it's impossible to know without being inside. I would imagine there's a fair bit of reuse within each manufacturer and very little sharing between manufacturers

Re:Toyota's killer firmware: Bad design and its consequences... by ptaipale on Sunday April 26, 2015 @02:11AM (#9440734)
Considering

1) how much other components are shared between manufacturers, and having companies like Delphi Automotive doing a lot of work for many manufacturers

2) how often car manufacturers own parts of each other, and how often these ownership structures change (look at Ford and Volvo and Mazda, or Daimler-Chrysler, etc)

I would imagine there are shared platforms and components, also software, between manufacturers.