Friday, March 14, 2003

For reasons that I can't really expain (probably related to chocolate deprivation), I got a hankering for a native win32, long-filename-handling, able-to-be-gracefully-shutdown-by-the-windows-task-manager version of edlin. As you may know, all versions of Windows still ship with edlin, but it is a 16-bit DOS program. This means that under NT, 2K, and XP it runs inside the virtual DOS machine and has all the usual problems associated with such applications.

Yes, I am aware that win32 ports of "ed" and "ex" exist. I even already have them on my work PC. But when I want edlin, I want edlin. When I'm in the mood to use a line editor, which is an inherently nostalgic experience, I want to feel nostalgia for MS-DOS circa 1989, not Unix.

I found myself thinking "if only edlin were open-source, I could just compile it with a win32 C compiler". (Ignoring the fact that the real edlin is probably in 8086 assembly, not C)

Fortunately, the good folks at the Freedos project have not only produced a clone of edlin called edline, but they have gone out of their way to make it portable to operating systems other than DOS. Kudos! All I had to do was compile it with mingw, and boom!

Now I just wish all the freedos stuff was that portable. Having native a win32 version of DEBUG that could handle the disassembly and debugging of other native win32 applications would be fun. Yes, I know that there are lots of graphical debuggers for win32, and ports of gdb and stuff like that, but I want my pseudo-DOS programs! And don't even get me started on QBASIC and EDIT.

Obviously porting these kinds of things would be more work than edlin. A line editor is probably one of the most easily portable applications that could be written. Its literally nothing but stdio.h and malloc. (Grandpa Simpson voice: I'm an old man. I hate everything but Malloc).