Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From the look of the PR, does this mean they ported LLVM to Serenity, so all languages that build to LLVM will work? Or am I way off the mark?


Surely even for a language with a very light runtime, the startup routines need to understand Serenity and so that's actual porting work, and if your runtime has any heft to it, or you supply standard libraries that do anything (e.g. an allocator, file I/O, networking) that all needs porting to Serenity as well.

So for example C freestanding or Rust "no-std" will "work" but you can't do very much, freestanding doesn't have this idea of you "running" a program since that implies the existence of some supervisory agent, the resulting machine code generally gets burned into a ROM, or whatever.

The full blown hosted C, or Rust's std needs a bunch of porting, each is separate, the fact you made C's fopen() work doesn't magically make Rust's File APIs work so the fact Zig stuff works doesn't make Clang or rustc deliver their hosted/ std environments.


> freestanding doesn't have this idea of you "running" a program since that implies the existence of some supervisory agent

It's perfectly possible to build freestanding Linux programs. The only thing you need is exactly one system call function to get access to every single Linux kernel functionality. All this function needs to do is move parameters to specific registers, execute a system call instruction and return the result. With this single function, a freestanding program can do anything.

This is possible on Linux because it has a stable system call ABI. Other systems don't have that, they make people link to system libraries. Not sure what SerenityOS does but I assume they provide C++ OS libraries.


SerenityOS is a monorepo, so as long as the entire OS + userland compiles, they don't really have a stable ABI yet.


This is where it helps to have a firm grasp of what running on bare metal is, so you can better understand what an OS really does. You have some code that runs on a CPU, but beyond that how do you actually talk to anything else? There's an address bus so you can use memory without much trouble, but you have to know where the RAM is mapped.

So yeah, there's a big step from compiling machine code to working correctly with a particular OS.


All these “alternative” OSes are nothing more than toy’s because generally it seems the devs working on them have no desire whatsoever to make them run on bare metal. Just a toy that boots up in a VM completely dependent upon a host OS.


There are plenty of examples of people running Serenity on physical hardware. It probably doesn't support a fraction of the HW that Linux supports, but still.


I just think that people generally have pretty high expectations of OSes these days. So the job of getting it to run on actual hardware, and getting it to run on lots of hardware is just kicked down the road until the OS is a lot more mature.


All these alternative OSes are people having fun, they don't have any agenda to take over the computing world.

So in a sense, yes, they are toys for grown ups.


I don't think Serenity has a set purpose. No one is going around calling it a viable alternative to Linux. That's ok though. In the future, who knows what will happen to it. There is no need for it to have good support for baremetal at this stage.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: