User:RHansen

From NDWiki
Jump to navigation Jump to search
Ronny
 
Real name: Ronny Hansen
Role: Developer, Architect, Geek
Interrested in: Everything between Embedded and Cloud
 

A long time ago, in another universe it seems, I was using SINTRAN on an ND-100 at our electronics/computer school. We configured and ran the machine after we inherited it.

These days I am a Cloud Architect, Developer and Geek - and the last years I have been spending an unhealthy amount of time writing emulators. You can read how this crazy journey started here [1]

ND-100 Emulator

I have successfully (with some help) created an ND-100 emulator in .NET/C# with peripherals such as TeleType, Serial Ports, Floppy and HardDrive.

The emulator contains a debugger, disassembler and code tracer in addition to logic to mount different floppy-image, read/write hardddrive, loading BPUN and PROG files directly into memory.

I have successfully dumped and booted SINTRAN versions H, K, L and M in ND-100 mode.

This YouTube video shows a boot of SINTRAN L in the emulator [2]


Booting SINTRAN H in the emulator

Possible disk choices to install SIII M on


SIII M ERROR
Results from PAGING:TEST

Core CPU and Instruction Set details I am working on

  • Validate CE (Commercial Extended) opcodes. They are confirmed working using "INSTRUCTION" test program, but it doesn't test all variants.
    • BCD
    • Stack (INIT, ENTR, LEAV, ELEAV) - for PLANC programs.
    • ND-110 Specific opcodes
      • Since the ND-110 emulator is now functional, I can analyze the missing opcodes and complete their implementation.
      • However, these are mostly performance extensions, so full implementation may not be necessary.
      • CX (Segment) opcodes are included in this group.

What's working in the ND-100 emulator

  • SINTRAN H boots and runs (with a minor hardcode in the emulator to fix ABSTR bug (?))
  • SINTRAN K,L and M boots and runs. XMSG starts in L and M
  • Test programs that validates the opcodes so far
    • ONE—CHECK, TWO—CHECK, THREE—CHECK
    • FOUR—CHECK (a few bugs still)
    • INSTRUCTION-B.BPUN (PROGRAM NUMBER: 204384B DATE ISSUED  : 83.11.01)
    • PAGING-B.BPUN (PROGRAM NUMBER: 203098B 1982)
    • FLOPPY-FU-1986F (All tests work except Test 2 "Format Decoder Test" on my PIO floppy driver)
    • Test programs on floppy "210523E00-XX-01D"
      • INSTRUCTION - Version: C00 - 1986-10-30
        • "48 BITS FLOATING INSTRUCTIONS" - not working as I am only emulating 32 bits FPU
      • PAGING - Version: C00 - 1986-10-16
        • All tests report success in MMS-1 and MMS-2 mode.
INSTRUCTIONS FPP test
CONFIGURATION test tool

What's NOT working in the ND-100 emulator

  • Bug found!!!! SINTRAN K,L and M triggers a "Memory protection" after a "Page-not-in-memory". This happens to just one specific page, so at the moment "Memory protection" is disabled while I am trying to identify the reason.
    • Found the bug after 18 months debugging, and many hundred-thousands of log-lines read... It was related to reading Indirect Data in memory with READ_FETCH properties, and the indirect data was on a page that was "NOT IN MEMORY" (ie it had to be paged in to be able to be read).
    • This bug also fixed
      • MON 131 ABSTR behaves "buggy" in SINTRAN H
      • Something odd happens with zero-pointers for some logical devices sending the CPU into a loop at P=0
  • Copying file from papertape driver to SINTRAN H disk with "COPY 'FILE:BPUN' PT1' fails after 129 bytes. It just stops, and I have to cancel the copy with ESC key.

ND-100 Running in the browser

    • Working on making the emulator(s) working in the browser by compiling C# to WebAssembly
    • CPU is running nicely, working on giving access to IO devices
    • You can test by going to (https://retrocore.hackercorp.no/ https://retrocore.hackercorp.no/) and selecting machine=ND100 then powering on the Emulator.
    • Feedback, comments, and help is much appreciated
      • I am able to mount HDD for code running in the browser, but booting and running SINTRAN is painfully slow. So maybe not so good idea to do that..
Compiling the C based nd100x emulator to WebAssembly was a better solution - see below

ND-100x Emulator

ND-100/CX Emulator written in C and its based on the nd100em emulator version 0.2.4 https://github.com/tingox/nd100em

  • All test programs validate the CPU, Memory Management and Devices.
  • Missing some opcodes around BCD
  • Boots SINTRAN L from SMD in 6-7 seconds on my machine.

This project includes significant enhancements:

  • Opcode Improvements
    • Added support for missing opcodes
    • Fixed bugs in several instructions
  • Memory Management
    • Fully re-implemented with support for MMS1 and MMS2
    • Proper TRAP generation for Page Faults and Access Violations
  • IO Subsystem
    • Complete rewrite: now single-threaded and simplified
    • Old IO code has been removed
  • Supported IO Devices
    • Real-Time Clock (20ms tick emulation pending for full SINTRAN compatibility)
    • Console
    • Floppy (PIO and DMA) for 8" and 5.25" formats
    • SMD Hard Disk (75MB; multi-drive support in progress)
  • Planned IO devices
    • Serial ports
    • HDLC
    • SCSI
    • ND500 Bus Interface
  • Codebase Modernization
  • Tested on multiple host systems

Source code in GitHub: https://github.com/HackerCorpLabs/nd100x

Run the emulator in your browser: https://nd100x.hackercorp.no/

   Boots SINTRAN in 1-2 minutes in the browser on my machine

I am looking for the following

  • COSMOS software: Ethernet drivers, TCP drivers, TELNET, FTP, NFS, X.21, X.25
  • SINTRAN N (the newest version of SINTRAN) and patch files for Y2K.
  • All SINTRAN III versions are of interest. And PATCH files!
  • Other binary images (Tape, PaperTape, HDD, Floppy,+++)
  • Source Code. Any source code. Especially test programs and IO drivers.

Things I am working on

Controllers and Peripherals

HDLC / MEGALINK

  • Goal: Simulate serial communication over TCP to interconnect emulated ND machines via **COSMOS**.
  • I/O interface implementation is finished.
  • The **SMC COM5025** HDLC controller is partially functional — refinement continues using the *HDLC test program*.
  • First working HDLC-over-TCP demo (still with some bugs):
 YouTube Demo
  • Looking for SINTRAN COMSOS network software (especially Ethernet and TCP/IP).
 This software has not been found on any known floppy images.  


Ethernet

  • The **Ethernet II** controller includes:
    • An onboard **Motorola 68000 CPU**
    • A **LANCE** Ethernet controller
  • Work in progress to emulate both chips and their shared-memory communication with the ND-100 host.
  • The controller has **no EPROM** — its firmware is loaded from ND-100 into shared memory, and the 68K CPU is restarted after load.
  • Reverse engineering of captured firmware is ongoing using Ghidra
  • Work is in progress to emulate the chips and map the devices together.

SCSI Controller

  • I/O interface implementation complete.
  • Fully implemented **NCR 5386** SCSI controller.
  • Emulated SCSI bus and generic HDD complete.
  • Collected documentation and had AI help to analyse SINTRAN source code and reference manuals -
  • Successfully emulated **Micropolis 1375 (135 MB)** SCSI hard drive:
  • Remaining issue:
    • SINTRAN boot / “ENTER-DIRECTORY”** for DISC-SCSI-1 fails with "APPROACHING END OF ACCOUNTING FILE"
  • Goal: Enable ND-100 to boot directly from real SCSI-drive images.
  • IRQ handling has been improved, allowing SINTRAN K to boot successfully from a Micropolis image, though it ends with the message "APPROACHING END OF ACCOUNTING FILE"
APPROACHING END OF ACCOUNTING FILE

DIRECTORY NOT ENTERED

BATCH NUMBER =      1
INPUT FILE ERROR:
NO MAIN DIRECTORY

20.29.11      2 NOVEMBER   1997
SINTRAN III - VSX/500 K
STANDARD CONFIGURATION:    D
GENERATION (WORK MODE NO.):    500B
REVISION (PATCH FILE NO.):   10200B
CPU TYPE:     9883
CPU NUMBER:  21238
GENERATED:   12.11.00      8 JUNE   1988
SINTRAN III RUNNING -

PAGES FOR SWAPPING:   3336B

NO SCRATCH FILE 20.29.28      2 NOVEMBER   1997
--EXIT--
  • I try to press ESC to login, but get "NO SCRATCH FILE 20.29.28 2 NOVEMBER 1997" every time.
  • Booting from SMD drive and trying to enter directory
@enter-dir
DIRECTORY NAME:
DEVICE NAME: disc-scsi-1
DEVICE UNIT: 0

APPROACHING END OF ACCOUNTING FILE
  • And no drive is entered


ND-500 Controller

ND-500 Emulator

I am in the process of implementing a ND-500 cpu emulator that has these features

  • ND-500 instruction set (fetch-decode-execute)
  • MMU (complete MMU with Domains and Segments)
  • Dissassembler and debugger
  • Loader with aout, PSEG/DSEG and the more modern DOM format

I also have the PCC-500 C compiler with

  • C compiler
  • Assembler (ported from NDIX-C)
  • Linker (ported from NDIX-C)
  • Generates a.out format and can be converted to PSEG and DSEG files.

I hope I will be able to integrate this into ND-100 with emulating the bus unterfaces


	    ND-100 Side                   ND-500 Side
		├─ 3022 Bus Interface     ←→  5015 Control Board
		├─ Multiport Memory (5MPM)←→  Direct Memory Access
		├─ SINTRAN Monitor        ←→  ND-500 Microcode
		└─ Message Buffers        ←→  Process Descriptors


Can be tested here: https://nd500x.hackercorp.no/ (At the moment all instructions are NOP)

Open Source

  • When I have a stable working version, I am planning to put the source code on GitHub under a BSD License. Then everyone can look at the code, modify it or just run it.
  • I have been playing with the idea on porting my C# code to C - when its stable. And integrate it in the SIMH projects [3]. For this I may need help :)
    • I just found out that there exists and ND-100 emulator in OPEN-SIMH written in C by "Ragge". It is not 100% complete, lacking some opcodes, complete MMU and some devices - so you cannot boot Sintran (yet..) - https://github.com/open-simh/simh/tree/master/ND100

ND-110 MicroCode Emulator

MicroCode with syntax highlighting
  • ND-110 MicroCode CPU
    • Creating a new CPU emulator at the MicroCode level to teach me more about the internals of the opcodes, but also to (hopefully) help me identify "features" in my ND-100 Emulator
      • Everything is written in C#/.NET7
      • MicroCode compiler works.
      • MicroCode retrieved from PDF document using OCR techniques mixed with some "text washing" gives me a file with 16600 lines of microcode I manually have validate against the PDF. After retriving a copy of a ROM for a ND-110 cpu board, I could compare the compiled result with the ROM and found 150+ errors in the source file. Now that is fixed, and the compiled microcode is identical to the ROM.
      • MicroCode CPU working. I have implemented registers, ALU (actually its 4x Am2901 chips) and interrupts (Am2914 chip)
      • Macro code execution work.
      • Interrupts and traps "somewhat" works. Still need improvement
      • Memory management is "copied" from ND-100 emulator, but needs to be re-written to match ND-110/ND-120 hw
      • This CPU is definitively slower than the ND-100 emulator, but hopefully behave 100% like the original. This way I can verify behavior differences between the ND-100 opcodes and the ND-110 opcodes.
      • If you want to test the emulator/debugger, its available at https://nd110.hackercorp.no/
  • ND-120 MicroCode CPU
    • Extended the ND-110 MicroCode CPU to work with ND-120 microcode.
      • Microcode almost identical, there are a few bits that has been negated and needs to be handled when reading the PROM
      • Different UART than ND-100 and ND-110, so support for this has been implemented
      • OpCom works, so I can communicate via console.
      • There are other differences, I am guessing in the interrupt subsystem. Consequence is that I cant start programs like INSTRUCTION verify, it just hangs.

ND-120 in an FPGA

Debugging Verilog version of ND-120 using GTKWave
  • Recreating the ND-120 CPU emulator at hardware level using the original design documents from 1988
    • Draw the digital logic using Logisim Evolution.
      • Finished : CGA (CPU Gate Array)
      • Finished : DGA (Decoder Gate Array)
      • Finished : CPU BOARD PCB 3202D.
      • Bugs fixed in Verilog code is backported to the Logisim drawings to make them as accurate and bugfree as possible.
    • Verilog
      • Convert the schematics to Verilog (Built in functionality in Logisim).
      • Finished : CGA (CPU Gate Array). Verilator test code generated, more automatic testcases needed.
      • Finished : DGA (Decoder Gate Array). Verilator test code generated, more automatic testcases needed.
      • Finished : CPU BOARD PCB 3202D. Verilator test code generated, more automatic testcases needed.
      • Creating special chips in Verilog
        • Finished : PAL Chips- Converting all PALASM sourcecode to Verilog
        • Working in Verilator: RAM and UART (Needs to be extended to work in real FPGA hardware)
      • Microcode ROM
        • Using microcode dumped from EPROM from a real ND-120 CPU (Might need a refactor to work with FPGA hardware(
    • Testing
      • Using Verilator to test the complete design
        • One test project to capure signal data for debugging in GTKWave
        • Another test project to run the CPU and communicate with OPCOM over serial port.
      • Many bugs has been fixed and more needs fixing
    • Summary
      • Communicating with OPCOM works, many opcodes work - but there are more bugs to fix
      • Development is done in the open, check out https://github.com/RonnyA/nd-120
      • Help is much appreciated as I am new to Verilog and FPGA programming
      • When the complete CPU PCB (with CGA and DGA) is finished in Verilog, with serial port access to OPCOM the next step is to implement support for IO devices like floppy and harddrive.

Modern ND Assembly programming using Visual Studio Code

"Hello world" being debugged in VS Code
  • Created plugin for Visual Studio Code
    • Have lot of functionality like Syntax highlighting, Hover information for instructions and registers, Code completion
    • Uses Microsoft Debug Adapter Protocol (DAP) to talk the the DAP Server implemented and integrated into ND100x
    • Uses Ragge's ND-100 assembler to assemble the code and create binary file with symbols
    • YouTube video showing VS Code with the plugin debugging "Hello World"

ND Library

  • ND Library - Online digital archive for Norsk Data floppies and documentation
    • Collection Size: Over 600 digitally preserved floppies as of July 2025
    • Search Functionality: Browse and search through archived floppy disks and technical documentation
    • Direct Downloads: Download floppy images directly for use in emulators or preservation
    • Future Plans:
      • Continue digitizing additional floppies to expand the archive
      • Implement direct "floppy mount" integration with popular emulators:
        • nd100x emulator
        • ND-100 emulator within RetroCore
      • Streamline installation of SINTRAN and other historical software
    • Access: Available at https://ndlib.hackercorp.no/

HDLC Gateway

HDLC Gateway Prototype
  • Microcontroller (RP2040 or RP2350) with RS-422 to TTL converters.
    • ND machine has a DB-25 connector pr HDLC card.
    • Connect a cable between this DB-25 connector and the HDLC gateway using cable 325402 (described in "Service handbook II", chapter 2-20 about HDLC to HDLC (Computer link) [4]
    • Software on the microcontroller receives and sends HDLC bit-stuffed frames over this cable
    • Software on the microcontroller converts this to byte-stuffed HDLC frames and send/receive over USB cable.
      • Later it will also be support for TCP/IP
    • The byte stuffed HDLC frames can be send to
      • The ND-100 emulator via the emulated "HDLC controller card"
      • To another microcontroller via TCP/IP to connect to another ND machine - to have point-to-point connection over Internet.

ND Controller card Emulator (NDModulE)

NDModulE Prototype
  • Controller card for HDD emulated in hardware using a RP2350 MicroController
    • Today you need an real working HDD or an MFM emulator with MFM controller card in an ND machine to boot.
      • I bought this MFM Emulator and worked with the person that made the device, and he was very helpful to extend the code it so the MFM emulator is now able to read and write ND Micropolis MFM disks.
    • If you have an SCSI controller you need a working SCSI HDD or an SCSI HDD emulator.
    • This project aims to solve this by emulating a real controller using FPGA, and having the "HDD DISK" as an image on a SD card.
    • Emulation of floppy controller is also planned.
    • This way we will be able to run test programs and boot ND hardware that doesn't have working disk/disk-controllers.
    • First prototype PCB has been created, but needs redesign because of multiple design errors.

TDV 2215 Emulator

TDV2215 booting with error
TDV2215 config page
  • Creating an emulator of the TDV2215 terminal.
    • Using the original schematics, an emulated 8085 CPU and ROM dumps from an original TDV.
    • The ROM code does some HW validation and fails with "ERROR NO.: qt" -There are multiple areas it can fail: Z80SIO UART emulation, Interrupt handling and memory mapping.
      • Error should have been shown as 13 not QT, there was a bug in the 8085 opcodes for BCD
    • Used Ghidra to reverse engineer the ROM code, but its hard to understand what the ROM code really tries to do, and why it fails.
    • Connected Claude AI to the Ghidra using an MCP bridge, and together that was powerful enough to dissasemble and decode most (if not all) of the assembly and I was able to find multiple errors in the Z80SIO implementation, signal mappings and FLASH memory implementation.
    • Emulator now boots, but there are still errors related to FLASH init/load/save and hange situation when data is recieved. Guessing interrupt handling in the emulated 8085 CPU.
    • Also, keyboard mapping of _all_ TDV keys not implemented yet.


  • Added TD2200 support directly in the emulators "graphic" mode
    • Decoding ESC sequences and sending ESQ sequences based on TDV manuals describing some of them. Adding in som VT100 emulation to make the rest work. Mapping special keys (arrow keys) to send ESC codes.
    • YouTube video showing TDV emulation running S3-CONF program under SINTRAN [5]

ND-110 Compact

I have beeen so lucky that I have gotten a real ND-110/CX Compact [6]

ND-100 Satellite

I recently inherited a ND-100 Satellite [7] that I am trying to get into working condition. The MFM HDD seems to be completely filled with bad sectors, so I am unsure if I can recover that - I will try to get it to boot from an MFM emulator


Sources