PitchHut logo
gasm
A lightweight Gopher server for constrained environments.
Pitch

gasm is a unique bare-metal i386 Gopher server built in pure x86 Assembly, perfectly suited for resource-constrained hardware. With a minimal footprint and zero dependencies, it runs efficiently on older systems while maintaining essential features like dynamic directory listings and strict input sanitization.

Description

gasm: A Bare-Metal Gopher Server

gasm is a lightweight and efficient Gopher server specifically designed for Linux operating systems, written entirely in pure x86 Assembly. This project emphasizes minimalism and performance, running seamlessly on resource-constrained hardware, from vintage computers like the 386DX to contemporary low-power devices.

Key Features

  • Dependency-Free Operation: No libraries, no runtime requirements—just efficient int 0x80 syscalls.
  • Minimal Resource Footprint:
    • Binary Size: Only 1.5 KB, significantly smaller than conventional web servers (typically 50MB+).
    • RAM Usage: Uses just 24 KB of RAM, compared to over 100MB for standard solutions.
  • Legacy Compatibility: Designed to operate with older Linux kernels (2.4+) utilizing the socketcall interface for robust networking.
  • Robust Security Measures:
    • Implements strict input size limits to prevent buffer overflows.
    • Sanitizes user inputs to thwart path traversal attacks.
    • Runs as a non-privileged user on port 7890 for additional security.
  • Protocol Support: Offers functionalities for Dynamic Directory Listings, Text Files, and Binary/Image files.

Hardware Support

gasm targets the i386 (IA-32) instruction set:

  • Minimum Requirements: Intel 80386DX, 4MB RAM, Linux 2.4.
  • Maximum Compatibility: Articulates well with modern x86_64 CPUs operating in legacy mode, allowing for broad applicability.

Getting Started

With simple prerequisites such as nasm and ld, building and running gasm is straightforward:

# Build the server
make

# Prepare the content directory
mkdir content
echo "Hello from Assembly" > content/hello.txt

# Run the server
a./gasm content

To test the server:

curl gopher://localhost:7890

Download the binary from here and unlock the potential of resource-efficient Gopher hosting.

0 comments

No comments yet.

Sign in to be the first to comment.