Monday, March 31, 2014

I cycle

Cycling to Work might sound easy but believe me it is not. So this is an email to support those that do:

Perceived Benefits

Enviromentally friendly:  Your way to work is zero carbon. If a typical commute is 10Km and a car is polluting at 150g/km, then that is a 15Kg per week reduction.

Exercise: You should normally walk 10,000 steps per day to stay fit.  Cycling can be a excellent and easy substitute.

Improved Alertness: You will arrive to work and home feeling refreshed and alive.  This corresponds to a more positive characteristic at work.  All good.

May not need to run a car: In the fortunate event that you only run a car in order to commute, you can now dispose of the car. This saves money and makes a tremendous saving on the environment  (far more than your Co2 reduction)

Parking: You are not taking up those precious car parking spaces, you only need a place in a secure bicycle store

Energy Savings: The energy saving in the transport your bicycle (say 30Kg max) instead of your car (over 1000Kg usually) to work and back is enormous. The straight cost to you is the petrol/diesel/fuel but behind this is the chain of savings that relate to refining and transporting the petrol, the people and processes spending their time to support this infrastructure, and the same principles (energy/ people/ processes/ infrastructure, servicing ..) to the motor vehicle that you could choose no longer to require full time.

Possible Issues

Run Over: Despite being careful it's possible to be run over.  Here is a personal example

It could rain or snow: On a road bicycle neither are good, especially for a long commute.  At the first sign of rain you could consider to leave for home or potentially get stuck.   The chances of a puncture/ flat grow exponentially in the wet.

Other factors:

You need a secure place to store your bicycle.  I left special secure locks at the client site.  However this would not detour any competent thief.

Lately I took part in a Corporate study to improve Bicycle security  (since there was a bout of thefts in 2013). After more than 2 months of waiting: Client said they did not have the money to improve security.

Just one reason why I'm not working there any-more.

Cycling Clothes
If you cycle any more than a trivial distance you will need special clothes and probably several sets, so that one set can be in the wash, whilst you wear the other.  Plus some for contingency.  And winter and summer clothe sets.  And waterproofs.

Cycle Clothes Storage
You will be hot and sweating on arrival to work.  Your Cycle clothes and equipment (for example Helmet) should be stored ideally in a ventilated changing room. Under your work desk or on a radiator are unacceptable places.  I wrote to my Client employer making this request. After waiting 3 years with no result I guessed they were not entirely serious about acting in a positive manner.

I would also comment that on repeated occasions some cycling clothes/ equipment was mysteriously disappeared.  I can only assume maliciously stolen.  What a laugh it must be to see how Marcus gets home without those items.

Work Clothes
A place to store your business clothes.  My client declined to provide any place

The Shower
For about 3 years there was 1 shower in a building with over 500 workers, and quite a few cyclists.  Then 2 more showers were built.   Not enough

Looking Weird
In most business environments walking to your Business Clothes store means a dash through the office in Cycle Clothing.   People think that you are weird.  And that is at best.

Added to that, and despite having a shower on arriving at work, at least one of the office bullies made repeated comments about /the smell/: cycling leaves you open to abuse in these other ways.

My high powered cycling lights last only 1 way to work.  So I needed to setup a charging infrastructure so lights were ready for the commute home. 

The Puncture
Besides keeping repair materials at work it means arranging some policy so that if you are late due to a Puncture, weather or some other calamity somebody could come to rescue you or at least realise that in such a circumstance you will be late arriving.

The Laptop
In my last job I needed 2 laptops.  My IBM one and the client one.  It was impractical to take 1 laptop on the 20Km cycle to and from work let alone 2.   But if I has a virtual machine or another laptop ...

(IBM let me virtualise my laptop so I had a copy laptop at home)

I contacted the client customer IT group to explain my position. No, we have rules and we are not interested in providing you with a second laptop.

How about if I buy a HP laptop (with my own money) and you put your build onto it

How about if I virtualise your laptop?

Just another one of the reasons why I don't work for this client.

After every return home it was my policy to check the bicycle.  And then clean the bicycle.  This adds to the total journey time.  Because an unmaintained bicycle, especially on the hilly descents in Lausanne could prove fatal.


In conclusion:  Cycling to work should be a commitment made both by the individual and client employer.  Employees should be congratulated and not harassed for choosing to cycle to work.

Sunday, March 30, 2014

Sunday Sermon: Surely God will make her well if He hears our prayers

I was not only dismayed but further saddened when I continue to hear that /the power of prayer/ is being used as a serious tool to aid in the recovery of wreckage and survivors from the recently crashed Malaysian Airlines flight MAS370 MH370.

I can only suggest that adults too, read the above elementary text which might explain why their approach is unlikely to work best.

Humanism: What is That

Mrs. Green is teaching her daily science class one day when suddenly she receives terrible news: A popular student named Amanda has been struck by a car on her way to class and is now hospitalized with serious injuries. 

"Let’s all pray for Amanda," says one earnest classmate. "Surely God will make her well if He hears our prayers."

Mrs. Green is confronted with the dilemma that every public school teacher must be ready to deal with. While the church-state separation laws won’t allow school prayer, Mrs. Green wants to do something to help her students cope with a life-threatening situation that has raised deep questions.

Transport minister Prays
Praying for Ukraine

Saturday, March 29, 2014

A spot of Evian darling

Marcus and Agata are conscious that the time for the yearly 180Km cycle race around the local Lake Leman approaches. Sometime in May we understand.

Cyclotour du Leman

As such, this Saturday we thought we would remind ourselves of the route upto Evian.   Yes, that French town, the one where the fizzy water comes from is just about 70Km away from us, here in Lausanne Switzerland.

From the above photograph you can see that the summer weather is back again in Lausanne, we hope to stay this time.

Just into France and it is time for a short food stop.

Proof we really are in Evian town centre!

Marcus snapping

Agustine, today pre bicycle upgrades.

Leaving Evian

It costs 8CHF per bicycle for the ferry, and 23CHF for a person!

View back to Lausanne

And Later Back home
To confirm the Stereotypes for the day, we are back in Lausanne to discover that the local Swiss supermarket is gearing up for a festive chocolate eating frenzy.  

 That is the purpose of Easter right?

Note: We are pleased to see that Swiss children will read anywhere, anytime :-)

Including our pre and post cycle journeys it has been about an 80Km cycling day.  We are very pleased!

Friday, March 28, 2014

What is on Sector 1, cylinder 0, side 0 of your Floppy Disk

Computers of the CPM genre and I mean in the early 1980's   (well before the IBM PC become a household presence) used floppy disks to store programs and data.

Either 5.25 or 8 inch floppy disks

At this time 3.5 or 3.x inch diskettes had not been invented

The Earliest recording format was Frequency Modulation (FM) and is usually spoken of as Single Density.  Soon this was replaced by a more sophisticated Modified Frequency Modulation  (MFM)

When the IBM PC was announced it started off with MFM diskettes so they never had to deal with the issue of FM diskette compatibility.

But the rest of the industry did.

What was the problem and solution in more detail?

Philosophically Aside
Before talking about the problem and solution in more detail it is important to realise that the IT industry used to believe in backward compatibility.

The idea is that no matter how dumb an ancient design was manufacturers did their best to guarantee that your old software or even hardware parts would be compatible with the new computers.

Today it's not so true.  Today we have
a) Maintain compatibility, but that old design was dumb
b) Use a software emulator so that your old software still works
c) Screw you Mr Customer.  Our old design was insane.   We break compatibility and to take advantage of our new hardware/ software,however you might need to repurchase your application.

Windows 1 to Windows 8

As you can see from this video, Microsoft used to always go for (a), other manufacturers would however might prefer (c)

Back to the plot
Many manufacturers of the day created a 

Mixed density format diskette.

In this schema typically track 0, or a part of track 0, perhaps the first sector contains a signature to say how the rest of the diskette is formatted.

How did it work out?
The IBM PC could not natively read FM diskettes.  So if the first track was in FM format this screwed up the PC's abilitiy to make sense of the diskette without using special conversion software.

The early IBM PC used the NEC PD765 diskette controller. But today's computers do not.  So that special software that could have worked under 16bit IBM / MSDOS will not work under todays 32bit and 64 bit systems.

To make it clear we can check an example
The example I know best would be the Cromemco 5.25 and 8" disk formats.  And I'm going to quote from the manuals thus:

Each disk used under CDOS is divided into two general
areas. The first area is the System Area. It may be
accessed by the user only through the WRTSYS utility
program or when creating a boot file with CDOSGEN. The
contents of this area are not listed by the DIRectory
intrinsic command. The System Area occupies the outer
tracks of the disk.

The second area is the File Area. This is the section
where user files (e.g., programs, data, etc.) and the
disk directory are stored.

        Tracks in      Approximate
Disk    System Area    File Area
------- -----------    ---------
5"SS SD 3               8lK
5"DS SD 3              l7lK
5"SS DD 2              l88K
5"DS DD 2              386K
8"SS SD 2              24lK
8"DS SD 2              490K
8"SS DD 2              596K
8"DS DD 2            1,208K

(SS=Single Sided; DS=Double Sided; SD=Single Density;
DD=Double Density)

The use of the two areas previously described is not
related. Even if the DIRectory command indicates a full
disk, a copy of the CDOS boot file may still be written
to the System Area using WRTSYS or CDOSGEN. The DIRectory 
intrinsic indicates only the user file portion
of the File Area which is occupied on the disk. This
has no bearing on the System Area.

Disk Specifications
This table shows the number of tracks per disk surface,
surfaces, sectors per track, and the sector size for
COOS disks. Numbers not within parentheses are decimal.
Numbers within parentheses are hexadecimal.

                              Sectors/     Sector
Disk      Cylinders Surfaces  Track        Size 
--------- --------  -------   ------      -------
8"SD      77(0-4CH)   2       26(1-lAH)  128 bytes
8"DD      77(0-4CH)   2       l6(1-10H)  512 bytes
5"SD      40(0-27H)   2       l8(1-12H)  128 bytes
5"DD      40(0-27H)   2       10(1-0AH)  512 bytes

The first track (cylinder 0, side 0) of all floppy
diskettes is initialized as single density with l28-byte
sectors by the INIT program to allow the disk to be
booted with 64FDC, l6FDC and 4FDC versions of RDOS

Disk Type Specifiers
COOS determines what type of disk is being used from a
special disk type specifier stored in the first sector
of the disk (sector 1, cylinder 0, side 0 of floppy
disks and sector 0, cylinder 0, surface 0 of hard
disks) • The disk type specifier consists of bytes 121
through 128 of this sector. The specifier is composed
of four groups of two bytes each which contain the ASCII

values of the characters listed in the following table.

Bytes     Characters Meaning
-----     ---------- -------
121 - 122 LG         CDOS large floppy
          SM         CDOS small floppy
          HD         CDOS hard disk
123 - 124 SS         single sided floppy
          DS         double sided floppy
          11         ll-Mbyte hard disk
125 - 126 SD         single density

          DD         double density
127 - 128 ST         single tracking (never implemented)
          DT         double tracking (never implemented)

The System Area of the disk includes all or part of the
first 1, 2, or 3 tracks of the disk, depending on the
disk type. The space reserved the System Area is always
at least 6.5K. On double density floppy disks, part of
the system area may be stored on a single density track
(cylinder 0, side 0) and part on a double density track
(cylinder 0, track 1).

The File Area starts at the beginning of the track
following the system area. (CDOS accesses disks by
alternating sides or surfaces as it works its way into
the disk by increasing cylinder numbers, so the next
track may be a different surface of the same cylinder.)
The directory always begins at the beginning of the file
area (i.e., the first lK of directory space is always on
the first track of the file area), but other parts of
the directory may be elsewhere on the disk. 

This information is summarized for each of the various types
of CDOS disks in the following table.

Disk Type System Area          Start of File Area 
--------- -----------          ------------------
LG SS SD  c0,s0; cl,s0          c2,s0
LG SS DD  c0,s0; cl,s0          c2,s0
LG DD SD  c0,s0; c0,s1          cl,s0
LG DD DD  c0,s0; c0,s1          cl,s0
SM SS SD  c0,s0; cl,s0; c2,s0   c3,s0
SM SS DD  c0,s0; cl,s0          c2,s0
SM DD SD  c0,s0; c0,s1, cl,s0   cl,s1
SM DD DD  c0,s0; c0,s1          cl,s0
HD 11     c0,s0                 c0,s1

SUDS 11.10 says:
The hidden sectors are the last two sectors on the first
track of the diskette. These sectors are left over from
composing sectors into blocks at four sectors per block.
They are not used to compose any block, so have not been
previously accessible. The hidden sectors on a floppy
diskette can-now be read by seeking to byte OFFFFFEOOh. On
large floppies, they are. the 25th and 26th sectors. On small
floppies, they are the 17th and 18th sectors.

Many early generations of 1980's computer used FM and later MFM formatted diskettes.  They typically used a special label on track 0, side 0 to indicate how the rest of the diskette was laid out.

IBM never had to deal with FM diskettes and made no allowances for the existing design of the day making such difficult difficult to read then, and now some 20 plus years later almost impossible.

Techy Notes
Marcus's catalog file notes down these specific Cromemco formats

SD means Single Density,  FM encoding
DD means Double Density,  MFM encoding

CSDSSDST 40 tracks, 300RPM, double sided, Track 0.side0 = 18 sectors x 128 bytes 250K SD, all other tracks 5 sectors per track x 512 bytes
CSDSDDST    40 tracks, 300RPM, double sided, Track 0.side0 = 18 sectors x 128 bytes 250K SD, all other tracks 250K DD, 10 sectors per track x 512 bytes 

USDSDDST 40 tracks, 300RPM, double sided, 9 sectors per track, 512 bytes per sector,  250K DD thoughout
IBM 360K    40 tracks, 300RPM, double sided, 9 sectors per track, 512 bytes per sector,  250K DD thoughout
IBM 320K    40 tracks, 300RPM, double sided, 8 sectors per track, 512 bytes per sector,  250K DD thoughout

SMDSDDST 40 tracks, 300RPM, double sided. Track 0.side0 = 18 sectors x 128 bytes 250K SD, all other tracks 10 sectors per track x 512 bytes   250Kbps MFM
SMSSSDST    40 tracks, 300RPM,  single sided, 18 sectors per track x 512 bytes per sector  250K SD
CLDSDDST    77 tracks, 360RPM, double sided, Track0.side0 = 26 sectors x 128 bytes 500K SD, all other tracks 16 sectors per track x 512 bytes  500K DD
00.00 26 x 128  500K SD  FM
00.01 16 x 512  500K DD  MFM
01.00 -> 76.01  16 x 512 500K DD  MFM

LGSSSDST    77 tracks, 360RPM, single sided, single density, 8" floppy,  26 sectors x 128 bytes 500K SD aka IBM 3740 format

ULDSDDST 77 tracks, 360RPM, double sided. 15 sectors per track x 512 bytes per sector

LGDSDDST    77 tracks, 360RPM, double sided, Track0.side0 = 26 sectors x 128 bytes 500K SD, all other tracks 16 sectors per track x 512 bytes 500K DD

Thursday, March 27, 2014

Do you have a Plan

Sheldon:Planning the Road Trip

A now frequently asked question of people meeting Marcus, now that he is /between/ jobs is

Do you have a Plan.

A Work Plan
A Life Plan
In general a Plan?

The first trivial and unhelpful answer can be gleaned from the 17 Jack Reacher novels that I have finished reading

Hope for the best, plan for the Worst

But this seems to be an unsatisfactory response to some people.  So let me try again.

Early in the morning Agata and Marcus get up.  How early varies.  Today, our exercise class in the park meant 05.45.

Before leaving the dishwasher is started and Swiffy is sent working

Run to the lake and participate in hearty exercise.

Afterwards run or cycle back up to North Lausanne taking care to feed the cats and pickup the post.

On entering the Apartment the main Computer Server is started.  Checking those Terabytes of Memory takes much time to startup .....  Start NAS (Network Attached Storage) and Scanner.

As they are starting dump all exercised and other clothes into washing machine, program the 93 minute cycle.

Get to server and Logon,  automatic synchronisation starts, cloud sync starts, move on....

Head to shower and whilst getting clean contemplate the top 8 work items for the day (any more I cannot remember).

Exit shower and write down work items.  Head towards lounge. Until completed: feed scanner each time you walk it with post items, items get propagated via automatic FTP (File Transfer Program) to NAS and eventually to server and cloud.  
Arrive lounge, start Lounge Video Interface and tune into BBC News or CNBC/ CNN.   Whilst listening to world News and Financial make a healthy breakfast.

Post breakfast start Working.

So given this level of Organisation, Concurrency, Integration, can you imagine that I would not have a plan?

Wednesday, March 26, 2014

Running Z80 Programs under Cromix 172 XXU

The last, fastest processor cards that Cromemco made (before selling their company to Dynatech Computer Systems)  was based on the Motorola 68020.

Unfortunately, except for a few bespoke applications, such as the ones written by the American Military, ColorGraphics or other Vertical markets, barely any consumer grade applications existed.

Now if only there was a way to run any of the hundreds of Z80 based CPM and CDOS operating systems applications .... And yes there is:

Pre Requisites
This is a procedure that will enable you to run Z80 programs on a Cromemco system with a 68020 processor.  You will need

a) some patience
b) a way to edit files
c) An Octart Communications Processor Card
d) A spare slot in your S100 card chassis
e) An interrupt cable to link in the Octart

Editing Programs

Initially there was no working screen editor so I had to transfer all files to a PC and back.  A non trivial process although cscopy did rather save the day.

Eventually I was able to transfer a working termcap (terminal capabilities file) to match the behaviour of putty.  putty is famous in the UNIX community as an xterm character emulator.  But it can also talk over a serial cable.  

I had to relearn the fact that putty is basically operating as a DEC VT52 terminal,  well, for serial communications anyway

in /etc/termcaps

v5|xter|Dec vt52 and putty and xterm:\
:cm=\EY%+ %+ :\


After the fact this is the magical entry that you can type into /etc/termcaps and then use the term keyboard command to immediately change your running terminal type

term xter

And now the ce screen editor will work again.  Phew!   I think this step (including debugging the output sent from CE and analysing the key sequences) took longer than the rest of the procedure ...

01 Build a new Operating System /cromix.sys and Test it
So Cromemco enabled a way to run older Z80 based Cromix or Z80 CPM programs.

Edit the /gen/sysdef file and include the zio device driver thus

d /gen
ce sysdef    # make the edit shown in the next line
zio 1

crogen 20140325cromix sysdef
boot  /gen/20140325cromix.sys

% Block devices:

BDEV    01      cflop                   % Cromemco floppy driver
BDEV    02      uflop                   % Suggested uflop
BDEV    03      allmem                  % Amem driver (required)
BDEV    04                              % Suggested tflop 0
BDEV    05      ramdsk                  % Suggested ramdsk
BDEV    06      stdc 1                  % STDC driver
BDEV    07                              % Removable part of SMD 0
BDEV    08                              % Not used
BDEV    09      zio 1                   % Suggested zio
BDEV    10                              % Not used
BDEV    11                              % ESDI driver

BDEV    12                              % Not used

zio     Supports Z80 programs running in BIART, OCTART, or IOPX, one per
board. Ensure that the boards will have the code downloaded
(See iostartup.cmd). Arguments are IO processor numbers
(1 through 8) which have the zio.iop code downloaded.

IO processor  Base address
     1         0xce
     2         0xbe
     3         0xae
     4         0x9e
     5         0xd6
     6         0xd8
     7         0xda
     8         0xdc

02 Setup Octart Card 

The Octart is actually an 8 port serial interface card.   Each of the 2 headers at the top of the card goes to a special fanout cable with 4 DB25 serial connections.

The Octart contains its own Z80A Processor and 64KB memory as well as the Zilog dedicated Serial Input Output interface chips.

Therefore  if you don't need the extra serial terminals then Cromemco provides a way to instead the Octarts as a satellite processor.

The main processor talks thru the /dev/zio<n> interface
03 Dip Switches

For my Octart card I set it to a base address of 0xCE checked via  the manual

04 Put Card in and Make sure Interrupt cable set

05 Check IO startup files

system[94] ls -l *startup.cmd
      2,083    1   rewa r--- r--- bin         Mar-22 20:40  iostartup.cmd

        189    1   rewa r--- r--- bin         Dec-02  1997  startup.cmd

/etc/ioload -r /etc/zio.iop io1
This is the line that you would need to include in the iostartup.cmd file which is run automatically on boot.

i01 correlates with the first Octart matching the previously shown dip switch settings.

If you made any change here I would reboot again.

utility:      IOLOAD
purpose:      This program loads a program into an I/O board

user access:  privileged user

summary:      ioload [-r] filename device

arguments:    filename of program to be loaded

              I/O device name (io1 .. io4 oc1 .. oc8)

options:      -r   Reset the board before loading


The Ioload utility loads a file into an I/O board (IOP, Octart, or Biart).
This utility is normally used to load the IOP driver /etc/quadart.iop,
/etc/tape8.iop, or /etc/tape16.iop into an IOP, the Octart driver
/etc/octart.iop into an Octart, or the driver for Z80 programs /etc/zio.iop
into a Biart or Octart. Ioload.bin is located in the /etc directory.


Device Definitions

system[97] ls -l /dev/z*
      9:0   B  2   rewa -e-- -e-- bin         Jan-19  1990  /dev/zio1

Directory: /dev/z80
      9:0   B  2   rewa -e-- -e-- bin         Jan-19  1990  zio1
      9:1   B  1   rewa -e-- -e-- bin         Jan-19  1990  zio2
      9:2   B  1   rewa -e-- -e-- bin         Jan-19  1990  zio3
      9:3   B  1   rewa -e-- -e-- bin         Jan-19  1990  zio4

06 Place some Z80 programs

Directory: /usr/bin
     26,112    1   rewa rewa rewa system      Oct-26  1985
     56,330    1   rewa rewa rewa system      Oct-26  1985  sbasic68.bin
      9,984    1   rewa rewa rewa system      Oct-26  1985

Don't forget to change permissions. (Say for example you used cscopy to read in the files).  Without it you will get this kind of error

system[101] /usr/bin/
Error during loading of the program
File not accessible: "/usr/bin/"

# correct with 

access rwa.rwa.rwa /usr/bin/

07 Running Structured Basic
As a small example I chose to run a trivial Basic program using the 32K Structured BASIC interpreter.

system[104] sbasic

Cromemco Structured Basic version 03.66
Copyright 1977, 1982 by Cromemco, Inc.


   20   Integer Counter
   30   Counter=10
   40     While Counter>0
   50     Print"hello cruel world ";Counter
   60     Counter=Counter-1
   70     Endwhile

hello cruel world 10
hello cruel world 9
hello cruel world 8
hello cruel world 7
hello cruel world 6
hello cruel world 5
hello cruel world 4
hello cruel world 3
hello cruel world 2
hello cruel world 1


Configuring Putty
Termcap Format

Github Termcap Xterm information