Nano‐X - ghaerr/elks GitHub Wiki
Graphics support
The Nano-X screen driver is built for VGA or EGA cards. If "EGAMODE=1" is set in the environment, it will assume EGA and run in 640x350 resolution, otherwise it will assume VGA resolution and use 640x480.
Nano-X can be built to use CGA, which was done with some experimentation for IBM PC using a special driver. There is no CGA support for IBM PC using the standard build. The PC98 version of Nano-X uses a driver specific for PC98 and runs in 640x400 resolution. More info on CGA is available here. And as Tandy graphics is an extension of CGA it could work on Tandy as well.
Mouse
You need to have a serial COM mouse on ttyS0 on real hardware, but ttyS1 on QEMU or when QEMU=1 is set in the environment. Nano-x does not start if mouse is not detected. Basically this means that if you use an emulator than the mouse port might not be correct for you. If the mouse port is incorrect then you might get a silent exit where the error message is hidden. If you configure COM1 in your emulator then this corresponds to export MOUSE_PORT=/dev/ttyS0 in ELKS. You can also set the MOUSE_PORT in /bootopts file. Check Troubleshooting below.
Compilation
Clone: https://github.com/ghaerr/microwindows
Go to ELKS' root folder. Type: . ./env.sh
Go to microwindows/src and type: make -f Makefile.elks
Binaries from: bin/nano-X will be automatically copied to /root/elks/elkscmd/rootfs_template/bin. This means that once you build a new ELKS image the Nano-X binaries will be in ELKS' /bin.
Configuration for ELKS is available in: microwindows/src/Configs/config.elks
If there is a problem, perform clean:
$ make clean
$ make -f Makefile.elks clean
Usage
Any client application checks to see if the Nano-X server is running, by checking the existence of the shared named socket at /tmp/nxsock. If it doesn't exist, then it fork/execs bin/nano-x to start the server, then connects to it via the named socket. After the nano-X server is running, then subsequent applications do the same check but don't start the server because they see it is already running, and just connect to it to start sending graphics commands.
A desktop app exists called nxstart. It creates a graphical desktop with a window manager and a menu that allows you to start other Nano-X applications.
Use CTRL+A to exit.
Troubleshooting
Error messages are sometimes hidden - they are printed, but Nano-X switches quickly to graphics mode and hides them. Incorrect mouse port is usually the main problem.
If Nano-x does not start:
- use
export MOUSE_PORT=noneto disable the mouse temporally and only test if Nano-X can access video memory, change video modes, etc. - try BOTH
export MOUSE_PORT=/dev/ttyS0andexport MOUSE_PORT=/dev/ttyS1 - there is a
mouseprogram in ELKS. It also checks for MOUSE_PORT variable. Start it, move the mouse. Check bothexport MOUSE_PORT=/dev/ttyS0andexport MOUSE_PORT=/dev/ttyS1 - by default target display is VGA. If you see a black screen, it might mean that you are writing at A000H, but there is no video memory at this address on your computer. Other display drivers do exist.
- You do not have unix sockets enabled in ELKS' kernel
- remove the
/tmp/nxsockif you get "Cannot connect to Nano-X". It indicates that the nano-x is already running and it does not need to be started again (which might be false in you case).
It is possible that your mouse port is incorrect and you get a silent exit which will also leave the /tmp/nxsock the first time you try. Once you select the correct mouse port then the left /tmp/nxsock will still prevent you from starting - meaning that you need to fix both problems.
Notes
- The size of the cursor and its implementation do affect overall performance as discussed here.