Softer - Orange Terminal Emulator

Ages ago, I was quite into BBSs, and wanted to create a better set of terminal emulation codes to use with them. I wanted something with more features and shorter codes. ANSI codes were long due to being text rather than binary. So I created my codes, and created a program named "softer" to interpret them, and subsequently was able to create wonderfully animated BBS screens that were far smaller than their ANSI counterparts. Indeed, the codes even supported creating macros, and so it was possible for the result to be smaller in size than plain text.

Then I started using Linux, and it all went downhill from there.

Current Status

I gave up on the project years ago. With every new kernel came new bugs to track down and correct. The kernel's graphics API is designed soley for X11, with maybe a small amount of attention given to SVGAlib. Anyone else can, apparently, go fuck themselves. ...and so I grew tired of the bullshit and just gave up.

...but then today I found a forum post with the following text:

A guy who goes by "Richard Cooper", also known as "PJd", has written a thing called "softer" which implements the "orange" protocol (??? like ansi.sys? a BBS thing, I think). This uses ports to set and run vga "mode 13" graphics - pretty chunky - and also has text/cursor manipulation routines. I *think* getcursor is in there, setcursor definitely is. I can dig up that code, if you want to look at it...

It hadn't occured to me that other people might find this code useful. However, now that I think about it, there's a lot of stuff in there:

1. It does direct hardware access to VGA under Linux. Exactly how to do this is incredibly undocumented. It took me a lot of time to figure out, so some people might like some source code to look at.

2. It gets raw keyboard access under Linux. This is better documented, but an example might help some people.

3. It has the most excellent crash handling system, which displays register dumps and a "stack trace" of sorts, all written in and for assembly language. This is nice to have in general, but it's essential if you plan to do any direct hardware video access, since, if your software crashes without restoring the video state, you're fucked.

4. It's generally a good example of how to write software in assembly language in Linux.
That said, I wouldn't run it. Like I said, every time I installed a new kernel, there were new bugs to fix. ...and it's been ages since I fixed any. Also, the VGA text modes haven't worked on any hardware I've had recently. The text mode it sets up is quite non-standard. Works fine on older VGA hardware, but modern hardware is designed for nothing more than the video modes that DOS used, and thus the custom text modes don't work.

Proceed with Caution

Nevertheless, I did give it a try. The "triangle screensaver" test still seems to work, as does the "processor utilization" test. The "type test" probably still works if you have older VGA hardware. Most of the other scripts were related to testing video frame synchronization. Thus they look like garbage without it, and upon trying the -s option to enable synchronization, my system began a slow downard spiral over the next five minutes which ended with me quickly typing "shutdown -r now" into a terminal during one of the brief moments when it became responsive. So if you do decide to try it, make sure you save all of your open documents and sync your filesystem first. It was beautifully stable code back in 2007, but like I said, each new kernel introduces new problems.

If you dare to try it, you should know that pressing left control, left alt, and backspace simultaneously is the emergency kill switch. Alternately, switch to another console and send it a SIGKILL. However, don't under any circumstances send it a SIGKILL while its console is active or you'll never get your video state restored. It will accept SIGTERM as a signal to terminate however, and in that case, it will restore the video mode. So setting up a "sleep 60; killall softer" on another console first might not be a bad idea. Honestly, setting up a "sleep 180; shutdown -r now" is probably a good idea as well. You can always kill the command if you're lucky and everything turns out fine.

Assembly Instructions

Also, it doesn't assemble. I'd written some awesome macros that allowed me to set up functions with named parameters and named stack variables, as well as another to call these functions, pushing all of the parameters onto the stack, even figuring out when it was possible to use MOV vs. LEA. To make all of this work I had to patch NASM to add a preprocessor directive or two. I sent my patches to the NASM developer, who rejected them as he had plans to create something he thought was better. Last I checked, that something better had never materialized. ...and as for the patches, when I submitted them, I simply linked to a file on my old web site, which no longer exists. Thus, you're not going to get this code to assemble unless you figure out what the missing preprocessor directives were supposed to do and then implement them in the NASM source.

On the bright side, I always included an executable along with the source for anyone who couldn't assemble it. However, as stated above, you probably shouldn't execute it. Just raid the source for anything you can use.

License

See my antiviral license. Basically you can do anything you want with it as long as what you want doesn't involve the GPL.

Download

softer_2007-01-17.tgz - The last "official release" I could find. Includes a pre-assembled executable, which is nice since it won't assemble anymore.

Screenshot

Here's a screenshot I accidentally made while testing whether it still works.


I'm rather surprised. To make a screenshot of a text mode, you basically have to read the data and reconstruct an image. So when I saw that I had accidentally made a screenshot, I expected an image of what was supposed to be on the screen, rather than the garbage I was looking at. Apparently it knew the screen was full of garbage.

A better screenshot would be nice, but honestly, I'm afraid to run it again.

Contact Information

My contact information is on another web page.