


Manual procedure to get Flex from a CPU09CMI Flex for floppy drives started with FlexNet. 


- mount FLEXCMI.DSDD80-5.IMA
- upload bootRoutine2.s19
- ^P: 1000, G  (run boot routine)
  This loads the loader code from disk with the start track/sector: 01/18
- upload flexLoader.s19
- patch start track en sector op $C105/$C106 (M: c105)
- ^P: C100, G (run the Flex loader)
  This loads the flex core at $C000-DFFF
- upload flexDriverCode.s19
  This patches the disk driver at $DE00-DFFF
- ^P: CD00, G (cold start Flex)
  This results in a date prompt and the '+++'

Now find a procedure to write the complete core back to the image :-)


How the uploaded programs were created/derived.

Most of the code is copied/derived from the "6809 FLEX Adaption Guide.pdf". The
"TSC-Advanced-Flex-Programmers-Guide.pdf" provided some crucial information.
The FlexNet documentation also has a sample driver code, but is for both physical 
floppy and serial floppy interfaces more complicated.

The examples in the Adaptation Guide for the boot routine, loader and driver code 
each have their own subroutines. I would prefer to use the same code base for all,
but the boot code is limited by spare monitor ROM space and the loader should fit 
in one (or two) sectors. This resulted in slimmed down versions of drivers.

The main thing to create and test are routines for reading and writing sectors from
disk. Writing these resulted in the testProg6 and testProg7 programs. testProg6 
does both reading and writing (good for scratch disk images) and testProg7 does just
reading (for disk images you want to use later). Both the console driver and the 
disk driver are included as separate .asm files. The console driver is not needed
when the system disk already is for the CPUXXXCMI/sbug configuration.
The testProg7.s19 is the source for the flexDriverCode.s19 data, it is the section
between $DE00 and $DFFF.

BootRoutine2 loads the boot sector which is the start of the Loader from disk 
and prints the disk address where the Flex system starts. 

The uploaded FlexLoader needs the proper address to load the Flex system into 
memory this has to be patched before running. After loading Flex in memory, the 
FlexLoader returns to the monitor prompt. This allows overwriting the disk driver
with the FlexNet code.

Now the Flex im memory can be started. The entry point is not $C100 as the 
Adaptation Guide suggests, but $CD00.

The final step would be to run PUTLDR, but it is not present on my system disk.

FlexNet can be found at https://github.com/linuxha/flexnet. It can be used to 
simulate a single disk, or a complete set of four disks. For this situation I
used the single disk mode. My command line:

flexnet -d /dev/ttyUSB1 -s 9600 -v ./FLEXCMI.DSDD80-5.IMA

The -v option is for verbose output.

fjkraan@electrickery.nl, 2026-09-05
