Monday, May 25, 2020

FreeDOS I16GCC vs WATCOM-C

This post, referring to two very different C-compilers, feels a little unfair. However, we are not comparing a commercial product with a hobbyist product eihter.

On my low powered ACER Aspire ONE I compiled the program listed below with both compilers...
No, I am not writing about the result, I want to encourage you to find out yourself which compiler will suite your needs.

Here is the code of my test program:

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
  unsigned long int i,h[20];
  int rnd;
  srand(43558);
  for (i=0;h[i]=0,i<19;i++);
  for (i=0; i<10000000; i++){
    rnd=rand()%20;
    h[rnd]++;
    if(i%10000==0)printf(".");
  }
  printf("\n");
  for(i=0;printf("count of [%02ld] is %ld\n",i,h[i]),i<19;i++);
  return 0;
}

As you see, this is very simple code...
Test the compilers yourself, and you will see which one wins...


Sunday, May 17, 2020

Open Source FORTRAN for DOS

As a physicist of trade, I mainly worked with FORTRAN during my science days. One of the most important factors for me in selecting an OS is therefore the availability of a FORTRAN compiler.
With DOS, or FreeDOS, we got lucky. The Waterloo Compilers are now available as Open Source under the Open Watcom Project.
On the download page, you will find that a C/C++ compiler, an ASSEMBLER and a FORTRAN compiler are now available as open source.
The FreeDOS project included the C/C++ compiler in the distribution. I figure, the ASSEMBLE is included too. However, the FORTRAN compiler is not. I got in contact with Jim Hall asking him to include Watcom FORTRAN in the next distribution of FreeDOS.
In the meanwhile, I installed Watcom FORTRAN to the same tree as Watcom C/C++ in FreeDOS.

Here is how to do it:
Download open-watcom-f77-dos-1.9.exe as provided by the Open Watcom webpage.
Run the installer and select "\DEVEL\OW\" as install directory. This will install the FORTRAN compiler into the same environment as the C/C++ compiler provided in the FreeDOS distribution.

To use the compiler, first run the BATCH-scrip "\DEVEL\OW\OWSETENC.BAT", which will set the correct PATH and LIBRARY variables. This script is part of the FreeDOS installation.
In order to compile a simple FORTRAN program, call "wfl".

When I was taught FORTRAN in University, a system called WATFOR-77 was used in the classroom. This was an integrated system having an editor and a compiler. Same origin as Open Watcom, however, WATFOR-77 is not available as open source by today. If the authors are reading, it would be great if you would turn the DOS version of WATFOR-77 including the editor into open source!

Saturday, May 16, 2020

FreeDOS - Linux-MINT dual boot

Transferring data from FreeDOS to the cloud is something I need, but not able to achieve over WiFi, mind you, my FreeDOS computer is a netbook.
So, I believe the easiest way would be to install a Linux distribution alongside FreeDOS. The 30GB HDD offers enough space for doing so.
With a Linux on the machine, it will be easy to boot into Linux when data-transfer is needed. Reading and writing from a DOS partition is something that Linux is able to do since a very long time.

I went for Linux MINT Tara i386, just because I had a USB thumb-drive with that particular distribution readily in my drawer.

Concerning the installation, nothing special to report. I decided to use 14GB for Linux and left 16GB for FreeDOS, plenty for both operation systems.

After installation, FreeDOS did not boot from GRUB. It turns out that one needs to boot FreeDOS from a thumb-drive and re-write the system files using the "sys" command.

What FreeDOS is concerned, that's it.

The native screen resolution of netbooks can be a low for your GUI on Linux.
However, resolution scaling works beautifully, should you need more real-estate on the screen.
Here are two tiny scripts I use to toggle scaling:

$ cat nb_scale1
#!/bin/bash
xrandr --output LVDS1 --scale 1x1 --panning 1024x600
 

$ cat nb_scale1_5
#!/bin/bash
xrandr --output LVDS1 --scale 1.5x1.5 --panning 1536x900


Enjoy toying with DOS and Linux on a small netbook.
 

Tuesday, May 12, 2020

As-Easy-As spreadsheet legally for free

One of the most popular office tools are certainly spreadsheet calculators.
Lotus 1-2-3 was certainly one of the most popular programs. Some versions of 1-2-3 are apparently available as abandonware, maybe I will some of those later.
There were, however, alternatives programs to Lotus 1-2-3. One of the shareware options was As-Easy-As.

The owner of As-Easy-As, TRIUS Inc., decided to release the DOS version of their spreadsheet by providing the necessary codes.
Here is a link to TRIUS Inc's very own forum post on their forum page, providing downloads for the program and the user manual, as well as license codes for the DOS version of As-Easy-As and the respective documentation for free!

Please note that the codes for the program and the manual are different.


Monday, May 11, 2020

MS WORD for DOS

Having a word processor on your FreeDOS machine is certainly a very important issue. Former DOS users might still have a box of floppies containing once purchased programs.

In case you are not so lucky, or you could not be bothered keeping obsolete stuff, sometimes on get lucky, very lucky indeed.

Searching the internet about ways to legally obtain old DOS programs, here is a gem: MS WORD directly from Microsoft:
http://download.microsoft.com/download/word97win/Wd55_be/97/WIN98/EN-US/Wd55_ben.exe

The file is a PKSFX archive which self-extracts to the active directory. It creates a bunch of EX$, CS$, PR$ and so forth files. Some of the printer driver files appear to have long names, since I am not running DOSLFN.COM, I got a few warnings.

SETUP.EXE lets you install Microsoft Word 5.5A for DOS on your HDD in a directory of your liking. Nothing to report about that process, other than to manually edit the PATH settings in FDAUTO.BAT yourself, since the installer modifies AUTOEXEC.BAT, which is not relevant in FreeDOS.

Text and VGA modes work perfectly fine. Playing with both, I settled on using the graphics mode with 30 lines and 80 columns. 34 lines looked still OK on the screen, so maybe I will switch to that later. 43 lines looks pretty painful and 60 lines, while still working fine, feels pretty squeezed and unnatural.

Concerning printing, I mentioned the problem with the long file names before. I no longer have any of those printers. In order to have something for WORD to think about concerning fonts, I chose the POSTSCRIPT driver.
However, printing is not my main objective using the netbook on FreeDOS. I will create files, e.g. DOC, which will then be transferred to the cloud and used as such. Another option would be to write Postscript files and convert those in PDF.



Sunday, May 10, 2020

Running FreeDOS in QEMU

As indicated before, I also have a Debian 8 latop, which is perfectly fine for my daily tasks, and hence, I do not have the desire to discard the Linux running on it, in particular since everything, including WLAN is running perfectly on this hardware.
This latop, a HP/Compaq nx6110, was also able to run the FreeDOS live-CD.

Anyway, I installed FreeDOS on a virtual drive on this particular computer. Again, the hardware, i.e. keyboard, is just perfect for my regular use under Linux.

When installing the FreeDOS image, I encountered some minor problems getting the networking to up and running. Finally, I ended up with a script as follows:

#!/bin/bash
qemu-system-i386 -m 32M -drive file=drivec.img,media=disk,format=raw -net nic,model=pcnet -net user


With this script, I am able to browse the internet using Lynx. I am pretty sure that I will be able to use other network services too.

Saturday, May 9, 2020

Hardware to run FreeDOS

In my earlier post, I stated that I intended to run FreeDOS directly on bare hardware, meaning, without virtualization.

Using the FreeDOS 1.3 Live CD, I tried a different systems at my disposal. Most modern ones failed, one way or the other.

An IBM 380Z laptop booted the CD fine, however, only the center of the screen was used. The system would work, however, the experience would be disappointing since the real estate of the screen is severely underused. The mouse-nipple, or however the red thing in the middle of the keyboard is called, worked find under FreeDOS.

My HP/Compaq nx6110 booted the live CD fine, screen fully used. The touchpad did what it was supposed to do, right away. This could be the perfect candidate for running FreeDOS on bare silicon. However, this laptop is my goto-PC for Debian/LINUX. So, for now. FreeDOS will live in qemu on this one.

Actually, the first hardware I tried FreeDOS on was one of my Acer ASPIRE ONE 110 netbooks. One that I had given an HDD years ago. Here is a link to a post on my RF related blog, concerning the HDD in the Aspire ONE netbook. To the time, I had not thought about an IT related blog, so, it was called "off-topic", seen the radio-frequency electronics content of my other blog.

Here is the netbook during the install of OpenWatcom FORTRAN on FreeDOS.
Acer ASPIRE ONE 110
The install files are on the USB thumb-drive on the right hand side of the netbook.
While the device is equipped with Ethernet, I had not set up or tested networking by the time of writing this post.
The touchpad on the Acer does not work with FreeDOS yet. I tried various options with the USB-mouse-driver, all of the attempts ended in crashes.

As a pure DOS computer, the netbook does a great job.
Several programming languages are available, through the FreeDOS-CD and also by installation using the USB thumb-drive and a USB floppy drive.
My old DOS version of Maple V runs just fine and so does a MathCAD student edition I happen to own.

Unfortunately, the Aspire ONE does is not fully supported in FreeDOS what APM is concerned. However, dictating processor speed does work fine.
I created the following aliases in fdauto.bat

alias slow=fdapm speed1
alias fast=fdapm speed8

Those commands set the processor speed to 1/8 and 8/8 (full) processor speed. In the case of the Aspire ONE, the native processor speed is 1.6GHz. Running the netbook at 1/8th of that, will still deliver a very decent 200MHz. This is plenty of fast for a DOS computer.

In fact, when editing code, I set my netbook to run at lowest speed. Only when I compile and run my programs, I will ramp the CPU up to max.

In conclusion, the Acer ASPIRE ONE 110 is the perfect DOS machine, I never was able to dream about.
In my nest post, I will compare the ASPIRE ONE to machines of that past, which I still own today.


Thursday, May 7, 2020

Taking every day computing a step back

Due to the present situation, a lot of my own professional use of computer is vastly reduced. Presently, there is not need and apparently no funds left for my clients to order polished illustrated reports nicely presented in PDF files.
So, that gives me the opportunity to reflect on how I did my personal computing in the eighties and nineties. At that time, computer mice were around, however, nobody really knew what to do with them, even CAD was done with console input. Many of the structures and devices designed that way are still standing and/or in operation.

Back in the day, I used an 8088 with two 5in floppy drives.
Later, I was able to buy a no-name 286/287 based PC with a 20MB hard-drive. OS of the time was MS-DOS, I believe it was version 4.01, not sure about that.
Remember those time? You switched the PC on and seconds later, you could start with your work.

Latest advances in the FreeDOS project got me back to those times. Jim Hall started the project in 1994 and still keeps improving this opensource MS-DOS compatible OS.
Some hardware support of modern hardware is present already.
While FreeDOS can run in a virtual machine, I am personally more interested in running a native DOS PC.

Why DOS, you might ask yourself. One reason I mentioned above already. But, there are additional reasons such as

  • easy administration and programming
  • tons of old freeware and shareware available
  • abandonware
  • some commercial software being turned into freeware, e.g. OpenWatcom and Borland compilers
  • one or the other software one has bought back in the day
In the next post, I will write about my first steps using mondern-ish hardware with FreeDOS.