RetroBrew Computers Forum
Discussion forum for the RetroBrew Computers community.

Home » RBC Forums » General Discussion » Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K (68000, CP/M-68K, 100mm x 100mm pcb)
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4437 is a reply to message #4436] Fri, 09 March 2018 19:49 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
Mike,
Lots of great ideas and suggestions. I have to do homework and think about them.

The UEXT is unknown to me, but a great idea. Interestingly Tiny68K almost have all the features already, but scattered across several different devices. The DUART has a spare serial port. I2C protocol is used to load serial EEPROM into DRAM. The 68000 processor can read/write the serial EEPROM by bit banging under software control. On rev 2 board there is a real time clock based on DS1302. It is not populated in the boards I shipped but it is populated on my own development board and is working properly. DS1302 uses a different serial protocol not quite like SPI. These serial protocols are fairly easy to implement if operate under software control (bit banging) but run slowly. A fast SPI would require logic resources in EPM7128 that I don't have. I'm rambling; what I'm thinking is that UEXT is a great idea and there are room on board to bring all these signals together in a 10-pin header, the beginning of an UEXT interface.

The Ethernet module I like fit nicely with the UEXT interface; it is the low-cost module based on ENC28J60 uses SPI interface.

I'll start a new topic about Tiny030 and put down what I'm thinking.
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4438 is a reply to message #4437] Sat, 10 March 2018 16:06 Go to previous messageGo to next message
etchedpixels is currently offline  etchedpixels
Messages: 333
Registered: October 2015
Senior Member
The 28J60 is what I use with socz80. It's not a bad interface. The only trouble I had with it is that the timing diagram on the SPI requires you don't drop chip select too early or violate some of the other delays or *really* weird stuff happens. I spent several days swearing at it trying to work out what I'd done wrong and why only writes to some registers worked until I added delays in the right places!

It does benefit from reasonably fast SPI and also the IRQ line being connected to a GPIO as well as the CS and reset.

[Updated on: Sat, 10 March 2018 16:07]

Report message to a moderator

icon5.gif  Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4439 is a reply to message #4430] Tue, 13 March 2018 12:09 Go to previous messageGo to next message
tingo is currently offline  tingo
Messages: 111
Registered: February 2017
Location: Oslo, Norway
Senior Member
mikesmith wrote on Thu, 08 March 2018 08:25

I've put together a simulator for the Tiny68K using the Musashi core bridged to Python. Musashi handles the CPU emulation, the bridge handles memory emulation, and then device emulation is implemented in Python (making writing and testing device models somewhat simpler).

Currently it emulates the 68681 and CF well enough to boot CP/M and run MicroEmacs with configurable tracing. Next on the list (but lower priority) is to implement the I2C state machine well enough to model the EEPROM and DS1203. I expect that it would be straightforward enough to model some of the other Tiny family as well. Speed is pretty good, certainly very usable.

Code is here: https://github.com/John-Titor/py68k

I'm playing around with this simulator, since I do not have any 68k-hardware at the moment. It compiles easily under FreeBSD.
The instructions reads "Grab the BIOS image and CF CP/M image", but from where? I've looked at the Tiny68k board pages https://www.retrobrewcomputers.org/doku.php?id=boards:sbc:ti ny68k
but the bios and CP/M images there are .S68 files not .bin files. So I looked for instructions on how to convert the provided files (.S68) to .bin, but didn't find any.
Did I miss it?


Torfinn
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4440 is a reply to message #4439] Tue, 13 March 2018 15:23 Go to previous messageGo to next message
norwestrzh is currently offline  norwestrzh
Messages: 190
Registered: November 2015
Senior Member
Look around on-line. There are converters available. I have "bin2srec" and "srec2bin". Don't remember now where I got them (they are Linux applications), but they work quite well for converting S-records to binary, and vs. versa.
Roger
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4441 is a reply to message #4440] Wed, 14 March 2018 15:44 Go to previous messageGo to next message
tingo is currently offline  tingo
Messages: 111
Registered: February 2017
Location: Oslo, Norway
Senior Member
Duh! I must have been dead tired. I already have srecord installed on my FreeBSD workstation, so two runs with srec_cat and I have the required files.
Thanks fro the reminder. Smile


Torfinn

[Updated on: Wed, 14 March 2018 15:44]

Report message to a moderator

Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4442 is a reply to message #4441] Wed, 14 March 2018 23:16 Go to previous messageGo to next message
mikesmith is currently offline  mikesmith
Messages: 80
Registered: March 2018
Member
Looks like you got it solved - I actually pulled the CF image off the card I have.

A quick note in case you missed it in Bill's notes - you will need to byte-swap the image if you want to use cpmtools with it.

I'm still working on the ELF->CP/M converter. Trivial executables work, but stdio is still børked. I'm suspicious of the relocation translation, in particular I need to check whether the addend from the RELA records on the ELF side can be ignored (it looks like the 'brownout' ELF->TOS converter ignores them, for example, though that code is far from clear). There are also linker script issues, etc. etc. but those are all manageable if I can get this working...

= Mike
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4443 is a reply to message #4442] Thu, 15 March 2018 03:38 Go to previous messageGo to next message
tingo is currently offline  tingo
Messages: 111
Registered: February 2017
Location: Oslo, Norway
Senior Member
not sure yet, I only get a black screen when I try to start the emulator. the CP/M image I created with srec_cat was 64 bytes short, so I just added 64 bytes of zero at the end. Perhaps those should be at the beginning?

Torfinn
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4444 is a reply to message #4442] Thu, 15 March 2018 06:12 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
mikesmith wrote on Thu, 15 March 2018 00:16
Looks like you got it solved - I actually pulled the CF image off the card I have.

A quick note in case you missed it in Bill's notes - you will need to byte-swap the image if you want to use cpmtools with it.



Have not thought of this for a while. Early on I was thinkng of using CF to transfer data from PC to Tiny68K. I used the cpmtools to create a CP/M image, copied it to newly formated CF on my PC and moved the CF to Tiny68K. I can see the CP/M image except the upper byte and lower byte of every words are swapped. So the image created in PC was "unswapped" one time in Tiny68K before use. If you move the CF from Tiny68K back to PC, you'll need to swap the upper/lower bytes before PC can read it (I haven't done this before so I'm guessing here).

I believe the byte swap occurred when PC wrote the data to CF because I can take the same CP/M image, converted to Srecord (using BIN2MOT), serially transferred to Tiny68K's RAM disk, and the image received would be correct without byte swapping. In fact, this is the procedure for creating CP/M distro files from PC to Tiny68K. Nowadays I use gkermit to transfer files between PC and Tiny68K so I don't have to deal with byte swapping.
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4445 is a reply to message #4443] Thu, 15 March 2018 08:04 Go to previous messageGo to next message
mikesmith is currently offline  mikesmith
Messages: 80
Registered: March 2018
Member
Try running just the ROM first:

# ./py68k.py --target tiny68k --trace-everything bios.bin


Here's a script I use to copy files to the CF for the emulator. Put it in the same directory as 't68k_cpm_disk.bin', which should be a raw dump of the CF from Tiny68k. It needs cpmtools and the diskdefs edit below.

#!/bin/sh
#
# Create CP/M disk image from a master, adding files to the User 0 area.
#
# usage: <output disk image> <input file> [...]
#
master_disk=`dirname $0`/t68k_cpm_disk.bin
temporary_disk=`mktemp`
output_disk=$1
shift
input_files=$*

error() {
	echo $*
	exit 1
}

if [ -z $output_disk ]; then
	error 'missing output disk file name'
fi

if [ -z $input_files ]; then
	error 'missing input file name(s)'
fi

dd if=$master_disk of=$temporary_disk conv=swab

for ifile in $input_files; do
	cpmcp -f tiny68k $temporary_disk $ifile 0:`basename $ifile`
done

dd if=$temporary_disk of=$output_disk conv=swab
rm $temporary_disk


For cpmtools to work you will need to edit /usr/local/share/diskdefs and add:

diskdef tiny68k
  seclen 128
  tracks 62
  sectrk 1024
  blocksize 4096
  maxdir 512
  skew 0
  boottrk 1
  os 2.2
end


This will only get you access to the first partition, but that's enough for quick tinkering.

HTH, let me know how you get on with the sim...
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4455 is a reply to message #4442] Sat, 17 March 2018 22:21 Go to previous messageGo to next message
mikesmith is currently offline  mikesmith
Messages: 80
Registered: March 2018
Member
mikesmith wrote on Wed, 14 March 2018 23:16
I'm still working on the ELF->CP/M converter. Trivial executables work, but stdio is still børked. I'm suspicious of the relocation translation,


FWIW, this is working well enough now to build a trivial "hello world" program with a relatively current (6.3.0) gcc and have it run under CP/M-68K. I spent a lot of time trying to work out what I had done wrong with the relocation translation when it turned out that I was smashing the first word of the data section due to a missing '0' in a .long directive in crt0.

I'll clean it up and add it as a sample project (with some pointers to toolchains) to the emulator repo. There is still a bunch of work to do (in particular, mapping posix-ish file I/O to the ... interesting CP/M file API), but much of it can be inspired by DRI's code, since they had to deal with this themselves. I see no reason why this would preclude using current (7.x) GCC as well, I just haven't tried to build one yet.

Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4474 is a reply to message #4455] Mon, 19 March 2018 15:58 Go to previous messageGo to next message
norwestrzh is currently offline  norwestrzh
Messages: 190
Registered: November 2015
Senior Member
Any DDT users out there? Noticed anything odd about DDT on the tiny-68k??

I'm trying to debug a small program using DDT. Use the "E" function to load it for execution:

A>ddt

********************************************************
* DDT-68K 9/20/84 Version 1.3 *
* Serial #XXXX-0000 All Rights Reserved *
* Copyright 1982,1983,1984,1985 Digital Research Inc. *
********************************************************

-estore.68k
No Symbols
text base = 00020100 data base = 000201AE bss base = 000201C6
text length = 000000AE data length = 00000018 bss length = 0000000A
base page address = 00020000 initial stack pointer = 006F6962

Everything seems OK, and the load values look fine (come from the header), but if I do (to execute it -- here without breakpoints, but with them result is the same):

-g20100

I get:

Trace --> Next instr:303C0001 at addr:00020106 current Status:00008000

Illegal Instruction at 00020106

Here is the code:

10 00000000 41F900000000 lea.l savit,a0 ; memory pointer
11 *
12 00000006 303C0001 charin: move.w #1,d0 ; BDOS cons. inpt.
13 0000000A 4E42 trap #2 ; call BDOS

I think it is complaining about the "move.w #1,d0"?? Why??

Oh, and if I run the program from the command line (no DDT), it runs fine.

And one other thing: after the "Illegal instruction" message, if I try to get out of DDT (with ^C), CP/M seems to be botched up. Have to reset the tiny-68k and start up CP/M again with "bo".

Roger

[Updated on: Mon, 19 March 2018 16:02]

Report message to a moderator

Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4479 is a reply to message #4474] Mon, 19 March 2018 17:31 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
Roger,
Could you upload the store.68k program? I want to try it on my hardware to make sure it behaves the same here. This is where simulator would be helpful as well and Mike Simith is making progress in that area.
Bill
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4480 is a reply to message #4474] Mon, 19 March 2018 17:41 Go to previous messageGo to next message
UhClem is currently offline  UhClem
Messages: 19
Registered: November 2015
Junior Member
norwestrzh wrote on Mon, 19 March 2018 15:58

I think it is complaining about the "move.w #1,d0"?? Why??


What does DDT think is in memory? (list using l20100)


Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4482 is a reply to message #4480] Mon, 19 March 2018 18:59 Go to previous messageGo to next message
norwestrzh is currently offline  norwestrzh
Messages: 190
Registered: November 2015
Senior Member
>> What does DDT think is in memory? (list using l20100)

Looks OK to me (except for my lousy assembler skills!):

A>ddt

********************************************************
* DDT-68K 9/20/84 Version 1.3 *
* Serial #XXXX-0000 All Rights Reserved *
* Copyright 1982,1983,1984,1985 Digital Research Inc. *
********************************************************

-estore.68k
No Symbols
text base = 00020100 data base = 000201AE bss base = 000201C6
text length = 000000AE data length = 00000018 bss length = 0000000A
base page address = 00020000 initial stack pointer = 006F6962
-l20100
00020100 lea $201C6,A0
00020106 move.w #$1,D0
0002010A trap #$2
0002010C move.b D0,D1
0002010E cmpi.b #$5,D1
00020112 beq $20118
00020114 move.b D1,(A0)+
00020116 bra $20106
00020118 movea.l A0,A4
0002011A lea $201C6,A0
00020120 adda.l #$80,A0
00020126 cmpa.l A0,A4
-

[Updated on: Mon, 19 March 2018 19:01]

Report message to a moderator

Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4483 is a reply to message #4482] Mon, 19 March 2018 19:06 Go to previous messageGo to next message
norwestrzh is currently offline  norwestrzh
Messages: 190
Registered: November 2015
Senior Member
Here's the .68k file. SENDC68 strips the header off, so that might not be too useful.

Dump of the program included.

Roger
  • Attachment: store.sr
    (Size: 3.00KB, Downloaded 319 times)
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4484 is a reply to message #4483] Mon, 19 March 2018 21:31 Go to previous messageGo to next message
mikesmith is currently offline  mikesmith
Messages: 80
Registered: March 2018
Member
(major edit because the previous content is superseded)

I converted your srecords above to ELF, disassembled / reverse engineered to assembler source, assembled and converted back to a CP/M executable. Regardless of whether it's named .68K or .rel, it seems to work in the simulator:
-ecpmtest.68k
No Symbols
text  base   = 00020100   data  base   = 000201B4   bss  base   = 000201CC
text  length = 000000B4   data  length = 00000018   bss  length = 0000000C
base page address = 00020000       initial stack pointer = 006F6962
-g20100
12345^E
starts at 000201CC
ends at   0002024B

(Source attached, please let me know if I missed something in the transliteration)
  • Attachment: crt0.S
    (Size: 1.71KB, Downloaded 285 times)

[Updated on: Mon, 19 March 2018 22:28]

Report message to a moderator

Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4486 is a reply to message #4484] Tue, 20 March 2018 03:30 Go to previous messageGo to next message
UhClem is currently offline  UhClem
Messages: 19
Registered: November 2015
Junior Member
The BIOS does not set the trace exception which DDT uses.

setexc:
        andi.l  #$ff,d1         * do only for exceptions 0 - 255
        cmpi    #47,d1
        beq     noset           * this BIOS doesn't set Trap 15
        cmpi    #9,d1           * or Trace




Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4487 is a reply to message #4486] Tue, 20 March 2018 05:04 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
Roger's Tiny68K has rev 6 BIOS where the trace exception is fixed. Trap15 exception is used by Tiny68K, does DDT uses trap15?

setexc:
	andi.l	#$ff,d1		* do only for exceptions 0 - 255
	cmpi	#47,d1
	beq	noset		* this BIOS doesn't set Trap 15
*	cmpi	#9,d1		* or Trace
*	beq	noset
	lsl	#2,d1		* multiply exception nmbr by 4
	movea.l	d1,a0
	move.l	(a0),d0		* return old vector value
	move.l	d2,(a0)		* insert new vector
noset:	rts


I need to scrub the wiki to make sure they contain the latest software fixes.

-------
Edit: Roger, my mistake, I forgot your board does not have a CF adapter. You must have installed it recently and downloaded the rev5 BIOS from the Tiny68K wiki. Rev5 BIOS won't work in DDT as uhclem has pointed out. I've updated the wiki page with rev6 BIOS just now. I'll go over the Tiny68K wiki to make sure information are up to date.

The code provided by you and translated by mikesmith is downloaded into my Tiny68K and edited a bit so 68K assembler won't complain and ran it (whew, probably introduced a million bugs by now). It just echoed back whatever I typed. Is this correct?

[Updated on: Tue, 20 March 2018 06:01]

Report message to a moderator

Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4488 is a reply to message #4487] Tue, 20 March 2018 06:29 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
I updated tinyBIOS to rev 6 in the wiki page "Procedure for install a new CF disk" https://www.retrobrewcomputers.org/doku.php?id=boards:sbc:ti ny68k:create_new_cf

The changes from rev5 to rev6 are:

12/19/17
* fix home routine, should be clr.w track
* fix setexec routine so trace exception is installed
* created a revision word to store BIOS revision at $1B002
* mask off interrupts in 68681. This is because the trace command in DDT does not mask off interrupts
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4490 is a reply to message #4488] Tue, 20 March 2018 15:03 Go to previous messageGo to next message
norwestrzh is currently offline  norwestrzh
Messages: 190
Registered: November 2015
Senior Member
The wiki update seems to have fixed the DDT problem. I was able to re-load the newer BIOS on the existing CF OK.

Has the content of the file system download changed (with the update)? Do I need to reload that as well?

What I have from the original build seems to work OK.

Roger
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4491 is a reply to message #4490] Tue, 20 March 2018 19:55 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
Glad to hear that updated BIOS fixed the DDT problem. The file system has not changed so you don't need to reload it.
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4493 is a reply to message #3702] Wed, 21 March 2018 11:11 Go to previous messageGo to next message
norwestrzh is currently offline  norwestrzh
Messages: 190
Registered: November 2015
Senior Member
I have another question:

Does the tiny-68k monitor, or BIOS, put the CPU in user mode? Or, does the tiny-68k run in supervisor mode?

Roger
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4494 is a reply to message #4493] Wed, 21 March 2018 12:34 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
Roger,
The monitor runs supervisor mode. It does not change to user mode when transfer control to applications.
The CP/M-68K BIOS does not change the mode, either.
Bill
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4495 is a reply to message #4494] Wed, 21 March 2018 16:33 Go to previous messageGo to next message
norwestrzh is currently offline  norwestrzh
Messages: 190
Registered: November 2015
Senior Member
>> The monitor runs supervisor mode. It does not change to user mode when transfer control to applications.
>> The CP/M-68K BIOS does not change the mode, either.

Hmmm .... that's strange! When I stuff a privileged instruction (move #$FFFF,SR) into memory (using DDT), and try to execute it, I get a "privilege exception". It's a little difficult for me to interpret the DDT dump of the status register, but I *think* that the supervisor bit is cleared (0). Does DDT do that? Just curious!

Roger
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4496 is a reply to message #4495] Wed, 21 March 2018 17:14 Go to previous messageGo to next message
UhClem is currently offline  UhClem
Messages: 19
Registered: November 2015
Junior Member
norwestrzh wrote on Wed, 21 March 2018 16:33
> Does DDT do that? Just curious!


Yes and no. All CP/M-68K user programs are run in user mode. (See file ccpload.s in the source.Wink DDT calls the BDOS function (#62) that requests a shift to supervisor mode so that it can dummy up a stack frame for your program before switching to it via a rte instruction. The rte being a privileged instruction.



Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4497 is a reply to message #4496] Wed, 21 March 2018 19:25 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
Thanks uhclem for the answer. I don't know the answer to Roger's question but I know when I replaced the 68000 with a 68010 in Tiny68K, I got privilege violation exception and I need to understand why. You've mentioned ccpload.s source, is that available online?
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4498 is a reply to message #4497] Wed, 21 March 2018 20:23 Go to previous messageGo to next message
UhClem is currently offline  UhClem
Messages: 19
Registered: November 2015
Junior Member
Source is in the usual place: http://www.cpm.z80.de/source.html

What were you doing to get an exception with the 68010? Were you using the wrong version of DDT?


Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4499 is a reply to message #4498] Wed, 21 March 2018 21:56 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
I tried the 68010 again tonight. I can boot up CP/M-68K, execute the internal commands (type, dir, ren), pip works, but dump does not (get Exception $08 at user address $00021728. Aborted). The simple 'Hello world" C program also get the exception. I can assemble an assembly program, but link68 gets the exception $08.

When run "ddt10 hello.68k" and execute 'g' command, I get:

D>ddt10 hello.68k

********************************************************
* DDT-68K 9/20/84 Version 1.3 *
* Serial #XXXX-0000 All Rights Reserved *
* Copyright 1982,1983,1984,1985 Digital Research Inc. *
********************************************************

File is relocatable
text base = 00020100 data base = 00022E16 bss base = 000231E2
text length = 00002D16 data length = 000003CC bss length = 00000B5C
base page address = 00020000 initial stack pointer = 006F6328
-g
HelloPrivilege Violation at 00020FF0
PC=00020FF0 USP=006F6066 SSP=0001A928 ST=0009=>IM=0 NEG CRY
VBR=00000000 SFC=0 DFC=0
D 00000000 006F5F9F 00000000 00000000 00000000 00000005 00000000 00000000
A 00022E3F 00000004 00020081 00000000 00000000 006F62B6 006F6296 006F6066
move.w SR,D0
-

Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4500 is a reply to message #4499] Wed, 21 March 2018 23:18 Go to previous messageGo to next message
mikesmith is currently offline  mikesmith
Messages: 80
Registered: March 2018
Member
plasmo wrote on Wed, 21 March 2018 21:56
I tried the 68010 again tonight.
...
Privilege Violation at 00020FF0
PC=00020FF0 USP=006F6066 SSP=0001A928 ST=0009=>IM=0 NEG CRY
VBR=00000000 SFC=0 DFC=0
D 00000000 006F5F9F 00000000 00000000 00000000 00000005 00000000 00000000
A 00022E3F 00000004 00020081 00000000 00000000 006F62B6 006F6296 006F6066
move.w SR,D0
-


Move from SR is privileged on the '010, and whilst the CP/M sources seem to imply that it was supported as a compilation target, it looks like it wasn't the default.

Note that the '010 exception frame format is different as well...

(edit) It looks like there's code in the BDOS exception handler specifically to handle these issues. I can't quite untangle what the build process is doing, but it looks like it *should* be assembling both into cpmlib, and there's this line in 15/make.sub:

$2lo68     -r  -ucpm -um68010 -f $1 -o cpm.rel    2:cpmlib biosa.o vt52.o bios.o 0$2clib


that looks like it would be pulling in the '010 exception handler path, but there's a lot of stuff in this directory that's not very clear.

At any rate, if you can build cpm.sys, it looks like the rest of the work's already been done...

[Updated on: Wed, 21 March 2018 23:42]

Report message to a moderator

Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4502 is a reply to message #4500] Thu, 22 March 2018 17:12 Go to previous messageGo to next message
UhClem is currently offline  UhClem
Messages: 19
Registered: November 2015
Junior Member
The build process puts two versions of the exception handler into CPMLIB. It places the 68010 version (conditional assembly selects which one gets built by as68) early in the library.

The linker will only include objects which satisfy some unresolved symbol. (Order of objects within the archive matters!Wink So the 68010 version (except10.o) provides nothing unless you include the command line argument to lo68 making it look for the m68010 symbol. Then when it looks at the 68000 version later on it skips it because all of the symbols in it are already satisfied. Unless you are building the 68000 version of course.

When building the 68000 version the linker skips over except10.o because it doesn't have any symbols it needs. But by the time it reaches except.o, another object has been linked that includes an unresolved symbol satisfied by except.o. So it gets linked.


While the manuals do not discuss the 68010 version, there is a readme.txt file on disk1 of the distribution that does.


Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4503 is a reply to message #4502] Thu, 22 March 2018 20:05 Go to previous messageGo to next message
mikesmith is currently offline  mikesmith
Messages: 80
Registered: March 2018
Member
uhclem wrote on Thu, 22 March 2018 17:12
While the manuals do not discuss the 68010 version, there is a readme.txt file on disk1 of the distribution that does.


Thanks, very educational. So in addition to needing to generate the system for the '010, there's also a separate DDT binary that's required.
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4504 is a reply to message #4503] Thu, 22 March 2018 20:45 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
Very helpful Indeed!
Since source files and LCPM.sub & LCPM10.sub are associated with ver 1.2 of CPM-68K. Would you suggest I start 68010 with CP/M-68K ver 1.2 first and then migrate to ver 1.3?
My goal is CP/M-68K for the 68030.
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4505 is a reply to message #4504] Fri, 23 March 2018 17:35 Go to previous messageGo to next message
UhClem is currently offline  UhClem
Messages: 19
Registered: November 2015
Junior Member
plasmo wrote on Thu, 22 March 2018 20:45
Would you suggest I start 68010 with CP/M-68K ver 1.2 first and then migrate to ver 1.3?


Step 1 is to generate CPM.SYS. There should be little difference between 1.2 and 1.3.


Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4506 is a reply to message #4504] Sat, 24 March 2018 09:17 Go to previous messageGo to next message
UhClem is currently offline  UhClem
Messages: 19
Registered: November 2015
Junior Member
plasmo wrote on Thu, 22 March 2018 20:45
My goal is CP/M-68K for the 68030.


I searched through my archives and found a version of the exception handler that claims to work with the 68020. I have also noticed that the V1.2 and V1.3 versions are slightly different.

I have no idea where the 68020 version came from or if it works. But I will work on figuring out the differences between the 1.2 and 1.3 version and add the 68020 changes using the 1.2 source as the base since it has good comments.

One interesting difference between the 1.2 and 1.3 versions that I have already found is that the function used to start a user program enables all interrupts in 1.2 and keeps the current interrupt mask in 1.3.


Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4507 is a reply to message #4506] Sat, 24 March 2018 11:12 Go to previous messageGo to next message
etchedpixels is currently offline  etchedpixels
Messages: 333
Registered: October 2015
Senior Member
Yes - because there were systems where enabling all interrupts was broken. That turned on things like high speed timer interrupts, horizontal blank interrupts and the like that system designers intended to be left off. You'll find some BIOSes contain workarounds as a result where the high speed interrupt default vectors to a routine that puts the interrupt mask back where it should be so you only take one hit.
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #4532 is a reply to message #4487] Sun, 01 April 2018 06:00 Go to previous messageGo to next message
UhClem is currently offline  UhClem
Messages: 19
Registered: November 2015
Junior Member
plasmo wrote on Tue, 20 March 2018 05:04
Trap15 exception is used by Tiny68K, does DDT uses trap15?

That is actually an interesting question.

The BDOS exception code initializes most vectors to point into a table within it. This is just a series of "bsr except" instructions. That code uses the return address left on the stack to calculate which exception happened. It then sets things up to call the user program in user mode if the user has setup a vector. Otherwise the default action is taken which is to print an error message and do a warm boot.

But if you look at that series of bsr instructions you will find that it ends with a couple of NOP instructions. These do not appear in the source file "exceptn.s". A mystery I didn't worry about too much until I looked at the assembler output for the code I am working on.

I found that the assembler was replacing the last bsr instruction in the table with those two NOPs because the "except" label immediately follows. The 68010 version has the privlege violation code here so this doesn't happen. I could understand the replacement, perhaps, if this were a branch instruction.

Looking at the assembler source I see a comment from [vlh] showing that this was added in the 4.2 version and one routine seems to handle both branches and branches to subroutines. It could be fixed but this is not something that is going to turn up often.


The entry that is replaced with NOPs happens to be trap #15. So while CP/M-68K isn't using trap #15 for anything, it does initialize the vector.


Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #5277 is a reply to message #4503] Sat, 06 October 2018 01:30 Go to previous messageGo to next message
rvumbaca is currently offline  rvumbaca
Messages: 17
Registered: September 2018
Junior Member
In case anyone is interested, I built a new CCP and BDOS for the 68010. Instructions and information are on the RBC Wiki at this page

I also placed a pre-built binary there.

I've never really used CP/M so some of what I wrote might be incorrect, but the build process appears indeed to be as uhclem describes it. The end result of my instructions is a CPM15000 binary that works correctly with the 68010 (has the exception handler and 68000 stack frame emulation).

[Updated on: Sat, 06 October 2018 02:05]

Report message to a moderator

Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #5279 is a reply to message #5277] Sat, 06 October 2018 09:20 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 876
Registered: March 2017
Location: New Mexico, USA
Senior Member
This is delightful. I have tried 68010 on Tiny68K and many CPM programs would crash exactly as you've described. I'm going to try your instruction when I get home tonight.
A note about DS1302: I have routed active signals within the exclusive zone of DS1302 so you'll notice that the RTC runs fast when the board is powered but keeps correct time with the board powered down. I plan to try shielding or reroute the active signals to correct the timing problem but they are still on my to-do list.
Bill
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #5281 is a reply to message #5279] Sat, 06 October 2018 11:00 Go to previous messageGo to next message
norwestrzh is currently offline  norwestrzh
Messages: 190
Registered: November 2015
Senior Member
>> In case anyone is interested, I built a new CCP and BDOS for the 68010.

You can be sure that someone is interested!!! Thank you!

I've built a new 68010 CCP/BDOS using your instructions. Worked great. The SENDC68 part is a little dodgy, but I have other ways to copy the new CPM .BIN file to the host machine, so no worries. I had no idea that there was a 68010 module in the CLIB!

I'm going to try it out asap. A friend has been trying to run CP/M 68k on a 68020, and having problems with privilege violations. I suspect that this information will help him as well!

Thanks again.

Roger
Re: Tiny68K, 68000 SBC with 16 Meg memory for CP/M-68K [message #5282 is a reply to message #5281] Sat, 06 October 2018 18:37 Go to previous messageGo to previous message
rvumbaca is currently offline  rvumbaca
Messages: 17
Registered: September 2018
Junior Member
Hi everyone - no worries, I'm glad that the information might come in useful Smile.

The SENDC68 part is not as bad as it sounds. S-Record data is 100% ASCII by design, so I think it's quite acceptable to directly copy and paste it, as it is text.

I had to paste all the S-Record data for CP/M into my terminal when first preparing my CP/M-68K CF card as I didn't have a program at hand that could "send" text files Smile.

I tried to use GKERMIT to copy the built binary across, but it does not work for me with TeraTerm (Windows). I am using a genuine FTDI serial cable - I have heard that this can cause issues?

(I will need to transmit an XModem or ZModem terminal program to my Tiny68K if one exists).

I don't think that there's a 68010 module in the CLIB, it's in the CPMLIB. The CLIB is just included as that is what was used in the original SUB files.

Regards,

Rosario
Previous Topic: Another 8085 Single Board Computer SBC-85
Next Topic: CTC/SIO Baud Rate Generation


Current Time: Thu Apr 18 20:33:59 PDT 2024

Total time taken to generate the page: 0.01011 seconds