Faster Baud and More Serial Ports (CSI Hurdler, SerialDMA, QuadraLink)

David Cook

Tinkerer
Jul 20, 2023
80
97
18
I recently acquired a CSI Hurdler II NuBus card that adds serial ports to the Macintosh. Using the card and upgrading it sent me down a rabbit hole.

When I received it, the CSI Hurdler indicated that it was a "dual" (HDS) serial port card, although it had all four ports soldered in place, along with some empty DIP sockets. Based on the existing chips, I guessed that it was missing an additional Zilog Z8530A SCC, (2) AM26LS32 line receivers, and (2) AM26LS30 line drivers. So, I added those. Unfortunately, that did not result in immediately converting the card to a "quad" serial port card.

I then reached out to @Byte Knight , who runs the Captain's Quarters II BBS with a quad (HQS) CSI Hurdler. He immediately sent me a copy of the ROM. (Thank you!!). Burning and installing the quad ROM indeed successfully finished the conversion of the dual card to a quad card.

CSI-Hurdler-II-card.jpg


The rear slot cover of the card only exposes two of the four serial ports. I simply unscrewed and removed the slot cover to access all four ports. However, I am considering drilling the other holes.

Two-exposed-connectors.jpg


One of the nice features of the CSI Hurdler II is that it can double or quadruple the baud / bit rate that the application chooses. For example, if your terminal program is set for 57600, the CSI can secretly set itself for 115200 or 230400. These values were not originally supported by the Macintosh System Software and thus aren't listed in old terminal programs. CSI notes that many baud rates don't double nicely. For example, 38400 doubles to 76800 -- which is not a standard rate. Watch out for that.

With the Dual ROM installed, my CSI card offers the 2x option, but not the 4x option.

Double-speed.jpg


With the Quad ROM installed, my CSI card does not offer any speed increase.

Quad works but no speed up.jpg


This could be a limitation in the ROM, as my Dual ROM is a newer version. Or, it could be that the card itself is not fast enough to service the four ports at double speed. It turns out that CSI had two faster cards, the CSI Hustler and the CSI Lightening. These cards were capable of the faster speeds. I have not been able to locate either of these cards for purchase.


Updating Tiny Transfer

To make use of these extra ports (and extra speed), I updated my Tiny Transfer software to detect the ports and speeds. Detecting the ports was easy, as the naming convention simply continues from the standard Apple modem ('.AOut') and printer ports ('.BOut'), to CSI Hurdler 1 ('.COut'), etc. This makes it compatible with pre-Communications Toolbox operating systems.

Added ports and faster baud.jpg


Applied Engineering's QuadraLink serial card includes AE Shadow software to provide old-style serial ports, although theirs are named ".QuadraLink Port 1 OutC" (and so on). This is frustrating as the code needs to follow a different pattern to check for the ports. But, this is also good, as the names don't conflict with the CSI Hurdler. Theoretically, you can end up with 10 or more serial ports.



Faster Baud Slightly More Complicated

Detecting the ability for the Macintosh to use a faster baud rate is not as straightforward. Let's ignore the nice feature where the CSI Hurdler secretly doubles the chosen baud rate. Instead, what if the application really wants to directly offer 115200 or 230400? Apple's technical note TN 1018 "Understanding the DMA Serial Driver" illuminates the new Control calls to select the faster rate. If the Control call returns an error, then the rate is not available. Basically, you need a Centris 660AV or better to even have a chance that Apple's serial ports support the faster rates.

That's simple enough. But, the software needs to make these calls on all of the additional ports, because those are not Apple drivers and are running different hardware. So, the application may need to select a slower rate if the user switches ports.

I successfully got my software to run at 115200 on a Power Macintosh G3 connected to Basilisk II. But, even though the drivers did not return an error, I could not get it to talk at all at 230400. I tried using a different USB-to-serial cable without luck. Eventually, I connected a Power Macintosh 4400 to another Power Macintosh 4400, which ran successfully at 230400. So, I believe there is a 230400 baud bug or limitation in Basilisk II.

In the screenshot below, I got 4x the throughput on a Power Macintosh 4400 at 230400. The reason the speed only lists 88.37 kb/s, is that BinHex adds bloat and XModem doesn't have a sliding window which means the channel is not saturated. So, the effective speed is only 38%. It would be worse still on a slower Macintosh where the CPU can't keep up. I noticed the IIci on a CSI Hurdler double rate of 115200 was not effectively double 57600, due to the CPU bottleneck.

230400 baund.jpg


If I switched to a binary transfer with a sliding window protocol and fast compression on a fast CPU, then the effective throughput could exceed 100% of the baud. However, Tiny Transfer is designed for period compatibility, not maximum speed.


Not Out of the Woods Yet - Serial Driver Version


Oddly, my Power Macintosh 8600/300 did not support 115200 and 230400 baud, even though it is newer and faster than the Power Macintosh 4400. What's going on?

The technical note indicates that you can detect the driver version with a Status call. The version is a single byte.

SerialDMA-Tech-Note.jpg


Uh oh. Inside Macintosh Devices says the version is a word (a short, aka two bytes).

Serial-driver-version-status-call.jpg


Let's see how to make a status call. Got it? Status(refNum, 9, &myByteOrShortVersion);

Naive-status-call.jpg


Making the Status call the naive way I describe above results in memory corruption. I just haven't played with Status calls enough to understand the weak documentation. It turns out that the Status call always copies a much larger structure (22 bytes) over to the provided pointer, even if the driver only populates a byte or a short. I made the choice to use the more complicated but definitive PBStatusSync (new naming convention) call with the full ParamBlockRec structure. Then, I read only the portion relevant to the serial driver version -- which is a byte (not a short).

Code.jpg


After doing this, the Tiny Transfer About Box now includes the serial driver version:


Here's what I've found so far...

// Serial driver versions
// Version 0 is ROM based - not verified
// Version 1 is the RAM version - not verified
// Version 2 is the Plus ROM - not verified
// Version 5 in IIci with System 7.1
// Version 9 on PowerMac 7100 with System 8.1. Supports 115 and 230
// Version 9 on PowerMac G3 with System 9.2.2. Supports 115 and 230
// Version 10 on a PowerMac 8600 (604ev@300) with System 8.1. Doesn't support 115 and 230

That last line is the killer. The Power Macintosh 8600/300 has a newer driver (version 10) which dropped support for the faster baud rates. What?? I assume this was a mistake as the later G3 switched back to version 9. I need to try installing the Serial DMA extension from Apple to see if this will override the ROM version and restore the faster baud rates.

Files

Attached are the CSI Hurdler II ROMs, the TN 1018 Serial DMA note, and a link to the AE Shadow software.

- David

 

Attachments

  • 1760816166801.png
    1760816166801.png
    2.5 KB · Views: 9
  • 1760818331181.jpeg
    1760818331181.jpeg
    18.6 KB · Views: 10
  • csi hurdler ii dual hds 3.175 1994.bin
    32 KB · Views: 8
  • CSI_HQS_3.09B.BIN
    32 KB · Views: 8
  • tn_1018 serial driver.pdf
    180 KB · Views: 7

joevt

Tinkerer
Mar 5, 2023
164
56
28
For the Power Mac 8600/300, you could use the driver to initialize the serial port, than add your own initialization to write directly to the serial port to enable 115.2 and 240.5 kbps.

Is there a way to get the addresses for the SCC registers of the CSI card using the drivers or accessing low memory globals? If not, then you would have to extract the .HQS DRVR from the "CSI_HQS_3.09B.BIN" Slot ROM and disassemble it to find the addresses.

It looks like the .HQS driver has hard coded driver names .CIn, .COut, .DIn, .DOut, .EIn, .EOut, .FIn, .FOut so you can't use two of these cards?

It looks like the .HDS driver has hard coded driver names .CIn, .COut, .DIn, .DOut so adding a second one of these cards would not add .EIn, .EOut, .FIn, .FOut.

What computer/serial port are you running Basilisk II? If there's a bug in Basilisk II then you can try a different app such as Serial.app.
https://www.decisivetactics.com/products/serial/
Or use a command in Terminal.app (cu or screen).
#3
 
Last edited:

David Cook

Tinkerer
Jul 20, 2023
80
97
18
I broke out the oscilloscope to determine if something is wrong with Basilisk II. I believe there is.

First, here is a Quadra 840av transmitting at 230400. The RS-422 voltage only swings from 4.4V to -4.5V. That's within Apple's specs. The width of two bits measures 8.760 microseconds. (It was easiest to reliably measure the end of the start high bit, across a low bit, to the end of another high bit). So, each bit is 4.38 microseconds, which is approximately 228310 baud. Given that I measured by eye, I'd say that's 230K.

DS1Z_QuickPrint4.png


Now let's look at my PC running Hyperterminal at 230400. This is an RS-232 signal going from 9.5V to -9.8V. So, maybe the difference in voltage levels at such high speeds is the source of communication errors. The width of two bits is 8.68 microseconds. Which gives 230414 baud. That means the Mac and PC are close enough that there should not be a problem.

DS1Z_QuickPrint2.png


Now let's run Basilisk II at 230400 (same PC, same USB adapter). Uh oh, the width of two bits is 7.64 microseconds, which is 261780 baud. That's too fast.

DS1Z_QuickPrint5.png
 
  • Like
Reactions: JDW

David Cook

Tinkerer
Jul 20, 2023
80
97
18
Welp, there's the problem. They are using 256000 baud because there doesn't seem to be a predefined CBR value for 230400 baud. I can't locate an answer online for generating the correct baud rate.

1760855719026.png


And another problem that I noticed, 14400 is missing. This is an easy fix.

1760855849917.png
 

Byte Knight

Tinkerer
Oct 21, 2021
121
104
43
I then reached out to @Byte Knight , who runs the Captain's Quarters II BBS with a quad (HQS) CSI Hurdler. He immediately sent me a copy of the ROM. (Thank you!!). Burning and installing the quad ROM indeed successfully finished the conversion of the dual card to a quad card.
No problem - that Slotrom program you suggested worked slick! Didn't even have to break out the ROM burner...

Just for clarification, CQ II BBS runs on a Mac Mini via telnet connections all year round. I've used the CSI Hurdler in my IIci during #MARCHintosh to host a Hermes II BBS (called The Crow's Nest) with 6 wifi modems.

And I'm still holding out hope that you'll eventually host a BBS with the 4-port Hurdler! 🤞
 
  • Like
Reactions: JDW

dougg3

Tinkerer
Jan 10, 2022
28
43
13
www.downtowndougbrown.com
Welp, there's the problem. They are using 256000 baud because there doesn't seem to be a predefined CBR value for 230400 baud. I can't locate an answer online for generating the correct baud rate.

Interesting! It appears that the DCB structure also allows just setting it to an arbitrary number, according to Microsoft's docs. For example the CBR_115200 constant is simply defined as 115200. It might be worth trying to patch the code to see if assigning 230400 "just works" for you.

It does appear that the higher bit rate likely won't work on all hardware, though. My motherboard's built-in COM port doesn't accept 230400 or 256000 in PuTTY, but an FTDI USB-to-serial cable does. (I didn't test if the requested rate was actually applied though). So you might want to see if PuTTY allows you to open the port as 230400 with your hardware before trying.
 

JDW

Administrator
Staff member
Founder
Sep 2, 2021
2,281
1,856
113
54
Japan
youtube.com
Because.... Why not? 😂
Oh, so it's a "techno-geek experiment" then. I see.

I was just curious because when I do geeky things like overclock a motherboard, and that geeky act has certain key benefits for me in terms of computing power, performance, better game play, and the list goes on. I was just curious if that was true in this case of this faster serial ports thread.

Another example is the SCSI Booster clone created by @max1zzz , which is super duper techno-geeky stuff, but it has real-world benefits for anyone who uses a drive in a NuBus Mac (and who has a Radius Rocket too, of course).

This is not to say experiments and tinkering is bad. We are TINKERdifferent after all. :)