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 #4438 is a reply to message #4437] |
Sat, 10 March 2018 16:06 |
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
|
|
|
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 |
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 #4443 is a reply to message #4442] |
Thu, 15 March 2018 03:38 |
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 |
plasmo
Messages: 876 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
mikesmith wrote on Thu, 15 March 2018 00:16Looks 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 #4455 is a reply to message #4442] |
Sat, 17 March 2018 22:21 |
mikesmith
Messages: 80 Registered: March 2018
|
Member |
|
|
mikesmith wrote on Wed, 14 March 2018 23:16I'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 |
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 #4482 is a reply to message #4480] |
Mon, 19 March 2018 18:59 |
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 #4484 is a reply to message #4483] |
Mon, 19 March 2018 21:31 |
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 #4487 is a reply to message #4486] |
Tue, 20 March 2018 05:04 |
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 #4499 is a reply to message #4498] |
Wed, 21 March 2018 21:56 |
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 |
mikesmith
Messages: 80 Registered: March 2018
|
Member |
|
|
plasmo wrote on Wed, 21 March 2018 21:56I 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 #4506 is a reply to message #4504] |
Sat, 24 March 2018 09:17 |
UhClem
Messages: 19 Registered: November 2015
|
Junior Member |
|
|
plasmo wrote on Thu, 22 March 2018 20:45My 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.
David Schultz
|
|
|
|
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 |
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.
David Schultz
|
|
|
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 |
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
|
|
|
|
|
|
Current Time: Thu Apr 18 20:33:59 PDT 2024
Total time taken to generate the page: 0.01011 seconds
|