Linux Foundation to support Zephyr microkernel
zephyrproject.org
zephyrproject.org
Zephyr is a no-protection microkernel, like VxWorks (but unlike QNX, Minix, or L4, which run user processes in protected mode.) Everything is in one address space. It's actually Rocket, from Wind River, which also sells VxWorks and has open-sourced Rocket. Zephyr is for very small systems. Think smart light bulb, not WiFi router. Supported hardware includes the Arduno Due (ARM) and Arduino 101 (x86). The QEMU emulator can be used for testing. The API is C-oriented and very low level - fibers, threads, mailboxes, semaphores, etc.
[1] http://www.linuxfoundation.org/news-media/announcements/2016...
If it is Rocket, is it a product that couldn't get traction so now they are giving it away?
[1] http://blogs.windriver.com/wind_river_blog/2016/02/wind-rive...
Zephyr is for systems far too small for Linux. You don't even have to have a file system.
Several of the endorsers in the press release speak of Zephyr as "secure". This OS has no memory protection, no user IDs, and no permission system. Any code can do anything. Messages are passed around as raw pointers; they're not copied. Nor is the size sent with the message. And it's all in C. What could possibly go wrong?
There's nothing wrong with using an OS like this when your application program is a few hundred lines. But if you add a networking stack and a mini web server, there's going to be trouble.
Well, my microwave firmware doesn't have any protection either but, seriously, you can apply security models/proofs to the code you run there.
Since it was possible to reprogram Super Mario World through the controller, it seems pretty plausible that it's possible to reprogram some embedded systems through their UI even when they're not designed for that!
http://hackaday.com/2015/01/22/reprogramming-super-mario-wor...
That's about what I was thinking. Hell, if there's a standard set of firmware that most, or even just most cheap ones ship with, then it might even work for a large chunk of the units in the wild.
So, a combo of top talent w/ a C history and tons of tooling made most of them go with C. Many others went with Ada/SPARK. A few small fish even use typed or structured assembler. C is only chosen due to tooling and "better the devil you know" philosophy. Work on superior languages got more results with less effort in both human and mechanical reviews, though. So, the inferior language is only used due to an accident of history.
Details on that here:
Those are the recommendations in that order. What you use depends on your domain, constraints, skills, and so on. Modula-2, Active Oberon, Modula-3, Free Pascal, and Component Pascal were probably closest to C's domain in terms of safe, efficient, easy-to-compile languages. Ada is systematic in all the errors it handles but with steep, learning curve. SPARK straight up proves your code. One can also use DSL's/4GL's that generate proper C w/ automated checks like iMatix and Galois do (and I once did). I've also seen Ocaml and LISP used for real-time, even embedded, systems with custom runtime. Ocaml was also used for tooling w/ source to object code verification.
So, there's a number of options. Each are behind C currently in tooling due to limited uptake and investment. More uptake and investment can fix that. Even so, average results of those tools have far lower defects than C code with shorter time to train people (ignoring Ada). That most teams aren't composed of geniuses in safe coding means that's important too.
These more mathematical languages have to prove themselves out with real-world examples, algorithms and compiled code, before I recommend them. I'd like to see CompSci keep hammering away at them to find easier and easier ways of learning and using them. Not to mention improve tooling.
1. Be closer to English to make them easier to read. Important as software is read more than written. Also can help in reviews.
2. Generally have proper features like modules or interfaces to aid programming in the large.
3. Still efficient enough for programming close to the metal.
4. Prefer sane defaults or automated checks on issues that trip programmers up. A good implementation usually lets you turn these off for a module if needed.
5. Tradition of thorough language reports and grammars means less undefined behavior.
6. Most common stuff is still efficient once compiled. If Wirth-like, then also efficient to compile.
7. Less tied to a specific processor style with its own style being more amenable to safe, maintainable operation. See Burroughs B5000 processor vs PDP-11's.
8. IMPORTANT. Easier to develop tooling for verification, esp static or dynamic analysis.
9. Easier to verify mathematically.
So, these are some things off the top of my head that various languages more ALGOL-like did better than C-like languages. I wouldn't say there was a single one that had all these traits but Modula-3 came close. A modified version of Go might as well given its predecessors were used in safe-language OS's. Hope this brainstorm gives you some idea of what things I valued vs C's style.
Seems like Rust needs a few more laps around the track.
( Rust is from Mozilla Foundation, perhaps we can see some alternate implementations of their products to see how reliable they are with Rust ).
As for the Linux Foundation, they seem to be branching out into strengthening the entire Linux ecosystem. Having Zephyr for embedded firmware on the bits not running Linux in Linux systems (e.g. sensors) is a step toward that.
Cram this with some server into a VM and drop the VM on top of Linux in the cloud.
Supposedly this setup provides performance vs security middle ground between containers and a full blown distro in a VM.
Meaning that as there is just a minimal kernel present you get higher performance, while being wrapped in a VM reduce the potential of exploits compared to a container.
"mlock" is about virtual memory manager "locking" physical pages, so they can't be swapped out to disk.
Here were talking about systems that might not have a disk or even an MMU to implement virtual memory. They might still have dedicated memory protection units, but those aren't necessarily able to support memory virtualization, but just simply to protect memory ranges in safety critical systems.
This is about ability to lock CPU caches (or parts of them, cache line locking) to get something akin to scratchpad memory to ensure deterministic memory access latencies.
For some applications there's a difference whether memory access takes 10 or 100 nanoseconds.
Specific example in PPC CPU's: http://www.ibm.com/developerworks/library/pa-ppccache/
Googling "cache locking real time" will give you all kinds of interesting work.
This is great approach especially with Linux Foundation behind it.
I am curious on what kind of License will it be released under, GPL?
Pro: Companies probably can hide IP in it.
Con: Companies likely to hide IP inside Binary BLOB inside it.
I am holding in my hand a device the size of a postage stamp (or full sized SD card) that has 64MB of ram and 16MB of flash rom and supports eight simultaneous wifi devices (the zsun usb adapter). It uses two chips to accomplish this (Qualcomm MIPS cpu) and a third to support an external microsd card.
http://i.imgur.com/F8P40Uo.jpg
The usb connector is almost larger than the board that holds the two chips.
Also have you seen the size of todays microcontrollers? They are absolutely tiny:
Less memory means less code, which means fewer bugs.