-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSIO2PC.txt
2285 lines (1880 loc) · 116 KB
/
SIO2PC.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
INTRODUCTION 4
FEATURES: 4
HARDWARE REQUIREMENTS: 6
HISTORY: 6
SHAREWARE INFO: 6
READ ALL ABOUT IT: 7
TECHNICAL INFORMATION ON SIO2PC 7
REMOTE CONTROL PROGRAM: 9
FILE2PC PROGRAM: 9
STRUCTURE OF AN SIO2PC ATARI DISK IMAGE: 10
USING RAMDISKS: 10
TIMING INFORMATION: 11
DOUBLE DENSITY: 13
FORMATS VS DISK SIZES: 13
FILE ACCESS: HOW IT WORKS & TIPS ON EFFICIENCY 16
MORE DISK CONFIGURABILITY: 17
SIMULATED DISKS: 19
PRINT-THRU: 20
UNINSTALL DISK: 22
STATUS LINE INFO: 22
PC MEMORY USAGE: 23
DOS SHELL FEATURE: 23
VIRUS DETECTION: 25
REMOTE CONTROL PROGRAM USAGE 26
MAKADISK.EXE 27
FILE2PC USAGE INFORMATION 28
COPY PROTECTED DISK SUPPORT 28
DIAGNOSTICS FEATURES 33
FUTURE PLANS, CURRENT PRICING 34
REVISION LOG: 36
PROBLEM DIAGNOSIS QUESTIONS 48
POSSIBLE PROBLEMS AND SOLUTIONS 49
USER'S QUESTIONS 53
WHO'S NICK KENNEDY? 56
OTHER PROGRAMS 58
SIO2PC: An Atari to PC Interface System
by Nick Kennedy
D I S C L A I M E R
I have tried to ensure that my software is free of harmful defects (bugs)
and of viruses. However, either could slip through my defenses. Use the
software at your own risk. Similarly, I believe my hardware design to be
in accordance with good practice, and I have a number of satisfied users.
However, wiring errors, errors in my design, and configuration
differences are possible and I cannot guarantee that these problems will
not lead to damage to your equipment or software or other unforeseen
damages. Use at your own risk. Furthermore, if you choose to construct
my interface yourself, you must be experienced with electronic building
techniques. Even if you are experienced, you could burn or cut yourself
or experience other damage or injury, for which you must assume
responsibility.
I consider the SIO2PC system to be a service to the Atari user's
community. Although I accept shareware contributions, and do make a
charge for assembling interfaces or kits, I still consider my efforts to be a
hobby and a service. IF YOU HAVE SENT ME ANY PAYMENT FOR
ANY SOFTWARE, KIT, OR ASSEMBLED INTERFACE AND DO
NOT WISH TO ASSUME FULL RESPONSIBILITY FOR USE OF OR
CONSTRUCTION OF THESE ITEMS, RETURN THEM TO ME
AND I WILL REFUND YOUR MONEY. IF YOU ARE
CONSTRUCTING THE INTERFACE AND CANNOT VERIFY THE
ADEQUACY OF THE DESIGN ON YOUR OWN, SEEK THE
ADVICE OF ONE COMPETENT IN ELECTRONICS. OTHERWISE,
DO NOT ATTEMPT TO BUILD AND USE THE INTERFACE.
DON'T USE THE SIO2PC ON COMPUTER SYSTEMS USED FOR
COMMERCIAL PURPOSES OR FOR CRITICAL APPLICATIONS.
INTRODUCTION
Greetings Atari and PC users! SIO2PC is now a shareware product. If
you know little or nothing about the system, let me give you a rundown.
A separate text file, SIOINSTR.TXT, gives more concise information on
running the system and describes its features.
SIO2PC is a hardware interface and software utility package to allow
storage of your Atari files on your PC's hard and floppy disks, file
conversions in both directions, and Atari printer output redirection to
your PC's printer, screen, or file.
FEATURES:
Create 1 to 4 virtual Atari disks on your PC.
Virtual disks can be ramdisks or physical file access disks; disk
images can be up to 65525 sectors in size.
Save Ramdisks to PC hard or floppy disks.
Boot from the PC. Real drive not needed to start-up.
Create Single or Double density ram-drives.
No special Atari software patches. Use your favorite DOS.
Almost twice as fast as an Atari 810 drive.
Co-exists in the Atari daisy chain with "real" drives.
Software written in assembler: Compact and Fast.
Compatible all the way down to the hardware level - CIO, SIO,
even direct hardware calls to drives will work.
Print-Thru mode sends your Atari's printer bound output to your
PC's Printer, Screen, or file.
File Conversion: Convert and transmit PC files to Atari, or Atari
files to PC files.
Won't endanger your PC's hard disk. Your Atari disk images are
stored as ordinary PC files. No direct sector writes used.
Status line shows you exactly what your Atari is telling your disk
drives: drive number, command, and sector number.
1050-2-PC Feature allows connecting PC directly to Atari drives
and copying or writing data. (Separate interface hardware
required)
HARDWARE REQUIREMENTS:
SIO2PC connects any PC compatible computer to any of the Atari 8 bit
computers (400, 600, 800, 800XL 130XE).
The interface between your PC's serial port and your Atari's SIO port
requires a simple interface. It uses an integrated circuit and a few
capacitors and other components and can be built on a 2" X 3" prototype
board. If you are handy with a soldering iron, read the BUILD_IT.DOC
file on your disk. It gives complete instructions, including addresses of
parts suppliers. If you wish, I'll build one for you, or provide you a kit of
all parts with drawings and detailed instructions. See BUILD_IT.DOC.
HISTORY:
SIO2PC has been about 10 years in the making. Before I got my PC, I
considered my alternatives for my trusty Atari 800. Should I invest in an
adapter and hard disk for the Atari? I realized that the huge PC market
made an entire PC with hard drive almost as cheap as adding a drive to
my Atari. So why not do both? The PC could store my Atari programs
(get rid of that huge pile of floppies), and I'd have a new computer to
boot! The project has worked out better than I could have imagined
Curing the Atari's mass storage weakness makes it even better.
SHAREWARE INFO:
As you no doubt know, Shareware is a system which allows you to
receive freely distributed software, and pay for it if you find it useful. If
you build the interface and find that the system is useful, I request the
modest sum of $10 for the design and software. If you choose to buy the
kit or assembled interface from me, no additional payment for the
software is expected. Upgrades are free. Your suggestions will be
considered for future revisions. I will try to answer questions and
problem reports.
READ ALL ABOUT IT:
Don't you hate to write off for a shareware program that looks good in
the ad, only to find an endless README file describing the limitless
complexities of the package? Now that I'm on the creating end of that
particular method of information overload, I can see how documentation
files just grow... But - SIO2PC is a simple menu driven program which
can, I believe, be mastered without instructions. So, skim through the rest
of this file and the other .DOC files for tidbits, and return only if you have
problems or specific questions after you get your system going. Of
course, if you decide to build it yourself, you will want to read
BUILD_IT.DOC carefully. Also, go ahead and run SIO2PC.COM and
play with the menu options a bit, even without the interface. Note: This
DOC file gives some problem resolution information, technical
information, and more information on file transfer features. For a more
concise user's guide to the program, see the SIOINSTR.TXT file.
A NOTE ON A RELATED SOFTWARE DEVELOPMENT
A programmer named Darek Mihocka recently (7/94) released a freeware
version of an Atari 800 emulator which runs on the PC. The faithfulness
with which it emulates the Atari is very impressive. It emulates a 6502
processer and the Antic video microprocessor perfectly and includes the
actual Atari OS and BASIC code. I mention this partly because every
serious Atari 8 bit fan with a PC must have it and partly because it will
read SIO2PC format disk images. So by having SIO2PC, you have the
capability to transfer your files to the PC for access by Darek's XF3
(Xformer) emulator.
TECHNICAL INFORMATION ON SIO2PC
SIO2PC is 100% written in PC assembly language. REMOTE.OBJ and
FILE2PC.OBJ are written in 6502 assembly language.
MAKADISK.EXE is written in 'C'.
SIO2PC recognizes the basic SIO bus commands: READ SECTOR,
WRITE SECTOR, PUT SECTOR, STATUS, FORMAT, FORMAT
1050 1.5 DENSITY.
Because it works at this elementary level, it should work with any DOS
and with non-DOS disk loader programs. You can also make boot disks
(without DOS) and boot them from the PC.
SIO2PC uses only MS-DOS calls to do file I/O on the PC. Because there
are no direct sector writes, etc., SIO2PC won't trash your PC disks. Just
use the right path/filename when doing writes.
SIO2PC uses file handles, so I assume it will require MSDOS or PCDOS
2.0 or later.
SIO2PC redirects the timer 0 interrupt for it's timing purposes. This is the
timer which supplies the BIOS its "timer tick", 18 times per second, 55
milliseconds per tick. SIO2PC also directly reads the timer as it is
counting down in a routine for more fine timing (the microsecond level).
Note: Most PC Clones are HIGHLY hardware compatible.
SIO2PC gets the port address for the specified COM port from bios data
area words at 040:0000, 040:0002, 040:0004, 040:0006 for COM 1,2,3,
and 4. I've found out that the POST routine typically doesn't set up the
addresses for ports 3 & 4. Therefore, version 1.01 will use default port
addresses 03F8, 02F8, 03E8, 02E8 for COM 1 - 4 if it finds a zero in the
BIOS data area word. If you know your port addresses to be other than
this, a third option is now available. Use your computer's documentation
to find the base address, and use SIO2PC's "E" command to enter the
addresses directly.
REMOTE CONTROL PROGRAM:
The Atari serial bus reserves device ID's 31 - 38 hex for disk drives 1
thru 8. I have used ID #39h for the remote control function. When the
SIO2PC program finds this ID # in a command frame, along with a Write
Sector command, it expects to receive one sector (128 bytes) containing
a command string. It then acts on the string as if it were a command tail
from the DOS command line. Any error, or the Atari EOL character, will
terminate command processing and flush the line of any further
commands. It is best to end the string with a space as a delimiter,
especially if your command ends in a pathname, else your PC may pause
waiting for input or an ENTER keystroke. A REV 2.1 change added this
function to the REMOTE process: When DEVID = 039h and DCOMND
= 'R', the SIO2PC sends a 128 byte data frame to the Atari containing the
DISK status information string shown on the screen. The string sent
depends on the contents of DAUX1 which must contain 1 - 8 for disks 1
- 8. This function allows REMOTE.OBJ on the Atari to update the user
as to the status of the ramdisks, before and after the execution of the
remote function. In this way, the user can see if his remote command
went to error free completion. In some cases, the PC may be busy
carrying out the command when the data request is received. For
example a command to write a ramdisk out to a floppy disk may take 10
seconds or so. Therefore, REMOTE.OBJ tries 3 times, pausing 4.25
seconds between retries, before giving up on getting the information.
FILE2PC PROGRAM:
The FILE2PC program also uses its own bus ID as a trigger for the
FILE2PC program. ID# 03Ah puts the program into File Transfer mode.
The Atari (running FILE2PC) always asks for Status of device 03Ah
before putting a sector. (Only Status and Write are recognized by device
03Ah.) If the first status byte (of 4) is normal (010h), then the PC is ok
for the transfer mode. If it is 0FFh, then the Atari will abort because the
PC has encountered an error. The process works like this: The Atari gets
Status, then, if OK, it sends a sector to the PC. The PC assumes that this
sector contains the pathname of the destination file, terminated in an
ATASCII EOL. The Atari pauses 4 seconds while the PC attempts to
create the file. (Note, any existing file of the specified pathname will be
overwritten.) After the Atari gets another good status, it starts sending
sectors of file information.
The AUX bytes, which usually carry sector # information, communicate
the following to the PC:
AUX1 = 0: Full sector, 128 bytes AUX1 = 1: Last sector, AUX2
contains the byte count
AUX1 = 2: Atari encountered an error, abort process.
As I said, the Atari asks the PC for Status after every write.
STRUCTURE OF AN SIO2PC ATARI DISK IMAGE:
It's extremely simple. There is first a 16 byte header with the following
information:
WORD = special code* indicating this is an Atari disk file
WORD = size of this disk image, in paragraphs (size/16)
WORD = sector size. (128 or 256) bytes/sector
WORD = high part of size, in paragraphs (added by REV 3.00)
BYTE = disk flags such as copy protection and write protect; see copy
protection chapter.
WORD=1st (or typical) bad sector; see copy protection chapter.
SPARES 5 unused (spare) header bytes (contain zeroes)
After the header comes the disk image. This is just a continuous string of
bytes, with the first 128 bytes being the contents of disk sector 1, the
second being sector 2, etc.
* The "code" is the 16 bit sum of the individual ASCII values of the
string of bytes: "NICKATARI". If you try to load a file without this first
WORD, you get a "THIS FILE IS NOT AN ATARI DISK FILE" error
message. Try it.
USING RAMDISKS:
SIO2PC uses, or can use, the PC's hard or floppy disks to store Atari
disk information. However, to give maximum speed, the disk information
can be buffered via a ramdisk set up in the PC's ram space. When the
Atari reads/writes its SIO2PC "disks", it is actually communicating with
the ramdisks in the PC's memory. The user can choose to load a ramdisk
image or save one back to physical disk at any time via menu selection.
For files too large to be installed as ramdisks, file access to the disk
image is used. (Actually, with modern PC's, there isn't any speed
advantage of a ramdisk over file access. The speed of the SIO bus is the
limiting factor)
TIMING INFORMATION:
The Atari SIO2PC bus protocol specifies minimum and maximum times
between Atari commands and disk drive's responses. The minimums give
the Atari time to get ready to take the data from the bus if it has to do
some other work in the interim. The maximums let the Atari decide that
the peripheral isn't ever going to answer and it will give a "time out"
error. I have found that the system is very flexible and forgiving. I have
used wide variations and still had a workable system. But for one guy
(you know who you are, Joe!) or maybe two, I've made this menu to
allow you to experiment with different values. The system goes through
this little dance of command - acknowledge - data - acknowledge -
complete, etc with timings in between. In addition to these times inside
the bus frame, I've made a couple more (normally zero) time delays
available.
First: On a serial bus, data is normally sent continuously, with no time
(except start and stop bits) between bytes. Now you can experiment by
adding some time here. (My system slowed down but still ran normally.)
Second: Some publications say that some UART (serial) chips can't stand
to be addressed as fast as some PC's are capable of addressing them. I
already had a bit of time delay in there, but now you can add some more.
The time delays work like this: Each unit is 420 nano-seconds which is
almost 1 micro-second. (Multiply units by .42 to get micro-sec.)
(Exception: the value for the printer delay is in 1/18ths of a second.)
Also, you must enter the units as a 4 digit hex number. Don't panic, it's
easy. Here are some conversions:
DECIMAL HEX
0005 0005
0010 000A
0050 0032
0100 0064
0250 00FA
0500 01F4
0750 02EE
1000 03E8
2000 07D0
The timing menu gives default values you can use as a starting point.
One problem with the TIMINGS menu is that it can't be addressed from
the command line tail, so if your system does need non- standard timings,
you have to set them up manually, each time you run the program. Not
any more, Joe! Here's a procedure to permanantly alter your program:
This procedure uses DOS's little utility "DEBUG," because everyone has
it. But you could use NORTON or similar if you want. I moved the
timing values to the front of the program and put an ASCII string in front
of it to make it easy to spot. Try this:
I recommend that you copy SIO2PC.COM onto a floppy because it's a
little scary using DEBUG to write to one's hard disk. Ok, you've done
that and you have the floppy in drive A:. Get into A: by typing A:
<ENTER>. Now, type DEBUG SIO2PC.COM <ENTER>. Give the
"GO" (run) command by typing G <ENTER>. SIO2PC runs from the
floppy. First give it a port number, then go to the "A" menu and change
the timings values to those you have found to work on your system.
Now, leave the timings menu and QUIT SIO2PC. You will see by the
hyphen that you are back in DEBUG. Type W <ENTER> and the
program will be written back to the disk file. Quit DEBUG with Q
<ENTER>. Now run SIO2PC without DEBUG, and call up the timings
menu again. You will see that the DEFAULT column stayed the same
but the CURRENT values are now permanently altered. Hey, I didn't
know that DEBUG could be so useful, did you? NOTE: You should get
a message saying program changed, possible virus. Just choose to write
a new CRC and the program will be fixed.
NOTE: Per Bo and Ernest Schruers, if you have a fast Pentium and are
having timing problems, try making T4 and T5 equal 0010. Paul Hozak told
me that he had to set T7 equal to 0190H (normally 0008H) on his 133 MHz
Pentium with 16550 UART.
DOUBLE DENSITY:
The Atari expects the first 3 sectors on a disk to be single density. This is
necessary if you are to be able to boot from the disk. SIO2PC uses this
format for its double density mode.
FORMATS vs DISK SIZES:
I generally haven't restricted these things, but recommend the following:
Use 130K size only for "enhanced" or "1.5" or "DOS 2.5" density. The
183K size was created for double density. A lot depends on your DOS.
Some DOS's can figure out the actual size of a disk, others may assume a
default. MYDOS is pretty smart. SPARTADOS probably is also. As of
REV 3.00, SIO2PC responds to "get" and "set" configuration commands,
and also allows you to select any size disk you want by specifying the
number of sectors.
As a result of changes made in REV 3.00 and beyond which allow
HUGE disk images, I now have additional information to present on disk
sizes:
File Access and BIG disks
The biggest change is the addition of file access to disk images. Since
this type of access doesn't require setting up ramdisks, the disk image size
isn't limited by available ram. You may choose the size of your disk
images using new size choice #5. You specify the size in sectors. If
you're interested in what this means in kilobytes, you can figure it from
the fact that a sector is 128 bytes for single density disks and 256 bytes
for double density. Remember the status line field that shows 'W' if
you've written to a ramdisk but not saved it? (And 'N' if the file has been
saved.) For direct file access type disks, this field will contain an 'F'.
Note that you can force the system to use file access, even when there is
enough ram for a ramdisk. You do this by following the filename by "/P"
for physical file access. Don't put a space between the filename and the
"/P". The "P" will appear on your status line. (The "/" won't.)
Concerns about Speed
I was concerned that the overhead of using DOS and having physical disk
accesses might slow the system down. On my two PCs, this hasn't been a
problem when using hard drives. I use disk caches on both systems and
can't tell any difference between "ramdisk" and "file access" speed. With
a floppy disk, my fears were justified. Access was slow enough that the
Atari would time out and generate errors. But, when I installed a disk
cache, floppy disk access worked fine too. Some disk caches don't
support floppies. Smartdrive (supplied with DOS 5 and WINDOWS)
doesn't. I used one called LIGHTING. It worked fine using
conventional memory while Smartdrive continued to run using extended
memory.
Get/Set Configuration
Even after I first made some BIG disks, MYDOS 4.5 still couldn't figure
out that they were bigger than a standard 810 or 1050 disk. The
standard Atari SIO protocol doesn't include a means for the drive to tell
the Atari what it is capable of (except in a very limited way). I found that
I had to implement the extended SIO commands for Get and Set
Configuration so MYDOS would realize the actual size of the disk.
MYDOS does some of this automatically (reads configuration on
bootup). But I found that I had to explicitly do this in sequence so
MYDOS would realize the disk size:
Create the new (blank) disk image.
Use the Set Configuration command, answering questions as
follows: Configurable? Yes. High Capacity? Yes. Number of
Sector? xxxx. Do this before formatting.
Format the new disk image.
Actually, SIO2PC doesn't do anything with the Set Configuration
command other than acknowledge it. But it lets MYDOS know that the
disk is capable of more sectors than a standard disk. The program WAS
going to also warn you if you tried to set the wrong density. But it turns
out that MYDOS always tries to set high density when you answer "Yes"
to "High Capacity Drive?". This doesn't cause a problem though: single
density still works OK. I'm describing MYDOS because it's what I use.
YOUR Atari DOS may have its own quirks with regard to large drives.
MYDOS can become confused when you use the SIO2PC Swap Disk
I.D.s command. MYDOS associates a certain disk number with a certain
configuration. You may have to uninstall and reconfigure the drive with
MYDOS when you swap disks of different types.
Formatting
With regard to formatting, it can take a long time with a BIG disk image,
especially on a floppy. SIO2PC sets a flag when you first create the disk,
to tell itself that the disk image is already blank. So, when you format it,
the program doesn't bother clearing the disk. This saves a lot of time.
After you write to the disk, the flag is cleared. Then, formatting includes
clearing the entire disk image file. This could cause the Atari to time out
and not realize the format was successful. So you may want to avoid
formatting "used" disk images. I can't think of a reason you'd want to.
(CREATING a new disk image can take a while too, but the Atari isn't
involved in this process, so it won't get impatient.) I may improve the
program to speed up this process if it's a problem. But creating new BIG
disks will probably be an infrequent operation for most of us.
*** NOTE: In a "rev 3.00 and 1/2" modification, I have taken a big step
toward curing the slow formatting problem. Instead of writing blank
sectors one at a time, I now write zeroes in blocks of 4K at a time,
dividing the number of DOS calls by 32. This only works if there is at
least 4K of free ram. Otherwise, formatting will still work slowly, as
described above.
Note that you need to be a bit more careful when formatting file access
disks. With ramdisks, you could always choose to not save the formatted
disk image, so your original was safe. With file access, formatting
actually clears your disk image file.
Another addition with this revision is that you can now number your
disks as 1 - 8 instead of 1 - 4.
Incidentally, you may wonder why your old 92K and 143K disks are now
90K and 140K. This has to do with the difference between a kilobyte as
1000 bytes and a kilobyte as 1024 (2^10) bytes. Revision 3.00 divides
the disk size in bytes by 1024 to establish the disk size.
FILE ACCESS: How it works & tips on efficiency
It's pretty simple. MS-DOS maintains a pointer into open files which can
be set by the program. SIO2PC maintains a corresponding pointer to the
next Atari sector. When SIO2PC receives a read or write sector request
from the Atari, it calculates the file offset from the sector number. It
compares this to its record of where the pointer is now. If they differ, it
asks DOS to point to the new location. Then it asks DOS to read or
write 128 (or 256) bytes and increments its internal sector pointer by one,
since DOS's pointer will now be at the next 128 or 256 block of the file.
As you can see, if the Atari asks for sectors sequentially the pointer
automatically moves along in step and no separate requests to reposition
the pointer are needed. This is a good reason to try to keep your disk
images unfragmented. Actually, it's possible to have things DOUBLY
fragmented: fragmented Atari disk images and fragmented PC disks. To
avoid Atari fragmenting, you should first put files on the disk which you
won't be deleting or changing: DOS, games, application programs. Last,
put on any stuff that will change: data files, text files, etc. If you suspect
your disk is fragmented it's easy to undo. Just do a file copy (*.*) from
the fragmented disk image to a newly created and formatted blank disk
image.
MORE DISK CONFIGURABILITY:
I've heard lots of reports about the inability to format certain disk image
sizes. My adding the "get configuration" and "send configuration"
functions in Rev 3.00 in some cases seemed to make matters worse.
I'm now getting into an area where the specific DOS one uses makes a
difference. So my treasured concept of "DOS independence" of SIO2PC
is going out the window. The problem is this: How can the system tell
the Atari exactly what size and type of disk it is emulating? The 12 byte
configuration table exchanged via the GET/SEND CONFIGURATION
commands would seem to be the answer. Unfortunately, both MYDOS
and SPARTADOS admit to ignoring most of the information exchanged.
The variables are:
SINGLE/DOUBLE DENSITY: 128 or 256 bytes/sector
SINGLE/DOUBLE SIDED DISK
NUMBER OF TRACKS/SIDE: TYP: 35, 40, 77, 80 expected
NUMBER OF SECTORS/TRACK: TYP: 18 or 26 expected
The MYDOS doc indicates that it likes to consider the disk to be one
huge track containing all the sectors. This seems to work pretty well for
SIO2PC.
SPARTADOS evidently expects to receive information which matches its
expectations about certain combinations. The sizes under the choice
6/Other are intended to give SPARTADOS what it expects. (As
standards, they are probably good for other DOSes too.)
One thing I've recently learned (I think it's true, anyway) is that
SPARTADOS considers 26 sectors/track to be "1050 enhanced density"
in all cases except for 77 track drives which always have 26 sectors/track.
The bottom line is this: Even though you can choose a disk image of any
size with the new SIO2PC option #5, you may have to adhere to certain
standard sizes when using SPARTADOS. I've added a lookup table to
the program. If the disk size matches a certain standard, it reports a
combination of standard values to the Atari. Otherwise, it uses the
MYDOS technique of 1 track holding all sectors. Note that this routine
puts a tilde ( ~ ) in the ERR field of the status line if it finds a standard
size.
Note that when you choose double density, the basic 1, 2, 3, & 4 choices
won't be seen as a standard size, but the equivalent chosen from sub
option 6/More WILL, for technical reasons too boring to go into here.
As I've said, this usually doesn't matter, because most DOSses don't use
the GET/SEND configuration capabilities anyway.
You could compute some standard sizes like this:
Number of Sectors = (#TRACKS * #SIDES * # SECTORS/TRACK)
Size in Bytes = (Number of Sectors) * (#Bytes/Sector)
(For the Size in Bytes, subtract 384 for double density, because the first 3
sectors are always 128 bytes.)
All YOU have to pay attention to is the density and the number of
sectors. SIO2PC will report the other numbers to the Atari. For
MYDOS, just randomly picking a number of sectors, without regard to
standard sizes, seems to work fine.
As I said before, the addition of the GET and SEND
CONFIGURATION info commands in some cases did more harm than
good. For this reason, I've added yet another feature. Now you can turn
on or off the configuration transfer function. Since the main menu was
getting full, I added this to the TIMINGS menu. Just hit 'A' to see the
timings menu. Then hit 'C'. The status of the installed disks will be
shown. 'Y' means they DO respond to configuration commands. Enter
the disk's number to toggle its status with regard to this function. I
believe this should only be necessary when getting ready to format, if at
all.
I realize this discussion of REV 3.01 isn't exactly simple. I hope you can
glean the necessary info from it. It should be worth the effort to get
ULTRA SPEED going and to cure formatting problems. Call or write if
you have problems, bugs, or suggestions. I'd especially like any
SPARTADOS experts to tell me how it tells me to go back to high
speed.
What is the '@' command SPARTA sends to device $4F? Also any info
on how to get SPARTADOS to accept ANY size disk image would be
useful.
Rev. 3.05:
I added many more choices to the standard disk sizes for the "create
disk" option (option #6). The new choices are those which correspond
the selections in the SPARTADOS format menu. This is to make your
choices easier when using SPARTADOS. Internally, things still work the
same. Again, with MYDOS, you shouldn't need to worry about certain
prescribed sizes. Rev. 3.17 refined and corrected much of this.
SIMULATED DISKS:
The main event for 3.05 is the addition of what I call "simulated" disks.
This allows you to install any PC file as an Atari disk, without the
necessity of converting it to an Atari disk image.. This is more or less
intended to replace the much despised MAKADISK.EXE. The features,
theory of operation, and limitations are described below:
The simulated disk is always single density (no size limit) and DOS
2.0/2.5/MYDOS compatible. It can't be written to, and can only be read
sequentially (no random access). You CAN copy your executable files to
the PC with FILE2PC and load (run) them directly using this new
function. If you ask for a directory, you will see the PC file's filename on
your Atari. (The length in sectors has no meaning.) Normally, after the
end of file has been reached, the system automatically unloads the disk.
If you don't want this, use the /N (no space) option after the filename and
the file pointer will be reset to the start of the file after the end is reached
- making the file available to read again. A new command has been
added to install the simulated disk - the "I" command. It replaces the old
"Z" command (create double) which is now a separate choice under the
Create Disk option.
The new function works like this: A simulated directory sector is given
on demand (#361). (When read, it causes the file pointer to be reset to
the start of the file.) There is also a simulated sector #1 and sector #360
because some DOSes read these sectors to get information about the
disk. The simulated directory supplies a dummy sector pointer to sector
401 to start the file. Each simulated data sector increments the sector
number for the "next sector" link. Thats why the status line will show
you reading sector 401 thru 700. Then, it rolls down to number 401
again. So if it rolls over, you have read 300. (As of 3.10, trying to write
doesn't return an error to the Atari, it "pretends" to write the sector.)
Trying to read a sector out of sequence doesn't return an error either.
The program would still just supply the next 125 file bytes if this
happened. Note: if you need full functionality (READ, WRITE,
RANDOM ACCESS) for your Atari-file-on-a-PC, just copy it to an Atari
(SIO2PC) disk image.
There are a lot of uses for this new feature. You can download Atari
files to your PC and immediately load/run them on the Atari. You could
program in 6502 on the PC using a cross assembler and load the files to
the Atari with no translation required. You may choose to keep some
favorite programs available under a "one Atari file per PC file" basis as an
alternative to having files under Atari disk images.
With rev. 3.11, boot files may also be simulated. To use this feature, just
put /B after the file name. You can combine /B and /N if you want. The
program will send the next sequential 128 bytes to the Atari each time it
requests a sector, until the end of file is reached.
PRINT-THRU:
The serial bus ID for the Atari printer is 040h. With PRINT-THRU in
effect, the program answers bus commands directed to the printer and
routes the data to the PC's printer or screen, as selected. Note that the
Atari uses an EOL character (09B hex) to mark the end of line, while the
PC uses carriage return and line feed (CR/LF) characters. So SIO2PC
gives you the option of making the translation. If you are printing text,
you should translate. For graphics, probably don't translate. You can also
strip the high bit if you want. The reason? ASCII is a 7 bit text code.
Computers use 8 bit data. So, text with the high bit set is not defined
under ASCII, and different computers use it differently. On the Atari,
text with the high bit set is printed to the screen as inverse video. On the
PC you may get graphics characters. So, when printing text, you usually
want to clear the high bit. If you are printing 8 bit graphics data, you
usually don't want to change it.
For revision 2.6, I've made some changes to the PRINT_THRU function.
The reasons, and other comments, are summarized below:
PRINTER NOTES, REV. 2.6
Due to reports of problems with the PRINT-THRU mode in certain
cases, I've reworked the print-thru routine.
My basis for this feature is to try to provide 100% compatibility with the
Atari 850 Printer/Serial interface, since it should be the standard for the
Atari. I went back and reread the functional description in my 850
manual. Here is a summary:
The Atari printer handler (in the computer's CIO, not in the 850) sends
fixed length records (40 characters) to the printer. If an EOL (RETURN
key) is encountered, it fills the rest of the buffer with spaces and sends it.
Note that software on the Atari doesn't necessarily have to use CIO. It
can send data directly to the serial port using SIO. Fixed length, 40 byte,
records are still necessary because the interface expects them. Now,
when the 850 receives a 40 byte record from the computer, it goes by
these rules:
1) Send all bytes to the printer, as 8 bit data (no clearing the high bit)
except,
2) If an EOL (9B hex) is encountered, convert it to a CR character, and
ignore the rest of the buffer (assumed to be extraneous spaces supplied
by CIO) except,
3) If several consecutive EOLs are found, translate them all to alternating
CRs and spaces and send to the printer. NOTE: rev 2.8 took out the
spaces. My version was adding a space even if there was only one EOL,
causing alignment problems in the printout.
My interface was designed to provide several modes of operation, one of
which would emulate the 850 exactly. However, it wasn't doing some of
the things above. It didn't ignore characters after the EOL. It didn't
translate multiple EOLs to multiple CRs, only the first. It also translated
EOLs only to CR plus LF, not CR only. Now you have the option of
doing either.
What do the 850 rules above mean to the Atari printer programmer?
Well, as I see it, you can NEVER send a hex 9B to the printer, because
the conversion is irrevocably hard coded into the 850's ROM. Since
graphics data by nature can represent any dot pattern, it must include all
possible combination of bits, including $9B. This really isn't a huge
problem. The software would just have to detect EOLs and change one
bit. One dot's worth of error out of every 256 * 8, on average, won't hurt
anything. Another "cure" would be to have a printer which requires 7,
not 8, bit data. Since $9B has its high bit set, it would never be required
to send graphics data. (Just as it is not required to send standard ASCII
text, a 7 bit system.)
All this info is presented for your amusement only. Hopefully, if my
emulation of the 850 is correct, your software will play just like it did on
your Atari printer. Of course, the Atari software will have to be
configured for the characteristics of your PCs printer, not your Atari's
printer, assuming they are different.
Rev 2.10 information: I added a value to the TIMINGS menu for the
printer. This is experimental at this time. One guy has a problem with the
system (PC) locking up after 3/4 page or so. I think maybe his printer
isn't handshaking properly, so I've added this timing value, to keep from
"overrunning" his printer. The normal value is 0. If you have problems,
add a little time. This value is in units of 1/18th of a second, so keep your
number small or you'll be in for a long wait. It is the value used between
sending of 40 byte records to the printer. Figure out about how long it
takes your printer to print a line and use about half this value in seconds.
So if your printer printed a line in 1 second, the value used would be
0009 for 9/18 of a second.
In 3.07, I added another translation to the PRINT-THRU function.
Now, you can also change the ATASCII tab character to a standard
ASCII TAB in the PRINT-THRU process. A 'T' on the PRINT-THRU
status line shows that you have chosen this option.
UNINSTALL DISK:
Why is it important to be able to do this? Well, if you have already used
up all your memory in defined ramdisks, you can't overlay them with new
ones unless you remove the existing ones. This often would mean you
had to quit SIO2PC and restart it to get the configuration you wanted.
Now, you can delete ramdisks, and thanks to "garbage collection"
performed by the program, all data moves down to fill in the hole. So,
you now have free memory equal to the size of the deleted disk.
Uninstalling "file access" disks doesn't free any ram, but it does free up
one of your four allowed virtual disks.
STATUS LINE INFO & SOUND:
I've created a special status line, which is displayed at the bottom of
the screen, to help identify problems and to show that the SIO2PC
program is actively doing something. It shows:
HDL: File handle #: for debugging - making sure files get closed.
CMND: SIO command from the Atari (Read, Write, etc.)
LAST: Command received previous to the one above.
DEV: Hex number for device being addressed by Atari. Note
31 - 38 = D1 - D8; 40 = Printer, 39 = Remote Control program
3A = FILE2PC program.
COM: High/Low status of the Atari command line.
ERR: An error code returned by one of SIO2PC's routines.
A character here doesn't necessarily mean a problem. To aid
me in debugging.
SEC#: The sector # currently being written to or read from by the
Atari.
RAM: The amount of RAM you have free for use. It changes as
you install and uninstall ramdisks.
SPEED: N means normal speed 19.2K Baud, H means high speed,
as in Sparta Dos' high speed I/O.
Note that the status line is updated even when the device being accessed
isn't an SIO2PC device. This allows you to use SIO2PC to eavesdrop on
the SIO bus.
Rev. 4.16 added some sounds to help you detect what's going on, similar
to the way an Atari 800 gives aural feedback when reading & writing
sectors. Clicks of slightly different sound character indicate reading or
writing a sector successfully. Also, in the 1050-2-PC function, a beep
tone indicates that an error occurred. Since unwanted sounds can be
irritating, you can use the Z (not on the menu but it works) command to
turn sounds off and on.
PC MEMORY USAGE:
The technically inclined may want to know how the program decides it
has the right to RAM for its ramdisks. Well, I initially wrestled with this
one. I was trying to use a DOS function for "Allocate Memory," but I got
an error code meaning "no memory available." This was crazy, because
SIO2PC is a very compact program. It turns out that when DOS runs a
COM file, it allocates ALL available memory to the program. This is
because DOS is intended to be a single tasking system. I took advantage
of that fact. My program doesn't ask for memory, it just takes it, as
though it's the only player (which it should be). (Note: TSRs loaded
BEFORE SIO2PC are safe. SIO2PC only uses memory higher than that
allocated to itself.) I use an internal DOS variable to decide if there is
enough memory to load/create the ramdisk you request.
DOS SHELL FEATURE:
The main improvement added in rev. 3.08 is the ability to "shell out" to
DOS. What this means is, you return to the DOS command line prompt
"C:>" while SIO2PC is still resident. Then you can run DOS commands
or programs, type EXIT, and be back in SIO2PC. You will of course be
subject to limitations on the amount of memory available with SIO2PC
and any ramdisks you have resident in memory. It's a good idea to avoid
messing with (deleting, renaming) any files that SIO2PC has open, such
as file access disks. (SIO2PC doesn't leave files open when ramdisks are
loaded.) In order to make this function fit on the menu, I had to dump a
function. So, I took "R" off the screen. This is the function which
restores the screen (ESCAPE also works). Note that "R" still works, you
just don't see it on the menu. Due to the way memory is managed, you
shouldn't install any TSRs while in the DOS shell.
VIRUS DETECTION:
I got a rude introduction to the world of viruses a while back when I
found that my system had been attacked by a virus. Since then, I've
added the byte count on the sign off message as a small first step. Rev.
3.03 adds some more complex checks. As soon as SIO2PC gets control,
it loads a second copy of itself into memory. Why? Because the virus
may have already "done its thing" to the running copy, then fixed it to
look unchanged. Anyway, SIO2PC loads a second copy, and checks to
make sure it isn't any bigger than its supposed to be. You get a message
if the size is wrong. It then does a CRC calculation on the copy. If the
CRC result isn't as expected, you get another warning. The program will
still run, however.
I translated the CRC calculation algorithm from C code in a book on
serial communications. My version may not be exactly right, but it does
work. I've tried toggling a single bit and got the warning. Please note
that no system is foolproof. Virus and counter-virus development is like
the arms race.
These additions don't seem to slow down program loading to any
appreciable extent, but for those of you who can't tolerate ANY
slowdown, I've included an override. Just put /v or /V on your command
line somewhere after the program name and the virus checking will be
skipped. (You should put the /v after the port # since the program comes
up expecting a port #.)
If you make changes to the program by interrupting it while it's running
(as I showed you how to do elsewhere), it may make the CRC wrong.
To fix this, I've had the program print out the calculated CRC with its
sign off message. The idea was that you could patch in the correct CRC
value with DEBUG. However, with rev 3.08, that's been automated:
In 3.08, I changed the virus detection function (CRC check) so that the
program will offer to fix SIO2PC's internal CRC value to that just
calculated. This is mainly for me, so newly assembled versions can have
their CRC set automatically. If you get the warning and haven't changed
the program, better get out your virus checker and go over your files.
Delete SIO2PC and install a healthy copy.
REMOTE CONTROL PROGRAM USAGE
This section is to tell you how to use the Atari program called
REMOTE.OBJ. This program is found on your disk image file,
ATARI.ATR.
The program allows you to send commands to SIO2PC from the Atari,
just as if you were typing them on the PC's keyboard. So, if your Atari
and PC are in different rooms (or something), you can swap ramdisks,
save and load, etc. without leaving the Atari. The file is fairly small, and if
you plan to make use of it, you should copy it to as many ramdisk images
as necessary to assure that it's accessible when you need it.
When the program comes up, it shows a list of most of the SIO2PC
commands. If you want to study this list, hold down the START key, or
else it will scroll off after 3 seconds. The program next gets the status's of
the 4 disks from the PC and puts them on the screen. Now you are ready
to enter your command. Say you want to load a disk image from
A:\ATARI.ATR into ramdisk #4. Just type L4A:\ATARI.ATR and
RETURN. Note that some commands give you prompts which you must
answer in your command string, so anticipate them. For instance, if you
tell the PC to write back a file, you need to anticipate "USE EXISTING
FILESPEC?" and "FILE EXISTS, OK TO OVERWRITE?". Note that if
writing was successful, the "W" in the status line will have changed to
"N" after completion. One person was using REMOTE.OBJ on the Atari
as an AUTORUN.SYS, and feeding it with a batch script from
SPARTADOS to automate setup of his MIO ramdisks. Because he
couldn't simulate a character from the keyboard with SPARTADOS, my
"Run another command (Y/N)" left him stranded. For this reason, you
can now skip the command by starting your string with a space. When
REMOTE.OBJ sees the space, it will send the command to the PC, then
return to DOS automatically.
Note: After transmitting a command, REMOTE.OBJ is allowing the PC a
certain number of seconds to complete it before giving up on getting the
ramdisk status. If you find that not enough time has been allowed, let me
know so I can add some more. (If you choose to skip the rerun prompt,
you won't be getting the ramdisk status after command completion.)
MAKADISK.EXE
As I stated earlier, the need for MAKADISK.EXE has been pretty much
eliminated by the introduction of SIMULATED DISKS, which allow the
Atari to load in a file which is in native PC DOS file format. However,
you may still find a reason to use MAKADISK.
The purpose of this program is to allow you to take a PC file and convert
it into an Atari ramdisk image so your Atari can read it. For instance, you
may have a modem on your PC only, and want to download Atari files.
Or, you may want to write program source code on your PC, because it
has an 80 column screen, and send it to the Atari for compiling.
At present, this program is basic - it allows you to put only one file to a
standard single density ramdisk image. You should then boot the Atari up
with SIO2PC and copy the file to a real disk or a "full featured" disk
image (one created by SIO2PC and your Atari DOS). Then you may as
well delete the MAKADISK created ramdisk image, it has served its
purpose. You can't write more files to it, the VTOC isn't correct.
Note that another utility may be useful. I want to make one, but they are
available in public domain (PC Magazine's utilities disk has one). The
utility needed is to translate PC "end of line" codes (CR and LF) to the
Atari EOL code, which is hex 9B. If you are translating text files, you
will probably need this. Binary files (such as executable programs)
shouldn't generally be translated.
Note that MAKADISK asks for three things:
1. The name (or pathname) of the PC file to be converted to Atari.
2. The name of the PC's ramdisk image file. This is the name you will
give SIO2PC when you load the ramdisk image. I use an .ATR extension
for all my ramdisk images stored on the PC, but you can use what you
want. Note, MAKADISK doesn't tell you if there's already a file by that
name, so be careful, existing files will be overwritten.
3. The name of the Atari version of the file. This is the name you will see
in the first position on your Atari screen when you ask DOS for a
directory.
FILE2PC USAGE INFORMATION
FILE2PC.OBJ is an Atari program found on your ATARI.ATR disk
image file located on the distribution diskette. If you run this program on
your Atari, it will cause SIO2PC to go into the file transfer mode. Just
follow the prompts on the Atari. You can read the technical details in the
TECHNICAL INFORMATION section if you're interested. This file
transfer function has been much requested. A lot of people seem to have
text files on their Atari's and want to transfer them to their PC's so they
can pick them up on the PC's word processor. I should tell you that the
usual warnings apply to this: Different word processors use different
formatting control codes. This is true even if you aren't going to a
different computer. Plus, the Atari has its own method of ending a line. It