Skip to content
xyprotoPublic

About

Linux distro based on archlinux32 and Arch Linux for retro gamedev, for playing DOS and SNES games, for demoscene dev, for old x86 PCs with less than 1G RAM. Fits on a 1G memory stick. Uses less than 100M RAM after boot. Also has the goal of lowering the threshold for getting into graphics and game programming in C, Assembly and Lua.

Topics

Resources

Stars

101 stars

Watchers

0 watching

Forks

Repository files navigation

Logo

Tiny Hat

This is a Linux distro based on Arch Linux and Arch Linux ARM, with a few custom packages on top. The 32-bit x86 versions are built from source: one runs on old CPUs without SSE, like the Pentium II and all the way down to the 486, and one is for CPUs with SSE2.

There are images for 32-bit x86 (486 and newer, and SSE2), 64-bit x86, the Raspberry Pi 4 and other 64-bit ARM computers (rpi4 and aarch64 will be supported when 1.0.9 is released).

Tiny Hat on a Pentium II Tiny Hat on x86_64 Tiny Hat on ARM64 (will be out when 1.0.9 is released)
Tiny Hat 1.0.9 on a Pentium II Tiny Hat 1.0.9 on x86_64 Tiny Hat 1.0.9 on ARM

Please recommend Tiny Hat on DistroWatch if you find it fun. :)

Goals

The goals for this distro are:

  • Use less than 100M of memory after booting.
  • Use around 600M of disk space (currently uses a bit more, but still usable on a 1GB USB stick).
  • Use modern libraries, frameworks and protocols (SDL3, Wayland).
  • To be possible to use on a 32-bit or 64-bit x86 machine with little ram and disk space, for:
    • Retro gaming (ScummVM, DosBox-X and ZSNES).
    • Playing whichever DOS games are on the first harddrive, after booting from an USB stick.
    • Creating graphics / pixel art (LibreSprite).
    • Creating music / tracking (Fast Tracker II / ft2-clone).
    • Programming in C with SDL3 and/or Raylib and/or fluidsynth, with tab completion in Orbiton.
    • Debugging with gdb and Orbiton.
    • Programming in Assembly with nasm.
    • Programming for SNES with cc65.
    • Game programming with Fennel and LÖVE.
    • Using a simple browser (TinySurf) + packet sniffer (jomon) + ssh client / server / scp (dropbear).
    • Running old Windows games and programs (Wine, on 32-bit x86).
  • Be straightforward to use for old DOS and Arch Linux users alike.
  • Be not impossible to use for brand new users.
  • Have reproducible builds.

Its boot menu also has MemTest86+ and a FreeDOS 1.4 live floppy with a couple of games.

Reproducible builds

  • Each release has a SHA256SUMS file with the SHA256 hash sum, as well as a detached GPG signature for the hash sum named SHA256SUMS.asc.
  • One can verify the image hash sum file with gpg --verify SHA256SUMS.asc SHA256SUMS and then sha256sum -c SHA256SUMS.
  • Each build of an image (like build/tinyhat-i686.img) is reproducible and bit-identical.

Dependencies

Building needs an Arch Linux host with base and base-devel. The other build tools come from the build environment that the build sets up from prebuilt Arch Linux packages. make checks for the packages below and names any that are missing.

For make i486, make i686, make x86_64, make x86_64_v3, make aarch64 and make rpi4:

bubblewrap cpio fish git ninja python

make dist also needs a GnuPG secret key, for signing SHA256SUMS.

For make run, make qemutest and make boottest, these packages are also needed:

edk2-aarch64 imagemagick qemu-system-aarch64 qemu-system-x86

For make autoupdate, these packages are needed along with fish, git and python:

nvchecker pacman-contrib python-jq python-lxml

Installation

From Linux, UNIX or FreeBSD

  • Download the image for your computer: tinyhat-x86_64_v3.img for a 64-bit PC from about 2015 or newer (AVX2), tinyhat-x86_64.img for other 64-bit PCs, tinyhat-i686.img for a 32-bit PC with SSE2 and tinyhat-i486.img for older ones, down to a 486 (or clone this repo, install the dependencies and run make i686 and so on).
  • Run sudo fdisk -l to list all drives, try to identify the USB drive you want to flash the image to.
  • Remember the drive name, for example /dev/sdq. Be 100% sure to use the USB drive and not an internal harddrive!
  • Run this command, but replace sdq with your drive. Please wait and think for 3 seconds and double check the of value before pressing return:
    • sudo dd if=tinyhat-i686.img of=/dev/sdq bs=4M conv=fsync status=progress
  • Or use ./burn.sh sdq tinyhat-i686.img, which refuses to write to drives that look like internal harddrives.

From Windows

  • Download the .img file from the release page.
  • Write it to a USB drive with Rufus or Raspberry Pi Imager (choose "Use custom"). Both are signed programs that most Windows systems, including company administered ones, allow.
  • Or skip the USB drive and run the .ova file in VirtualBox.

Booting

  • Just plop the USB drive into the x86 computer you wish to boot and turn on the computer.
  • The .iso file can be burned to a CD, or used in a virtual machine.
  • For the Raspberry Pi 4, write tinyhat-rpi4.img to an SD card instead, and plop that in. tinyhat-aarch64.img is for other 64-bit ARM computers with UEFI.
  • If needed, press F10, Del or F2 repeatedly at boot to get into the BIOS, where it is possible to select that the system should boot from the USB drive before the harddrive.

Tooling

This README.md file, design choices and package selection is human made. AI tooling has been used for creating the Makefile, adding test scripts, debugging why some program fails to start etc. Time consuming testing on real hardware has been done by a human (me).

Licenses

The licenses are generated during the build (make licenses writes them to build/licenses). In Tiny Hat they are in /usr/share/licenses/tinyhat, and each release includes them as tinyhat-licenses-<version>.tar.gz.

General

  • Version: 1.0.9
  • License: BSD-3

About

Linux distro based on archlinux32 and Arch Linux for retro gamedev, for playing DOS and SNES games, for demoscene dev, for old x86 PCs with less than 1G RAM. Fits on a 1G memory stick. Uses less than 100M RAM after boot. Also has the goal of lowering the threshold for getting into graphics and game programming in C, Assembly and Lua.

Topics

Resources

Stars

101 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages