2 comments

  • tombert1 hour ago
    I&#x27;ve thought about doing something like this but I am only very recently getting into low-level OS stuff.<p>I can&#x27;t remember who said this, but they called &quot;Erlang an operating system for your code&quot;, and I think that&#x27;s fairly accurate. When I build an Erlang app, I don&#x27;t build it the same way as I would with Rust; I have a lot of independent gen_servers that do operate independent from each other.<p>The Erlang VM is (roughly) preemptive multitasking, and even each process has its own GC, so it does feel like it could be a natural fit for its own operating system without having to live on top of Linux.
    • calvinmorrison54 minutes ago
      There&#x27;s some definite prior art here where they worked on that a LOT.<p><a href="https:&#x2F;&#x2F;www.erlang-factory.com&#x2F;static&#x2F;upload&#x2F;media&#x2F;1498583896660864samwilliamshowtobuildanoswitherlang_awhistlestoptourofhydros.pdf" rel="nofollow">https:&#x2F;&#x2F;www.erlang-factory.com&#x2F;static&#x2F;upload&#x2F;media&#x2F;149858389...</a>
      • toast015 minutes ago
        Unfortunately, the hydros project website is gone. I&#x27;m not sure if it moved somewhere.
      • tombert30 minutes ago
        You know, I read those slides when they were new, and I apparently just completely forgot about it.<p>Not that it&#x27;s not interesting, just that my brain is dumb sometimes.
  • mixedbit1 hour ago
    Is the OS implemented from scratch, or is it a stripped down version of some existing OS?
    • toast01 hour ago
      The kernel is pretty much from scratch. It provides a FreeBSD compatible syscall interface for the syscalls that BEAM calls, as well as the FreeBSD runtime loader. I do make healthy use of FreeBSD libraries to provide the OS, you can get an idea of what I pull from the file names in the Makefile [1]. Building an OS is a lot, so I tried to stick to the parts I find fun and interesting. Things like a NIC driver in Erlang [2] (with NIFs to copy to&#x2F;from device memory). But process &#x2F; thread creation is original, memory management is original (not necessarily good), time keeping is original, etc. I used existing code and interfaces so I didn&#x27;t have to write a bootloader, memcpy, and lots of other stuff.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;russor&#x2F;crazierl&#x2F;blob&#x2F;main&#x2F;Makefile#L23" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;russor&#x2F;crazierl&#x2F;blob&#x2F;main&#x2F;Makefile#L23</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;russor&#x2F;crazierl&#x2F;blob&#x2F;main&#x2F;src&#x2F;rtl_8168.erl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;russor&#x2F;crazierl&#x2F;blob&#x2F;main&#x2F;src&#x2F;rtl_8168.er...</a>