News for hackers. Stuff that matters.
Re:Linux running on RISC-V emulated in Scratch by yjftsjthsd-h on Sunday October 29, 2023 @11:34AM (#38059532)
In fairness, a lot of the friction on real devices is from it being a real device; VMs have fewer and simpler drivers to deal with.

(And nobody cares about stability in a PoC)

Re:Linux running on RISC-V emulated in Scratch by charcircuit on Sunday October 29, 2023 @12:39PM (#38060243)
A lot of friction also comes from kernel modules not having a stable API they can target meaning they need to be updated for new versions.
Re:Linux running on RISC-V emulated in Scratch by josephcsible on Sunday October 29, 2023 @06:27PM (#38063472)
There doesn't need to be a stable API. They should just upstream their drivers into the kernel tree.
Re:Linux running on RISC-V emulated in Scratch by FreeFull on Sunday October 29, 2023 @06:56PM (#38063684)
Someone has to actually maintain the driver in the tree. Drivers that don't have maintainers end up being removed from the kernel.
Re:Linux running on RISC-V emulated in Scratch by josephcsible on Sunday October 29, 2023 @07:03PM (#38063740)
Yes, but that's way less work than maintaining an out-of-tree one is. Since fixes for kernel API changes are then the responsibility of whoever changed the API, instead of the driver's maintainer, it's basically the same amount of work it would be if the kernel did have a stable API.
Re:Linux running on RISC-V emulated in Scratch by charcircuit on Sunday October 29, 2023 @07:04PM (#38063744)
That is not always possible due to licensing like OpenZFS's kernel module. There may also be trade secrets in a kernel module that they do not want to reveal by upstreaming. Upstreaming code takes time and it is not guarenteed that your patches will be accepted where an out of tree module can be created instantly.

It may not be needed, but in practice kernel modules will exist and make upgrading Linux harder than it needs to be. A stable API is about providing value and saving time for driver developers and end users. It is no coincidence that successful operating systems like Windows, Mac, and Android have stable ABIs that you can use to make drivers.

Re:Linux running on RISC-V emulated in Scratch by josephcsible on Sunday October 29, 2023 @07:20PM (#38063854)
> That is not always possible due to licensing like OpenZFS's kernel module.

Aren't these sorts of hardware drivers generally written in-house by the company who makes the hardware? Can't they pick whatever license they want since they own the copyright?

> There may also be trade secrets in a kernel module that they do not want to reveal by upstreaming.

A company that asserts the existence of "trade secrets" in kernel modules deserves to have to do the extra work. All kernel modules should be open source.

Re:Linux running on RISC-V emulated in Scratch by charcircuit on Sunday October 29, 2023 @07:36PM (#38063950)
>Aren't these sorts of hardware drivers generally written in-house by the company who makes the hardware? Can't they pick whatever license they want since they own the copyright?

I gave you an example of OpenZFS where this is not the case. The code in hardware drivers may not be owned entirely by the company. It could have even been done entirely by a third party which may not even still be in business. Even if they were willing to license there would be extra costs in making the code into a state that can be upstreamed. Even then it might just never be accepted.

>A company that asserts the existence of "trade secrets" in kernel modules deserves to have to do the extra work.

This is an unreasonable stance that hurts end users. If no one exists to maintain the kernel module end users will get stuck on old, insecure, kernel versions. Even if they get updated it prevents people from upgrading until there is a version all drivers support.

>All kernel modules should be open source.

That is your opinion. It is not true in practice meaning there is utility in having a stable ABI.

Re:Linux running on RISC-V emulated in Scratch by josephcsible on Sunday October 29, 2023 @07:42PM (#38063995)
> I gave you an example of OpenZFS where this is not the case.

But that's not a hardware driver.

> It is not true in practice meaning there is utility in having a stable ABI.

That would benefit the people who are doing the wrong thing, at the expense of people who are doing the right thing.

Re:Linux running on RISC-V emulated in Scratch by charcircuit on Sunday October 29, 2023 @08:05PM (#38064147)
>But that's not a hardware driver.

It is still a kernel module.

>That would benefit the people who are doing the wrong thing, at the expense of people who are doing the right thing.

People are going to make out of tree kernel modules regardless. It is only the wrong way because there is not a stable ABI for doing it.

Re:Linux running on RISC-V emulated in Scratch by benj111 on Monday October 30, 2023 @05:15AM (#38067178)
>It could have even been done entirely by a third party which may not even still be in business.

That's not really a good basis for defending closed drivers.

Yes it happens, but it is a scenario we should be trying to avoid.

Re:Linux running on RISC-V emulated in Scratch by charcircuit on Monday October 30, 2023 @11:53AM (#38071100)
The real world is not as nice as you imagine. These things do happen. Sure it's in a businesses best interest to avoid things like this, but that doesn't mean it will never happen.
Re:Linux running on RISC-V emulated in Scratch by josephcsible on Monday October 30, 2023 @01:11PM (#38072356)
Yes, bad things will happen, but we should be making them harder, not easier.
Re:Linux running on RISC-V emulated in Scratch by benj111 on Tuesday October 31, 2023 @05:03AM (#38081979)
I don't imagine the world to be a nice place. I think we're coming from different philosophical view points.

Murder is going to happen, I would say we should try and prevent it, not just accept that it is going to happen. Yes, that attempt will never be 100% successful, but that isn't a reason not to try and prevent murders to start with.

Re:Linux running on RISC-V emulated in Scratch by yjftsjthsd-h on Sunday October 29, 2023 @11:59PM (#38065522)
> A stable API is about providing value and saving time for driver developers and end users.

At the expense of undermining the quality of the rest of the kernel and burning kernel dev time.

> It is no coincidence that successful operating systems like Windows, Mac, and Android have stable ABIs that you can use to make drivers.

It's also no coincidence that drivers for previous versions of NT/Darwin regularly break with new releases, leaving users stranded while the Linux versions stay maintained in-tree. (I suspect the same is true of Android but I'm not familiar enough to say for sure)

Re:Linux running on RISC-V emulated in Scratch by charcircuit on Monday October 30, 2023 @03:12AM (#38066508)
>At the expense of undermining the quality of the rest of the kernel and burning kernel dev time.

It shouldn't undermine quality and it could save dev time and make it more user friendly to write new drivers.

Yes, drivers break over time, but it is better if there is a clear expectation on how long things will be stable and what changes will be needed when you upgrade.

Re:Linux running on RISC-V emulated in Scratch by freedomben on Sunday October 29, 2023 @01:14PM (#38060605)
Indeed, for people who have never had to work with real hardware before, it is shocking how complex it is and the level of hackiness it sometimes takes to make it "work" (I say "work" because often times drivers are doing insanely hacky things to make it seem like it's working, even though it's duct tape and bubble gum under the hood). Not just when things are going right, but also when they go wrong (which can involve real-world physical things that break expectations, like damn voltage fluctuations or a physically damaged component for example!). When you only have "virtual" hardware to control, things are much, much, much more simple.