百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

snakeos

> 编程语言
开源

Rust 中的可启动的 x86 蛇游戏

329 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Rust 中的可启动的 x86 蛇游戏

SnakeOS

This is the game snake, bootable on a x86_64 CPU, written completely in rust. Its foundation is following the very interesting Writing an OS in Rust blog which I would recommend everybody who is interested in this kind of stuff.

But it's not just snake. Thanks to @MoZhonghua its now possible to add different games to the OS and to play them. So apart from snake you can also enjoy a round of 2048.

Features

  • Play snake or 2048 on any x86_64 CPU
    • Let's have fun!
  • Dynamic memory management
    • The snake can grow!
  • Interrupt handling
    • We can read the keyboard!
  • Async/Await support
    • We can update the world and read user input at the same time!
  • Only 226kB kernel size
    • You can even put this on a 8-inch floppy disk!
  • All the infrastructure you need to implement and play a game
    • You can implement your own game!

Build it

Use the Makefile to build the game. The only dependencies are podman and buildah which are used to setup the build environment.

make snakeos.img

This will first setup a build container with the necessary dependencies and then build the game.

Alternatively, you can use the rust compiler directly with some tricks applied:

bash
rustup override set nightly
rustup toolchain install nightly
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
rustup component add llvm-tools-preview
cargo run \
    --release \
    --target x86_64-custom.json \
    -Zbuild-std=core,alloc \
    -Zbuild-std-features=compiler-builtins-mem -- \
        --no-run
ln -sf target/x86_64-custom/release/boot-bios-snakeos.img snakeos.img

To now run the game, you can use the following command:

make run

which will actually run qemu-system-x86_64 --enable-kvm -drive format=raw,file=snakeos.img for you. From here you can use either w, a, s and d or the arrow keys to control the snake.

Screenshots

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言