展示HN:BananaOS,一款可以在约11MB RAM的486上启动的振奋人心的操作系统

3作者: madamdo大约 1 个月前原帖
我10岁的儿子最近一直沉迷于低级编程,最终自己编写了一个操作系统。由于他还小,并且自己并没有在HN上发帖,所以我在他的允许下代他发布这条消息。 这一切始于对计算机如何启动的好奇,结果不知不觉中发展到了编写内核、构建图形用户界面(GUI)以及设置持续集成(CI),每次提交时都会生成一个可启动的操作系统镜像。 BananaOS是一个小型实验性操作系统,主要用于学习和探索低级系统编程。它目前针对i386 BIOS系统,设计用于在极其受限的硬件上运行。有趣的是:壁纸逻辑(Wallpaper logic),作为操作系统最重要的功能之一,直接在内核中实现。这让我的儿子忍俊不禁! 一些亮点包括: - 通过GRUB加载的多重引导兼容内核 - 支持双缓冲的VESA帧缓冲图形 - 可移动和可调整大小的自定义窗口管理器 - Dock风格的应用程序启动器 - PS/2键盘和鼠标输入处理 - PCI枚举和AHCI SATA支持 - 基本应用程序(终端、记事本、计算器、文件浏览器、设置) - 基于可用RAM的内存检测和分配 - 在QEMU中启动,约需11.2MB RAM - 包含一个ISR解决方案以模拟CMOV,使其能够在Intel 486 CPU上启动 我觉得特别有趣的是,他还添加了GitHub Actions工作流,自动为每次提交构建操作系统镜像,因此这个仓库持续生成新的可启动工件。 该项目非常实验性,应该仅在虚拟机内运行。 仓库(包含构建说明和截图): [https://github.com/Banaxi-Tech/BananaOS](https://github.com/Banaxi-Tech/BananaOS) 快速开始(仅限Linux,请检查依赖项,并查看README): ``` git clone https://github.com/Banaxi-Tech/BananaOS cd BananaOS make qemu-system-i386 -cdrom bananaos.img -m 128M ``` 复古模式: ``` qemu-system-i386 -cpu 486 -cdrom bananaos.img -m 11.2M ``` 他主要是为了理解内核、内存管理、驱动程序以及操作系统在用户空间下的实际工作原理而构建这个项目。 对于那些曾经构建过爱好型操作系统或与硬件密切相关的人士的反馈,我们将特别感激。
查看原文
My 10-year-old son has been deep in low-level rabbit holes lately and ended up vibe-coding his own operating system. Since he’s still a kid and not on HN himself, I’m posting this on his behalf with his permission.<p>This started as curiosity about how computers actually boot, and somehow escalated into writing a kernel, building a GUI, and setting up CI that produces a bootable OS image on every commit.<p>BananaOS is a small experimental operating system built mainly for learning and exploration of low-level systems programming. It currently targets i386 BIOS systems and is designed to run on extremely constrained hardware. Fun fact: Wallpaper logic, one of the most important OS functionalities, is directly implemented in the kernel. That cracked my son up!<p>Some highlights:<p>Multiboot-compliant kernel loaded via GRUB<p>VESA framebuffer graphics with double buffering<p>Custom window manager with movable and resizable windows<p>Dock-style application launcher<p>PS&#x2F;2 keyboard and mouse input handling<p>PCI enumeration and AHCI SATA support<p>Basic applications (terminal, notepad, calculator, file explorer, settings)<p>Memory detection and allocation based on available RAM<p>Boots in QEMU with about 11.2 MB RAM<p>Includes an ISR workaround to emulate CMOV so it can boot on Intel 486 CPUs<p>One thing I found particularly fun: he also added GitHub Actions workflows that automatically build the OS image for every commit, so the repo continuously produces fresh bootable artifacts.<p>The project is very much experimental and should only be run inside an Virtual Machine.<p>Repo (with build instructions and screenshots):<p><a href="https:&#x2F;&#x2F;github.com&#x2F;Banaxi-Tech&#x2F;BananaOS" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Banaxi-Tech&#x2F;BananaOS</a><p>Quick start (only on Linux, check dependencies, and see README):<p>git clone <a href="https:&#x2F;&#x2F;github.com&#x2F;Banaxi-Tech&#x2F;BananaOS" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Banaxi-Tech&#x2F;BananaOS</a> cd BananaOS make qemu-system-i386 -cdrom bananaos.img -m 128M<p>Retro mode:<p>qemu-system-i386 -cpu 486 -cdrom bananaos.img -m 11.2M<p>He’s mainly building this to understand kernels, memory management, drivers, and how operating systems actually work below user space.<p>Feedback from people who have built hobby operating systems or worked close to hardware would be especially appreciated.