Close
0%
0%

6809/6309 Eurocard CPU System

A retrosystem based on the elegant 8/16 bit 6809 processor capable of running UniFLEX and OS9 level II multiuser/multitasking OS

Similar projects worth following
For those that would like to play with an nice 8-bit CPU from the late 1970's featuring a rich environment with memory management unit, DMA (memory-IO and memory-memory), Realtime Clock, IDE interface, CompactFlash and SD card interface. RAM disk, 4-port serial, video, ethernet.

Although some of the components used are no longer manufactured there seems to be plenty of 'old new stock' available through the various marketplaces online.

The system design philosophy was to create an eurocard based system with DIN41612 connectors which was very popular in the 1980s in Europe to create systems. Commercial systems at the time where Gespac, PEP Modular Computers, EuroCUBE Celeste and Eltec. The Elektor magazine also published an Eurocard system running FLEX (EC68). There were also many systems developed by hobbyists and I got inspired by the nice UniFLEX system developed by Kees Schoenmakers (https://github.com/kees1948/UniFLEX).

I focused on using only 5V logic but avoided the usual forest of TTL chips and a PAL/GAL solution for the glue logic. Instead I used two 5V CPLD devices which are fast, cheap and can hold a lot of logic allowing one to add some nice features to the system such as fast memory to memory DMA but also esoteric ones like a hardware CRC calculation of OS9 modules. In the File Section I have placed Python code that highlights how to create the CRC calculation in hardware.  I used it during testing of the Verilog code. With in-circuit (re)programming system development & testing is quick without having to remove devices from the PCB.

Source code for both UniFLEX and OS9 level II is available, something we could only dream about having in the 1980s since both hardware and software were rather expensive. Full details will be made available through my Codeberg GIT.

The system closely matches the CMS9639 from the 1980s which was similar to the GIMIX III board. Thanks to the SARDIS technology website (https://sardis-technologies.com/oth6809/cms.htm) there is a lot of information on these nice systems.

The addition of a dedicated ethernet interface offers opportunities not available in the 1980s.

The CPU board is the heart of the system and combines CPU with 1Mbyte memory, (EP)(EE)ROM, console port, ethernet, MMU. Thanks to a EPF10k20 CPLD which is positioned between the CPU and the rest of the system many functions can be integrated. For example, the MMU can hold 128 tasks simultaneous and each task will have the full 64k address space. Tasks are autoswitching and the dual channel DMA controller addresses memory through dedicated tasks. The detailed MMU maps are kept in a 2kbyte dual-port RAM memory which is also on the CPU board. Block (page) size chosen is 4kbyte. To have the full 64kbyte for each task requires automatic switching of tasks on interrupts and returning from interrupts. The dedicated Motorola MMU (MC6829) uses a fuse register to switch tasks. Using the 6809E we can easily work out when the first byte of an opcode is present on the database and by looking for the opcode for RTI, we know when to switch when returning to a user task. Switching to a system task is easier since one can detect the occurrence of an interrupt by encoding the CPU BA & BS signals.

For a working system, however, the addition of the IDE board is advised as it allows connecting 2 SD cards, CF cards and upto 4 hard disks. All transactions can be done through either software IO or DMA. Since the 6809 is HALTed during the DMA operation (burst DMA) we can conduct transfers much faster than the 1 or 2MHz of the 6809 clocks (during DMA the E and Q clock continue as normal). The DMA controller uses a 16MHz clock (8Mbytes/s) such as to not exceed the speed of the CF cards that I have.  The above shown logic analyser traces show the onset of a DMA read of a IDE device. 

Extra serial ports are added through inclusion of a 4-port 6850 board that provides integrated serial to USB C converters with an option for mini USB.

No retro system is complete without a RAM disk and this system has one that is upto 4Mbytes large using a very small 4-byte memory interface  using high-speed DMA transfers or programmed IO.

A video board with VGA output and USB keyboard & mouse is also available which...

Read more »

myBoot_PIO.asm

Source code for Boot module, which resides together with OS9p1, in EPROM. This module loads the OS9boot file from disk. Note that I have assumed the use of a 6309 CPU which has the TFM instruction for moving data fast. I should really change this to have optional compilation with a 6809/6309 flag ...

plain - 5.29 kB - 03/26/2026 at 11:15

Download

myIDEdrv.asm

OS-9 RBF device driver for IDE disks

plain - 6.15 kB - 03/26/2026 at 10:49

Download

interleave.py

Code to convert .vhd virtual hard disk file from 256byte sectors to 512byte sectors ready for use with IDEdrv disk driver for OS9

x-python - 755.00 bytes - 03/24/2026 at 14:41

Download

CS09-CPU-III-v2.kicad_pro.zip

JLCPCB production files for CS09_CPU_III_v2

x-zip-compressed - 1.49 MB - 03/13/2026 at 15:16

Download

crc24_new.py

Python command line programme to calculate OS9 CRC used to test the non-shift register approach that suits verilog implementation. Normally it is done in 6809 assembly which is relatively slow.

x-python-script - 2.29 kB - 03/13/2026 at 11:26

Download

View all 8 files

  • Floppy disk controllers

    roelof420 hours ago 0 comments

    During the 1980's the Western Digital floppy controllers were abundant. Starting with the 179x series and 279x ones after that. There were also more compact solutions like the 177x series which were popular due to the low supporting chip count. Like many I used all of these and learned to live with them. Especially the requirement to not poll their status too quickly was a nuisance. 

    With that in mind I made two different designs of the IDE interface. One with a WD2793 and one with a newer WD37C65 device. The latter one is a NEC uP765 like interface plus some extra support so that it is a one chip solution. Both should allow reading of both 8" and 5.25" disks but the WD37C65 goes further (3" extra density) so an interesting option to explore. A 3D KiCAD representation of the WD37C65 version is uploaded to the picture gallery.

    I have an old Siemens 8" drive which is well preserved and some original TSC FLEX OS 8" floppies (!) and it will be fun to see if I can read these eventually.

    OS-9 drivers for the WD279x are around and should be easy to adapt. However, for a multi-tasking system these can be a drag since byte don't come out as a stream of bytes that can be transferred as a burst DMA. Instead people have used 'cycle stealing' DMA something which requires some overhead in managing.

    So during design time I thought of a way to buffer the bytes from/to floppy drives sector by sector. Hence by keeping a 256-byte buffer between the CPU and the floppy drive, the sequence of writing/reading to/from floppy drives becomes much like interfacing to IDE disks and we can employ burst DMA transfer of data.

    There is still the issue of how to deal with disk formatting which requires more than 256-bytes but it should be simple to create a bypass to the sector buffer and handle these the 'old way'.

  • OS-9 DMA disk driver details

    roelof42 days ago 0 comments

    As mentioned I use an IDE (PATA) type interface to connect to storage devices like hard disks or Compact Flash cards. There are several adapters for CompactFlash cards that plug into IDE connectors to make that easy.

    Currently the Boot loader module that resides in EPROM reads the disk using Programmed Input/Ouput or in other words data is transferred not using DMA but simply by programmatically reading byte for byte. This allows the code to be very compact and since that is the only task running has little downside.

    The IDEdrv RBF driver is using DMA to quickly load sectors of data to memory. Since we are using burst DMA (during which the processor is HALTed) no other task is running. However, there is a significant delay between issuing a read sector by DMA command and the onset of the DMA transfer. The delay depends on the drive used. For the CompactFlash card that I use (Scandisk Ultra II) this delay is 0.28ms much longer than the actual DMA transfer of 256bytes (which is several tens of microseconds). Currently the driver simply polls the DataReady bit during these 0.28ms then the CPU is HALTed once data is ready. So no interrupts are involved at this stage.

    It would be better to issue the read sector command go to sleep so other tasks can run and use an interrupt when done. But it is a bit more complicated than that. Because the DMA controller needs to be setup before the transfer we can't do this at the time of issuing the read sector command. That is because the same DMA controller is used for other tasks (such as moving data between tasks by OS-9 system calls). So one would have to issue the sector read command without setting up the DMA registers, go to sleep and wake up when data is ready as signalled by the IDE disk. Then load the DMA registers and acknowledge the DMA transfer. That way there is no clash between DMA users and other tasks can use the 0.28ms of waiting for data from the disk for useful operations.

    Although IDE devices have a dedicated Interrupt request line, this line is toggled only at the end of the DMA transfer which is not what we want because the driver will release the CPU directly after the DMA transfer. In our case we would like an interrupt signal directly before the IDE disk is ready to do the DMA transfer so we can quickly upload the DMA registers and allow the transfer to happen. Plan is to use the DMA request signal to trigger the interrupt request and toggle the DMA acknowledge line to the IDE disk once the DMA registers are loaded and the DMA is armed. Just like the CPU board, the IDE interface is built around a complex logic circuit and details of signalling can be adjusted easily through changes in the verilog code.

    Details of putting read/write disk to sleep and how to wake them up are described in the OS-9 programmers manual (pages 6-15 and 6-16) and the interrupt service routine on page 6-19. I have revision H (January 1984) of the manual.

    I had a look around to see how legacy drivers handle this and unfortuately I haven't found many such disk drivers around. There is the GIMIX G68 driver but that is centred on doing 'cycle stealing' DMA as far as I can see. It does show how the Sleep and Busy and Wakeup signalling is done. It also introduces a system variable that indicates if the DMA device is 'in use' or 'free'.

    For those interested in the code I have attached the source code for the Boot module and the current IDEdrv RBF device driver (still working out how to setup the CodeBerg repository ...).

  • Development System

    roelof403/15/2026 at 19:19 0 comments

    During the development stage there is a requirement to convert 6809/6309 assembly into binary OS9 modules. Thankfully OS9 is well structured and the number of modules needing changes is relatively small. Apart from the bootloader and kernel modules there are also driver modules for serial ports and disks that need changing or writing from scratch. To do so I use the Virtual Color Computer (VCC) emulator on a Windows system (https://github.com/VCCE/VCC).  It is provided in both source form and binaries. It can also be run on Linux platforms.

    The emulator allows you to hook up 4 virtual floppy disks and 2 virtual hard disks. I've installed the NitrOS9 operating system which has lots of nice code with it including a modified assembler that will generate 6309 code. Just what I needed to create a set of adapted OS9 modules from existing source code.

    VCC works with disk files (.dsk) for floppy or (.vhd) for hard disks. Files can be extracted or inserted into these virtual disks by using Toolshed (https://github.com/nitros9project/toolshed). You can also create blank virtual disk files using this tool. Alternatively there is a  Windows tool called Floppymaintenance (http://flexusergroup.com/swtpc/Downloads.htm).

    If you are looking for a crosscompiler that can create OS9 modules from source then LWTOOLS is recommended (https://www.lwtools.ca/).

    Details of setting up  NitrOS9 can be found online (https://lcurtisboyle.com/nitros9/nitros9_docs.html). A quick online search will feature some guided youTube videos as well.

    In fact NitrOS9 is a further development of OS9 developed and maintained by the Color Computer community and has many upgrades. It would be a logical next step to adapt it.

  • Booting OS9 level 2

    roelof403/15/2026 at 18:53 0 comments

    Source code for the first part of the OS9 kernel (OS9p1) adapted for the CMS9639 is published on GitHUB (https://github.com/sorenroug/osnine-java/tree/master/os9software/cms9639). The binary file is available at https://www.sardis-technologies.com/oth6809/cms9639.htm.

    I took the binary file as is and removed the Boot loader part at the beginning of this file and added my own Boot module. (The CMS9639 Boot module is not well documented but seems to use a SCSI controller as a disk interface to a Winchester hard disk which I don't have). In order to manipulate binary files I use ImHex (https://imhex.werwolv.net/) which includes a 6809/6309 disassembler (amongst many).

    The CMS9639 part 1 code is different than the 'stock' OS9p1 code. This not only has to do with the details of the MMU but also because the CMS9639 has a nice way of capturing the postbyte which follows the SWI2 system calls. The postbyte indicates which system call is requested. Other systems have to capture this byte from user space and adjust the program counter so that upon return the location with the postbyte is skipped. The CMS9639 does this in hardware and makes the postbyte available in a dedicated memory location accessible only in the system state (see memory map on page 1 of the schematics).

    Secondly there are a few memory copy routines between tasks and since this has to work between tasks there is a significant overhead of switching. The CMS9639 removes the instructions for copying and uses the memory-to-memory functionality of the DMA controller with different tasks for source and destination.

    It seems I have implemented these hardware ideas correctly because I can see (with the use of a Agilent 16802A logic analyser) the system calling the Boot module which loads the so-called OS9boot file from disk (well CompactFlash in my case). Afterwards I can see the processor starts to execute the OS9p2 code which is the second part of the OS9 kernel. There is no dedicated CMS9639 version of OS9p2 so I have used a standard one at this stage (https://github.com/sorenroug/osnine-java/tree/master/os9software/dragon128).

    I do get an error upon changing directories to the default /H0 disk as indicated on the Init module which is loaded during Boot time. I suspect there is an issue with my bespoke disk driver module which has not been tested too well.

    OS9 is hard coded to use 256 byte sectors which is half of what IDE/PATA/CompactFlash filesystems have. I tried to be clever to put two 256-byte sectors into one 512 byte sector using a cache. For now I will just use one half of a 512 byte sector which makes things fast and simple.

    After updating the disk drive to use every other byte of a 512-byte sector and ironing out several bugs OS-9 booted on the system console as shown below. The hardest error to find was an indexed store of the B register which turned out to be unindexed (I forgot the 0,U) which corrupted the least significant byte of the D.POLL variable. As a consequence the system would go haywire after receiving interrupts ...

    Great to see this!

    In he Init file I have set 0x0FBFFF as the Top of RAM.

    There are no floppy disks specified yet, I still have to write the driver.

    The modules needed for booting are listed above and have standard names. Exception is IDEdrv which is the RBF type driver for the IDE board that was hooked up to a 512Mbyte ComplactFlash card.

    All these modules (minus the MDir one) are part of the OS9boot file that is loaded by the low level boot loader that together with OS9p1 resides in EPROM.

    For creating the boot disk I made a full system disk using VCC and used a small python programme to bulk up the 256byte OS9 sectors that make up the virtual hard disk file (.vhd) to 512-bytes simply by inserting a 00 byte every other byte in the disk effectively doubling the disk size. This programme code is attached for info.

    Virtual hard disk files are just binary files that contain sector data starting with Logical...

    Read more »

View all 4 project logs

  • 1
    PCB

    The provided zipped PCB file contains all Gerber files for production of the 4-layer PCB by JLCPCB. It was created within KiCAD with the JLCPCB toolkit extension.

    To get an idea of the costs you simply upload this zip file to the JLCPCB web site and it works out all the details needed from it. JLCPBC make it simple to order a solderpaste stencil from the same files, so all in one stop shopping.

    The uploaded version 2 has small changes from version 1 which I am using for testing. So I should add a note of caution:  I haven't tested PCB version 2 yet. Although the changes are small the probability of errors is not zero.

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates