Show HN:一个用 Rust 和 x86 汇编写的类 DOS 趣味操作系统
Show HN: A DOS-like hobby OS written in Rust and x86 assembly

原始链接: https://github.com/krustowski/rou2exOS

RoureXOS是一个用Rust重写的操作系统,可以使用提供的ISO镜像在QEMU或x86_64裸机上进行测试。 **构建和运行:** 1. **前提条件:**安装Rust,`xorriso`,`net-tools`,`grub2-tools`和QEMU。 2. **初始化:** `make init` 3. **编译:** `make build` 编译内核和引导加载程序,创建一个包含GRUB的ISO镜像。 4. **模拟:** `make run_iso` 或 `make run_iso_floppy` 分别使用ISO或ISO+软盘运行QEMU。或者,`cargo bootimage` 后接 `make run` 只运行内核。 **网络设置:** 在QEMU中运行内核后,从输出中获取pty编号。然后: 1. 连接SLIP:`sudo slattach -L -p slip -s 115200 /dev/pts/X`(将X替换为你的pty编号)。 2. 配置接口:`sudo ifconfig sl0 192.168.3.1 pointopoint 192.168.3.2 up`。 3. 使用`tcpdump`捕获数据包。

一个Hacker News帖子讨论了“rou2exOS”,这是一个用Rust和x86汇编语言编写的类似DOS的业余操作系统。创建者krustowski邀请用户从源码构建或在QEMU中使用可引导的ISO镜像。 评论重点关注该项目的内存安全、x86_64架构(路线图中包含ARM)和网络堆栈。一些用户开玩笑地建议添加一些功能以真正与DOS竞争,例如运行Doom、BASIC和Lotus 1-2-3。关于命令名称也有一些讨论,用户正在争论“dir”的替代方案,并建议一些奇特的命令。 该项目类似DOS的特性受到了争议,一些人指出了它与MS-DOS的兼容性差异,而另一些人则关注其美学、简单的文件系统和直接的VGA缓冲区写入。讨论还涉及引导方法、计划中的FAT32支持以及在ARM上创建简单操作系统与x86相比的挑战。一些人表达了对现代、自由开放源码软件64位类似DOS环境的兴趣,可能从EFI系统分区启动。
相关文章

原文

A second iteration of the RoureXOS operating system, rewritten in Rust.

To run the OS, you can use the attached ISO image from any Release, and run it in QEMU emulator. The system was also tested on x86_64 baremetal (booted from the USB flash disk).

# install Rust and its dependencies
make init

# make sure you have `xorriso`, `net-tools` and `grub2-tools` installed (Linux)
dnf install xorriso net-tools grub2-tools qemu qemu-common qemu-system-x86

# compile the kernel and stage2 bootloader, link it into an ELF binary and bake into an ISO image with GRUB stage1 bootloader
make build

# run the QEMU emulation with ISO image (respectively with additional floppy image attached as well)
make run_iso
make run_iso_floppy

# (alternative) run the kernel exclusively only (needs the `bootloader` dependency in Cargo.toml to be added)
cargo bootimage
make run

Run the kernel in QEMU to get the pty number in stdout:

make run

char device redirected to /dev/pts/3 (label serial0)

Listen for SLIP packets and create a sl0 interface:

sudo slattach -L -p slip -s 115200 /dev/pts/3
sudo ifconfig sl0 192.168.3.1 pointopoint 192.168.3.2 up

Catch packets using tcpdump:

联系我们 contact @ memedata.com