Unofficial Hacker News companion — get notified on comment replies, and more.

Show HN: Custom X64-86 Operating System Written from Scratch (opens external site)

53 points by adrianbyte 1 day ago github.com 37 comments (opens Hacker News) Vote (opens Hacker News)

Comments (37)

  1. Awesome work. I would love to see Plan9 style of per-process namespaces so network, framebuffer, and remote resources can be mounted directly into private file hierarchies via syscalls analogus to bind() mount() and rfork().
    Replies (1)
    1. On a side note, Im also curious to throw my hobby x86-64 C compiler at the tree just to see what breaks.
      Replies (1)
      1. thanks! that would actually be cool, im kinda curious too know, got a link for it? i would love to inspect it! and ill make sure to start working on those new features as soon as i can!
        Replies (1)
        1. for the plan9 namespace ideas you can find a collection of papers and man pages at: cat-v.org

          my C compiler is here: https://github.com/gaidardzhiev/sccc

          Replies (1)
          1. > cat-v.org

            Yeah, thanks, they don't even have a search feature, and using Google with "namespaces site:cat-v.org" yield no results. Apparently they chose to be not indexes.

            Replies (1)
            1. fair point, the papers live on a subdomain at doc.cat-v.org/plan_9/4th_edition/papers/ and the specs are on man.cat-v.org
  2. > ai-assisted, but only about 10%

    x_to_doubt.png

    Replies (2)
    1. Seriously, why lie? It's immediately apparent looking at the commits, the frequency of commits, and the volume of code being pushed that the "10%" estimate was off by about a factor of 10.
      Replies (3)
      1. Or Claude's extremely verbose commit descriptions on virtually all commits. Turning off Claude's attribution doesn't magically made the commits not slop.
      2. He is just 13 years old (https://github.com/adriantips). This is still pretty impressive for kid wanting to build an OS at this age. But it would be better to drop the claim about the percentage if this is not the case.
        Replies (2)
        1. There is no way to verify this assertion. I have serious doubts, AI generated or not.
        2. > This is still pretty impressive for kid wanting to build an OS at this age.

          There's nothing impressive about asking LLM to do it for you...

      3. I wouldn't be surprised if it's 90% of the time & effort spent coding manually, and only 10% as much time prompting AI.

        Still not too shabby.

    2. yeah, it takes weeks for a human to hand write a basic linux 0.1-like kernel, let alone a whole OS, that takes years. It took SerenityOS a whole year to reach a point where you could run DOOM on it, while this project had its first actual commit in September - a human may have indicated the direction, but the code is likely 100% AI generated, unless he has 8 hands
      Replies (3)
      1. "From Scratch" becoming meaningless.
        Replies (1)
        1. If it is not based on an existing kernel, then it is somehow from scratch.

          Of course we have plenty of examples and documentation.

      2. > but the code is likely 100% AI generated, unless he has 8 hands

        Well for one, there are zero references as to where they got this magic driver code from. For example the sdcard [0], bluetooth [1] and usb [2] drivers have magically been "written" close to perfect C.

        Several questions about this:

        1) How did they eliminate the memory corruption bugs in this OS?

        2) What did they test for in the OS to achieve the former to determine a stable build for a release?

        3) What exact tools did they use to check for those memory corruption bugs?

        4) Finally, which existing datasheets did they read from to get those constants in those drivers?

        Very curious to know for a from scratch OS...

        [0] https://github.com/adriantips/boltossource/blob/156a83dc3c6b...

        [1] https://github.com/adriantips/boltossource/blob/156a83dc3c6b...

        [2] https://github.com/adriantips/boltossource/blob/156a83dc3c6b...

        Replies (2)
        1. This kinda thing is what made me laugh the hardest, kid claims to be 13 on their GitHub profile but one-shots a 1700 line xHCI driver with almost no comments? Either Terry A Davis himself has fallen back from heaven or I need some of whatever greens their mom is feeding them.
        2. The sdcard driver uses some tricks that I've used in my driver: https://github.com/bztsrc/raspi3-tutorial/blob/master/0B_rea...

          The UEFI loader comes (at least partially) from my other project: https://gitlab.com/bztsrc/posix-uefi whereas memory management and page table generation (at least partially) from https://gitlab.com/bztsrc/easyboot

          I'm sure because I can see some unusual variable naming that originates from my code. I guess Codex was trained on my Free and Open Source stuff too...

      3. It took me 6 years to reach the point of running DOOM in my x86-64 hobby OS (written in Rust), but maybe I'm slow.
  3. Can this go unkernel style and boot on a browser (wasm compile?) For 14mb this gives way lot more.

    (Also is this posix underneath?)

    Replies (1)
    1. Nice idea
  4. > A stock OpenSSH client can log in to its SSH server, and its SSH client can log in to another BoltOS.

    Can its client not connect to openssh sshd?

  5. I'd recommend experimenting and introducing non-UNIX functionality. As it stands (and I didn't look into the OS in detail), your kernel mostly follows UNIXland conventions.
  6. It's x86-64, not the other way round. I know it's nitpicking but I'd think someone being able to write an OS from scratch with "only about 10%" by AI would know this... ;)
    Replies (1)
    1. > It's x86-64, not the other way round. I know it's nitpicking but I'd think someone being able to write an OS from scratch with "only about 10%" by AI would know this... ;)

      I've written an x86-64 OS.[1] It's obviously untrue to anyone who's written an x86-64 OS.

      -----------------

      [1] Ran out of steam just after I got processes loading and executing. It was a solid 12 months of effort (a/hours, hobby OS) simply to get to that point, and I wasn't new to writing OSes and kernels at that time either.

  7. That's what we need: diversity.
    Replies (1)
    1. Diversity of vision, sure. This is just a copycat of existing OSes. It doesnt justify its existence with some new big idea. It could have been a great learning project for someone if the effort has been done by a human. As it is, the only thing I'd be interested in is the kind of prompting that was used to come up with such a large, multi layered project. Unfortunately the author claims minimal AI use which is clearly untrue and as such we're unlikely to get those juicy bits of wisdom.
  8. Very interesting - more so if you've written that by hand, I wonder what I was doing when I was teenager.
  9. Over 30 200+-line commits to different subsystems in a day, the whole thing started just a little less than half a year ago, Codex smells all over the codebase, "ai-assisted, but only about 10%".

    What is the point of doing this?

    Replies (1)
    1. I know what you mean, average teenagers with a PC are more often spending hours concentrating serious effort moving up one level at a time playing some quite difficult AAA games.

      And here's a kid who's only moving up one level at a time on just plain computer science, I know he started with nothing but it's already been 5 months and all he has is Doom.

      How much fun can that be for any NPC that comes along?

  10. Wow that's impressive
  11. Turn it into a microkernel and use MMURTL (and the book) as a reference.

    We don't need another Unix-like operating system. What we need is a secure, real-time microkernel-based operating system.

  12. If it uses custom kernal, can you split that and publish the kernal part only? And, try to keep lightweight and fast. I think, it'll be great!
  13. - how do i actually learn to build this from scratch

    - what is the thought process at step 0

    - you say you need a bootloader, how do i learn how to code a bootloader and its algorithms?