SnakeOS: Bootable x86 snake game in Rust
github.com
github.com
Here's a 11 kB bootable x86-64 version of the game written in C# https://github.com/kant2002/SeeSharpSnake/tree/kant/uefi#run....
There's an accompanying article with a video at the bottom https://codevision.medium.com/running-c-snake-inside-uefi-df....
Edit: Got my answer. /p:Mode=CoreRT-NoRuntime, /nostdlib, and a bunch of others.
1. Used CoreRT instead of the standard .NET libraries 2. He avoided using functionality that would use GC in the first place 3. Created his own alternative runtime library w/out GC and exception handling 4. Created a base type library for some of the System functions 5. Re-directed certain functions like Thread.Sleep to smaller implementations in specific libraries.
The blog posting is well worth reading:
https://medium.com/@MStrehovsky/building-a-self-contained-ga...
https://github.com/nongiach/snake_boot_sector
or:
Bare-bones Rust executables can start at about 3.5KB, and code size increase on top of that is comparable to C or C++. Rust can be a "portable assembler" if you write code in such style. It can also generate lots of code if you lean into generics (same issue as with C++ templates).
(Just wondering. Of course nobody would seriosly want to use a modern PC to run that game.)
Couldn't quickly find a good reference, here is at least some: https://www.dell.com/support/kbdoc/fi-fi/000151899/no-boot-d...
Edit: UEFI class 3 is the keyword https://en.m.wikipedia.org/wiki/Unified_Extensible_Firmware_...
It's a technology demonstrator. And people run all sorts of tools from USB drives. For example, I recently ran a memory tester from USB.
v4: GPL, but legacy boot only
v5-v9: Closed source, no-cost variant available, UEFI
How much space can it take up?
Without that lots of visitors are not going to look much further at it.
If the IMG was there, I would have already tested it on bare metal, if it fit on a floppy that functionality would have been confirmed bare metal too.