computing

Project “NoX”

Harold Smith

INTRO

    Back in the day when this century dawned, I was running Slackware Linux 7.0 on a PC equipped with S3 Trio3D graphics card. This card had no driver for X, and after a lot of fiddling with configuration and options, I’ve finally made it to work via VESA framebuffer support. This gave me nice high-resolution (text mode) console and very usable X desktop. It wasn’t the fastest thing on Earth, but it worked well enough to be perfectly usable.

    Interesting thing with Linux framebuffer device is that it was maintained over the years, and support for it expanded over time. Nowadays you can find things like development libraries, image viewers, media players, PDF readers, web browsers, paint programs, emulators, etc. that support it.

 

PIES

    I own couple of Raspberry PI SBC’s. They are such a nice little computers, running small but powerful Raspberry PI OS (derivative of Debian Linux). Latest addition to my PI collection is Raspberry PI Zero 2 W, even smaller board than its big brother PI 3, equipped with only 512MB of RAM, but still sporting 1GHz quad-core CPU. This thing is great for running apps in command line, and Raspberry PI OS in text mode gives you beautiful framebuffer display to work with!

Zero 2 W

    (my PI Zero 2 W)

 

CONNECTING THE DOTS

    My usage scenarios for PI Zero 2 W are:

        1. have some good text editors around for scripting, programming and system configuration

        2. I need a C/C++ development tools targeting SDL2 (for my game prototypes) and java compiler for simple (TCP socket) services 

        3. view images and read PDF files

        4. basic web browsing and email client

        5. be able to use decent text processing tools

        6. music player (mp3)

        7. play some (super light) games

    Goal is to have a set of tools that utilize framebuffer if possible (and when necessary), otherwise default to text mode. Xorg will not be installed nor used. Another important constraint is that (at least initially) only stock software is to be used (available from default Raspberry PI repos) – I want to discover “vanilla maximum”, before adding any extra layer on top of (easy to setup) defaults.

 

SOFTWARE SETUP

    At first boot, I’ve enabled SSH login (headless mode) and configured WiFi (from raspi-config). Initial configuration included running 

        sudo dpkg-reconfigure console-setup

to setup console font and encoding.

    Next, I’ve added a basic set of utilities:

        sudo apt install mc dfc neofetch ncal screen cmatrix zulucrypt-cli

    Now its time to add some extra text editors:

        sudo apt install neovim

        sudo apt install --no-install-recommends emacs-nox

    The ‘no-install-recomends’ parameter is used to prevent MTA from being installed (I don’t need it). Now its time to add development tools and libraries. SDL2 port on Raspberry PI OS supports framebuffer and I can run my games without X:

        sudo apt install git gdb gdb-doc clang-19 libsdl2-dev libsdl2-image-dev libsdl2-net-dev libsdl2-mixer-dev libsdl2-ttf-dev liblua5.4-dev libglu1-mesa-dev

        sudo apt install --no-install-recommends default-jdk

        sudo apt install ant

    After this I’ve configured default clang settings to target clang-19:

        sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 10

        sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 10

    Now its time to install mailer & browsers:

        sudo apt install links lynx links2

        sudo apt install –no-install-recommends mutt

    Links2 is compiled with framebuffer enabled: running with ‘links2 -g google.com’ will give you GUI with mouse support. Mutt (email client) configuration is well documented and I will not describe it here.

    Mp3 playback is easy:

        sudo apt install mpg123

    Image viewer comes with framebuffer support and has nice keyboard navigation shortcuts:

        sudo apt install fbi

    When it comes to word processing, this is what I've installed:

        sudo apt install wordgrinder-ncurses poppler-utils odt2txt dosbox

    Now, this requires some explaining. Wordgrinder is native linux word processor (ncurses). Poppler-utils (provides ‘pdftotext’) and odt2txt are there to convert formats when needed. Dosbox is another wonderful app with framebuffer support that allows me to run Word 5.5 for DOS (Microsoft released it for free and is easy to download). The only thing to note here is that dosbox required some extra config to properly work – I’ve added the following to my dosbox.config file:

        set 'usescancodes=false'

        set 'fullscreen=true'

        set 'fullresolution=desktop'

Scancodes thing was required to get the keyboard input working. Also, you can use CTRL+F9 to quit dosbox. Now, if needed - you can also set 'output' to 'overlay' and 'aspect' to 'true' to get scaled up display (a bit jaggy, will depend on personal preferences and screen size). 

    Finally, I’ve installed Grafx2, a little paint program inspired by DeLuxe Paint (which also supports framebuffer device) – if needed, you can also set your display defaults in ‘$HOME/.config/gfx2/gfx2.ini’:

        sudo apt install grafx2

    The only remaining thing to resolve was PDF reader. Unfortunately, Raspberry PI OS does not come with framebuffer-enabled PDF reader (like fbpdf for example). Therefore my method of overcoming this was to install:

        sudo apt install mupdf-tools

which I used to covert PDF file into a series of PNG images via:

        mutool convert -o page_%03d.png input.pdf

(specified 3-digit file index numbers, to end up with ordered list of files). Now it is possible to view extracted content as a serises of images by running

        fbi ./*.png

    Fbi provides awesome controls for zoom and navigation (press ‘H’ for onscreen help) and reading books in this way is a very pleasurable experience.

    With all this done, I have my PI Zero 2 W fully set up for all of my (pocketable) computing needs.

 

 FUTURE IS CYBERDECK?

    Obvious next step might be to turn this little thing into a cyberdeck. All it needs is the following:

        - 4.3” 800x480 display (maybe even 7” 1024x600?!)

        - mini keyboard

        - 3D printed case

        - a power bank

    The reason for consideration of using power bank instead of a solution based on 18650 batteries is simple: if everything is built with cables, its super easy to switch the device to external power supply, and also to replace power bank itself. This would allow me to carry extra power bank in my backpack and simply replace it when needed. Very flexible and cheap solution.

    However, turning my PI Zero 2 W into cyberdeck might be an adventure for some later date :)