It was primarily written for the Synertek SYM-1 belonging to the 'local hackers club', to allow fast (~8kB/sec) program transfers during development, and to also provide a pseudo-terminal channel replacement for the none-too-reliable bitbanging 6522 serial port interface. (No dropped chracters at ~1400chars/sec. :)
To explain the protocol used, lets say I wanted to sync the Dallas DS1230Y Time-keeping nonvolatile RAM used on the 6502 system here with the system clock on the GNU/Linux box. The client might send through the handshaked parallel port, via calls to the PP Put_Char and Get_Char routines:
Code: Select all
"*t"Code: Select all
"101128142833"Code: Select all
Sync_Time:
lda #42
jsr Put_Char
lda #'t'
jsr Put_Char
jsr Delay ;required during any change in transfer direction
lda #80 ;enable updating the DS1230
sta $7FF8
jsr GetBCD
sta $7FFF ;year
jsr GetBCD
sta $7FFE ;month
jsr GetBCD
sta $7FFD ;day
jsr GetBCD
sta $7FFB ;hour
jsr GetBCD
sta $7FFA ;mins
jsr GetBCD
sta $7FF9 ;sec
lda #0 ;online the DS1230 clock
sta $7FF8
rts
Get_BCD:
jsr Get_Char
pha
jsr Get_Char
pha
jmp Magic_BCD_ConverterRather than conjure up code for the server's Time command handler, here's what's used for the '*T'ext command:
Code: Select all
void do_talk (void)
{
char s[MAXFNLEN];
get_string (s);
printf ("* TEXT\n%s\n* EOT\n\n",s);
}(*: a friend wrote an operating system for my 6522IDE interface that used a real harddrive; it was straight-forward to patch its I/O vectors to use PP-- the advantage being no need for a seperate power supply for the drive, and all data is stored and more accessible on the server this way.)
The server software runs on GNU/Linux systems(*), using IOCTLs for parallel-port access, so I assume it is portable across hardware platforms (maybe even USB-parallel adapters?) No bloated frameworks or obfuscation was employed-- there's just the one plainly-written C program.
(*: I had attempted to include the *BSDs, I have NetBSD on my primary workstation, but their schedulers got in the way..)
The server also provides a multiplexed 'telnet' manager for the pseudo-terminal feature: any number of users can telnet to port 2001 on the server to access the console [of the SYM-1], with all shared character I/O being converted to PPtty commands. The SYM-1 implementation includes a replacement
INTCHAR/OUTC with circular queues, so most 'well behaved' programs will now appear in the telnet sessions. I've tested it with MicroChess. :)
Hopefully you can see how this can be useful... This release includes the client software for the SYM-1 and Commodore 64/128. In future (after the around-Australia motorcycle holiday) I'm planning on a port for a recycled Z180 printer-buffer system with two parallel ports that has issues with its
serial (10MHz xtal..)
Source tarball download: http://tinyurl.com/26frgv2 (via http://kildall.apana.org.au/~cjb/sym1/index.php ) Code licenced as per the GPLv3.
