r/rust • • Oct 26 '21

Writing a Linux-compatible kernel in Rust

https://seiya.me/writing-linux-clone-in-rust
442 Upvotes

89 comments sorted by

30

u/GenaroCamele Oct 26 '21

Awesome! Congratulations! It'd be great to have an article rewriting kernel parts while the interoperability keeps working

149

u/XtremeGoose Oct 26 '21

Rust is undoubtedly recognized as an excellent alternative (not a replacement!) to C and C++.

Speak for yourself, I absolutely view it as a replacement for c++.

28

u/InsertMyIGNHere Oct 26 '21

For C also? Rust is the only systems programming language I know, and it seems pretty capable at everything, but it's not like I'm experienced enough to know where its deficient

80

u/LeberechtReinhold Oct 26 '21

Definitively not for C.

C is the lingua franca and everything can bind to it. It's also a very simple language and that can be very beneficial for some projects. Additionally, C compiles to absolute whatever architecture you can think of, and that includes a lot of propietary shit, while Rust is fairly limited in that regard.

75

u/matthieum [he/him] Oct 26 '21

I agree with the conclusion, but not all parts of the reasoning.

C is the lingua franca and everything can bind to it.

Rust can expose a C-compatible interface. It's not the source language that matters, it's the ABI.

Additionally, C compiles to absolute whatever architecture you can think of, and that includes a lot of proprietary shit, while Rust is fairly limited in that regard.

This doesn't preclude replacing C on the most common architectures, and little by little expanding Rust to cover more and more.

Which leaves:

It's also a very simple language and that can be very beneficial for some projects.

And that is a non-starter for Rust, I agree.

Such simplicity is a non-goal for Rust, and it's already too far gone, if simplicity of the source language is desired, then Rust is not on the list of challengers.

41

u/VanaTallinn Oct 26 '21

Which leaves: It's also a very simple language and that can be very beneficial for some projects. And that is a non-starter for Rust, I agree. Such simplicity is a non-goal for Rust, and it's already too far gone, if simplicity of the source language is desired, then Rust is not on the list of challengers.

One could argue that C isn’t either. Writing clean and correct C is difficult because of the numerous pitfalls.

Once you deal with a little complex situations, the time you will spend debugging in C is probably as long or longer than the time you will spend learning and struggling with the compiler in rust.

26

u/is_this_temporary Oct 26 '21

I think they meant simple more in the sense that Linus likes C because it's "basically a portable assembler".

https://www.reddit.com/r/programming/comments/1t0gfy/linus_torvalds_on_the_question_if_there_is_a/

Worth noting that even he is supportive of rust in the Linux kernel, despite many very strong tirades against every other language ever proposed for use in writing the kernel.

20

u/[deleted] Oct 26 '21

Simplicity is not the same as difficulty. C is absolutely simpler than Rust. Though writing Rust is much easier.

11

u/Vijfhoek Oct 26 '21

Wouldn't even say that writing Rust is easier. Learning Rust is no easy feat. But Rust does make writing good software easier

5

u/ThirdEncounter Oct 27 '21 edited Oct 27 '21

I was with you until the last part. I think you meant to say writing safe, compilable Rust is easier than writing safe, compilable C.

Driving a car is easier than flying a helicopter. Newbies without absolutely no experience will probably crash the car faster than they can lift a helicopter off the floor (and crash it.)

Edit: /u/Vijfhoek said it best.

2

u/[deleted] Oct 27 '21

I think you meant to say writing safe, compilable Rust is easier than writing safe, compilable C.

Yeah this is definitely what I should have phrased it as.

4

u/matthieum [he/him] Oct 27 '21

One could argue that C isn’t either. Writing clean and correct C is difficult because of the numerous pitfalls.

English is so ambiguous...

C is simple does NOT mean that C is simple to use, it means that the specification of C is simple.

Now, simple is in the eye of the beholder, but certainly the specification of C is much simpler than that of C++, for example, and it is also simple enough that Annex J contains an exhaustive list of Undefined Behaviors.

The simplicity of the language (not the programs written in it) has a number of advantages: easier to write a compiler for, smaller compilers1 , easier to statically analyze, etc...

Of course, this does mean that complexity may be (and is) pushed to the developer, which result in programming difficulties. Sure.

However, some people favor using a simpler language, that they can know exhaustively, to using a more complex, if more robust, language. And for them -- whatever the reason for their preference -- Rust is just not going to be an option.

1 I'm not sure you could have a rustc compiler as a 100 KB executable, whereas tcc exists for C.

5

u/RomanRiesen Oct 26 '21

Regarding the compilation targets;

Most people could write a c compiler for a certain instruction set.

Sure llvm makes that somewhat superfluous, but creating an llvm output format for a hardware seems like a lot more work.

And that might become relevant outside of embedded as there will be more specialised silicon going around (tpus, bitcoin miners, ect). Maybe.

(I'm not an expert in any of this but this is my current world view which I am very happy to improve).

3

u/matthieum [he/him] Oct 27 '21

Most people could write a c compiler for a certain instruction set.

I am afraid that embedded developers have found the hard way that this is not quite true.

There are many proprietary C compilers in the embedded world, and the overwhelming feedback is that they are all incorrect.

Turns out that C is quite more subtle than most people realize. Subtle enough that even the most used compilers (GCC and LLVM) still regularly have bug reports on features that were specified over a decade ago, despite their massive user base.

So... I'm not quite sure I subscribe to the idea that even a qualified compiler writer can write a good C compiler, even a non-optimizing one.

3

u/aerismio Oct 28 '21

As an embedded engineer when u can use ARM Cortex M and R. U will want to use that. Special microcontrollers with their own compilers with their own bugs are used less and less. Now upcoming RISC-V with dirt cheap microcontrollers... both ARM and RISC are supported by gcc and llvm. So no problems for Rust. And in the embedded world u want correct software. The embedded world really really wants Rust.

3

u/ummonadi Oct 27 '21

Rust is simple to write simple code in.

  • Use owned types like String.

  • Clone.

  • Avoid generics and lifetimes.

Error handling is much simpler than other languages I've worked with.

Compiler errors are better.

I do think that closures and async are more complex than I wish, and if you need to work with explicit lifetimes, then the threshold is real.

We also lack documentation on how to code "dirty rust" where beginners can get things done in a soumd way that might not look idiomatic or be top performant.

2

u/Knuckerr Oct 26 '21

I agree and the Rust main goal is not to replace c or c++ but to give a third safer option and to be able to write some critical security parts on Rust and call them from c or c++ if is needed they can work together
the whole rewrite everything in Rust is not Rust goal is like a bad meme which starts here

2

u/diabolic_recursion Oct 27 '21

Why I agree that this may be relevant, the usage of punctuation would rapidly increase the readability of this sentence. That would make its valid claims that much more available to the public 😁

1

u/diabolic_recursion Oct 27 '21

May I remind of the in-progress rust gcc backend?

10

u/CJKay93 Oct 26 '21

For sure for C, if not moreso than C++. Rust's feature set is still catching up to C++'s (e.g. variadic generics, const generics... I guess a lot of generics), but it can do anything and everything C can do (except variadic arguments outside of FFI).

0

u/[deleted] Oct 26 '21

[deleted]

22

u/CJKay93 Oct 26 '21

True, but most niche hardware doesn't even fully support C.

5

u/MCRusher Oct 27 '21

Which was intentionally allowed in the standard in a lot of cases.

Like stdio doing nothing.

2

u/CJKay93 Oct 27 '21 edited Oct 27 '21

What I mean is that a lot of niche hardware compilers do not support substantial parts of the language itself, on top of some parts of even the freestanding standard library. SDCC, for example, can't pass/return a struct to/from functions on some hardware.

1

u/ThirdEncounter Oct 27 '21

Sure, but at least it supports some C. I love Rust, but this is an area in which C is (so far) prevailing.

13

u/[deleted] Oct 26 '21

Rust compiles to LLVM bitcode. The llvm compiler transforms that to native machine code. It's much easier to develop a LLVM backend for niche hardware then doing that directly for C or any other language for that matter.

Rust can actually be used for micro controllers if the language is used with some restrictions (no std library etc.)

Of course historically there are more C compilers and C libraries but that could change if companies and developers discover and like rust. Who knows

16

u/CornedBee Oct 26 '21

It's much easier to develop a LLVM backend for niche hardware then doing that directly for C

I don't think this is true. A stupid backend for a simple compiler is easy to produce. An llvm backend cannot be stupid.

1

u/moltonel Oct 27 '21

Looking at LLVM's m68k target code (or any other target), it's far from simple. Looking for something simpler I found VBCC, but its m68k or even Z80 backend looks even more impenetrable.

I haven't been able to find a simple, idealy single-backend compiler. Can anybody point to a good "simple C compiler VS compiler toolchain backend" comparison, for any target ?

I do wonder whether "writing a basic C compiler for a small arch is easy" is a myth, because the hard work is always somebody else's problem, and because they always prefer to plug into an existing compiler anyway.

3

u/CornedBee Oct 27 '21

TCC's backends are a spaghetti mess, but they're still pretty straight-forward: https://repo.or.cz/tinycc.git/blob/refs/heads/master:/x86_64-gen.c

The parser just calls straight into the various codegen routines. Like, literally, if it sees an integer addition, it calls gen_opi, which writes out the bytes of an ADD instruction.

1

u/moltonel Oct 27 '21

Thanks. I'll have to trust you that it is straight-forward, as it still looks rather inscrutable to me. The LLVM backends actually look more approachable even though there's more code overall.

I'm obviously out of my depths, but the difficulty of writing an LLVM backend seems comparable to the difficulty of writing a tinycc backend. Even if LLVM is extra work, the multi-language support, better optimizations, and larger ecosystem/community seem well worth it.

This hints that the "many niche platforms only have a C compiler" argument is only historically true, and we should expect multi-language compilers like LLVM and GCC to catch up and become the norm for new platforms.

5

u/ondono Oct 26 '21

While that’s true now it wasn’t the case before. I’m not worried about compatibility with niche hardware built in the future because it will be probably be sorted out with time (although embedded is notoriously resistant to change, so it will take time).

If you are going to work with embedded devices, learning C is a must for now and the forseeable future.

3

u/[deleted] Oct 26 '21

Certainly, C won't go away anytime soon. Not just embedded also general system programming. Nobody would rewrite the Linux kernel but maybe new parts can be added in a safer modern language like Rust.

3

u/LongUsername Oct 27 '21

I see embedded changing faster than it has historically.

ARM is eating most of the esoteric architectures and RISC-V is coming to eat the rest.

IoT means everyone is pushing their Embedded OS and they're improving fast. Amazon bought FreeRTOS, Microsoft bought Thread-X, and Google/Intel/NXP/Nordic are pushing Zephyr.

Rust already supports Cortex-M well and RISC-V support is coming along nicely from what I hear.

2

u/TDplay Oct 28 '21

C's biggest advantage is that it compiles to almost anything. The language is simple enough that one person could write a basic compiler in around a year, so it enjoys the ability to run on basically anything with an instruction set. Rust is far more complex, so will probably never enjoy this huge portability.

Another problem is when resources are constrained. C still sees a lot of use in microcontrollers and other embedded systems. I don't think Rust will ever see use there, just because it's not suitable. Embedded systems are typically single-threaded (so Rust's thread-safety measures will just get in the way), and are often constrained for memory (which is a problem because Rust tends to produce bigger binaries than C due to all the templating).

And for simple programs, it's overkill. Rust is geared towards larger programs, which can benefit hugely from its safety guarantees (you don't know hell until you've debugged a segfault in a large C codebase). In smaller programs, you can keep track of everything (and such programs rarely benefit from multithreading), so Rust's safety checkers are more of a hindrance than a help.

1

u/InsertMyIGNHere Oct 28 '21

Seems like rust will slowly take over things like drivers and game development, but probably not embedded unfortunately. I guess I should still learn C then

also how is C simple? That stuff looks hard dude

2

u/TDplay Oct 28 '21

also how is C simple? That stuff looks hard dude

"Easy" and "simple" are different things.

C is best described as a portable assembler with a basic type system, which is almost as simple as it gets. A C function translates almost directly to assembly, the only big complication is the conversion from the variable names to memory addresses or registers (a naïve way to do this is just to allocate stack space and assign a stack offset to the variable). Of course, this comes with some issues, like the complete lack of modern language features.

It is due to C's simplicity that it's so hard to write, but that's also why it's so well-suited to embedded systems, OS kernels, etc.

1

u/InsertMyIGNHere Oct 28 '21

Ohhh. Like arch/gentoo linux. Simole, but not easy. Gotcha

5

u/dontyougetsoupedyet Oct 26 '21

Rust is not a practical replacement for C, as the programs produced are not as portable. Being frank there's likely no way to replace C at this point without scrapping the whole user space and the general structure of the abstract machines we target. Which might be desirable, we could focus on much faster machines that way, but that's extremely unlikely any time soon.

To date it would be disingenuous to say that Rust can do anything that C can, given people regularly use C to target systems they cannot with Rust. Most Rust users may simply not care for those use cases but even if being pedantic it just seems needlessly narrow sighted to disregard these things. It doesn't seem right to disregard the special spot C has as a language that can target just about whatever hardware I care to cook up.

Rust also doesn't seem to be a practical replacement for C++ either, from my vantage point it seems like they're both great at a different set of things. C++ isn't special with regards to a comparison with Rust, it's also difficult to disregard the feature rich nature of a whole family of languages like D and C++, even if only meta-programming wise. There's a lot of freedom and flexibility to be found there.

I definitely see Rust as an alternative with a lot on offer to a developer and with unique features for the take, but I don't see Rust as a practical replacement for C++, C, D, or any number of other languages.

Rather than being excited or encouraged when I see language zealotry of the "replace x and y with z" type I'm usually just reminded of how narrow people's take on specific languages often is and can be. I would rather people explore and celebrate what languages really are and provide, they're often rather unique.

31

u/moltonel Oct 26 '21

Rust is not a practical replacement for C, as the programs produced are not as portable.

In practice, a lot of people are happily replacing C (and other languages) with Rust. Don't dismiss the trend for the sake of corner cases. There are indeed cases where C is the only option, but they are diminisheningly rare.

The Rust language is not yet ported to every little platform, but it is definitely is portable to them, and that compiler porting work is underway, at a pace linked to the interest in those platforms. Rust programs themselves are arguably more portables than C ones, in that they usually run unmodified on the first try, whereas C programs typically need a fair amount of header tweaking.

Rust remains just one tool in our collective toolbox. We've got C and C++ in there too which are not going away, but they're not the first pick anymore, for a growing number of projects.

2

u/antifragileJS Oct 26 '21

There are indeed cases where C is the only option, but they are diminisheningly rare

It is not rare. There are industries eg, automotive, aviation, defense, that use embedded C.

These industries will not be switching to Rust anytime soon because of the legal/compliance systems that have developed alongside the use of C in mission critical applications that are not easily replaced.

9

u/moltonel Oct 26 '21

Being in use and being the only option are very different things. A contractual/legal requirement and a technical requirement are very different things.

Those industries are slow-moving behemoths, but also have a lot to gain from a C to Rust transition. Check out Ferrous System's ongoing ferrocene certification effort. FWIW, my company writes Rust on embedded for the automotive industry, sometimes replacing old C++ code.

-1

u/antifragileJS Oct 26 '21

Different in theory but not in practice. My understanding is building the legal/compliance frameworks necessary to use Rust in these mission critical applications is a non trivial task, thus making C the only practical option.

The fact that this affects entire industries also means it is not a rare corner case.

1

u/moltonel Oct 27 '21

Yes, contracts move slowly, but there is a strong push from within many of those industries. But contracts are a dubious angle to look at this: many companies require PHP, does that mean that nodejs is not a practical replacement for PHP ? I stand by my technical interpretation of "only option", which AFAICT matches the spirit of dontyougetsoupedyet's comment I was replying to.

It's misleading to talk about "entire industries", as each component firmware can have different requirements, and get modernized one generation at a time. It's even misleading to say that these industries require "C" today : for aeronautics at least, C is only transpiled to, from a higher-level language/framework like Mathematica. And of course, the bulk of the code in big companies is not in high-stakes firmware hampered by legal requirements.

All in all it's hard to get a clear picture of the current state, but the trend of C's slow decline has been ongoing for years, and today Rust is often the chosen replacement.

1

u/antifragileJS Oct 27 '21

I didn’t say “contracts”

1

u/moltonel Oct 27 '21

I did, and you replied to me. Nevertheless, I don't think the difference between contract and legal/compliance matters in this discussion : they all point to requirements that are administrative rather than technical.

The former is hopefully inspired from the later, but they rarely stay in sync. A lot of ISO standards quickly fall behind the state of the art and become counter-productive. Administrative requirements evolve slowly. They are currently evolving to make a bigger place for Rust.

I'm more interested in technical requirements.

20

u/XtremeGoose Oct 26 '21

I agree that rust won’t replace C for embedded systems any time soon, but I completely disagree with your second point. Rust absolutely fills the same niche as C++ and does (almost) everything better. You even mention D which is a very niche language not really used in the industry and has many of the same issues as C++.

I would rather people explore and celebrate what languages really are and provide, they’re often rather unique.

That’s very academic. In the practical world having a monopolistic language which doesn’t actively harm you in accomplishing your task is a good thing because there is better interop and documentation and library support. Now, C++ could have been that for systems languages, but it has too many issues, which is why I feel rust should replace it.

6

u/LongActive2965 Oct 26 '21

I can't see any reasons why it can't succeed though. Most microcontrollers are ARM based now so there's very good support with Rust.

And chances are someone using a very old Architecture not supported by rust probably needs to update their 1990s era design to use modern ICs and it'd be a good opportunity to switch to rust

-2

u/dontyougetsoupedyet Oct 26 '21

I'm not going to get in a holy war over it with you and I'm not sharing opinions, I'm just flatly referring to features supported by the tools. If you want to advocate for replacing everything with Rust for personal reasons all power to you. InertMyIGNHere was specifically trying to learn about decifiencies, not specifically trying to learn whatever your given set of preconceptions may be for replacing everything with Rust replacements.

1

u/aerismio Oct 28 '21

Rust tooling can grow fast. Rust is a very wide usable language. Maybe not the same type of wide as C regarding niche platforms. But... its not like its not possible. But Rust can be used from small Microcontrollers up to super big massive multi-core computers in which in both situations its good at to produce good results. Its not grown up yet i agree. But look at webassembly making Rust super portable and also making it a Javascript replacement. It can also replace Java and C# by limiting developer time. Practically u have more result in less time with Rust than other language because u spend less time debugging and problem solving. Rust is still young in my opinion.... but the roads are open to become a super wide language that can be used from small microcontrollers up to front-end development. Rust CAN replace alot and be super portable with WASI and webassembly runtimes with a little bit of overhead. If u got a niche platform, write a webassembly runtime for it in C and Rust can run on it without supporting it in llvm.

1

u/[deleted] Oct 26 '21

very well written

0

u/UNN_Rickenbacker Oct 27 '21

I‘ve had luck using Ziglang as a C replacement for embedded devices. The language is niche, but it has a small surface area and does only a few key things better than C.

One of them is code splitting. If I‘m honest, header files do not really make programming enjoyable for me. Everything is global, nothing is namespaced.

It integrates seemlessly into C.

2

u/schungx Oct 27 '21

Well, probably not when writing operating systems, where the actual coding needs require trying to move around Rust's restrictions a lot.

Nothing to do with Rust as a language, just that its strong safety guarantees make writing operating system kernels difficult.

0

u/[deleted] Oct 26 '21

[deleted]

9

u/XtremeGoose Oct 26 '21

Is ffi a requirement for replacement? Languages replace other languages without being compatible.

15

u/UtherII Oct 26 '21 edited Oct 26 '21

In my opinion, yes unless the target environment is not too resource-constrained.

I'm not sure the double negation is intentional.

6

u/dreamwavedev Oct 26 '21

Would it be possible to have the allocator actually handle low memory situations? Like if we try to allocate during some internal operation (not like mapping something, like we need a temporary allocation for tracking internal state) is the recovery process to fail that operation or to try to get more free memory to do it?

6

u/carterisonline Oct 26 '21

I absolutely love this. The idea of hotswapping kernels written in a completely different language is mindblowing to me.

3

u/Leshow Oct 26 '21

Congrats on the project! Looks very cool, I hope you share some more of your experiences writing the kernel.

4

u/IohannesArnold Oct 26 '21

I found it surprising that the LICENSE in the repo was Apache-2.0 OR MIT. Without getting into a normative argument about which license is more desirable, is this even possible? I'm not a lawyer, but I thought that translating software in one language into another would be a "derivative work" in any jurisdiction, and thus under the terms of the GPL2, must be offered under the GPL2. Anyone know better?

20

u/tristan957 Oct 26 '21

This isn't about translating the Linux kernel. It's about implementing a compatible ABI while also developing the same UNIX/POSIX APIs that you know and love. APIs and ABIs are not copyrightable.

2

u/IohannesArnold Oct 26 '21

It's about implementing a compatible ABI while also developing the same UNIX/POSIX APIs that you know and love.

Right, but where are they getting that information? The most natural place I would look for information about how Linux-specific ABIs and API work would be... the Linux kernel. I suppose one could work strictly off the man pages, but I don't see any mention of observing that restriction, either by the main developer, or for accepting submissions. Compare this with the policy ReactOS has for contributions, where you have to affirm you've never looked at Microsoft source code.

APIs and ABIs are not copyrightable.

My understanding of Oracle v. Google is that, in the US at least, it's not settled law whether APIs are copyrightable or not. The programming world assumes that they're not, and proceeds from that assumption.

17

u/schuyler1d Oct 26 '21

I think SCOTUS was as clear as they could be that APIs are not copyrightable (to be niggly, they always fall under "fair use") -- they took it on as a fact which they determined directly, and found it succeeded on all fair-use tests that are all general to re-implementing APIs.

The nature of the work at issue favors fair use. The copied lines of code are part of a “user interface” that provides a way for programmers to access prewritten computer code through the use of simple commands. As a result, this code is different from many other types of code, such as the code that actually instructs the computer to execute a task. As part of an interface, the copied lines are inherently bound together with uncopyrightable ideas (the overall organization of the API) and the creation of new creative expression (the code independently written by Google). Unlike many other computer programs, the value of the copied lines is in significant part derived from the investment of users (here computer programmers) who have learned the API’s system. Given these differences, application of fair use here is unlikely to undermine the general copyright protection that Congress provided for computer programs.

Perhaps their only more-specific determination was that Google was using it for 'new purposes' in mobile Android, however since Oracle also licensed their library for mobile, it's clear that merely avoiding the burden of licensing is enough to be a 'new purpose'.

4

u/po8 Oct 26 '21

Further, Oracle v Google was about copied lines of API code. The general principle that the APIs themselves (the "application programming interface" specifications) has not been in question for many decades, I think.

8

u/schuyler1d Oct 26 '21

I think implementing the external APIs is currently not copyrightable based on the Google v Oracle case.

I think if the method is "translation" (ie studying the Linux source code and then writing rust) then you're right that it's likely derivative esp. if it looks quite similar. For most of posix they can obviously study the BSDs (but then it should at least credit them with that).

(Disclaimer: Not a lawyer)

3

u/Jon_Hanson Oct 27 '21

A while ago I was working for Intel and was supposed to be given access to some Microsoft source code for my job. I remember I had to sign something that said that I was forbidden to work on any open source/Linux projects for a year after my access to Microsoft source code terminated. It also might have had a clause in there stating that I hadn't done any open source/Linux work one year prior to getting Microsoft source code access either but I'm not completely sure about that one.

1

u/TDplay Oct 28 '21

FreeBSD already did this. The Linuxulator lets you run Linux software, and is under the FreeBSD license. And they've not been sued yet, so it seems to be fine.

-25

u/IsleOfOne Oct 26 '21

Ugh…a permissive license. Why do you do this?

3

u/Nilstrieb Oct 26 '21

Why not?

1

u/FruityWelsh Oct 26 '21

It means users can get saddled with spyware and other anti-features, but have no way of seeing themselves. (For example if I sold a laptop with this, I could modify it and never show anyone my modifications legally).

3

u/ThirdEncounter Oct 27 '21

The sketchy folks who would do this won't be deterred by the GPL.

2

u/[deleted] Oct 27 '21

In all practicality, it doesn't mean that any more than any other license does. The idea that a license which requires you produce the code protects users is extremely theoretical and doesn't apply to the vast majority of users, simply because those users don't have the skills to audit the code nor the resources to get someone else to do it.

2

u/FruityWelsh Oct 27 '21

But someone can is the point. Much like most people aren't devs, but when code is opensource and kept opensource people can benefit from others efforts.

1

u/[deleted] Oct 27 '21

But they actually can't, is the point. The fact that something is theoretically possible is not actually empowering when the practical ability to do so is far beyond a person's reach.

1

u/FruityWelsh Oct 27 '21 edited Oct 27 '21

There are people who can and do review opensource code for malicious intent. Heck automated static code analysis, which granted is not 100%, but is better than nothing, even further lowers the barrier to entry.

If one out of 1000 users have the capacity, then it is still better than if 0 users are allowed to.

Edit: Adding negatives really changes a sentence

1

u/[deleted] Oct 27 '21

[removed] — view removed comment

10

u/[deleted] Oct 27 '21

It's being downvoted because it's incredibly obnoxious to whine about someone's choice of license. It's fine to have opinions about OSS licenses. It's not fine to go into a thread and make rude comments about someone else's license choice.

0

u/IsleOfOne Oct 27 '21

This project is extremely close to being a derivative of the linux project. The fact that it uses a permissive license is not good news for the Linux community. It is only good news for the corporate community.

7

u/UARTman Oct 27 '21

THERE IS ALREADY A PERMISSIVELY LICENSED LINUX COMPATIBILITY MODE. FreeBSD has Linuxulator, which is good enough for Steam.

Go harass them instead of this one-person pet project. Let's see how they react to that.

-3

u/ThirdEncounter Oct 27 '21

That's a weak argument. If you don't like it, fork the project and make your version GPL. Problem solved.

-11

u/[deleted] Oct 26 '21

I would have made a Windows compatible (at the ABI level) kernel which is inspired by Linux (have all its good features like live update, etc), and keep it open source, if I were you.

That would be really amazing. Because Linux lack so many apps which are available on Windows, but Windows is bloated, unoptimized and closed source.

Although I don't know if it's possible because Windows source code is not available and the only way is reverse engineering, which might be near impossible.

Having an open source kernel binary compatible with Windows will be a very useful thing that could have a lot of impact.

18

u/[deleted] Oct 26 '21

I would have made a Windows compatible (at the ABI level) kernel which is inspired by Linux (have all its good features like live update, etc), and keep it open source

Go do that then. This is their project.

8

u/mnbryant Oct 26 '21

Have you heard of ReactOS?

2

u/[deleted] Oct 27 '21

Wow, this looks amazing! I will try it out. Thanks 🙂

5

u/DanySpin97 Oct 26 '21

We have WINE already.

-2

u/[deleted] Oct 27 '21

In that case, we have Linux C kernel already.

0

u/[deleted] Oct 26 '21

[deleted]

62

u/moltonel Oct 26 '21

No mention of GNU professionals though.

2

u/eggyal Oct 27 '21

However, a question came to my mind: what are the pros and cons of writing a practical UNIX-like OS kernel in Rust from scratch? How does it look like? This is why I started this project.

Admirable goal, but wouldn’t it have been a bit easier simply to browse https://gitlab.redox-os.org/redox-os/redox ? Perhaps I’m just lazy. 😜

3

u/[deleted] Oct 27 '21

Is linux binary-compatibility a goal of redox as well?

4

u/eggyal Oct 27 '21

No, of course not—and I totally get that the project has *very* different goals!

FWIW the emoji in my previous comment was (an attempt) to convey that I wasn't being entirely serious. The snippet that I quoted made me smile when I read it, as I couldn't help thinking "*wow, you're MUCH braver (and significantly more competent) than me to choose to write an OS from scratch just "to see how it looks if written in Rust" when there's already one right over there...*".