Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!ames!ucbcad!ucbvax!decvax!ima!mirror!rayssd!cc From: cc@rayssd.RAY.COM (Charles R Coday) Newsgroups: comp.sys.atari.8bit Subject: Re: questions Message-ID: <457@rayssd.RAY.COM> Date: Mon, 15-Dec-86 12:53:27 EST Article-I.D.: rayssd.457 Posted: Mon Dec 15 12:53:27 1986 Date-Received: Tue, 16-Dec-86 22:57:26 EST Sender: cc@rayssd.RAY.COM (Charles R Coday @ Raytheon Company, Portsmouth RI) Distribution: net Organization: Raytheon Company, Portsmouth RI Lines: 61 Keywords: double-density, DOS 2.0 Here is the program to create a double-density ATARI DOS 2.0. Presently, it requires two drives only because it was easier to program. The basic idea is to set the appropriate entry in DRVTBL which starts at 4881 and continues for up to 8 drvies. A value of 1 indicates a single density (810) drive and a value of 2 indicates a double density (815, remember them?) drive. Then it does a JSR to DINT to re-initalize DOS and cause it to re-build all tables for disk i/o. Next, an XIO command is used to format the drive (in the command block rcvd by the drive is a flag indicating density) and a trick is used to cause DOS.SYS to be written. Trick= WHENEVER DOS receives a write command and the file name specified is "DOS.SYS", a full copy of DOS is written to the disk with the appropriate updating of sectors 1-4 (which are still written with only 128 bytes of valid data, although in a 256 byte sector). Finally, the slow method of getting and putting is used to transfer a copy of DUP.SYS. If you have only one drive this could be modified BUT a LOT of disk swapping will be needed with the appropriate JSRs to DINT and changes to 488X. Good luck, if this doesn't make it, let me know. 10 REM PGM TO CREATE A DOUBLE DENSITY 40 REM ATARI DOS 2.0 60 REM 80 REM FIRST, SET UP VARIABLES 120 DRIVE=2:REM DRIVE NUMBER 140 DOUBLE=2:REM DOUBLE DENS. CODE 160 WRT=8:RD=4 500 REM 520 REM SETUP M.L. ROUTINE 540 REM IN A STRING 560 REM 580 DIM DINT$(5):REM DOS INIT 600 DINT$(1)=CHR$(104):REM PLA 620 DINT$(2)=CHR$(32):REM JSR 640 DINT$(3)=CHR$(224):REM $E0 660 DINT$(4)=CHR$(7):REM $07 680 DINT$(5)=CHR$(96):REM RTS 700 REM 820 REM DRIVE 2 TO DOUBLE AND INIT 822 REM DOS. NOTE-USE 4881 FOR DRIVE 1 840 POKE 4882,DOUBLE:X=USR(ADR(DINT$)) 860 REM FORMAT DISK 880 XIO 254,0,0,"D2:*.*" 960 REM USE OPEN TRICK TO WRITE DOS.SYS 980 OPEN #2,WRT,0,"D2:DOS.SYS" 990 CLOSE #2 1000 REM 1020 REM NOW WE HAVE TO READ DUP.SYS 1040 REM AND PUT IT ON NEW DISK 1060 REM 1080 OPEN #1,RD,0,"D:DUP.SYS" 1100 OPEN #2,WRT,0,"D:DUP.SYS" 1120 TRAP 5000:REM FOR EOF 1160 GET #1,DATA:PUT #2,DATA:GOTO 1160 5000 REM 5020 REM ERROR HANDLER 5030 CLOSE #1:CLOSE #2 5040 ERR=PEEK(195):ERRLINE=PEEK(187)*256+PEEK(186) 5060 IF ERR=136 THEN PRINT "ALL DONE!":END 5080 PRINT "ERROR #";ERR;" -LINE ";ERRLINE 5100 END