CST Q+4 Interface

Sell your QL items here!
User avatar
1024MAK
Super Gold Card
Posts: 593
Joined: Sun Dec 11, 2011 1:16 am
Location: Looking forward to summer in Somerset, UK...

Re: CST Q+4 Interface

Post by 1024MAK »

Well, given the number of buffers and line drivers on the I/F card, I'd be surprised if there was many signals that were not buffered :mrgreen:

Mark


:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer in Somerset later in the year :)

QL, Falcon, Atari 520STFM, Atari 1040STE, more PC's than I care to count and an assortment of 8 bit micros (Sinclair and Acorn)(nearly forgot the Psion's)
User avatar
dilwyn
Mr QL
Posts: 3087
Joined: Wed Dec 01, 2010 10:39 pm

Re: CST Q+4 Interface

Post by dilwyn »

prime wrote:I've also included a dump of the on board eprom. I loaded this into the rom slot in Mess and it is recognized and prints a sign on banner, but doesn't introduce any keywords so I suspect it is a low level driver for the expansion backplane.
The Q+4 ROM will no doubt include code to correct an issue with QDOS versions up to 1.03 (version JM ROM) whereby only one add-on board with an on-board ROM will be detected. Obviously, RAM cards have no on-board ROM so this is not an issue with RAM cards.

Since CST had to make sure the Q+4 could recognise up to four add-on boards, they would have had to include code to make sure the Q+4 could work correctly on AH and JM ROMs.

So, the ROM probably serves two purposes:
1. Provide an on-screen CST copyright notice
2. Include code to ensure that as many peripheral card onboard ROMs as the Q+4 could handle were indeed recognised correctly

I haven't tried disassembling the code to find out what goes on, but a quick look shows most fo the ROM is empty, any code just filling a fraction of the 8K EPROM.

The whole issue of problems with add-on cards was discussed by Andrew Pennell inhis book Sinclair QDOS Companion, in chapter 9. I've OCR'ed the most relevant parts to explain what I mean. See under 'Peripheral ROM Problem' below for a full explanation.

Code: Select all

External ROMs and Device Drivers
--------------------------------
(from QDOS Companion, Chapter 9)

The QL hardware and firmware has been designed for expansion with additional hardware, in the form of external ROMs which may also include extra hardware for peripherals. All extra ROMs have a defined format, so that the QL can recognise them and take action on finding them. There are two areas in which additional ROMs can lie — in the ROM socket at $0C000, or in a peripheral ROM from $C0000 to $FC000 in 16K blocks. 

The ROM socket

This can accommodate up to 16K of ROM, and plugs in via the socket on the back of the QL. In the address map it always lies from $OC000 to $OFFFF, and is thus the only place in the memory map that user-written routines can be position dependent. 

The peripheral ROMs

Up to 16 peripheral ROMs of 16K each can be added to the QL, though if more than one is added then an additional board, such as the expansion module, is required. As such ROMs can lie anywhere within the memory map, all code within them has to be position independent. They connect via the expansion bus on the left of the QL and can contain ROM, RAM or any other I/O devices, though they must start with ROM for the system to recognise them. 

ROM Header Format

To tell if a ROM is connected or not, the system looks for a specific pattern in it, thus:

START   DC.L    $4AFB0001      ; identification word
        DC.W    BASPROCS-START ; start of proc/fn definitions (or 0)
        DC.W    INIT-START     ; initialisation routine (or 0)
        DC.W    NAMELEN        ; length of ROM name
        DC.B    “ROM name”,10  ; the name itself + LF

BASPROCS should be a list of SuperBASIC procedures and functions to be added to the system, as per usual QDOS documentation for BASIC extensions, or 0 if there are none to be aded. INIT should point to the initialisation routine called after power-up, or 0 if one is not required. The INIT routine will be executed in user mode, and if a successful return to QDOS is required then registers A0 (zero), A3 (points to the start of the ROM) and A6 ($28000) should not be altered. When INIT is called, the system tables and BASIC have been set up, but channel 0 is the only channel open. Other channels should not be opened by the INIT routine. Channel 0 is initially the top section of the screen, and all ROM names found are printed in it. For this reason, they should not be longer than 36 characters and should end in a LF character.

Peripheral ROM Problem

While this method is a very neat way of adding ROMs to the QL, there is a problem with peripheral ROMs — in QDOS 1.03 and earlier, there is an error in the ‘look for peripherals’ routine that terminates the search after checking for one device driver only, so other peripherals are ignored. One way to get around this is for the INIT routine in every peripheral to see if the peripheral is the first, and if it is then it has to carry on the search as the ROM should. This is complicated by the fact that the patch to fix it has to work once the ROM gets corrected. Thus the INIT routine has to look something like this: 

INIT    BSR     NORMINIT	; call the init routine
        CMP.L   #$C0000,A3    ; is it the first?
        BEQ.S   NEXT          ; if so
        RTS                   ; it isn’t, so quit
NEXT    ADD.L   #$4000,A3     ; try next one
        CMP.L   #$100000,A3   ; at the end?
        BGE.S   NOMORE        ; if so
* if might be a ROM so let’s see
        CMP.L   #$4AFB0001,(A3)
        BNE     NEXT          ; no so do next
        LEA     8(A3),A1      ; start of name
        MOVE.W  UT.MTEXT,A2
        JSR     (A2)          ; print the name
        MOVE.W  4(A3),D0      ; BASIC procedures and functions
        BEQ.S   NOBAS
        LEA     0(A3,D0.W),A1
        MOVE.W  BP.INIT,A2
        JSR     (A2)          ; add the procedures and functions
NOBAS   MOVE.W  6(A3),D0      ; INIT routine
        BEQ.S   NEXT          ; if none
        JSR     0(A3,D0.W)    ; call the INIT routine
        BEQ     NEXT          ; get next ROM
* here when all have been done
NOMORE  ADDQ.L  #4,A7         ; remove return address
        ADD.L   #$1E,(A7)     ; skip over rest of routine
        RTS                   ; and go back to it

This fix assumes that the number of bytes taken by the erroneous routine will remain constant from ROM to ROM. If all device drivers take similar action to the above, then there will be no need to fix the bugs anyway, and the number of bytes will remain constant. 

Note that, unlike the usual use of BP.INIT, ROM procedures and functions get added before the built-in ones, so if there is a name clash then the external ROM version will override the usual built-in ones. 


twellys
Bent Pin Expansion Port
Posts: 92
Joined: Tue Jun 28, 2011 11:00 am
Location: Boston Spa

Re: CST Q+4 Interface

Post by twellys »

I've got another Q+4 interface (from the blue keyboard-less QL I bought on Ebay). That Q+4 has not got the ROM or the chips for the 26-way and the 20-way (Didn't I see a picture in one of the QL mags hooking up a harddrive to the Q+4?).

Tim


User avatar
dilwyn
Mr QL
Posts: 3087
Joined: Wed Dec 01, 2010 10:39 pm

Re: CST Q+4 Interface

Post by dilwyn »

twellys wrote:I've got another Q+4 interface (from the blue keyboard-less QL I bought on Ebay). That Q+4 has not got the ROM or the chips for the 26-way and the 20-way (Didn't I see a picture in one of the QL mags hooking up a harddrive to the Q+4?).

Tim
Yes, you may well have done. The Q+4 was done by CST, who also made disk interfaces and hard disk systems for the QL.


User avatar
Dave
SandySuperQDave
Posts: 2797
Joined: Sat Jan 22, 2011 6:52 am
Location: Austin, TX
Contact:

Re: CST Q+4 Interface

Post by Dave »

Unfortunately, this CST Q+4 card has been so messed with, I can't learn anything further from it. Without a comparison card, I can't replace the missing resistors. The 7805 and two resistors have been removed, and many tracks have been cut or jumpered.

The card was previously owned by a heavy smoker, and it took much acetone and alcohol and an overnight ultrasound bath to clean it just to the non-sticky stage.

Hopefully, Phill can make some use of it. Phill, PM or email me your mailing address and I'll send it on to you.


RWAP
RWAP Master
Posts: 2893
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: CST Q+4 Interface

Post by RWAP »

I will check who bought the full Q+4 system off me as they may be willing to lend a board or at least provide some hi-resoluction photos - Urs may also have one...


User avatar
QLvsJAGUAR
Gold Card
Posts: 485
Joined: Tue Feb 15, 2011 8:42 am
Location: Lucerne, Switzerland
Contact:

Re: CST Q+4 Interface

Post by QLvsJAGUAR »

RWAP wrote:Urs may also have one...
Yes, I do.

I just uploaded some more 31 pictures (4 of such Q+4 buffer boards, 20 of QL-SD, ...) to the Sinclair QL Picture Gallery. The Q+4 photos are in the folder Expansions. See: https://onedrive.live.com/?cid=c250d874 ... E5A%214686

Dave, did you post pictures of your Q+4 buffer board somewhere?

QL forever!
Urs


QL forever!
https://www.sinclairql.net/ - Go and get THE DISTRIBUTION & QL/E!
https://www.youtube.com/QLvsJAGUAR/community - Blog
https://www.youtube.com/QLvsJAGUAR - Dedicated QL videos
Sinclair, QL, ATARI, JAGUAR, NUON, APPLE, NeXT, MiST & much more...
Videos, pictures & information
RWAP
RWAP Master
Posts: 2893
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: CST Q+4 Interface

Post by RWAP »

That reminds me Urs - I could do with using some of your photos for the QL Wiki - would you permit that please :D


Ralf R.

Re: CST Q+4 Interface

Post by Ralf R. »

And also for the Miraculous Winnie.


prime
Trump Card
Posts: 192
Joined: Fri Feb 18, 2011 8:58 pm

Re: CST Q+4 Interface

Post by prime »

Hi all,

I now have the Q+4 interface from Rich, via Dave, thanks both.

Looking at the board, it looks to me like it has been used in a QL that has been modified for 5V operation instead of the normal +9V IIRC, which is why the regulator has been removed and some tracks wired to others.

I've started tracing the circuit into Eagle, and hope to get this completed fairly quickly as it looks like it pretty much is just a straight buffer card with some switching and pullups.

I'll of course post the schamatic / layout once done.

Cheers.

Phill.


Post Reply