Saturday, September 24, 2016

Saturday Music

Marcus and Agata and friends are getting ready for a Sports and Arts packed weekend.

This is music to get us into a suitably reflective mood.

Black Eyed Peas: Where is the Love

Zara Larsson: Too Good

See Also: Musical Links
Gala, Freed, Volkan UCA Remix
Gala, Freed, Official

Friday, September 23, 2016

Cromemco Millennium Bug

Can you really use a computer where the date, and perhaps the time is wrong?

Well try it.  I'd argue not.  But that's the current dilemma I am facing whilst trying to restore and use my Cromemco 68020 processor system, running the Cromix 172XXU Operating System.

Setting the Date and Time

Under Cromix from the command line you must use the time command and the time -s to set.  Unfortunately you must use console input so here are some examples

Setting time to 1995 works fine

Here is the time command help

Setting the time to 2016 does not work so well!

Trying a Rollover

After midnight on Dec 31 1999 the time jumps to Feb 6, 2036 !!

I tried a C program
Getting the C compiler to work was non trivial.  Well because it was designed for the 68010 Operating System not the 68020 one.  Oh and the docs describing the Linker options were well, wrong (and this was a late revision of the manual.  Tut tut)

 ty sd.c
#include <jsysequ.h>
#include <syslib.h>
#include <stdio.h>

int rc;
unsigned int year;
struct sys_date mydate;
int sigmask=0, sigvalues=0;

char cmdline [20] [80];
strcpy ( cmdline [0], "sh");
strcpy ( cmdline [1], "-c");
strcpy ( cmdline [2], "/bin/time.bin");
strcpy ( cmdline [3], NULL );

printf ("cmdline0 was %s\n", cmdline[0] );

for ( year=0; year <=255; year++)
  mydate.year= year;

  printf ( "Year %u, return code %d\n", year, rc);
/* no worky   rc=fshell (cmdline, sigmask, sigvalues);
  printf ("rc was %d\n", rc );



I was able to determine that the full range of character based input for the year which might logically viewed as an unsigned integer 0-255 were not accepted.  The results are

00-59 BAD
60-195 GOOD
196-255 BAD

68000 Assembler Interface

 I wrote and then assembled a 68000 Assembler program for 2015.  Works!

 ty sdate.asm
*INCLUDE '/equ/jsysequ.asm'

      move #116, D1   ; year 116 for 2016
      move #09,  D2   ; month 9 september
      move #23,  D3   ; day is 23 decimal
      jsys #_setdate

      move #0,   D3
      jsys #_exit


system[74] /usr/pkg/asmd/asm68 sdate.asm
Cromemco 68000 Assembler version 01.15

Assembling: sdate.asm

Free memory = 27632

0 error(s)

system[75] /usr/pkg/asmd/link68 sdate

68010 XPU 167   Link68 source 1.32
sdate        sdate                     000000 000018  RWE

  0 multiply defined symbol(s)
  0 unknown symbol(s)

Address    Size     Attributes
000000     000018     RWE

Starting address: 000000
system[76] ./sdate
system[77] time
       Wednesday, October 29, 2036            20:10:34

As you can see when I change the assembler to ask to set the date to 2016, things go to pot :-(

Z80 Cromix Call

CDOS Z80 Assembler Interface

Hand Assemble A Z80 program
Since I still remember Z80 assembler I tried writing a privileged program in machine code  (there is no equivalent on the native 68000 processor).   There is a Z80 coprocessor card to execute Z80 instructions

2015 works ... wahoo!

But asking for year 2016 results in year 2036 and a mashed up time and month etc :-(

fshell does not work (for me)

Cromix does not have the equivalent of the Linux system() call and so you need to use fshell or fexec.  Unfortunately I did not get it working.  Bear in mind the C compiler I was using does not allow C99  or modern array assignment so it could well be my code.  Or alternatively bad sigmask and sigvalues since I could not find any guidance, despite match (Cromix version of UNIX grep) all the .h files I could find in /usr/include.

Desperate shell times

Not being able to get any C program to work, and with no 68010 assembler installed I resorted to a kludge testing solution

more doit
/bin/time.bin < ifile61
/bin/time.bin < ifile62
/bin/time.bin < ifile63

cat ifile61

- On my linux system generate a controlling script doit
- do it runs the time command 256 times, and takes input from 256 different files
- each one of those files has a different year number in it from 0 to 255
- I can't use the native Cromix shell because there is no way to make a loop!
- tar up the files into a v7 UNIX compatible file
- transfer the tar file from Windows VM machine to Cromix over a Serial cable
- unpack the tar file using the ftar -ux  Unix extract option
- run the doit shell script that reads the 256 files and log the output

So I iterate the year from 61 to 195 and find a whole range of illogical years result.  Including 2015 but not 2016.  I just don't believe it!

What works in the 68010 Cromix Version
I found however that this does work under the Cromix 167 Operating system for the 68000 processor

system[5] version cromix.*
    CRC OK   68010 XPU 167   Cromix-Plus Operating System
system[6] time -s
        Saturday, September 17, 2016            16:34:53
DATE (mm/dd/yy): 09/19/116
TIME (hh:mm:ss): 18:20
          Monday, September 19, 2016            18:20:00

Oh, and because 68010 code can work on the 68020 system I took the /bin/time.bin 68010 version and executed that in the 68020 environment.  No!  That did not work sadly.

Unbelievable bad luck!

Summary So far

Under the 68010 processor and the Cromix 167 Operating system, by specifying 3 digits  e.g. 116, to the 68010 version of /bin/time.bin I can specify the year 2016 and that is correctly set into the Operating System.  Further then, files created and saved have the correct date and time of the year 2016.

But under the 68020 processor, which cannot run Cromix 167 I must run Cromix 172XXU ( or 168XXU).  In this environment the same 'trick' to use 116 as the 2 digit year does not work and when used screws up both the date and the time

I tried using a C program instead of a command line to set the time, but it is no better

I then tried using 68000 Assembler and Z80 assembler via the priv and debug commands. They work for year 2015 (by specifying year 115) but not for 2016

Since the 68020 processor card is over 300% faster than the 8Mhz 68000 processor, and can also run UNIX  (well yet to be proven!) it would really suck to be constrained to run the older Operating System with the Slower processor card, just to have the time and date come out right.


Thursday, September 22, 2016

Cromemco and the line editor

Marcus is in the middle of rebuilding this circa 1980 Cromemco Computer.  Actually the circuit cards and all software are from Cromemco, the case shown is one from any number of manufacturers at the time.

But I digress.

In order to successfully configure the system I have to edit, i.e. textually manipulate a number of Operating System files.

Here is an example

ty /cmd/makeram.cmd
% create ram disk directory and fill it with progs necessary to copy disk

echo "Creating ram disk of 128K bytes, 2016 version"
ramdisk -c 128 rd0
if -err exit

makfs -b 2 -i 20 rd0
if -err exit
mount rd0 /ram
chowner bin /ram

% copy useful files into /ram
d /bin
copy -v copy.bin cptree.bin ls.bin mount.bin mode.bin /ram
copy -v unmount.bin inithard.bin initflop.bin makfs.bin  /ram
copy -v icheck.bin dcheck.bin readall.bin free.bin citoh/screen.bin /ram

But modern text editors, and even those in about 1984 were screen oriented.  Trouble is I can't use the screen editors until the Operating System config files are corrected.


It is back to the Cromeco Line Editor,

Editor Types
I'd divide text editors into the following categories from newest to oldest

Gui Word Processor
Like Microsoft Word.  Able to Type into a Graphical User Interface (GUI) into a window that is resizable  (i.e. not full screen), able to display proportional text  (i.e. not monospaced all same width).  And seamlessly include graphics and any diagrams.  Able to handle colour.

Gui Screen Editor
A Screen based editor, meaning you can move around the editor window with cursor keys, but not usually interact with the mouse.  And only display monospaced text and no graphics or bitmaps. Colour support may be there but only in a rudimentary fashion

Line Editor
You view the file that you are editing one line at a time.  Text is monospaced, their is no mouse support or screen based editing e.g. cursor keys.

Often you are simply adding to the beginning or to the end of an existing document.  Adding or changing text in the middle of the document often involves you moving an invisible document pointer using text commands and then once you move from command mode to insert mode, typing in text, returning to command mode and printing the page again to see if you made the right changes.

A line editor is probably the most basic form of interactive input to a computer.  The only thing worse would be punched cards  (where you convert a handwritten program to cards with holes in them in special places, and those cards is read to convert those specially placed holes into the text that you want).  A card reader is not interactive.

Cromemo Line Editor

Yes it is pretty basic!  And this is the best version that they had


Cromemco made 2 versions of the editor  00.09 and 00.10 and you can see that the best is 00.10 and it is under 7K bytes in size.

Program Loading
This program was written in Z80 Assembler and when the computer loads this program it simply reads the code and loads it to hex 0x100.   One should contrast this with

- Relocatable code
The code is written in such a way that it can be freely loaded at any start address without patching or manipulation

- ELF format or similar
Today code would be in ELF or similar format meaning that the binary cannot simply be loaded into memory but the disk image contains different parts of the program that are loaded and patched appropriately.

Additionally today programs with make use of 'dynamic link libraries' meaning that they rely on subroutines not in the Operating System but (say) in a set of Shared library directories.  This too needs resolution at runtime

But back in 1980 such mechanisms were not invented.  A program would load statically, in this case at hex 0x100 and the program would make calls to the CDOS Operating System as required.


CDOS i.e. Cromemco Disk Operating System,  was a superset of the then standard Digital Research CP/M Operating System.

These are the main Operating System Calls that were available to any programmer.   Really just a basic set of commands to read and write files from the disk and also to write character output, line by line to a Serially connected terminal screen.

CP/M,  the rival Operating System also provided an editor called ED.   Here is some documentation  Both ED and Cromemco edit were laughably unforgiving but at the time, a lot better than punched cards, or nothing! UNIX also had a line editor called ed, really unfriendly.

Text Editor Messages

Copyright (c) 1978 CROMEMCO, INC.
Rewinding file
Type a command line to be executed by the M command.
Obliterate Text Buffer and rewind Input File (Y/N)?
Discard Text Buffer, restore Input File, and quit EDITOR (Y/N)?
File not found
Room for yyy  more characters in buffer
Save Buffer Full
Use space bar to move across line; set tabs with "T".
         1         2         3         4         5         6         7
Macros nested too deep
CROMEMCO Text Editor version 00.10
All text now on Output File
Cannot find "
End of Input File
Text Buffer Full
"-" not allowed in this command
" not legal here
Missing ">"
No Directory Space
Output File Write Error
Illegal Filename
Cannot edit xxx file; rename file

New File


The full manual for the Text Editor is Here

The full Manual for the CDOS Operating System is here

Some Time Later

After what seems like an eternity later I have made the necessary edits to the screen Editor configuration files, using the line editor.   So now I can continue my editing using a Screen based editor and so further configuration will be accelerated.

But before further ado, time for a full backup, this system is now a mature 38 years old and in the case of disk failure I want to be able to revert back to this moment and not have to start configuration again from scratch.

Wednesday, September 21, 2016

Letter From Switzerland: Waiting

They say the English are good at queuing which is perhaps why I am supposed not to get too irate when I see a picture like this above

But First
Having lived in Switzerland now for over 10 years (but how much longer?) I think it is time for Marcus and Agata to start a new Blog Theme

Letter From Switzerland

Switzerland has many positive stereotypes, but not everything is rosy here.  Over the next few months I will examine some of the wrinkles, and some of the things that I used to find very annoying, but now completely agree with!

About 1Km from home the following sign has been errected.  As it says there is going to be traffic jams due to roadworks

For the next 2.5 years

Yes, in English this would rightly be called  "Taking the Piss", but here they are very slow and very serious.

And where is my B*****y Phone
Whilst the pace of life has certainly eased up in the last year there is always the time when Swiss glacial slowness hits hard.

My Google Nexus 5X smartphone failed for the second time on September 9th.  Two weeks ago.  And the retailer Digitec informed me that it would take 4 weeks,  or thereabouts to repair.

4 weeks!

As somebody who makes use of a Smartphone 24x7 I would normally always have a backup.  However my Lumia 950 was stolen  and I have been patiently waiting for a non ridiculously expensive nextgen phone  (so no to the iPhone 7 and even Google Pixel so I am told)  to get back to : Primary phone and backup phone.

So the sudden Death of the 5X  again has hit particularly hard.

And the further gotchas are

- They won't just repair the phone.  As I found out with the Nexus 5 where they claimed water damage, and refused repair.  I got the phone back. Then 9 months later when I opened it up, found this to be untrue, fixed the phone myself, and wrote to complain to Digitec.   No reply, no comeback, got nothing for my trouble

- They will charge for a technician to look at the phone, and so if its not covered by Warranty you are going to get a Bill for labour!

- Yes and they will take upto 4 weeks to get around to doing anything.

To me it is intolerable!  But Digitec is the best, not the worst supplier I could find.

John Mayer: Waiting for the World to Change

Tuesday, September 20, 2016

Cromemco XPU and Memory Upgrade

Subtitle: Hands On

A friend sent me a hard disk containing

Cromemco UNIX V.

I was very excited.

I should perhaps mention that this was an Operating System released in 1984 and so getting it working was and still is going to be a challenge.  In fact I am in the hands of fellow enthusiasts reading this article.

After connecting up the hard disk it was time to try a boot

First interact with the RDOS boot monitor

This reads a cromix.sys from the hard disk or in this case an 8" floppy disk.

For technical legacy reasons Cromemco Floppy disks contain a first track written in Single Density and the rest of the Floppy is in Double Density.

The Cromemco UNIX distribution is however on disks of Uniform 512 Bytes per sector Double Density.

To make a long story short the usual way to boot UNIX on a Cromemco System  is to boot Cromix  (from Floppy or Hard Disk) then use the boot.bin program to load uboot.sys and that will reboot into UNIX.   Sounds like a palava I know, but in 1984 or thereabouts this was really ahead of the times.

So I got this far and then nothing.

Whilst waiting for feedback from the Cromemco Google Group I thought the probable cause was either the CPU or Memory Sizing

The Memory and CPU Upgrade

Consult the Spare S100 bus cards store at home.

Initial great news is that the DPU card that I was running can be replaced with the faster XPU card. The Cromemco UNIX documentation only makes reference to the XPU processor so surely I need this

Good news #2.  I have a spare Dynamic Memory Card or two.  A number have 'faulty' written onto them so obviously this is not the time to recheck those.

One small issue:

The manual does not give me the Switch settings that I require to configure all the memory cards that I need to insert or reconfigure.

Old Skool Upgrading

It's worth pointing out that back in the day some Computer Skills might be taken for granted

- The ability to do basic Hexadecimal arithmetic
- A knowledge of the different between Bytes, KiloBytes, Megabytes and between Bits and Bytes
- The ability to actually open up a computer and change the necessary parts, without shorting something or blowing it up
- The stepwise methodical ability to take stuff apart, note what you did, & how you did it carefully, so you can reverse it and get everything back together
- The need for patience and beverages, usually coffee

 I made some hex calculations on the Dip Switch settings I would need for the Memory Cards

 Like a professional I thought I would label the base memory address in Hex on each memory card.

 I drank many cups of coffee and checked stuff


Some time later.  Completed.

Time to reconnect the power, Switch on and go back to Putty.

No Worky

Okay we have a reboot at least

 First the very good news

- It booted up into the Cromix Operating System without issue
- We now have an amazing 1792KB of memory.

This is amazing, because the same chassis and computer when first bought in about 1979 had a mere 16KB of memory installed and a single Z80 processor running at 4Mhz.

Now with the XPU processor card there is a Dual Motorola 68010 and Zilog Z80 B switchable processor pair.

And the memory thanks to cards like this 256KB Dynamic Memory card has lept upto over 1MB.

I think that is pretty amazing.

 On the downside the boot still fails.   I am gutted!

What can be wrong?

Still Wanted

So it transpires that I am still missing a vital XMM Hardware Memory Management Card.
Cromemco's signature Operating System of the day namely Cromix did not use Memory Management.  When you ran a program it loaded the whole program into memory, not just a part of it.  

Now their version of UNIX, obvious in retrospect, like all other UNIX I am aware of (well except IBM PC/IX) uses Hardware Memory Management and this needs the XMM card.

Ah, the benefit of hindsight.

So I can go no further on this UNIX boot until I can find, beg, borrow, buy a working Cromemco XMM card.  Anybody?

Introduction to UNIX for Cromemco Systems