展示HN:MyraOS – 我的用C和汇编语言编写的32位操作系统(Hack Club项目)
Show HN: MyraOS – My 32-bit operating system in C and ASM (Hack Club project)

原始链接: https://github.com/dvir-biton/MyraOS

MyraOS是一个从零开始构建的、功能完整的x86类Unix操作系统。它具有保护模式、分页/虚拟内存、强大的内存管理以及内核模式和用户模式等关键特性。它支持进程、调度和键盘、鼠标、帧缓冲等设备的必要驱动程序。 MyraOS包含ext2文件系统、带有可定制小部件的UI合成器,以及一个ELF加载器,能够执行标准应用程序——甚至像Doom这样的游戏(已预装移植版!)。 MyraOS专为真实设备构建,经过测试,可以通过QEMU(一个机器模拟器)运行。提供了有关使用各种显示选项(包括全屏)运行它的说明。开发者欢迎通过电子邮件([email protected])提供反馈和功能请求。

## MyraOS:用C和汇编构建的32位操作系统 年轻开发者Dvir Biton在一次求职面试的挑战下,创建了MyraOS——一个用C和汇编语言编写的32位操作系统。该项目最初是一个学习练习,旨在加深他对底层编程的理解,最终发展成一项持续7个月的努力,并因参与Hack Club的Summer of Making活动而得到显著提升。 MyraOS包含引导加载程序、VGA驱动程序、中断处理、键盘驱动程序、物理和虚拟内存管理、RTC/PIT驱动程序、支持PATA硬盘的EXT2文件系统、系统调用、libc实现、多进程处理以及一个shell。在Hack Club竞赛的推动下,Dvir还添加了一个GUI甚至一个Doom移植版! 开发过程中遇到了诸如页面错误和Doom特定的内存问题等挑战,并借助GDB等工具克服了这些问题。Dvir欢迎讨论,并分享了项目的代码仓库 ([https://github.com/dvir-biton/MyraOS](https://github.com/dvir-biton/MyraOS))。他还计划探索与copy.sh/v86等平台集成,以便更轻松地访问。这次经历对他作为开发者的成长非常有价值,并强调了社区和动力在雄心勃勃的项目中的重要性。
相关文章

原文

A x86 Unix-like OS made entirely from scratch.

Features

  • Protected mode (GDT/IDT, ISRs/IRQs)
  • Paging and virtual memory
  • Memory management
  • Heap and dynamic memory
  • User-mode (ring 3) and kernel mode (ring 0)
  • Processes and scheduling
  • Drivers (PIT, RTC, Keyboard, Mouse, Framebuffer, PATA)
  • ext2 filesystem
  • UI compositor with window widgets, labels, icons, buttons, and even a custom-made font
  • ELF loader, which gives you the ability to run real apps

All these features let you run real games, just like Doom, giving the preloaded Doom port in MyraOS ready to be played!
So, this isn't just a toy OS or a look-alike, it's a real OS that can run on real devices

  1. Download the latest release from the release tab in GitHub
  2. Download QEMU - an open-source machine emulator and virtualizer

After you get the latest release, you can run this on your platform:

Normal

qemu-system-i386 -cdrom MyraOS.iso -drive file=fs.img,format=raw,if=ide,index=0 -m 1024

Fullscreen (if you are like me and want it to look real)

qemu-system-i386 -cdrom MyraOS.iso -drive file=fs.img,format=raw,if=ide,index=0 -m 1024 -full-screen

Normal

qemu-system-i386 -cdrom MyraOS.iso -drive file=fs.img,format=raw,if=ide,index=0 -m 1024

Fullscreen

qemu-system-i386 -cdrom MyraOS.iso -drive file=fs.img,format=raw,if=ide,index=0 -m 1024 -display gtk,zoom-to-fit=on -full-screen

Here, Linux/macOS or even WSL are better; use it as a last resort:
Normal

qemu-system-i386 -cdrom MyraOS.iso -drive file=fs.img,format=raw,if=ide,index=0 -m 1024

Fullscreen

qemu-system-i386 -cdrom MyraOS.iso -drive file=fs.img,format=raw,if=ide,index=0 -m 1024 -display gtk,zoom-to-fit=on -full-screen

I really hope you like it, as I spent a lot of time on it, and I'd really appreciate any feedback you have for me.
If you have anything, from feature requests to feedback, or even if you want to talk, email me here: [email protected].

联系我们 contact @ memedata.com