News for hackers. Stuff that matters.
Re:Fuchsia OS Introduction by altmind on Monday March 25, 2019 @11:17PM (#19489000)
yes, I'll try to sum up the article as i understand:

* better process isolation

* stable hw/driver api (this is a huge mistake in linux, agreed)

* less historical craziness(who likes fork()?)

* more micro-kernel

some of the things I personally cannot buy:

* vulkan native. android is not vulkan-native, it provides both opengl es and vulkan, for your choice

* flutter. why bundling and bringing opinions to the system becomes a benefit? it was a major problem with android that you have to interact with java if you want any native ui => I would prefer more ways/languages/bindings to interop with the UI

* fidl ipc. cool, again, why bundling something with the os?

* vDSO. why is even vdso on the slides - vdso is important, but it already with us for a decade.

This article is great because its one of the first that breaks down Fuchsia on a tech level. But at the same time, its not an article that explains all the reasons the fuchsia is better that what google have now.

Re:Fuchsia OS Introduction by josephg on Monday March 25, 2019 @11:47PM (#19489151)
> * vulkan native. android is not vulkan-native, it provides both opengl es and vulkan, for your choice

IMO vulkan-native is the right choice because opengl (or opengles, or anything else) can always be reimplemented on top of vulkan anyway. Layering opengl on top of vulkan means you're no longer at the mercy of hardware vendors to provide a bug-free opengl implementation. And if you're calling a userland opengl library running on top of vulkan, you can actually debug into graphics system and much more easily tune performance. (Debugging through into opengl calls is almost impossible when the opengl implementation is hardware-specific and part of the graphics driver itself).

Re:Fuchsia OS Introduction by hornetblack on Tuesday March 26, 2019 @01:34AM (#19489526)
Case in point. Google's ANGLE library has a in-progress Vulkan back-end. (Used for WebGL in Chrome and Firefox). ANGLE does only provide OpenGL ES, but then so does Android. I wouldn't be surprised if an upcoming android version required Vulkan suppport and Android shipped with ANGLE for OpenGL.

https://github.com/google/angle

Re:Fuchsia OS Introduction by kllrnohj on Tuesday March 26, 2019 @01:29PM (#19494048)
In reality this is entirely moot and comes down purely to driver development cost. Nothing in the OS is designed around the idea of being "vulkan native" or not. That's just not a system architecture thing at all.

But what is a thing is whether or not the GPU driver bothers to have an OpenGL ES path or not. It's obviously simpler if the driver doesn't, but a quality driver implementation will also obviously always beat something like ANGLE in every way.

So take a hypothetical Nvidia Shield 5 running Fuchsia in 5 years or whatever. If games are still dominantly in OpenGL ES, then you can bet your ass Nvidia will be shipping a first-class GLES driver and not use ANGLE-on-Vulkan.

Re:Fuchsia OS Introduction by atombender on Monday March 25, 2019 @11:35PM (#19489104)
FIDL is used extensively through the OS, and looks like it will be the primary means of communication between processes, not too different from macOS's XPC (which is used for a lot of services as well as very low-level stuff like talking to the T2 processor, apparently). Fuchsia being a microkernel, it makes sense to make this part of the OS. The alternative of inventing ad-hoc RPC mechanisms for each area of the system would be worse.
Re:Fuchsia OS Introduction by wongarsu on Tuesday March 26, 2019 @06:43AM (#19490607)
If I remember correctly Android also has IPC in the kernel, using it to enforce permissions and the security model between apps.
Re:Fuchsia OS Introduction by pjmlp on Tuesday March 26, 2019 @07:17AM (#19490715)
Moreso after Project Treble, now Android Linux behaves a bit like a micro-kernel.
Re:Fuchsia OS Introduction by microcolonel on Monday March 25, 2019 @11:29PM (#19489072)
> stable hw/driver api (this is a huge mistake in linux, agreed)

Not to get into a flamewar over this, but there are real benefits to Linux's rolling driver ABI (the "API", however, is mostly stable, contrary to what you say). It encourages mainline collaboration, and greatly improves the quality and compactness of the drivers.

On Windows (and to some extent macOS), you'll find whole classes of driver where each driver has its own proprietary internal implementation of something that should have been in the API and ABI, but is not (or just was not when the driver was written). Linux has great, up to date drivers for the vast majority of devices you'd want to use†, and all of the best ones are built (compactly!) right in to the kernel, so it is more or less moot at this point whether a stable ABI is a good thing (at worst, it didn't matter in the long run; at best, it made the system better).

The level of integration and standardization in the Linux kernel is spectacular, and absolutely would not have been achieved if vendors were empowered to link ABI-compatible binary blobs into end user kernels. There is tremendous value in the fact that I can manage, consistently, every LED, every DVFS controller, every fan controller, every GPIO pin, etc. on each supported system in a consistent fashion. Left to their own devices, each vendor would use their pet interface (as seen with NVIDIA putting their foot down and demanding EGL surfaces be used with their driver on Wayland, despite the fact that no standard software supports it); NVIDIA insists that this is the way it's meant to be played, and I'm glad that the answer is a resounding no.

† Outside of the Android ecosystem, which, through what could maybe be called poor stewardship on the part of Google, inexplicably refuses to develop against the mainline kernel, so is constantly fighting to maintain literally thousands of vendor-, OEM-, model-, SKU-, country-, and carrier-specific kernel trees for absolutely no recognizable benefit, and against the clearest and most consistent advice of the highest experts on the subject.

Re:Fuchsia OS Introduction by ebg13 on Tuesday March 26, 2019 @01:22AM (#19489485)
> It encourages mainline collaboration

I feel like this is demonstrably a false promise by looking at the billions of mobile devices never getting any updates because of vendor neglect.

> and greatly improves the quality

Compared to what?

> and compactness of the drivers

Which no user has ever cared about.

> up to date drivers for the vast majority of devices you'd want to use†

I notice that you excepted billions of devices in order to make this claim.

> inexplicably refuses to develop against the mainline kernel

It's not inexplicable. It's easier and cheaper.

Re:Fuchsia OS Introduction by ufo on Tuesday March 26, 2019 @09:41AM (#19491687)
The Linux model definitely encourages mainline collaboration. It just happens that the Android vendors are fighing against this encouragement, and Google has caved in to their demands.

> Compared to what?

Compared to what happens on Windows and Android, where individual drivers have to reimplement common functionality, often in inconsistent ways.

> Which no user has ever cared about.

Users care that their drivers work and that they continue to be supported in the future. Less compact code is larger, and therefore buggier. Drivers which are provided as proprietary userspace blobs are invariably unmaintained and stop working with future kernel versions.

Re:Fuchsia OS Introduction by yc12340 on Tuesday March 26, 2019 @07:01AM (#19490667)
> feel like this is demonstrably a false promise by looking at the billions of mobile devices never getting any updates

Third-party firmware like CyanogenMod exists only because in-kernel GPL parts can be ported to new OS versions.

With Fuchisa there won't be anything like CyanogenMod anymore.

Re:Fuchsia OS Introduction by ebg13 on Tuesday March 26, 2019 @07:28PM (#19496879)
> Third-party firmware like CyanogenMod exists only because in-kernel GPL parts can be ported to new OS versions. With Fuchisa there won't be anything like CyanogenMod anymore.

I think you're confused. If the interface for the drivers stays stable, then you can just carry over the same exact binary blob and it will keep working perfectly, which is exactly what Microsoft does. Windows 7 drivers still work just fine in Windows 10.

Re:Fuchsia OS Introduction by imtringued on Tuesday March 26, 2019 @07:41AM (#19490799)
If third parties can update the OS despite an unstable driver API then it all boils down to the laziness of the vendors.
Re:Fuchsia OS Introduction by jhasse on Tuesday March 26, 2019 @02:51AM (#19489741)
> Which no user has ever cared about.

The user cares because it results in fewer bugs.

Re:Fuchsia OS Introduction by pjmlp on Tuesday March 26, 2019 @03:27AM (#19489858)
Which paper proves such correlation?
Re:Fuchsia OS Introduction by jhasse on Tuesday March 26, 2019 @03:36AM (#19489891)
Re:Fuchsia OS Introduction by pjmlp on Tuesday March 26, 2019 @03:59AM (#19489962)
Thanks.
Re:Fuchsia OS Introduction by PlutoIsAPlanet on Tuesday March 26, 2019 @04:01AM (#19489970)
Android devices not running mainline kernels is a direct result of the Linux development process.

If an Android device launches with a new CPU or device, the OEM has to go through the process of up-streaming the changes to mainline before they can launch their phone? not going to happen.

Re:Fuchsia OS Introduction by yc12340 on Tuesday March 26, 2019 @07:04AM (#19490680)
> Android devices not running mainline kernels is a direct result of the Linux development process

That's a wishful thinking. Majority of Android drivers are userspace blobs. Linux kernel development process is completely irrelevant for them.

Device vendors don't update already sold devices because they don't care (and because average consumer also does not care).

Re:Fuchsia OS Introduction by ebg13 on Tuesday March 26, 2019 @07:59PM (#19497038)
> Device vendors don't update already sold devices because they don't care (and because average consumer also does not care).

You should consider why the hardware vendors are in the critical path for OS updates in the first place. Dell doesn't get to decide whether you can apply Windows updates.

Re:Fuchsia OS Introduction by petecox on Tuesday March 26, 2019 @08:43PM (#19497274)
Turning that notion on its head, Pinephone could be one to watch.

They more or less intend to supply the hardware only. This avoids the pretence of vendor updates entirely, by both the company (Pine64) and the ARM licensee (Allwinner).

The software stack is up to you, with mainline Linux support courtesy of the A64 [0] powering a number of 'RPi-killer' boards. Device updates will be supplied by the likes of Ubuntu Touch, LineageOS, postMarketOS et alia mobile distributions.

[0] http://linux-sunxi.org/A64

Re:Fuchsia OS Introduction by ebg13 on Tuesday March 26, 2019 @10:30PM (#19497739)
> Turning that notion on its head, Pinephone could be one to watch.

Maybe. Except that for me (and I know I'm not alone) the second most important part of my pocket computer after web searching is the camera, and they're unlikely to have anything great in there.

> Allwinner

Hah. The repeat GPL violator?

Re:Fuchsia OS Introduction by andrekandre on Wednesday March 27, 2019 @07:31AM (#19499812)
i think in the end, this whole divide boils down to a divide in philosophy between free software and corporations that support “open source” but don’t want it free (as in gpl)

thereby we get the constant tension between google and hardware makers that want to keep their jewels secret, and the linux/foss community that wants to keep their freedom to install their (open) software on any device... by keeping the drivers in with the kernel, linux can foster that end, but it causes no end of frustration to google et al...

i think that’s probably the reason we get fuchsia: google can be open source, and with the hw makers, keep the proprietary parts proprietary... the result being, we have open kernel and os bits but no guarantee (or much hope at least) we could ever run it on our devices...

i think that’s the biggest cultural divide: freedom to change and replace the software vs freedom to look at the code (and maybe run it in an emulator...

Re:Fuchsia OS Introduction by altmind on Tuesday March 26, 2019 @11:31AM (#19492729)
This is so untrue.

There's a whole class of devices that will never be in linux mainline kernel - experimental filesystems(remember those years wher FUSE was a patch?), propietary hardware(embedded devices), kernel bypass hardware(onload), security hardening mechanisms(remember PaX?), commercial software who basically sell the driver(intel studio profiler).

All this breaks every time linux releases a major rewrite. If the vendor is out of business or no longer interested in a product - you are left with the drivers that do not work.

Moreover - in a case of major api breakage - its kernel contrubutors who are left with re-writing every driver for a new api, delaying the kernel releases.

Re:Fuchsia OS Introduction by snvzz on Tuesday March 26, 2019 @01:09AM (#19489449)
>NVIDIA insists that this is the way it's meant to be played, and I'm glad that the answer is a resounding no.

I have some bad news for you. They got their way.

Re:Fuchsia OS Introduction by _pmf_ on Tuesday March 26, 2019 @02:14AM (#19489627)
Very well put.
Re:Fuchsia OS Introduction by 0815test on Tuesday March 26, 2019 @07:09AM (#19490691)
Windows doesn't even have a standard driver-ABI anyway - if it did, we wouldn't have hardware losing driver support when switching the system to a different Windows version (XP/Vista/7/8+/10).
Re:Fuchsia OS Introduction by ebg13 on Tuesday March 26, 2019 @08:09PM (#19497087)
> Windows doesn't even have a standard driver-ABI anyway

It does to a very significant degree. Windows 7 drivers from 10 years ago still work today with Windows 10. Windows 95 user software from 23 years ago will still work today in Windows 10. Microsoft cares strongly about maintaining compatibility and only removes functionality when necessary.

Re:Fuchsia OS Introduction by nwah1 on Monday March 25, 2019 @11:31PM (#19489084)
I don't understand why they didn't want to base it on the formally-verified, capability-based micro-kernel called seL4.

Formal verification is the difficult but necessary next step for security-intensive applications.

Also, any new kernel should only be written in a memory-safe language. Rust would be the best, since it is also safe from data races, outside of unsafe blocks.

Re:Fuchsia OS Introduction by im_down_w_otp on Monday March 25, 2019 @11:41PM (#19489126)
Well... it's non-trivial to use seL4 correctly. It has all of the facilities to build something great and very little rails to ensure that you actually do. CAmkES, the component framework to help you do that, is... challenging in all the wrong ways.

The proof evidence is very hard to extend meaningfully for new platforms, and you're limited to environments which have a sufficient MMU.

We're starting with seL4 and building a whole Rust-based userland around it, and creating a whole pile of compile-time assurances along the way to make sure we're not inadvertently doing something dangerous or stupid with the rope seL4 gives you.

It's worth it for us. However, it is a colossal pain in the ass. That said, in the coming months we're likely to open source some of our progress in making it easier and more reliable to work with, integrate with, and otherwise leverage seL4 for certain use cases.

Re:Fuchsia OS Introduction by thenewwazoo on Tuesday March 26, 2019 @12:40AM (#19489344)
I'm super interested in the work you're doing. I spent a couple of weekends building bindings and trampolines to get Rust binaries linked into Chibi/OS and FreeRTOS and it worked really well. I've always wanted to work with seL4, so I downloaded the source and started working through the tutorials and... oh dear. There ended my experiments trying to add Rust into the mix. So if there's any way I can subscribe or otherwise keep abreast of the work you're doing, I'd love to do that.

As an aside, I wonder just how much async/await in Rust will obviate the need for small kernels in deeply embedded applications. If I can do blocking IO with my peripherals and use the async state machines to do "task" switching, well... who needs tasks and capabilities? It'd land somewhere on the "language OS" side of an embedded OS almost.

Re:Fuchsia OS Introduction by im_down_w_otp on Tuesday March 26, 2019 @01:18PM (#19493903)
At the moment we're light on marketing materials & outreach. We've been heads down bootstrapping and working with early customers.

When we open source things in the coming weeks & months they'll all land on GitHub, https://github.com/auxoncorp, so that's probably the lowest touch way of observing what we're up to as things mature.

Re:Fuchsia OS Introduction by Matthias247 on Tuesday March 26, 2019 @02:47PM (#19494848)
async/await in embedded is actually an interesting thing, that i also evaluated. I think it can't be an alternative to preemptive RTOS kernels, since the cooperative nature doesn't allow to process things within guaranteed deadlines. Therefore I think async/await might end up more as an add-on to RTOS: All time-critical things are run within independent RTOS tasks. And all the remaining and less critical stuff could potentially be run inside a single-threaded async/await scheduler.

While Rust seems to be promising here, I'm not sure whether the current async/await implementation will really allow for this. I experimented a bit with it, and found lots of issues where async/await lead to severe memory bloat (composing 3 async functions that do not a lot things requiring a 20kB task allocation). The compatibility with Futures and the requirement to move async fns to compose them before using them (which requires extra stack - which again ends up as extra heap/task memory) plays a bit against it. But these things are also worked on, so let's seee how it works out.

Re:Fuchsia OS Introduction by guywhocodes on Tuesday March 26, 2019 @01:10AM (#19489450)
>If I can do blocking IO with my peripherals and use the async state machines to do "task" switching, well... who needs tasks and capabilities? It'd land somewhere on the "language OS" side of an embedded OS almost.

Waiting directly on the resource like that would require exclusive access quite often though?

Re:Fuchsia OS Introduction by Scramblejams on Tuesday March 26, 2019 @12:30AM (#19489314)
Deets would be appreciated. Sounds interesting.
Re:Fuchsia OS Introduction by rujuladanh on Tuesday March 26, 2019 @06:11AM (#19490459)
Rust isn't safe from race conditions. It is not a guarantee. It is free from memory errors, that is true, though.
Re:Fuchsia OS Introduction by ZirconiumX on Tuesday March 26, 2019 @08:47AM (#19491252)
Rust is safe from race conditions, because race conditions are memory errors.

You should read [1] to understand how Rust achieves this.

[1]: https://doc.rust-lang.org/nomicon/send-and-sync.html

Re:Fuchsia OS Introduction by manaskarekar on Tuesday March 26, 2019 @09:26AM (#19491548)
Quoting some more relevant stuff from the nomicon. The linked article is short and sweet.

A data race has Undefined Behavior, and is therefore impossible to perform in Safe Rust.

...

However Rust does not prevent general race conditions.

This is pretty fundamentally impossible, and probably honestly undesirable. Your hardware is racy, your OS is racy, the other programs on your computer are racy, and the world this all runs in is racy. Any system that could genuinely claim to prevent all race conditions would be pretty awful to use, if not just incorrect.

Source: https://doc.rust-lang.org/nomicon/races.html

Re:Fuchsia OS Introduction by netrikare on Tuesday March 26, 2019 @10:07AM (#19491935)
not true - you can have a program that is free of data races but still contains race conditions. Rust prevents data races.
Re:Fuchsia OS Introduction by rujuladanh on Wednesday March 27, 2019 @06:21PM (#19506739)
No, Rust isn't.

Maybe you should read a bit more on its docs [1]. I quote:

However Rust does not prevent general race conditions.

[1] https://doc.rust-lang.org/nomicon/races.html

Re:Fuchsia OS Introduction by suby on Monday March 25, 2019 @11:47PM (#19489148)
Regarding Fuschia only having an option for vulkan and not opengl, it doesn't seem like that would necessarily stop opengl software from working on fuchsia, right? There are opengl implementations on top of Vulkan like MoltenVK. I don't have a great understanding of this stuff, but assuming that this is true, I imagine that it has upsides like eliminating potential driver bugs which have plagued opengl in the past.
Re:Fuchsia OS Introduction by earenndil on Tuesday March 26, 2019 @02:36AM (#19489689)
MoltenVK implements vulkan itself, on top of metal, and its counterpart, moltengl is closed-source. There do exist projects to implement opengl on top of vulkan, but I don't think any of them are mature yet.
Re:Fuchsia OS Introduction by j16sdiz on Tuesday March 26, 2019 @06:06AM (#19490444)
Google does not mix well with stable api. They love the shiny new stuffs and break things often.
Re:Fuchsia OS Introduction by fouc on Tuesday March 26, 2019 @12:06AM (#19489228)
How tied to the internet will it be? How many callbacks to google will it have? Will it rely on google DNS?
Re:Fuchsia OS Introduction by sagartewari01 on Tuesday March 26, 2019 @05:29AM (#19490291)
> Will it rely on google DNS? You bet!
Re:Fuchsia OS Introduction by HeWhoLurksLate on Tuesday March 26, 2019 @09:24AM (#19491525)
As default, that makes a lot of sense. I guarantee there will be a lot of pushback from enterprises if they can't change the DNS servers to their own.
Re:Fuchsia OS Introduction by hrdwdmrbl on Tuesday March 26, 2019 @01:23AM (#19489491)
not