Giter VIP home page Giter VIP logo

sorenroug / osnine-java Goto Github PK

View Code? Open in Web Editor NEW
19.0 6.0 8.0 27.27 MB

6809 and OS-9 emulator in Java

License: GNU General Public License v3.0

Java 15.77% Shell 0.03% Assembly 74.79% Makefile 0.04% C 5.83% Pascal 1.20% XSLT 0.26% CartoCSS 0.13% Dockerfile 0.01% TeX 0.04% COBOL 0.11% Roff 0.55% BASIC 0.74% Logos 0.36% RPC 0.14% C++ 0.01%
emulator uart nitros9 retrocomputing 6809 java os9

osnine-java's Introduction

Retrocomputing: A Java-based 6809 emulator

The purpose of this project is to create an 6809 emulator that can be configured at runtime with a range of memory mapped devices. You can allocate RAM, load data into the memory and set up devices.

Emulators

The original emulator is v6809. It uses a Java properties file for the configuration. Several examples are provided. The most interesting is the genericos9. It is a graphics application that runs OS-9 Level 1 in multi-user mode with two terminals, two disk drives and a printer. The other called mo5 emulates a Thomson MO-5 with a cassette tape device.

Devices

  • Acia6551 emulates a Roswell 6551 UART.
  • Acia6850 emulates a Motorola 6850 UART.
  • Both Acias can be configured with 3 different user interfaces: AciaConsoleUI writes to Java's System.out and reads from System.in. AciaGraphicalUI uses Java Swing to create a simple terminal and AciaTelnetUI opens a socket on port 2323, which the user can telnet to.
  • IRQBeat sends an IRQ interrupt every 20 milliseconds to the CPU.
  • HWClock makes it possible to get the date and time from the host of the emulator.
  • VirtualDisk interfaces a DSK image to the emulator as a floppy or harddisk.
  • PIA6821 emulates a Motorola 6821 Peripheral Interface Adapter

Because of their modularity, the Microware OS-9 or NitroOS9 operating systems can easily be configured to take advantage of these devices. Each device has a corresponding OS-9 device driver.

The MC6809 was an 8-bit CPU with some 16-bit features from Motorola introduced in the late 70-ies. OS-9 was sold as a business operating system that enabled word processing, spreadsheets and various programming languages. By today's standards it is obsolete. It only handles 7 bit ASCII and it is not year 2000 aware.

Image of terminal

Build instructions

This project uses Maven. You can get the software from https://maven.apache.org/. To build the software and create the manuals type:

mvn install

Visit the sub-directories to learn how to use the tools.

osnine-java's People

Contributors

dependabot[bot] avatar ep00ch avatar hathaway3 avatar sorenroug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

osnine-java's Issues

cputests errors

Two instances of setCCflag in instructions.c that have a parameter missing. setCCflag(CC_N);
Probably intended to be setCCflag(1, CC_N);

Invalid carry flag after DAA

Steps to reproduce:

Assemble and run the following code:

LDA #$91
ADD #$91
DAA

What happened?

Carry was reset.

When similar code was used for multi-byte decimal addition, it yielded incorrect results.

What was expected?

Carry should be set. DAA keeps the carry flag set if it was set beforehand, see the mc6809 emulator sources for comparison: https://github.com/spc476/mc6809/blob/master/mc6809.c#L420 or the official Programming Manual: https://archive.org/details/bitsavers_motorola68_13419254/page/n83/mode/2up

C โ€“ Set if a carry is generated or if the carry bit was set before the operation; cleared otherwise.

After some research, I noticed that this is a common bug in many 6809 emulators.

indirect.c/Doffset2 assertX(0x8E7A); ?

In indirect.c, test "Doffset2", could you confirm that the expected value in X after execution is correct? Thanks.

--------------------------------------------------- Doffset2 CC=0x28 X=0EFA Y=0EF8 A=FF B=82 -> X=8E7A Z=0
PC=0400 A=ff B=82 X=0efa Y=0ef8 S=03fe U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 ENTRYPT PSHS U,Y,X,DP,B,A,CC ; 0400: 34 7F
PC=0402 A=ff B=82 X=0efa Y=0ef8 S=03f4 U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 STS $046E ; 0402: 10 FF 04 6E
PC=0406 A=ff B=82 X=0efa Y=0ef8 S=03f4 U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 LDS #$0464 ; 0406: 10 CE 04 64
PC=040A A=ff B=82 X=0efa Y=0ef8 S=0464 U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 PULS CC,A,B,DP,X,Y,U ; 040A: 35 7F
PC=040C A=ff B=82 X=0efa Y=0ef8 S=046e U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 JSR Doffset2 ; 040C: BD 00 00
PC=0000 A=ff B=82 X=0efa Y=0ef8 S=046c U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 Doffset2 LEAX D,Y ; 0000: 30 AB
PC=0002 A=ff B=82 X=0e7a Y=0ef8 S=046c U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 RTS ; 0002: 39
PC=040F A=ff B=82 X=0e7a Y=0ef8 S=046e U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 L040F PSHS U,Y,X,DP,B,A,CC ; 040F: 34 7F
PC=0411 A=ff B=82 X=0e7a Y=0ef8 S=0464 U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 LDS $046E ; 0411: 10 FE 04 6E
PC=0415 A=ff B=82 X=0e7a Y=0ef8 S=03f4 U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 PULS CC,A,B,DP,X,Y,U ; 0415: 35 7F
PC=0417 A=ff B=82 X=0efa Y=0ef8 S=03fe U=0000 CC=28 DP=02 E0F0H1I0C0Z0V0N1 RTS ; 0417: 39
Doffset2:X expected 8e7a - actual 0e7a

FYI: test structure

The cpu tests are currently structured for executing on a 6809 itself - but that is the only method of execution, if you want to test under emulation, you have to emulate a system that supports these C programs with a runtime library etc and run the entire program as if it were running on a 6809 with console output. However what is often wanted it to test a bare emulator independent of target architecture (or the emulator is for an embedded system with no text I/O, such as the Vectrex). The code as it stands is not capable of doing this, for several reasons. For example there are several places where the byte order within a word assumes IBM/Motorola ordering, so the current C code could not run on systems with DEC/Intel ordering.

I've started a restructuring of the code where an emulator running on a host system can execute 6809 code that is stored in array memory[] which is the common interface between the host and the virtual machine - no other variables can communicate between the two systems. At the moment it supports a binary translation rather than a true emulation, but the major changes needed are the same for both. The program runs primarily on the host and it calls the interpreter to execute only the code fragments in the memory[] array.

Handling this with a static binary translator is actually a bit trickier than just an emulator would have been as the tests have to generate C code, compile it, and link it in and execute it. To avoid OS-specific hassles with dynamic loading, this has turned the process into a 2-pass compilation, which is easiest to handle by just running the code and typing make twice.

So this isn't really ready for release or a fork but I thought you might be interested in seeing the direction I'm taking it and and may have some advice or requests.

gtoal.com/SBTPROJECT/6809sbt/sorenroug-cpu-tests/

regards,

Graham

mvn install issues

Hi @sorenroug

Excellent work - especially the cpu tests is something I was looking for! I'll try to adapt them to run in my js 6809 emu.

anyway i tried to install you project on OSX using mvn v3.3.3 - it failed with:

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'parent.relativePath' of POM roug.org.osnine:osnine-gimix:1.0-SNAPSHOT (/_code/github/osnine-java/emulations/gimix/pom.xml) points at roug.org.osnine:emulations instead of roug.org.osnine:osnine, please verify your project structure @ line 6, column 13
[FATAL] Non-resolvable parent POM for roug.org.osnine:osnine-gimix:1.0-SNAPSHOT: Could not find artifact roug.org.osnine:osnine:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 13
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project roug.org.osnine:osnine-gimix:1.0-SNAPSHOT (/_code/github/osnine-java/emulations/gimix/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for roug.org.osnine:osnine-gimix:1.0-SNAPSHOT: Could not find artifact roug.org.osnine:osnine:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

invalid mvn version?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.