Posted: Fri Nov 21, 1986 6:46 PM PST Msg: OGIG-2492-7647 From: CHHU To: CHHU Subj: TO ALL CHHU and you too 'allo, Mates: Attached hereto is a 71 Basic program which will take a full disk on one drive and block copy its contents onto as many blank tapes as required. Seriously. Its one of a few ideas which I've sequestered from this media, and this one, from the Mynard, has been deemed useful to Brian before he obliterates his mass media units on an overdose of file copies; and useful for Michael who seems to quartermaster the group's media. M's block copy routines were written for him to turn a bunch of tapes into some disks. That task, well performed, is now old hat and mostly obsolete as it is the assumption of brains that files are now garnered upon the faster medium, which per chance has five times the capacity. Yet there yet be those who won't buy the beast, and should be CHHUfully welcome to use their tape drives. Thus the task has become the opposite, eh Bri? Now henceforth the downloaders of this program will be able at almost luxurious ease to self human and mechanical mass memory storage devices, accomplish the heretofore gnashing task of providing tapes for the non-diskers. Notable about the program is some of the following, as translated by the Woodpecker: Each useful sector on the disk, and only those which have information, is read only once. The tape is initialized by the program for a capacity of how ever many files will fit. This is optimum for all but the last tape, which presently will allocate but one file if that is all that is left on the disk after transferring the others. That problem is transferred to you. Put a test in before the initialization, that if it is the last tape (if c=e(0,0)), and if the allocation is less than some standard which you employ, then change it; it won't hurt anything. The program as given will not put a volume label on the tape. If you want one, prompt for it in the WAITTAPE routine, and patch the initialization line, 3022. Disk sectors are transferred sector by sector, sequentially; thus wasted space is also transferred. That problem transferrs to the tape user, and is no concern of mine. No garbage is written. The program works like this: Disk directory sectors are written into the 71 into the D$ array, one file entry per array element. The array is one dimension. This takes 14 seconds. Each of these file entries is individually scanned to determine the following values which are stored into E(c,n), where c is the tape number, and n is: n=0 directory length in whole records n=1 first disk file number (corresponds to D$ array) on the tape n=2 number of files n=3 total length of files n=4 disk record number of first tape file. This is where the problem is. I haven't figured out the DDL 4 data sequence to position the disk to an absolute record which exceeds the range accessible from track 0. Nor have I tried. This problem just came up on record 560; and I've spent all week's available time deferring other pre-hibernation duties to get this out and up before Bri wastes his equipment and whats left of his mind. So you'll have problems copying onto tape 2 until this thing is resolved by somebody. See the POSDEV routine at 7210-60, called from BLKCPY at 6025. Other notes: the integer variable, B, is used after TO in loops as a replacement to a relatively complex equation which would be solved on each pass. What a genius; and you thought I only did drugs! Shame. After figuring the E(c,n) parameters, wherein E(0,0) is the number of tapes necessary to complete the assignment, the next step is to reset the directory entry values for which record the file starts at. These adjusted start records are then written onto the tape directory sectors; and then the file sectors are transferred one at a time, in about 20 minutes. Plug your devices into the AC and let me know your comments. Yours truly, BIFF 1000 ! Program DSK2CAS written for the HP-71B and IL massmem devices 1010 ! ver. 1.0 1020 ! Original Release today, Nov. 21, 1986 1030 ! to CHHU BBS 1040 ! 1050 ! Author: BIFF 1060 ! 1070 ! This program is used for transferring all the files on a HP9114 disk 1080 ! to the HP82161A Digital Cassette Drive, by as many tapes as it takes. 1090 ! The disk is read only once; and the tape written in one continuous 1100 ! block after initialization and directory write. 1110 ! Start with disk in the drive, and some memory available in the 71 1120 ! The program will prompt for tapes which will be initialized for 1130 ! the exact number of files which will be trasferred to the tape. 1140 ! 1150 ! The tape write after initialization takes about 20 minutes 1160 ! 1170 ! No external keywords used other than the HPIL ROM 1180 ! 1190 ! 1280 RESET HPIL 1290 DESTROY ALL @ DELAY 0,0 1300 OPTION BASE 0 1310 DIM A$[256],B$[32] 1320 INTEGER E(5,4),F,L,R,C,X1,X2,X3,X5,S,S1,S2,B,B0,B1,D,T 1330 S1=2 ! First Directory Record for Destination Device 1340 S2=512 ! Number of medium records on Destination Device 1350 D=DEVADDR(":HP9114A") 1360 T=1 1370 IF DEVAID(T)#16 THEN T=T+1 @ GOTO 1370 1380 IF LEN(DEVID$(T))#0 THEN T=T+1 @ GOTO 1370 1390 ! by now T is the 82161A tape address 1400 X=TIME 1406 ! 1408 ! 1410 DISP "Reading Disk Directory"; 1412 ! 1415 SEND UNT UNL MTA LISTEN D DDL 4 DATA 0,0 1420 SEND UNT UNL MLA TALK D DDT 2 1425 ENTER :LOOP USING '#,256A';A$ 1430 S=0 @ FOR I=9 TO 12 @ S=S*256+NUM(A$[I]) @ NEXT I ! Directory Start Rec 1440 L1=0 @ FOR I=19 TO 20 @ L1=L1*256+NUM(A$[I]) @ NEXT I ! Directory length 1450 DIM D$((S+L1-1)*8)[32] ! Directory entries stored here 1470 SEND UNT UNL MTA LISTEN D DDL 4 DATA 0,S 1480 SEND UNT UNL MLA TALK D DDT 2 1485 F=0 @ B=S+L1-1 1490 FOR I=S TO B ! entire disk directory 1500 ENTER :LOOP USING '#,256A';A$ 1510 FOR J=1 TO 255 STEP 32 ! each separate file entry 1520 B$=A$[J,J+31] ! Disk Directory Entry for File# F 1525 IF NUM(B$)=255 THEN J=INF @ I=INF @ GOTO 1540 1530 F=F+1 @ D$(F)=B$ 1540 NEXT J ! next file entry 1550 NEXT I ! next directory sector 1560 SEND UNT UNL MTA LISTEN D SDC UNT UNL 1570 X1=TIME-X @ DISP " : ";X1;" seconds" 1580 C=1 ! Tape Number 1582 R=0 ! Number of files targeted for tape C 1584 L=0 ! # of records these files consume 1585 E(1,1)=1 ! First file on tape 1590 E(1,4)=S+L1 ! Disk start record for first file on tape 1595 B0=0 @ FOR K=13 TO 16 @ B0=B0*256+NUM(D$(1)[K]) @ NEXT K 1596 ! 1598 ! 1600 DISP "Processing ..."; 1602 ! 1610 FOR I=1 TO F ! for each file 1630 B1=0 @ FOR K=13 TO 16 @ B1=B1*256+NUM(D$(I+1)[K]) @ NEXT K 1640 L0=B1-B0 ! Records used for file on disk 1650 R=R+1 ! Number of files targeted for tape C 1660 IF S1+R DIV 8+1+L+L0<=S2 THEN 1730 1670 E(C,0)=R DIV 8+1 ! Directory Length 1680 E(C,2)=R-1 ! Number of files 1690 E(C,3)=L ! Length of files 1700 C=C+1 ! Next Tape 1710 E(C,1)=I ! First file on tape 1720 E(C,4)=B0 ! Record Number of file on Disk 1725 R=0 @ L=0 1730 L=L+L0 1740 B0=B1 1750 NEXT I 1751 E(C,0)=R DIV 8+1 ! Directory Length 1752 E(C,2)=R ! Number of files 1753 E(C,3)=L-L0 ! Length of files 1754 E(0,0)=C 1760 X2=TIME-X-X1 @ DISP " : ";X2;" seconds" 2000 ! 2020 ! 2021 DISP "Adjusting Start Records"; 2022 ! 2030 FOR C=1 TO E(0,0) ! for each tape 2060 O=E(C,4)-E(C,0)-S1 ! determine start record offset 2065 B=E(C,1)+E(C,2)-1 2070 FOR J=E(C,1) TO B ! for each file on the tape 2080 B$=D$(J) ! get the directory entry 2090 R=0 @ FOR K=13 TO 16 @ R=R*256+NUM(B$[K]) @ NEXT K ! Disk start record 2100 R=R-O ! Tape start record 2110 B$[15,15]=CHR$(R DIV 256) 2120 B$[16,16]=CHR$(RMD(R,256)) 2130 D$(J)=B$ ! store adjusted start record in the directory 2140 NEXT J ! next file entry 2150 NEXT C ! next tape for new offset 2170 X3=TIME-X-X2 @ DISP " : ";X3;" seconds" 2990 ! 2995 ! 3000 ! Begin writing tapes 3005 ! 3010 FOR C=1 TO E(0,0) ! for each tape 3020 GOSUB 'WAITTAPE' 3021 X=TIME @ DISP "Initializing Tape : "; 3022 INITIALIZE :T,E(C,2) 3023 X4=TIME-X @ DISP X4/60; @ DISP " minutes" 3025 X=TIME @ DISP "Writing Directory"; 3030 GOSUB 'WRTDIR' 3035 X5=TIME-X @ DISP " : ";X5;" seconds" 3040 GOSUB 'BLKCPY' 3042 X4=TIME-X-X5 @ DISP X4/60;' MINUTES' 3050 NEXT C 3100 END 6000 ! 6005 ! 6010 'BLKCPY': ! copies the file sectors 6020 ! 6025 B0=S1+E(C,0) @ B1=E(C,4) @ GOSUB 'POSDEV' 6030 STANDBY 120 ! prevents time-out error while tape moves to tract 2 6040 DISPLAY IS * ! keeps display devices off the loop 6045 B=S1+E(C,0)+E(C,3) 6050 FOR I=S1+E(C,0) TO B ! tape file records 6055 DISP I ! keeps you posted of record number 6060 SEND UNT UNL MLA TALK D 6070 ENTER :LOOP USING '#,256A';A$ 6080 SEND UNT UNL MTA LISTEN T 6090 OUTPUT :LOOP USING '#,256A';A$ 6110 NEXT I 6120 STANDBY OFF 6130 SEND UNT UNL MTA LISTEN T DDL 8 ! terminate tape write 6140 SEND UNL UNT MTA LISTEN T,D SDC UNT UNL IFC ! clear devices and loop 6150 RETURN 6160 ! 7000 ! 7010 'WRTDIR': ! writes the new tape directory 7020 ! 7030 SEND UNT UNL MTA LISTEN T DDL 4 DATA 0,S1 DDL 2 7035 B=E(C,1)+E(C,2)-1 7040 FOR I=E(C,1) TO B-8 STEP 8 ! Whole records only 7050 A$="" @ FOR J=0 TO 7 @ A$=A$&D$(I+J) @ NEXT J ! Builds each record 7060 OUTPUT :LOOP USING '#,256A';A$ ! Writes the record 7070 NEXT I ! next record 7080 FOR J=1 TO 256 @ A$[J,J]=CHR$(255) @ NEXT J 7090 K=1 7100 FOR J=I TO B ! Build the last directory record 7110 A$[K,K+31]=D$(J) @ K=K+32 7120 NEXT J 7130 OUTPUT :LOOP USING '#,256A';A$ ! Writes the record 7170 SEND DDL 8 UNL UNT ! end the write session 7180 RETURN 7190 ! 7200 ! 7210 'POSDEV': ! sets disk and tape to position and readies each 7220 ! 7230 SEND UNT UNL MTA LISTEN T DDL 4 DATA 0,B0 DDL 2 ! ready tape to write 7240 SEND UNT UNL MTA LISTEN D DDL 4 DATA 0,B1 ! position disk 7250 SEND UNT UNL TALK D DDT 2 ! disk to begin talking 7260 RETURN 7270 ! 7998 ! 8000 'WAITTAPE': 8002 ! 8010 BEEP @ DISP "Insert tape ";C;" of ";E(0,0) 8020 WAIT 5 8030 INPUT "key 'G' when ready; else EndLine :";B$ 8040 IF B$="" THEN 8010 8050 IF B$#"G" THEN BEEP @ GOTO 8030 8060 RESET HPIL @ RETURN Action? Command? read 10 Posted: Wed Nov 19, 1986 4:07 AM PST Msg: EGIG-2490-3842 From: CHHU To: chhu Subj: to sam from john baker dtape Dear Sam, Well howdy!!! What's up doc??? I was just wondering (or is that wandering?), In a fit of sheer boredom (frustration, etc) I commented a good hunk of the Pompeii firmware. Well............. I was just curious if you had ever done a hardware map of that pcb. I started to some time back and got bored with the idea, it being four layer and all that such nonsense. As an offshoot of my mind tripping the lights fantastic in firmware fantasyland I reached the inexorable conclusion that those little chippers (I C said the blind man), had to be configured as follows for the code to make even the slightest notion of rational sense..... 0000 is the PIA for motor control (or right-on rotations!) 2000 is the PIL chip (for talking loop trash) 4000 is the 2k of RAMskie we are blessed with 6000 is the FDC from good 'ol Western Digital (Eastern Analogues cousin) C000 is the firmware ROM Any other layout just doesn't make any sense to me based on what is accessed from where and how. If you have any further information ( that is if I'm so blind I can't seethe forest for the trees ) please be kind enough to correct my act. Gosh and golly, just think, instead of having a device ID of HP9114A in my code, I can have something as stupid as JRB9114..... The only change needed is to alter the cute little wrap around carry checksum in the word at C000. If the checksum is not correct, the 6809 Restart vector code at F063 goes into a spiffy little loop which ends only when the power switch is toggled off or the battery becomes deceased (whichever comes first!). Better yet is such bizarre ideas like adding 128 byte sectors which the WD FDC chip supports. There are a few hunks of unused ROM space in which to play. Or, just think, we could write unusual cylinder, side, or sector trash in the headers instead of the IBM system 34 MFM stuff. Heck... why be conventional, lets get 'trendy', just think... change for changes sake. Why it doesn't even have to be practical. Till next time, think CRC..... John Action? Command?