Show HN:我的业余操作系统终于在我的老式IBM ThinkPad上运行了
Show HN: My self-written hobby OS is finally running on my vintage IBM ThinkPad

原始链接: https://github.com/joexbayer/RetrOS-32

RetrOS-32是一个业余爱好者开发的32位操作系统,具有图形界面、多任务处理和网络功能,项目始于2022年5月。内核和实用程序使用C语言和汇编语言编写,用户应用程序使用C++编写,使用Make进行编译,并使用Docker进行跨平台构建。 其主要功能包括自定义引导加载程序、GRUB兼容性、用户管理、多线程调度、内存管理和设备驱动程序(键盘、鼠标、VGA等)。它拥有文件系统、网络协议栈和一些基本的使用者空间应用程序,例如终端、窗口服务器和文件查找器。未来的计划包括开发一个C编译器/解释器、自定义虚拟机、文本编辑器、计算器和游戏。 该操作系统可以通过QEMU、基于Web的模拟器运行,也可以通过将.iso文件刻录到USB/CD在真实硬件上运行。它使用MIT许可证。默认用户“admin”的密码是“admin”,而guest用户没有密码。用户创建命令为:admin create <用户名> <密码>。

Hacker News上的一篇文章重点介绍了joexbayer在其老式IBM ThinkPad上运行的业余操作系统。这一成就激发了人们对早期计算和动手精神的热情。用户们提供了建设性的反馈,特别是关于改进系统字体以获得更精致的外观,并分享了字体资源。讨论还探讨了从头编写操作系统的挑战和回报,规划和直觉式开发之间的平衡,以及语言选择(C与Zig)。Joexbayer表达了减少对UNIX依赖并专注于原创代码的愿望。其他主题包括图形初始化、编译器交互以及WiFi支持和移植到树莓派等潜在的未来功能。许多评论者称赞该项目是充满激情、非商业化科技创作的一个令人耳目一新的例子。Joexbayer承认了技术债务以及项目的持续性,并表示它是由社区反馈和个人乐趣驱动的。

原文

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

32bit Hobby Operatingsystem with graphics, multitasking and networking!

Started: 12.05.2022

(back to top)

There are 3 default users: system, admin and guest. The password for admin is 'admin', while guest has no password. Currently there is no difference between admin and guest.

You can create a user with the 'admin' command:

admin create <username> <password>

This project is built with C & Assembly for the kernel, utilities and build system. C++ for userspace applications and Make for compilation. Docker used for crossplatform compilation.

Docker

(back to top)

Tested on: Lenovo x240, Asus Eee PC series, Dell Optiplex 780, Samsung N150 Plus, Samsung NP-NC10, IBM Thinkpad a21p

Crossplatform: Docker to compile the image file and QEMU for emulation.
For native compilation you will need:

  • i386-elf-gcc, i386-elf-ld and i386-elf-g++ for MacOS.
  • build-essential and gcc-multilib for Linux / WSL (ubuntu)
  • Also need: grub2, xorriso and xxd (for using Grub as bootloader)

To compile the kernel and its needed programs you simply need to run make img and make qemu to open QEMU

  1. Clone the repo

    git clone https://github.com/joexbayer/RetrOS-32.git
  2. Check that all dependencies are installed (Only for debian based distros)

  3. Initialize Git submodules (C-Compiler)

    git submodule update --init --recursive
  4. Compile and create image

  5. Launch QEMU

  6. Use GRUB (Optional)

Currently MacOS cannot natively compile the build tools as they depend on 32bit x86 code. Docker is the simplest way if you still wish to compile the operating system.

  1. Clone the repository

    git clone https://github.com/joexbayer/RetrOS-32.git
  2. Initialize Git submodules (C-Compiler)

    git submodule update --init --recursive
  3. Build using Docker

    docker-compose up --build

Use Docker (see MacOS section) or WSL (see Linux section).

(back to top)

To run RetrOS-32:

  • http://copy.sh/v86/ : Upload .img file as Hard disk image.
  • QEMU: make qemu or qemu-system-i386 <image name>
  • Real hardware: Burn .iso file to USB or CD (Use a GRUB iso)

(back to top)

NETOS - Project
├── Dockerfile 
├── LICENSE.txt
├── Makefile
├── apps (userspace applications)
│   ├── Makefile
│   ├── <app>
│   ├── libcore.a
│   ├── libgraphic.a
│   ├── libnet.a
│   ├── readme.md
│   └── utils
│       └── *.cpp
├── bin 
│   └── *.o
├── boot (custom bootloader)
│   ├── bootloader.s
│   └── multiboot.ld
├── docker-compose.yml
├── docs (documentation)
│   ├── *.md
├── drivers (kernel drivers)
│   └── *.c
├── fs (filesystem)
│   ├── Makefile
│   ├── bin
│   └── *.c
├── graphics
│   └── *.c
├── include
│   ├── arch
│   │   └── *.h
│   ├── fs
│   │   └── *.h
│   ├── gfx
│   │   └── *.h
│   ├── lib
│   │   └── *.h
│   ├── net
│   │   └── *.h
│   └── *.h
├── kernel (main kernel source files)
│   ├── arch
│   │   └── *.c
│   ├── kthreads
│   │   └── *.c
│   └── *.c
├── legacy (old code)
├── lib (libraries)
│   └── *.c
├── net (networking code)
│   └── *.c
├── readme.md
├── rootfs (root filesystem for the OS)
├── tests (testing code)
│   ├── Makefile
│   ├── bin
│   ├── *_test.c
│   └── readme.md
└── tools (build tools)
    ├── scripts
    └── bin
        └── *.c
  • Custom Bootloader & GRUB compatible
  • Stage 2 bootloader
  • Wallpapers
  • Mountable image
  • Users
  • Multi-threaded pre-emptive scheduling
  • GDT & TSS kernel / userspace separation
  • Interrupt handling
  • PS/2 Keyboard & Mouse, PIT, VESA (640x480x8), RTC, Serial drivers, E1000
  • PCI.
  • 8Bit RGB to 8Bit VGA
  • Filesystem
  • Textmode VGA only
  • Networkstack
  • ATA IDE Driver
  • Memory
  • Graphics
  • Terminal, Window Server, Process Informtaion, Finder.
  • Library (printf, memcpy, etc)
  • IPC
  • System calls
  • C Compiler / interpreter to bytecode
  • Custom VM to run bytecode.
  • Editor with Syntax Highlighting
  • Calculator
  • 3D Game
  • Snake game (Textmode only)
  • Userspace threads (shared virtual memory)
  • Remote virtual terminal over TCP
  • LZ compression library
  • Tools

See the open issues for a full list of proposed features (and known issues).

(back to top)

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Joe Bayer

Project Link: https://github.com/joexbayer/RetrOS-32

(back to top)

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

(back to top)

联系我们 contact @ memedata.com