Things Are Getting Rusty In Kernel Land

There is gathering momentum around the idea of adding Rust to the Linux kernel. Why exactly is that a big deal, and what does this mean for the rest of us? The Linux kernel has been just C and assembly for its entire lifetime. A big project like the kernel has a great deal of shared tooling around making its languages work, so adding another one is quite an undertaking. There’s also the project culture developed around the language choice. So why exactly are the grey-beards of kernel development even entertaining the idea of adding Rust? To answer in a single line, it’s because C was designed in 1971, to run on the minicomputers at Bell Labs. If you want to shoot yourself in the foot, C will hand you the loaded firearm.

On the other hand, if you want to write a kernel, C is a great language for doing low-level coding. Direct memory access? Yep. Inline assembly? Sure. Runs directly on the metal, with no garbage collection or virtual machines in the way? Absolutely. But all the things that make C great for kernel programming also make C dangerous for kernel programming.

Now I hear your collective keyboards clacking in consternation: “It’s possible to write safe C code!” Yes, yes it is possible. It’s just very easy to mess up, and when you mess up in a kernel, you have security vulnerabilities. There’s also some things that are objectively terrible about C, like undefined behavior. C compilers do their best to do the right thing with cursed code like i++ + i++; or a[i] = i++;. But that’s almost certainly not going to do what you want it to, and even worse, it may sometimes do the right thing.

Rust seems to be gaining popularity. There are some ambitious projects out there, like rewriting coreutils in Rust. Many other standard applications are getting a Rust rewrite. It’s fairly inevitable that the collection of Rust developers started to ask, could we invade the kernel next? This was pitched for a Linux Plumbers Conference, and the mailing list response was cautiously optimistic. If Rust could be added without breaking things, and without losing the very things that makes Rust useful, then yes it would be interesting. Continue reading “Things Are Getting Rusty In Kernel Land”

Transparent Framedeck Is Clearly Capable

When the universe tells you to build a cyberdeck, then build a cyberdeck you must. The lucky [Richard Sutherland] got an email from user-serviceable laptop purveyors Framework about the availability of their main board for use as a single-board computer. They agreed to send him a laptop and some extra modules as long as he promised to build something awesome with it. There was just one fabulous caveat: whatever design he came up with had to be released to the public.

[Richard] took this capable board with four USB ports and built an all-in-one that pays homage to the slab-style computers like the TRS-80 Model 100, which [Richard] really wanted as a kid. It looks lovely in layered acrylic and brass, and even though we pretty much always think that see-through is the best design choice you can make, transparency really works here. Tucked into those layers is a custom 36-key split running on an Elite-C microcontroller with Gazzew Boba U4 Silent-but-tactile switches, and a trackball in between. Be sure to take the build tour and check out all the process pictures.

Acrylic looks great and seems great on paper, but what about actual use? [Richard] put rubbery SKUF feet on the front, and a pair of repositionable feet on the back. Not only will it stay in place on the table, but he’ll be able to see the screen better and type at an angle greater than zero.

As cool as it would be to have Framedeck in the apocalypse, it will be hard to hide and could get looted. You might want to build something a bit more concealed.

Building Petahertz Logic With Lasers And Graphene

There was a time when we thought a 50 MHz 486 was something to get excited about. In comparison, the computer this post was written on clocks in at about 3.8 GHz, which these days, isn’t an especially fast machine. But researchers at the University of Rochester and the  Friedrich-Alexander-Universität Erlangen-Nürnberg want to blow the doors off even the fastest modern CPUs. By using precise lasers and graphene, they are developing logic that can operate at nearly 1 petahertz (that’s 1,000,000 GHz).

These logic gates use a pair of very short-burst lasers to excite electrical current in graphene and gold junctions. Illuminating the junctions very briefly creates charge carriers formed by electrons excited by the laser. These carriers continue to move after the laser pulse is gone. However, there are also virtual charge carriers that appear during the pulse and then disappear after. Together, these carriers induce a current in the graphene. More importantly, altering the laser allows you to control the direction and relative composition of the carriers. That is, they can create a current of one type or the other or a combination of both.

This is the key to creating logic gates. By controlling the real and virtual currents they can be made to add together or cancel each other out. You can imagine that two inputs that cancel each other out would be a sort of NAND gate. Signals that add could be an OR or AND gate depending on the output threshold.

[Ignacio Franco], the lead researcher, started working on this problem in 2007 when he started thinking about generating electrical currents with lasers. It would be 2013 before experiments bore out his plan and now it appears that the technique can be used to make super fast logic gates.

We often pretend our logic circuits don’t have any propagation delays even though they do. If you could measure it in femtoseconds, maybe that’s finally practical. Then again, sometimes delays are useful. You have to wonder how much the scope will cost that can work on this stuff.