hexagonal-sun 8 days ago

Hello!

For the past 8 months, or so, I've been working on a project to create a Linux-compatible kernel in nothing but Rust and assembly. I finally feel as though I have enough written that I'd like to share it with the community!

I'm currently targeting the ARM64 arch, as that's what I know best. It runs on qemu as well as various dev boards that I've got lying around (pi4, jetson nano, AMD Kria, imx8, etc). It has enough implemented to run most BusyBox commands on the console.

Major things that are missing at the moment: decent FS driver (only fat32 RO at the moment), and no networking support.

More info is on the github readme.

https://github.com/hexagonal-sun/moss

Comments & contributions welcome!

  • Rochus 2 days ago

    Cool project, congrats. I like the idea with libkernel which makes debugging easier before going to "hardware". It's like the advantages of a microkernel achievable in a monolithic kernel, without the huge size of LKL, UML or rump kernels. Isn't Rust async/awat depending on runtime and OS features? Using it in the kernel sounds like an complex bootstrap challenge.

    • kaoD 2 days ago

      Rust's async-await is executor-agnostic and runs entirely in userspace. It is just syntax-sugar for Futures as state machines, where "await points" are your states.

      An executor (I think this is what you meant by runtime) is nothing special and doesn't need to be tied to OS features at all. You can poll and run futures in a single thread. It's just something that holds and runs futures to completion.

      Not very different from an OS scheduler, except it is cooperative instead of preemptive. It's a drop in the ocean of kernel complexities.

      • rcxdude 2 days ago

        Yeah, for example embassy-rs is an RTOS that uses rust async on tiny microcontrollers. You can hook task execution up to a main loop and interrupts pretty easily. (And RTIC is another, more radically simple version which also uses async but just runs everything in interrupt handlers and uses the interrupt priority and nesting capability of most micros to do the scheduling)

        • Rochus 2 days ago

          Interesting references, thanks. Moss seems to be doing the same thing as Embassy.

        • boguscoder 2 days ago

          Sorry for nit but embassy is not a RTOS (or any OS), its a framework

          • rcxdude a day ago

            The difference becomes a bit murky at this level. For example embassy comes with a lot more things I would consider OS-related than FreeRTOS does.

      • netbsdusers a day ago

        I find it interesting that this fulfills some of Dennis Ritchie's goals for what became the STREAMS framework for byte-oriented I/O:

        > I decided, with regret, that each processing module could not act as an independent process with its own call record. The numbers seemed against it: on large systems it is necessary to allow for as many as 1000 queues, and I saw no good way to run this many processes without consuming inordinate amounts of storage. As a result, stream server procedures are not allowed to block awaiting data, but instead must return after saving necessary status information explicitly. The contortions required in the code are seldom serious in practice, but the beauty of the scheme would increase if servers could be written as a simple read-write loop in the true coroutine style.

        The power of that framework was exactly that it didn't need independent processes. It avoided considerable overhead that way. The cost was that you had to write coroutines by hand, and at a certain point that becomes very difficult to code. With a language that facilitates stackless coroutines, you can get much of the strengths of an architecture like STREAMS while not having to write contorted code.

      • Rochus 2 days ago

        Ok, I see. I spent a lot of time with .Net VMs, where you cannot simply separate await from the heavy machinery that runs it. I now understand that in a kernel context, you don't need a complex runtime like Tokio. But you still need a way to wake the executor up when hardware does something (like a disk interrupt); but this indeed is not a runtime dependency.

        EDIT: just found this source which explains in detail how it works: https://os.phil-opp.com/async-await/

      • vlovich123 2 days ago

        There’s got to be some complexity within the executor implementation though I imagine as I believe you have to suspend and resume execution of the calling thread which can be non-trivial.

        • kaoD 2 days ago

          You can implement an executor with threading to achieve parallelism, but it's not a fundamental characteristic of Future executors.

          To reiterate: an executor is just something that runs Futures to completion, and Futures are just things that you can poll for a value.

          See sibling comments for additional details.

          • vlovich123 2 days ago

            I’m aware; you’re not adding new information. I think you’re handwaving the difficulty of implementing work stealing in the kernel (interrupts and whatnot) + the mechanics of suspending/resuming the calling thread which isn’t as simple within the kernel as it is in userspace. eg you have to save all the register state at a minimum but it has to be integrated into the scheduler because the suspension has to pick a next task to execute and resume the register state for. On top of that you’ve got the added difficulty of doing this with work stealing (if you want good performance) and coordinating other CPUs/migrating threads between CPUs. Now you can use non interruptible sections but you really want to minimize those if you care about performance if I recall correctly.

            Anyway - as I said. Implementing even a basic executor within the kernel (at least for something more involved than a single CPU machine) is more involved, especially if you care about getting good performance (and threading 100% comes up here as an OS concept so claiming it doesn’t belies a certain amount of unawareness of how kernels work internally and how they handle syscalls).

            • kaoD 2 days ago

              No. I am adding new information but I think you are stuck on your initial idea.

              There's no work stealing. Async-await is cooperative multitasking. There is no suspending or resuming a calling thread. There is no saving register state. There is not even a thread.

              I will re-reiterate: async-await is just a state machine and Futures are just async values you can poll.

              I'm sure moss has an actual preemptive scheduler for processes, but it's completely unrelated to its internal usage of async-await.

              See embassy in sibling comments.

              • vlovich123 a day ago

                Embassy is a single threaded RTOS. Moss implements support for Linux ABI which presumes the existence of threads. The fact that async/await doesn’t itself imply anything about threads doesn’t negate that using it within the context of a kernel implementation of the Linux kernel ABI does require thread suspension by definition - the CPU needs to stop running the current thread (or process) and start executing the next thread if there’s any blocking that’s required. Clue: there’s a scheduler within the implementation which means there’s more than 1 thread on the system.

                You’re arguing about the technical definition of async/await while completely ignoring what it means to write a kernel.

    • hexagonal-sun 2 days ago

      This has been a real help! The ability to easily verify the behavior of certain pieces of code (especially mem management code) must have saved me hours of debugging.

      Regarding the async code, sibling posts have addressed this. However, if you want to get a taste of how this is implemented in Moss look at src/sched/waker.rs, src/sched/mod.rs, src/sched/uspc_ret.rs. These files cover the majority of the executor implementation.

  • andrewl-hn 2 days ago

    > no networking support

    Would something like Smoltcp be of help here? https://github.com/smoltcp-rs/smoltcp

    Great project either way!

    How do you decide which sys calls to work on? Is is based on what the user space binaries demand?

    • hexagonal-sun 2 days ago

      Yip, I panic whenever I encounter a syscall that I can't handle and that prompts me to implement it.

      Yeah, I was thinking of integrating that at some point. They've done a really nice job of keeping it no_std-friendly.

      • whitequark_ 18 hours ago

        Original author of smoltcp here! I couldn't have imagined how much of a cornerstone of the Rust ecosystem it would become. Very excited to see it get used like this, and yeah, #![no_std] use cases were the original and primary motivation to build the stack in the first place.

  • phkahler 2 days ago

    Love the MIT license. If this were further along we could use this as the foundation of our business without having to "give back" device drivers and other things.

    • bfrog 2 days ago

      This should be the sort of red flag to take note of. There’s an LLVM fork for every esoteric architecture now and this sort of thinking will lead to never being able to run your own software on your own hardware again. A reversion to the dark ages of computing.

      • 533474 2 days ago

        Great, an MIT license to accelerate planned obsolescence and hardware junk. Truly a brilliant move

        • surajrmal 2 days ago

          Linux magically solves this problem how? GPL isn't magic. It doesn't compel contributing upstream. And half of modern driver stacks live in userspace anyways.

          • mikelpr 2 days ago

            > And half of modern driver stacks live in userspace anyways ??? I haven't touched hardware whose driver lives in userspace since 2017 and it was a DMX512 controller of a shitty brand

            • surajrmal 2 days ago

              They seem to be primarily targeting arm. A lot of drivers live in userspace for arm socs, especially on the higher end.

          • Blikkentrekker a day ago

            There are also so many G.P.L. violations and nothing is done about it.

            I think a big issue is also that it's hard to show actual damages with this kind of copyright violation. It's obviously copyright violation but what damages are there really? Also, there are so many dubious cases where it's not clear whether it is a violation or not.

      • woodruffw 2 days ago

        > There’s an LLVM fork for every esoteric architecture now

        Can you provide examples of these? I'm aware of temporary forks for things like Xtensa, but these typically get merged back upstream.

        • RealityVoid a day ago

          Infineon tricore compiler from hightec. Compilers are actually, IMO, one of the things that are the most easy to have GPL because you can use it internally however you want without releasing the source outside. You could build whatever you want and you don't have to ship it on the final HW. A kernel does not afford you such a thing, you MUST ship it with your product.

          • woodruffw a day ago

            Thanks for the example! Your opinion here aligns with mine: GCC's GPL status has manifestly not been an issue for vendors in the past. I think the reason for vendors selecting LLVM has much more to do with the fact that LLVM is easier to develop on than GCC.

      • imiric 2 days ago

        Seriously.

        To the author: kudos for the interesting project, but please strongly consider a copyleft license moving forward.

        • cryptonector a day ago

          Seriously: stop it. It's none of your business what the author's license choice is. You don't know what the author is trying to accomplish by their choice of license. It could be a mindless choice, or it could be an informed choice. Perhaps the author wants to build interest and later plans to switch licenses (it's not like others are likely to fork _and_ do an excellent job of evolving and maintaining the fork). Perhaps the author is looking to get hired. Perhaps the author believes that BSD/MIT licensing is more free than the GPL. You really don't need to be shaming the author for not making the choice you made.

    • surajrmal 2 days ago

      Do you think soup kitchens and food banks should only serve food to those who volunteer? MIT is a perfectly fine FOSS license.

      • imiric 2 days ago

        No, but if someone takes the free food and builds a business by selling it to others, without giving anything back to the original places, it harms everyone other than the person doing that.

        F/LOSS is not a charity or a gift, so your analogy is not appropriate. It is a social movement and philosophy with the goal of sharing knowledge and building software for the benefit of everyone. It invites collaboration, and fosters a community of like-minded people. Trust is an implicit requirement for this to succeed, and individuals and corporations who abuse it by taking the work of others and not giving anything back are harmful to these goals. Copyleft licenses exist precisely to prevent this from happening.

        MIT is a fine license for many projects, but not for an operating system kernel.

        • surajrmal 2 days ago

          This feels eerily close to having someone try to convince me to be join their religion. You don't need to force your opinions into others. Let them choose. If folks agree then the license will hold them back in terms of building a community. There are plenty of great open source kernels that don't use GPL, including freebsd. I think most embedded os kernels are not gpl (zephyr, freertos, etc). I would argue that Linux does well in spite of its license not because of it.

          • vacuity 2 days ago

            Just as people who strongly prefer permissive licenses deny copyleft licenses, this is the same in reverse. If you don't want to touch GPL projects, then don't.

            • surajrmal a day ago

              Im not trying to suggest non gpl licenses are superior and folks writing kernels with gpl are making a mistake. On the contrary I'm advocating that both are fine options and you shouldn't make people feel bad for choosing to not use gpl. There is a difference here and it matters greatly. Most people will not care for the differences between the two and the ones that do will choose the one that aligns with their values. If I'm even a hint of anti gpl, it's due to zealotry of it's supporters.

              • vacuity a day ago

                I think a lot of the backlash for the GPL is unreasonable, and not really better than a lot of the backlash for permissive licenses, and furthermore I believe there are reasonable ideological opinions to prefer one or the other (though ideology isn't an excuse to be mean). But I concede that the person you responded to set a poor standard of discussion.

    • cryptonector a day ago

      I take this as an oblique critique of TFA's choice of license. What's it to you? Why must we all use the GPL always in order to satisfy busybodies?

      • phkahler 15 hours ago

        >> I take this as an oblique critique of TFA's choice of license. What's it to you? Why must we all use the GPL always in order to satisfy busybodies?

        Thank you for reading it correctly. I originally had a </sarcasm> to make sure nobody thought I liked the license choice. What's it to me? Well someone posted it to HN here so we could comment on it, so I did.

        I think the MIT license has its place, but IMHO it does not belong on an OS like that. Reason is indicated in my original comment.

        • cryptonector an hour ago

          Glad the author disagrees with you. So do I.

    • 0x457 a day ago

      You just described android.

    • nickpsecurity 2 days ago

      MIT licensed code is a gift. A gift indeed doesn't require the recipient to give back anything related to the gift.

      A "gift" requiring GPL-like conditions isn't really a gift in the common sense. It's more like a contractual agreement with something provided and specific, non-negotiable obligations. They're giving while also asserting control over others' lives, hoping for a specific outcome. That's not just a gift.

      People doing MIT license are often generous enough where the code is a gift to everyone. They don't try to control their lives or societal outcomes with extra obligations. They're just giving. So, I'm grateful to them for both OSS and business adaptations of their gifts.

      • vacuity 2 days ago

        While the FSF's vision for the GPL is clear, the GPL itself is not so powerful that it is more than a "gift" that has some terms if you want to do certain things you are not obligated to do. It is like a grant that enforces some reasonable conditions so the money isn't just misappropriated. I wouldn't give that to a friend for their birthday, but I think it's reasonable that powerful organizations should not be free to do whatever they want. Not that the GPL is perfect for that use, but it's good.

      • eggy a day ago

        I agree, and even if a company doesn't give back, they further the popularity and sustainability of the project. Isn't Python an MIT-like license (PSFL)? As well as React and Godot? And Tensorflow is also permissive with Apache 2.0, corrrect?

        • phkahler 15 hours ago

          Godot is meant to be used for commercial games, so it should have an MIT, BSD, or LGPL license.

          I'm done with proprietary operating systems and IMHO everyone should be. There's no reason to support that.

      • naasking 2 days ago

        MIT is throwing a free party where food and drinks are paid for, and copyleft is where food is paid for but you BYOB. Both are fine, so what's the problem?

        • cryptonector a day ago

          That's my question. Why is this thread full of license choice flamewar? Do we have nothing of substance to contribute?

          Here, I'll make a substantive contribution. I hope this succeeds and causes a lowest-common denominator Linux ABI to exist that user-land can target, thus freeing us all from the Linux kernel as the only viable option. Solaris/Illumos, the BSDs, and even Windows have all gone through one or two phases of attempting Linux ABI compatibility, ultimately giving up because the Linux ABI is such a fast-moving and underdocumented target.

          • nickpsecurity 16 hours ago

            Someone implied that people were evil if they gave away software with nothing asked in return. I didn't think the author deserved that. I'm also starting to think such people are at war with both private property and generosity for political reasons leaning toward socialism or communism. That segment also tries to pressure others to adopt their ideas.

            So, I defended the author and the concept of generosity. I also tried to help FOSS people reframe what their doing as collective property or work so everyone understands the tradeoffs better. They confuse people by advocating for "free" or "freedom" with licenses that take away freedoms from authors. It's like they're redefining words to have non-standard meanings but get angry when people act on standard morals or word usages.

            I'm also starting to think the confusion was intentional because many of their arguments look like socialism or communism disguised as software advice. We also see the same failure modes across most projects and products. Like communist nations (eg Shenzhen), we see the GPL projects succeed best when they relied on capitalists instead of communist principles for code contributions. So, I'll eventually look to see if people like Stallman were communist and if this was sneaky, ideological warfare or subversion. Like we see with critical theory ("woke") proponents constantly repacking their ideas (eg DEI, Codes of Conduct) to snesk them in where they'd be rejected after peer review. I feel like so much fighting online started with people doing something evil built on a conflict-oriented philosophy (Marxism/Communism) that causes the same destructive effects everywhere people promoted it.

            • phkahler 15 hours ago

              There is a huge distinction between socialism/communism and Free Software.

              1) the marginal cost of software is zero.

              2) some software is becoming more like infrastructure that everyone uses.

              In the physical world, some infrastructure is privatized, some is regulated, and some is provided by the government. But going back to point 1 we see that privatization makes even less sense (to society) with software.

      • phkahler 15 hours ago

        Thay "holier than thou" attitude from BSD/MIT proponents seems like some kind of ego talking. Freedom to deny others the freedom you had is not noble.

        GPL is a gift that keeps giving.

        • nickpsecurity 14 hours ago

          Using the legal system to force other people to do what you want and perpetually isn't freedom: it's controlling others by force to make them live the way you want them to. You're taking away their personal freedoms, like sharing or not sharing their work, to promote or force compliance with a goal of yours. Again, that's control, not freedom.

          Would you want people controling your property based on their current and future desires? And dictating what you do with your property enhancements? Would you call that giving you more freedom? Or denying you freedom to force you to support their goals for your property?

          • fragmede 14 hours ago

            It's stupid to discuss this in the abstract because what you want to do with your property is very relevant. If you want to paint your fence a weird color and that's what's being prohibited by law is different is totally different from if you want to build a heavy polluting chemical processing factory or a poorly run slaughter house with animals squealing at all hours of the day.

      • pessimizer 2 days ago

        > It's more like a contractual agreement with something provided and specific, non-negotiable obligations.

        The obligation is not to the author of the code, it is to the public. MIT-style licenses are gifts to people and companies who produce code and software, copyleft licenses are gifts to the public.

        I don't give a shit about the happiness of programmers any more than the happiness of garbage collectors, sorry. I don't care more that you have access to the library you want to use at your job writing software for phones than I care that somebody has access to the code on their own phone. You're free to care about what you want, but the pretense at moral superiority is incoherent.

        It is non-negotiable. GPL is basically proprietary software. It's owned by the public, and all of the work that you do using it belongs to the public. If you steal it, you should be sued into the ground.

        • pstoll 2 days ago

          I get what your saying but I think it’s not the best way to describe it - “GPL is property”? Hardly - it’s a societal common good that can be used by anyone interested in helping that common good.

          Are parks “proprietary”? I can’t run my car dealership from one, so it’s …proprietary? No. So using the terminology of “proprietary” doesn’t do justice to what it actually is.

          • wredcoll 2 days ago

            The phrasing is a little awkward but I like the sentiment: gpl software is owned by the public/humanity/the commons/etc in the same way something like the grand canyon should be.

          • mcdonje 2 days ago

            Public property is different from private property, which is different from personal property.

        • nickpsecurity a day ago

          A gift is when you do something without expecting anything in return, esp compensation.

          If I use GPL'd code, I have to keep releasing my modifications for free because it's mandated. I have to do that even if I do 1000 hours of labor but they gave me 30 min of it. So, it's also near-infinite work required in return for finite work they did. And I have to bind others to this with my own work.

          That's not someone giving me a gift. I'm not sure what to call that except a collective work with permanent obligations for all parties. It's more like a job or corporate charter or something. I like another person's claim that it's creating property with requirements for those using it (which copyright certainly does).

          • procaryote a day ago

            If you intend to spend 1000 hours extending a gpl project someone put 30 minutes into, and you wouldn't have wanted to use GPL, perhaps don't use that project as a base? Spend 1000.5 hours and pick whatever license you like

            The point of copyleft is that the author wants the code to remain available to the public, not to give it as a gift to whoever wants to build their own closed source system

          • phkahler 14 hours ago

            >> That's not someone giving me a gift.

            You're right. GPL code is not a gift to you its a gift to the public.

            Dont try to build your house or business in a national park.

          • fragmede a day ago

            > If I use GPL'd code, I have to keep releasing my modifications for free because it's mandated.

            Pedantically, only recipients of your updated binary are owed updated source, so if you're not distributing that binary to the whole world, you're not required to release updated source to the whole world. Kind of a nitpick, but maybe not.

      • imiric 2 days ago

        A gift where the recipient can remove the freedoms that they've been enjoying themselves is a bad deal for ensuring those freedoms are available to everyone. A permissive license is a terrible idea for a F/LOSS kernel.

        This is the paradox of tolerance, essentially.

        Also, seeing F/LOSS as a "gift" is an awful way of looking at it.

        • nickpsecurity a day ago

          They can't remove it. They gave it to you. They just don't have to keep giving you more stuff. Many people think they're owed more software, including fixes to software, without compensating the laborer. That worldview is the real problem.

          So, we have a variety of licensing styles that meet various goals. People can pick what suits their needs and wants. That's a good thing.

          • phkahler 14 hours ago

            >> Many people think they're owed more software, including fixes to software, without compensating the laborer. That worldview is the real problem.

            Many people (corporations) think they're owed more money beyond the labor. This is why SaaS is a major business model these days. The marginal cost of software is zero, and yet people expect to keep getting paid for it over and over.

          • imiric a day ago

            > They can't remove it. They gave it to you. They just don't have to keep giving you more stuff.

            Who is "they" in this context?

            A permissive license allows anyone to take someone else's work, profit from it, and never contribute back to the original project. For someone advocating for fairness, it's remarkable how you ignore this very real and common scenario.

            > Many people think they're owed more software, including fixes to software, without compensating the laborer. That worldview is the real problem.

            Compensation is orthogonal to F/LOSS. Authors are free to choose whatever income streams they like, and many successful businesses have been built around F/LOSS. Whoever is expecting people to work without compensation is being unreasonable, of course.

            But F/LOSS as a social movement goes beyond a mere financial transaction. It works on the basis of mutual trust, where if I share something you find valuable, then the acceptable "payment" for that work is for you to do the same. This collaborative effort is how the highest quality products are produced.

            The irony of your point is that a permissive license allows precisely the scenario you're arguing against. We've seen corporations profit from the work of others without compensating them for it. So much so, that OSS projects are forced to roll back their permissive licenses, often going too far in the other direction, to where they can no longer be labeled as "Open Source". E.g. Elastic: Apache -> SSPL -> AGPL; Redis: BSD -> SSPL; HashiCorp: MPL -> BSL; etc.

            That is the actual problem which copyleft licenses prevent.

            • nickpsecurity 17 hours ago

              Re fairness

              Not giving anything back is fair because the author's license specifically allows them to do that. A gift has no expectation of anything in return. God blesses such generosity because it's a a truly, selfless act.

              re compensation

              Compensation is not orthogonal to FLOSS. Copyright was mainly designed to ensure work couldn't be shared without paying the author. Anything given for free dramatically decreases the chance of getting paid. OSS and FLOSS almost guarantee no money is made on standalone software but GPL with CLA's allows dual licensing to recover some.

              If anyone uses permissive licenses, it's a gift where they're not (in legal terms) expecting money. Some try to sell it or ask for donations, too, which is incompatible with the license. The free license usually undermines that. It works for some people to some degree, though.

              Re roll backs

              I didn't argue against any scenario. The original person I replied to appeared to be arguing that it was evil to give software away with no obligations. I had to explain what a gift is and why it's morally good to give. I believe the reason is years of people promoting FOSS politics which I now see are rooted in ideas similar to socialism or communism. It wouldn't surprise me if Stallman was a closet communist and just repackaged those ideas into software licensing.

              (Note: I feel like I'm going to have to think more on that political angle given I've been influenced by such people for years on these sites. I'll do a fresh take at some point.)

              On companies being unsustainable, I've already explained what happened. Their goal included selfish gain (money/contributions) from selfish entities who normally take but don't give. Their goal was also to build, individually or collectively, a shared work. They used a license that said it's a one-time gift with no obligations. So, entities took the gift and felt no obligations to return anything. Surprise!

              Now, they've changed to licenses that suit their commercial and/or property goals. That may or may not work for them. Whereas, the companies successfully marketing proprietary software are able to build it up to their hearts' content. Some companies give out the source or dual license under GPL/AGPL. They should probably do Parity License to close remaining gaps and see if FOSS people are really about the free commons.

              License Zero and Polyform have new licenses to help. I conceptualized some in the past that allow modifications, forks, etc so long as the customer keeps paying. Then, redistribution among paying customers. I'd like to see more models for people aiming for sustainability with software freedoms baked in.

  • sheepscreek a day ago

    Very impressive and I like how accessible the codebase is. Plus safe Rust makes it very hard to shoot yourself on the foot, which is good for outside contributions. Great work!

    After you got the busybox shell running, how long did it take to add vim support? What challenges did you face? Did you cross-compile it?

    • fortran77 a day ago

      BUt it's not "safe" because it's mixed with assembly

      • loeg a day ago

        This has been discussed ad nauseam and this adds nothing new. There's value in the memory safety for the majority of the code even if there are some escape valves ("unsafe" keyword, assembly).

      • scottlamb a day ago

        There are no programs written in 100% safe Rust—the std library is written with unsafe as needed. But typically the majority of lines in the program—sometimes even all outside std or some well-audited foundational creates—are safe. Those lines can not directly cause any unsoundness, which has tremendous value.

  • F3nd0 2 days ago

    Congratulations on the progress. If I may ask, I'm curious what considerations have motivated your choice of licence (especially since pushover licences seem extremely popular with all kinds of different Rust projects, as opposed to copyleft).

    • dymk 2 days ago

      I’ve pretty much only seen MIT and to a lesser extent GPL on most open source projects. Would you expect a different license?

    • tingletech 2 days ago

      What is a "pushover" license?

      • nmz a day ago

        A derogatory term for copyfree licenses

      • SAI_Peregrinus a day ago

        Permissive license + complaining when companies don't contribute back from their forks.

        • tingletech a day ago

          Do rust projects have a reputation for complaining about corporate forks not contributing back code?

          • SAI_Peregrinus 14 hours ago

            Not in particular, but it's pretty common for permissively licensed projects to complain about companies complying with their license instead of what they imagine the license to be, then relicensing to a proprietary or copyleft license (e.g. Elasticsearch for a high-profile case but there are many others). This lead to some people disliking permissive licenses.

            Personally I dislike them because they don't preserve end-user freedom, I prefer the MPL. But if someone wants to donate their work to for-profit companies that's their choice.

        • cryptonector a day ago

          I've worked on plenty of BSD and MIT licensed code. I've never complained about lack of contribution. You're projecting. Please stop.

          • SAI_Peregrinus 14 hours ago

            I'm not the person who used the term "pushover license". I just explained why some people use the term.

      • WD-42 a day ago

        It’s a play on “permissive” license.

      • F3nd0 15 hours ago

        'Pushover licence' is a licence which may grant freedom, but doesn't care to protect it. One may modify software under a pushover licence and release their modifications as non-free software. Another, more common name is 'permissive licence'.

    • Blikkentrekker a day ago

      Copyleft doesn't work well with Rust's ecosystem of many small crates and heavy reliance on libraries alongside static linking.

      If one library be GPLv2 and the other GPLv3 they couldn't be used together in one project. LGPL solves nothing because it's all statically linked anyway. And yes, one could licence under both under the user's choice but then GPLv4 comes out and the process repeats itself, and yes one could use GPLv2+ but people aren't exactly willing to licence under a licence that doesn't yet exist and put blind faith into whoever writes it.

      Using anything but a permissive licence is a good way to ensure no one will lose your library and someone will just re-implement it under a permissive licence.

      C is a completely different landscape. Libraries are larger and the wheel is re-invented more often and most of all dynamic linking is used a lot so the LGPL solves a lot.

      • F3nd0 15 hours ago

        Correct me if I'm wrong, but I think all of these are solved problems.

        LGPL should only pose a problem if you explicitly want your program to be used with non-free software. And then only if said non-free software doesn't give you a way to rebuild it yourself, should you want to modify the LGPL program. (So not a problem for open-core or public-source projects, either.)

        If, for some reason, you insist on allowing static linking for all the projects, I think the MPL allows this. (People often seem to think of the LGPL, but it's not the only weak-copyleft licence around.)

        Otherwise, when releasing your project under GPLv3+, you don't have to put blind faith into the FSF; you can designate a proxy which will decide whether the new version should be allowed for your project or not. This proxy can be yourself, or it can be a different organisation you choose to trust. Plus, I'm pretty sure the GPL allows you to make linking exceptions of your liking.

        • Blikkentrekker 4 hours ago

          > LGPL should only pose a problem if you explicitly want your program to be used with non-free software. And then only if said non-free software doesn't give you a way to rebuild it yourself, should you want to modify the LGPL program. (So not a problem for open-core or public-source projects, either.)

          No, just if you want it to be used with anything that isn't that exact same GPL licence.

          > Otherwise, when releasing your project under GPLv3+, you don't have to put blind faith into the FSF; you can designate a proxy which will decide whether the new version should be allowed for your project or not. This proxy can be yourself, or it can be a different organisation you choose to trust. Plus, I'm pretty sure the GPL allows you to make linking exceptions of your liking.

          That's the same as just licencing under the GPLv3 and later retroactively deciding to also give the GPLv4 option when liking that licence. The issue is, what if you don't? Then your code can't be combined with any GPLv4 library.

          The simple reality is that crates that have incompatible licences, and GPLv2 and GPLv3 are incompatible, cannot be used together in one distributed project without committing copyright infringement. The thing with MIT is that it's compatible with about every single licence out there.

  • kennykartman 6 hours ago

    Ah, nice. I wish this was licensed GPL instead of MIT. I'll avoid contribution, sorry!

  • IshKebab 2 days ago

    Impressive work! Do you have any goals, other than learning and having fun?

    Also how does it's design compare with Redox and Asterinas?

    • cies 2 days ago

      Are the collaborations possible/foreseeable?

  • Onavo a day ago

    How does android compatibility look? Can this be compiled to WebAssembly and run in browser?

leo_e 2 days ago

The choice of MIT for a kernel feels like setting up the project to be cannibalized rather than contributed to.

We've seen this movie before with the BSDs. Hardware vendors love permissive licenses because they can fork, add their proprietary HAL/drivers, and ship a closed binary blob without ever upstreaming a single fix.

Linux won specifically because the GPL forced the "greedy" actors to collaborate. In the embedded space, an MIT kernel is just free R&D for a vendor who will lock the bootloader anyway.

  • LeFantome 2 days ago

    Not sure why am getting in the middle of this but I need to point out that you are not even correct for Linux.

    Linux rather famously has avoided the GPL3 and is distributed under a modified GPL2. This license allows binary blob modules. We are all very familiar with this.

    As a result, the kernel that matches your description above that ships in the highest volume is Linux by a massive margin. Can you run a fully open source Linux kernel on your Android phone? Probably not. You do not have the drivers. You may not pass the security checks.

    Do companies like Broadcomm “collaborate” on Linux even in the PC or Mac space? Not really.

    On the other side, companies that use FreeBSD do actually contribute a lot of code. This includes Netflix most famously but even Sony gives back.

    The vast majority of vendors that use Linux embedded never contribute a single line of code (like 80% or more at least - maybe 98%). Very few of them even make the kernel code they use available. I worked in video surveillance where every video recorder and camera in the entire industry is Linux based at this point. Almost none of them distribute source code.

    But even the story behind the GPL or not is wrong in the real world.

    You get great industry players like Valve that contribute a lot of code. And guess what, a lot of that code is licensed permissively. And a lot of other companies continue to Mesa, Wayland, Xorg, pipewire, and other parts of the stack that are permissively licensed. The level of contribution has nothing to do with the GPL.

    How about other important projects? There are more big companies contributing to LLVM/Clang (permissive) than there are to GCC (GPL).

    In fact, the GPL often discourages collaboration. Apple is a great example of a company that will not contribute to even the GPL projects that they rely on. But they do contribute a fair bit of Open Source code permisssively. And they are not even one of the “good guys” in Open Source.

    This comment is pure ideological mythology.

    • rendx a day ago

      > In fact, the GPL often discourages collaboration

      Not true. Yes, companies choose not to contribute, so they discourage themselves. It's not inherent to the GPL.

    • beeflet a day ago

      >Probably not.

      Probably not, but possibly yes. Which is more than the cuck license guarantees. See postmarketOS and such, which would be impossible in a BSD world.

      >The vast majority of vendors that use Linux embedded never contribute a single line of code

      It doesn't matter. The point is just that they can be legally compelled to if needed. That is better than nothing.

      >The level of contribution has nothing to do with the GPL.

      None of this would be feasible if linux wasn't a platform where the drivers work. They wouldn't have worked on the linux userspace in the first place if it didn't have driver support: it wouldn't be a viable competitor to windows and the whole PC platform would probably be locked down anyways without a decent competitor. Permissive software is parasitic in this sense that it benefits from inter-operating in a copyleft environment but cooperates with attempts to lock down the market.

      LLVM was made after GCC and is designed with a different architecture. It is apples and oranges.

      Apple is a great example of a company that is flooding the world with locked-down devices. Everything they do is an obstacle to general purpose computing. What do they meaningfully commit to the public domain? Swift? Webkit? It is part of a strategy to improve their lock-in and ultimately make collaboration impossible.

    • ece a day ago

      A few vendors have been stopped from shipping binary modules with Linux, notably those linking to certain symbols. Enough vendors have contributed enough to make Linux actually usable on the desktop with a wide range of off the shelf hardware and more and more are announcing day one compatibility or open source contributions. The same is hardly true for the BSDs.

      It's obvious Sony is keeping certain drivers closed source while open sourcing other things, and why Nvidia decided to go with an open source driver. It's not hard to understand why, it could be some pressure or a modified GPL2.

  • kev009 a day ago

    I think GCC is the real shining example of a GPL success, it broke through a rut of high cost developer tooling in the 1990s and became the de facto compiler for UNIX and embedded BSPs (Board Support Packages) while training corporations on how to deal with all this.

    But then LLVM showed up and showed it is no longer imperative to have a viral license to sustain corporate OSS. That might've not been possible without the land clearing GCC accomplished, but times are different now and corporations have a better understanding and relationship with OSS.

    The GPL has enough area to opt out of contributing (i.e. services businesses or just stacking on immense complexity in a BSP so as to ensure vendor lockin) that it isn't a defining concern for most users.

    Therefore I don't think Linux' success has much to do with GPL. It has been effective in the BSP space, but the main parts most people care about and associate with Linux could easily be MIT with no significant consequence on velocity and participation. In fact, a lot of the DRM code (graphics drivers) are dual-licensed thusly.

    • josefx a day ago

      > But then LLVM showed up and showed it is no longer imperative to have a viral license

      I am not sure I remember everything right, but as far as I remember Apple originally maintained a fork of gcc for its objective-c language and didn't provide clean patches upstream, instead it threw its weight behind LLVM the moment it became even remotely viable so it could avoid the issue entirely.

      Also gcc didn't provide APIs for IDE integration early on, causing significant issues with attempts to implement features like refactoring support on top of it. People had the choice of either using llvm, half ass it with ctags or stick with plain text search and replace like RMS intended.

  • netbsdusers a day ago

    > Linux won specifically because the GPL forced the "greedy" actors to collaborate.

    How do we know that? It seems to me that a greater factor in the success of Linux was the idealism and community. It was about freedom. Linux was the "Revolution OS" and the hacker community couldn't but fall in love with Linux and its community that embodied their ideals. They contributed to it and they founded new kinds of firms that (at least when they began) committed themselves to respect those principles.

    I realise the memory of Linux's roots in hacker culture is fading away fast but I really do think this might have been the key factor in Linux's growth. It reached a critical mass that way.

    I'm quite certain of the fact that this was more important anyway than the fact that, for instance, Linksys had to (eventually! they didn't at first) release the source code to their modifications to the Linux kernel to run on the WRT54G. I don't think things like that played much of a role at all.

    Linksys were certainly kind enough to permit people to flash their own firmware to that router, and that helped grow Linux in that area. They even released a special WRT54GL edition to facilitate custom firmware. But they could just as easily have Tivoised it (something that the Linux licence does not forbid) and that would've been the end of the story.

    • wmf a day ago

      We can't really prove it but I noticed a lot of people worked on BSD for a few years, got poached by Sun/NeXT/BSDI/NetApp, then mostly stopped contributing to open source. Meanwhile early Linux devs continued contributing to Linux for decades.

  • phendrenad2 a day ago

    Kinda sad that the top comment on this really interesting project is complaining about the license, reiterating the trite conventional wisdom on this topic,which is based on basically two data points (Linux and BSD) (probably because any time someone tries something new, they get beaten down by people who complain that BSD and Linux already exist, but that's another topic).

  • cryptonector a day ago

    This comment does not contribute to discussion of TFA: it's just license flamewar bait.

    The authors almost certainly gave a bit of thought to their choice of license. The choice of license is a "business choice" that has to do with the author(s)' goals, and it is a choice best seen as intending to achieve those goals. Those goals can be very different from your own goals, and that's fine! There is no need to shame TFA for their choice of license, or implicitly for their goals as opposed to yours.

  • vermaden 10 hours ago

    How the 'GPL' part worked out to force VMware to send back the things they modified?

  • loeg a day ago

    This comment is a tangential distraction, but it's not even correct. Linus Torvalds has specifically claimed that he wouldn't have created Linux at all if 386BSD was available at the time. But BSD was tied up in a lawsuit with USL, discouraging companies and individuals from use.

  • KerrAvon 2 days ago

    Not meaning to single you out specifically, but this entire discussion — all of this license gatekeeping is ridiculous. This is a very cool project, but if the license ruins it for you, there are zillions of open source GPL3 kernels.

    I mean, this is not different from bitching about someone writing their custom kernel in C++ instead of Rust, or Zig. It’s not your project! Let people do their own thing! MIT is a perfectly fine license; maybe the lack of zealotry associated with it would even be a positive thing for whatever community might be built around this eventually, if the author is even interested in having other contributions.

    • dejung 2 days ago

      Why is a proven effect "ridiculous" to discuss? It's a valid concern and the discussion could make the authors rethink their choice.

    • leo_e 2 days ago

      That’s the truth

  • wmf a day ago

    That's 1980s-90s thinking. Nobody is making proprietary BSD forks any more and new kernels probably have no chance of reaching production anyway so worrying about proprietary forks is irrelevant.

marty-oehme 2 days ago

Very cool project! I do have to admit - looking far, far into the future - I am a bit scared of a Linux ABI-compatible kernel with an MIT license.

  • juliangmp 2 days ago

    I agree, I know a lot of people aren't huge fans of it but in the long run Linux being GPL2 was a huge factor in its success.

  • viraptor 2 days ago
    • jorvi 2 days ago

      Somewhere there is a dark timeline where the BSDs won, there are 50 commercial and open source variants all with their own kernel and userland. The only promise of interoperability is in extremely ossified layers like POSIX. There is, however, something terrible gathering its strength. A colossus. The great Shade that will eat the net. In boardroom meetings across the land, CTOs whisper its name and tremble... "OS/2."

    • andrewl-hn 2 days ago

      Also, AFAIK SmartOS / Ilumos has had a combat layer for it, too.

  • cryptonector a day ago

    > I am a bit scared of a Linux ABI-compatible kernel with an MIT license.

    What's the threat? Solaris/Illumos, the BSDs, even Windows, have all tried -sometimes more than once- to be compatible with the Linux ABI, and in the end they've all given up because the Linux ABI evolves way too fast to keep up and is underdocumented. Someday someone -perhaps TFA- will succeed in building momentum for a well-defined and highly functional least common denominator subset of the Linux ABI, and that will be a very good thing (IMO) regardless of their choice of license.

    I guess you imagine that everyone will switch to Moss and oh-noes!-everyone-will-be-free-to-not-contribute-back!! So what?

  • stingraycharles 2 days ago

    Why?

    • p0w3n3d 2 days ago

      because otherwise big tech companies will take it and modify and release hardware with it without releasing patches etc? Basically being selfish and greedy?

      • surajrmal 2 days ago

        Does this happen to freebsd? I know plenty of closed source Linux drivers.

        • bmicraft 2 days ago

          Isn't that basically every router out there?

          • WD-42 a day ago

            Routers are all running ddwrt which we only have access to because of a GPL lawsuit against Linksys. The GPL works.

          • wmf a day ago

            Most routers are on Linux now.

      • sneak 2 days ago

        It is neither selfish nor greedy to accept and use a gift freely given to you.

        Receiving a gift does not confer obligations on the recipient.

        • Hendrikto 2 days ago

          True, but you would probably still be pissed if somebody took your gift and hit you over the head with it.

        • lumb63 a day ago

          Gifts definitely confer obligations on the recipient. You can experience this firsthand: take the next gift a loved one gives you, and then sell it, and let them know. Please report back on how you selling their gift impacts your relationship with that person.

          People can license their code however they please, but comparing open source software to a gift is not an argument for permissive licenses.

        • mordae 2 days ago

          It does. There is an implied expectation that the recipient will will not be selfish. They can pay it back, pay it forward, possibly later when they can afford it, etc., but they are expected not to be selfish and also give someone something eventually.

    • mnau 2 days ago

      Because unlike most other functionality, you generally need hw specs or cooperation to write drivers (see Nvidia GSP).

      Anyone can write Photoshop (provided reasonable resources). The problem is going to be proprietary file format and compatibility with the ecosystem. It's same with hardware, except several orders of magnitude worse.

  • tensor a day ago

    FreeBSD already has Linux ABI compatibility and has for a long time.

    I have to say the GPL trolling in this post is some of the worst I've ever seen on HN. Literally 99% of the comments GPL trolls coming in and thread shitting everywhere. It's genuinely disgusting.

meisel 2 days ago

Really neat. Do you have any specific long term goals for it? Eg, provide an OS distro (using Linux drivers?) to provide memory safety for security-critical contexts?

Also, are there any opportunities to make this kernel significantly faster than Linux’s?

  • hexagonal-sun 2 days ago

    Eventually, It'd be amazing to use Moss as my daily driver OS. That means targeting the specific hardware that I have, but in doing so, I hope to build up enough of the abstractions to allow easier porting of hardware.

    A more concrete mid-term goal is for it to be 'self-hosting'. By that I mean you could edit the code, download dependencies and compile the kernel from within Moss.

    • meisel 2 days ago

      Are you interested in beating Linux performance-wise? Eg:

      - Moving away from the too-small 4kb default page size (while having a good strategy for dealing with fragmentation)?

      - Make it easy to minimize/track interrupts on a core, for low-latency contexts

nikanj 2 days ago

Just a hobby, won’t be big and professional like Linux?

cedws 2 days ago

I don't know much about Linux internals - how difficult would it be to reimplement KVM? I'm guessing a big undertaking.

maxloh 2 days ago

In what extent is this compatible with Linux?

Could I swap Ubuntu's or Android's kernel with this, while keeping those OSes bootable?

  • tuyiown 2 days ago

    While it's very legitimate question, the answer is between the lines in the README, and it mostly means that there is a user space binary compatibility for everything that is implemented.

    It might seem obscure, but syscalls to get access to kernel requires a tight integration on compilation and linking. So this is their approach and this is where the compatibility really means something : since you can cross compile on another machine, they don't need the full toolchain right away. Just compile your code on a linux machine, and run it there. You're at the mercy of all missing kernel API implementations, but it looks like a very good strategy if you aim is to code a kernel, as you only have to focus on actual syscalls implementation without getting distracted by toolchain.

  • HackerThemAll 2 days ago

    At this stage you'd need to contribute to it, not treat it as a finished product.

drnick1 a day ago

Why Rust and not C however, given that is meant to be Linux-compatible?

nektro a day ago

very impressive! i think this is a far better approach to bringing rust's advantages to linux rather than trying to squeeze rust into the existing linux kernel. best of luck!

erichocean 2 days ago

This plus using Fil-C for the BusyBox commands is a nice combination (once Fil-C supports ARM64).

randyfox 2 days ago

[flagged]

  • CharlesW 2 days ago

    I understand that you've only been on HN for 7 days, but please don't do this. It's gross.

  • netbsdusers 2 days ago

    Just about everything of worth in operating systems (and in software in general) was already invented in those decades.

  • Towaway69 2 days ago

    Just shows how little we have achieved since then. In both hardware architecture and software based on that hardware.

  • eterps 2 days ago

    Wait until they get to the networking layer; you're going to hate what Vint Cerf did in the 70s :)