Menu
|
PowerSOFT Products 11500 Stemmons Expressway, Suite 125 Dallas TX 75229 (214) 484-2976 |
| The Model 4/4P computer has the capability of running in two modes: Model III mode and Model 4 mode. This allows a Model 4/4P owner to use two (or more) different operating operating systems on the computer. Two operating systems, one for each mode of operation, are available from Radio Shack for use on the Model 4/4P with a Radio Shack 5-megabyte hard drive: TRSDOS 6 for Model 4 mode, and LDOS 5.1 for Model III mode. The question has arisen among users of the 5-megabyte hard drive of whether there is any way to use both operating systems on the same hard drive without having to reformat and recreate the system partition every time. There is some justification for wanting to do this. The two operating systems involved, LDOS 5.1 for the Model III mode and TRSDOS 6.1 for the Model 4 mode, are very similar. Moreover, since the software base for TRSDOS 6 is not yet as large as that for LDOS, it can be to a user's advantage to switch to LDOS to run applications which are not available for TRSDOS 6. Finally, a hard drive system provides extensive storage capacity as well as increased operating speed over floppy disks. It seems a waste to have to switch to floppies just to run a particular application. |
| We at PowerSOFT have been able to place both the LDOS and TRSDOS 6 operating systems on a single hard drive so that they can be used by a Model 4 running in either mode. The selection of which system to utilize is done by simply booting up the appropriate floppy system disk and letting the configuration file transfer control to the hard disk. The files on the hard disk are accessible to both operating systems. This was made possible by the media compatibility which exists between LDOS and TRSDOS 6. This means that they can read each other's directories and disk formats without requiring special software. |
| The key to placing both operating systems on a single hard drive lies in the flexibility of the two operating systems. Both LDOS and TRSDOS 6 allow you to split up a hard drive into one or more logical drives; and the logical drive numbers need not be the same as the physical positions of the hard disk partitions. This is what makes it all work. The hard disk partition which is assigned as Drive 0 for LDOS need not be the same as the partition which is assigned as Drive 0 for TRSDOS 6! This means that TWO independent logical drive zeros (system drives) can exist on a single hard drive, one for each operating system. And of course, each operating system sees only its own drive 0, the other one appearing to it as something else. |
| Once this concept is understood, the application of it is quite simple. |
| Consider the setup of a 5-megabyte hard drive system. Each hard drive contains two disks or platters, each with two surfaces (four surfaces in all). Each surface has its own read/write head. Both LDOS and TRSDOS 6 allow us to split the hard drive along the surfaces (sometimes referred to as the "head offset method," head referring to the individual read/write head of each surface). This means that we can split a hard drive into a maximum of four logical drives, assigning one surface ("head") to each. This is what happens when we execute the Model 4 hard disk initialization program. The hard disk is split into four logical drives, the first surface being drive :0, the second drive :1, the third drive :2, and the fourth drive :3. |
| There is nothing in either operating system which says that Surface Number One must be logical drive 0 always. So what we can now do is run a modifiedinitialization file under LDOS that reverses the order of logical drives :0 and :3.That is, surface four becomes drive :0, and surface number one becomes drive :3. Thuswe can have two different drive zeros on the hard drive. But the drive :0 which isthe system drive when TRSDOS 6 is running is drive :3 when LDOS running and viceversa. Voila, we have two operating systems sharing the same hard drive! And sinceonly one operating system can be running at any one time, there is no conflictbetween them. Consider the diagram below. |
TRSDOS 6 sees ==> :0 :1 2 :3
PHYSICAL SURFACE 1 2 3 4
LDOS 5.1 sees ==> :3 :1 :2 :0
|
| Of course, it falls on the user of such a shared system to make sure thatprograms which run only under one operating system or the other are clearly andobviously marked. One way to accomplish this is to place model- specific programfiles on each operating system's respective drive 0, and have data files (which canusually be read by both systems) resident on the other two logical drives. Or filescan be renamed so that those intended for LDOS (Model III mode) only end with "M3"while those intended for TRSDOS 6 (Model 4 mode) only end with "M4." There are many possible schemes to choose from and you should select one which suits your particularsituation best. |
| We present below a three-step procedure to implement the method just described, for those Model 4 hard drive owners who wish to use both LDOS and TRSDOS. Please makesure that you backup EVERY file on your hard drive before you implement this procedu re, as the hard drive will be reformatted. |
| To use this procedure, you must have both the TRSDOS 6 hard drive initialization disk as well as the LDOS hard drive initialization disk available. |
| STEP ONE. Boot up your TRSDOS 6 Hard Drive Initialization Disk. This will automa tically execute the initialization program. Follow the steps described in your Hard Disk Startup Manual. Tell the program that you to create a hard drive system with eq ual partition sizes, the hard disk to be the system device, and the hard disk to be s earched FIRST when looking for a file. This will result in the hard drive logical dr ive numbers as 0, 1, 2, and 3. Proceed to format the hard drive, move files over to it, and create your BOOT diskette. These procedures are all described in the Hard Di sk Startup Manual. |
| STEP TWO. Make a BACKUP of your LDOS Hard Drive Initialization disk. Boot up thi s disk but do NOT execute the initialization procedure yet. We must modify the Model III Hard Disk Initialization files, using the PATCH command of LDOS. First type: BU ILD INITHD3/FIX. Then type in the patch lines below EXACTLY. |
.Patch to INITHD3/JCL to reverse head order and skip
.FORMAT
D09,B8="1"
D09,EB="4"
D0E,6F="."
D0E,9C="."
D0E,C9="."
.End of Patch.
|
| Now press BREAK. The patch file will be written to disk. Now type: PATCH INITHD3/JCL USING INITHD3/FIX and press ENTER. The patch will be applied to the INITHD3/JCL file. There is one more patch which needs to be applied. Since it is very short, you will not build a separate patch file for it, but simply type it in on the command line. Type: |
PATCH HD1/CFG.CCC (D02,F7=13:D03,15=10)
|
| And press ENTER. The patch will be applied to HD1/CFG. |
| You have just patched the LDOS Hard Disk Initialization files to (a) reverse the order of logical drives :0 and :3 on the hard disk, and (b) skip the formatting process (since we've already formatted the hard drive under TRSDOS 6). |
| STEP THREE. Execute the patched LDOS (Model III) Hard Disk Initialization with the command, |
DO INITHD3 (NEW,PW=PASSWORD,HARD1,FLOPPY2,ABS) |
| Refer to the Model III Hard Disk Startup Manual, page 31 and following, for more details. |
| You now have a hard drive shared between LDOS and TRSDOS 6. Selection is automatic depending on which boot disk is in the floppy drive when the reset button is pressed. When you are running TRSDOS 6, you will note that your logical drive :3 has the LDOS system files on it. When running LDOS in Model III mode, logical drive :3 will have the TRSDOS 6 system files on it. Logical drives :1 and :2 will be the same regardless of which operating system is currently running. This way, any programs which reference files on these two logical drives will not need to be changed. |
| Using this method, you will be able to use a Model 4 or 4P system with a hard disk to its maximum capability, rather than having to use one operating system on a hard disk and the other on floppies (or on another hard disk). The same method works on larger-capacity hard drives as well, if you have them hooked up to a Model 4 or 4P computer. Unfortunately this method is not usable with CP/M Plus, since CP/M Plus does not have the capability of splitting a hard drive into several logical drives; it sees a hard drive as a single volume only. |
| The same technique is used to create different system partitions that will be used by two or more computers in a multiplexed situation. In this type of environment, several computers share the same hard drive, and the hard drive is split up so that each computer has its own system partition. These system partitions may be set up so that they are invisible to the other computers, in order to prevent accidental alteration of the system files. In order to maximize the use of available storage space, a hard disk driver program which permits a type of partitioning known as cylinder offset is preferable. Using such a driver, the size of the system partitions can be limited to the minimum necessary to hold the operating system modules and a few often-used (and machine-specific) utilities, leaving the rest as sharable storage between the various computers. |
| If you have a hard drive which uses a Western Digital controller board, contact PowerSOFT at the address above for more information on hard disk drivers and other hard drive utility software. |
by Michael Cooper
| One of the features of LDOS that make it a superior operating system is the device independence. This allows you total flexibility in the way you can set up the system I/O. In the case of CLUB-80 I needed to include a communications link to the operating system, but still protect the integrity of the applications programs and files. |
| The Standard Devices in LDOS are : |
*KI = Keyboard
*DO = Video Display
*PR = Printer
*SI = System Input (Unassigned)
*SO = System Output (Unassigned)
*JL = Job-log (Unassigned)
|
| LDOS comes supplied with a Serial Device Driver for use with the RS-232 Port.The Model 3 version of the driver(RS232T/DVR) is very sophisticated, with an input buffer of 128 bytes and interrupt handling of incoming characters. To set the driver for use with a MODEM you must specify the Baud Rate and Byte configuration. |
SET *CL TO RS232T (B=300,W=8,S=1,P=N,DTR,RTS)
|
| This will create a new device called *CL- Comm Line that uses RS232T as its driver program. The parameters passed in the parentheses set Baud Rate = 300, Word length = 8 Bits, Stop Bit = 1, No Parity Bit, sets DTR and RTS to logical "TRUE". Now by connecting a MODEM to the RS-232 Serial port you have a pathway for data to and from the Telephone. |
| The remaining task is to connect the *CL device into LDOS. This can be achieved in several ways,but in this case we want to use the system in remote mode, so we connect *CL to the *KI (Keyboard) device for input, and to *DO (Display) device for output. In LDOS this is done by: |
LINK *CL *KI |
| This permits any request for keyboard input via *KI Keyboard to be serviced either by the keyboard of the HOST machine or via MODEM through *CL. Any character output to *DO (Display) will also be sent to *CL and thus to the MODEM, this provides the ECHO. |
| As an added bonus, the LDOS Type-ahead Keyboard Driver allow double buffering of all input via *CL. Data from the MODEM is fetched by the interrupt handler as soon as it arrives, and buffered until the next scan of th typeahead routine. The data is then buffered for use by the *KI driver when needed. |
| To complete this operation, the whole of high memory and the DCB's are saved in the CONFIG file for loading at Boot. All is now prepared so the computer can be used remotely via the phone. All the programs it will run can be written in BASIC and do whatever you want. |
| The CLUB-80 software is written in LBASIC and the programs run in "EXEC" mode(Level 7) to afford maximum protection from tampering. As an added protection a FILTER program is used on the *KI (Keyboard) device to check that the system hasn't somehow dropped into DOS READY or BASIC READY. If the FILTER finds this condition true, the system is rebooted to disconnect the current caller before they can play around. |
Frank Durda IV
To turn floppies 2 & 3 on immediately, but only for the current session:system (drive=2,enable) |
| To make this permanent, SYSGEN these settings or make these commands part of the boot jcl. |
| The MODELA/III file must be loaded from a diskette in the TRSDOS 1.x, LDOS 5 or LS-DOS 6.x format. The 4P Boot ROM doesn't understand any of the other directory/filesystem layouts, and by default the NEWDOS disk format is quite different.* |
| The normal process for booting an "alien" format diskette is: |
1. Insert the diskette with MODELA/III on it and press reset. 2. If that diskette is LS-DOS 6, press the [3] or [F3] key within three seconds. 3. Press the [P] key to indicate that you want to swap diskettes. You must also do this within the three seconds after pressing RESET. (You can press the F3, 3 and P keys in any order or all at once.) 4. The system prompts to change diskettes. Insert NEWDOS, MultiDOS or whatever non-TRSDOS/non-LDOS format OS this is. 5. Press [ENTER] to boot the other operating system when the new diskette is in place.
| Once loaded, if you press RESET or otherwise reboot, the MODELA/III image will still be there and you can boot directly onto the NEWDOS or other Model III OS without having to swap diskettes again or pressing any other keys. If you cycle power, you will have to repeat the first procedure. |
| Optional keys related to Model III-mode booting are [L], which means says to load the Model III image even if it doesn't appear to be needed, and [N], which says to NOT load the ROM-image even if it does appear to be needed. |
| * Implied in that is if you make a NEWDOS diskette with a directory cylinder pointer in the boot sector that points to a cylinder that "looks" like a LDOS/LS-DOS diskette directory track, and it contains a LDOS/LS-DOS/TRSDOS-style directory entry that points to a cylinder/sector position containing the MODELA/III file data, *then* you could load from a non-TRSDOS/LDOS/LSDOS OS, and someone has done this, but you have to make a very strange looking disk layout to make it occur and it wastes a lot of space. This exercise is left to those with lots of spare time. |
For the more adventuresome ...
| Build a diskette with a boot sector that doesn't look like a Model III-mode boot sector. This means the ROM won't try to load MODELA/III at all, assuming it's a Model 4-mode diskette. Then when the boot sector is loaded and control is transferred to it, it can do anything it wants to. You could write a boot sector that knows where to load the MODELA/III file from on this alien disk format and load it yourself before loading the rest of the OS, or you could concatenate the BOOT/SYS or SYS0/SYS modules of the operating system onto the contents of a MODELA/III file, which loaded everything as though it was one big file. Typically the MODEL%/III contents needs to be loaded first, so that later stages of the boot process will have the old Model III ROM functions available for use, such as to print those boot-up screens. |
| In theory, you could do the latter (build a blob file containing both MODELA/III and BOOT/SYS contents) and let the boot ROM do the work (ie load MODELA/III contents and BOOT/SYS that have been combined in one file), but it would be much easier to simply not let the boot ROM try to load a MODEL%/III file and take over things from there. You can't make the 4P-ROM know about any new disk formats, so the best choice is to not rely on it at all for that function. |
| To decide if the MODELA/III file is needed, the 4P ROM scans sector 1 on the floppy diskette looking for the CD XX 00 (CALL 00XXH) instruction sequences and other clues. If it finds any, it knows the boot sector is expecting the Model III ROM image to be there, so the 4P-ROM loads the ROM image first before turning control over to the boot sector. Frequently, the only reference to the "A" ROM address range in the boot sector would be to display a message like "DISK ERROR", but that one hit was enough to make the determination automatic. I recall that during development back in 1983, Frank Durda IV tested several dozen alien diskette formats, including all the Kim Watt stuff, looking for signatures like this. |
Another solution, by Tony Domigan and Northern Bytes, Vol.5, #7, Page 14
| MODELA/III can be copied to LDOS 5.x and TRSDOS 1.3B diskettes so that they can Cold Start on the Model 4P. If, however, you wish to use NEWDOS/80 version 2.0 the only option is to load MODELA/Ill with 'pause' and then enter your NEWDOS disk - two operations not very convenient. Furthermore, the Model 4P hardware seems to check the boot sector (sector 1) in a way which excludes any DOS other than TRSDOS or LDOS. |
| The method I have used relocates the NEWDOS directory to lump 36 i.e. track 20; the same track on which the LDOS directory resides, |
| The FPDE for MODELA/III is created and the directory entry modified so that when the file is copied from the TRSDOS MODELA/Ill disk it will be copied to a true track. I have used track 30 as it is not allocated in a standard NEWDOS diskette, |
| The ROM file is then modified on the NEWDOS diskette so that the bootstrap loader will select sector 0 to boot the diskette. |
| Using Superzap the MODELA/III FPDE is again modified to read Track lEH or 30 decimal and the total granules changed to 09H. The normal boot sector (sector 1) is modified with 3 bytes located by the hardware in checking for a TRSDOS or LDOS disk. |
| The diskette is now configured such that the hardware assumes it is an LDOS diskette with the ROM starting on track 30 decimal, Once loaded the ROM bootstrap boots NEWDOS from sector 0. |
| 1. | Construct a new system diskette with a directory on lump 36 - e.g. |
PDRIVE,0,1,DDSL=36,A
COPY,0,1,00/00/00,CBF,FMT,NDP=NEWDOS4P,DPDN=1
| |
| 2. | Boot the new system diskette, |
| 3. | Create a file called MODELA/III - e.g. |
CREATE MODELA/III:0
| |
| 4. | Using Superzap, page through the directory, from relative sector 360, till the FPDE for MODELA/Ill is located, Modify Bytes 21-24 in FPDE i.e. |
0000 FFFF to 3900 36DB
| |
| 5. | From 'NEWDOS READY" copy MODELA/Ill from the TRSDOS 1.3B boot disk to the new NEWDOS disk - e.g. |
COPY MODELA/III:1 :0 SPDN=4
| |
| 6. | Using Superzap locate the MODELA/III FPDE and modify bytes 20-24 i.e. |
Find 3900 360B Change to 3900 1E09
| |
| 7. | Using Superzap 'DFS' modify MODELA/Ill at FRS 53 Relative Byte 39 i.e. |
Find 3E01 D3F2 Change to 3E00 D3F2
| |
| 8. | Using Superzap modify the first sector (360) of the directory (GAT). Change relative bytes 36H to 3BH inclusive to FF (i.e. lump(s) allocated), |
| 9. | Modify Disk Relative Sector 1 at relative byte 0: Do a 'ZTFF' |
Relative Byte 02 ==> 14
Relative Byte 14 ==> 28
Relative Byte SA ==> CD
| |
| 10. | Now the easy part, RESET the 4P holding the 'P' and 'L' keys, If the ROM fails to load successfully then recheck the FPDE entry and the Sector 1 bytes. If the ROM loads successfully but NEWDOS fails, either partly or completely, then recheck the patch to MODELA/Ill (or perhaps you have accidentaliy written to the wrong part of the system!). |
| /sys0 | Essential |
| /sys1 | Essential - Interrogates DOS commands |
| /sys2 | Necessary - Creates files, opens FCBs, allocates file space, allocates FDEs, encodes passwords and loads user programs. Executor for RENAME and LOAD. |
| /sys3 | Necessary. Closes FCBs, kills files, inserts/deletes entries. Executor for BLINK, BREAK, CLOCK, DEBUG, JKL, LCDVR, LC, VERIFY, and PURGE. |
| /sys4 | Displays DOS ERROR messages |
| /sys5 | DEBUG |
| /sys6 | Executor for FORMAT, COPY, and APPEND. |
| /sys7 | Executor for TIME, DATE, AUTO, ATTRIB, PROT, DUMP, HIMEM, and the first part of PURGE, SYSTEM, and PDRIVE. |
| /sys8 | Executor for DIR and FREE. |
| /sys9 | Executor for BASIC2, BOOT, CHAIN, CHNON, MDCOPY, PAUSE, and STMT. |
| /sys10 | Executes BASIC statements GET and PUT. |
| /sys11 | Executes BASIC direct statement RENUM. |
| /sys12 | Executes BASIC direct command REF. |
| /sys13 | Executes BASIC ERROR messages and the first part of RENUM. |
| /sys14 | Executor for CLEAR, CREATE, ERROR, LIST, PRINT, and ROUTE. |
| /sys15 | Executor for FORMS and SETCOM. |
| /sys16 | Executor for most of PDRIVE. |
| /sys17 | Executor for WRDIRP and most of SYSTEM. |
| /sys18 | BASIC direct statement executor. |
| /sys19 | Executor for BASIC statements LOAD, RUN, MERGE, SAVE, and CMD"F". |
| /sys20 | Executor for a number of BASIC statements. Must be present if BASIC is active. |
| /sys21 | Executor for CMD"O". |
F. McCloy
| Following are instructions for initializing Radio Shack 12 & 35 Meg hard drives under TRSDOS 6.02.00 and LDOS 5.1.4 using TRS-80 models 4 &4p. These drives are not directly supported by Radio Shack for use with computers listed, and therefore, the "automatic formatting" utilities provided by RS will not give tou satisfactory results. |
| PLEASE NOTE: The 35 Meg disk has 512 actual tracks, but you can use only 404 of them due to the limitation of the TRSHD6/DCT device driver. This limits useable space to about 80% of the drive's capacity. Partitioning the drive for both TRSDOS and LDOS will not solve the problem. (All of the space on the 12 Meg drive will be available to you.) |
| Use the following procedure to initialize the 12 or 35 meg drive with TRSDOS 6.02.00. (A similar procedure can be used for LDOS using its utilities.): |
| COMMAND ---------- | QUESTIONS --------------- | ANSWER 12 MEG --------- | ANSWER 35 MEG ------ |
| SYSTEM (DRIVE=6,DRIVER="TRSHD6") | Number of heads: Tracks per surface Step Rate: # Heads/Partition Starting Head: |
1 6 230 .01 1 1 |
1 8 404 .01 1 1 |
| TRSFORM6 :6 | Disk pack name: Password: Manual Lockout: |
HARDA PASSWORD N |
HARDA PASSWORD N |
| SYSTEM (DRIVE=1,DISABLE,DRIVER="TRSHD6") | Drive Select Address: # Heads/partition: Starting head: |
1 1 2 |
1 2 2 |
| TRSFORM6 :1 | Disk pack name: Password: Manual Lockout: |
HARDB PASSWORD N |
HARDB PASSWORD N |
| SYSTEM (DRIVE=2,DRIVER="TRSHD6") | Drive Select Address: # Heads/partition: Starting head: |
1 1 3 |
1 2 4 |
| TRSFORM6 :2 | Disk pack name: Password: Manual Lockout: |
HARDC PASSWORD N |
HARDC PASSWORD N |
| SYSTEM (DRIVE=3,DRIVER="TRSHD6") | Drive Select Address: # Heads/partition: Starting head: |
1 1 4 |
1 1 6 |
| TRSFORM6 :3 | Disk pack name: Password: Manual Lockout: |
HARDD PASSWORD N |
HARDD PASSWORD N |
| SYSTEM (DRIVE=4,DRIVER="TRSHD6") | Drive Select Address: # Heads/partition: Starting head: |
1 1 5 |
1 1 7 |
| TRSFORM6 :4 | Disk pack name: Password: Manual Lockout: |
HARDE PASSWORD N |
HARDE PASSWORD N |
| SYSTEM (DRIVE=5,DRIVER="TRSHD6") | Drive Select Address: # Heads/partition: Starting head: |
1 1 6 |
1 1 8 |
| TRSFORM6 :5 | Disk pack name: Password: Manual Lockout: |
HARDF PASSWORD N |
HARDF PASSWORD N |
| SYSTEM (DRIVE=7,DRIVER="FLOPPY") | I/O ADDRESS: | 2 | 2 |
| BACKUP :0 :6 (SYS,INV) | |||
| SYSTEM (SYSTEM=6) | |||
| SYSGEN (DRIVE=6) | |||
| Your system is now set up as follows: | ||
| LOGICAL DRIVE | PHYSICAL DRIVE | PHYSICAL DRIVE |
| 12 MEG | 35 MEG | |
| ------------- | -------------- | -------------- |
| :0 | HD Head #1 | HD Head #1 |
| :1 | HD Head #2 | HD Head #2-3 |
| :2 | HD Head #3 | HD Head #4-5 |
| :3 | HD Head #4 | HD Head #6 |
| :4 | HD Head #5 | HD Head #7 |
| :5 | HD Head #6 | HD Head #8 |
| :6 | Floppy Drive #0 | Floppy Drive #0 |
| :7 | Floppy Drive #1 | Floppy Drive #1 |
| PLEASE NOTE: This procedure can provide guidelines for partitioning your 12 or 35 meg hard drive for use with both TRSDOS and LDOS. | ||
| Tim Mann / Frank Durda IV |
Files LDOS 5.1 LDOS 5.3.1 TRSDOS 6 LS-DOS 6.3.1 ----- -------- ---------- -------- ------------ basic/* (unused) basic basic basic lbasic/* basic (unused) (unused) (unused) config/sys ccc ccc ccc ccc */sys wolves system lsidos system6 */flt gsltd filter filter filter */dvr gsltd driver driver driver */dct rrw3 driver utility driver or utility */cmd rrw3 utility utility utility */hlp (unused) help (unused) help back door rs0lt0ff rs0lt0ff (none) (set bit 7 of nflag$) back door? LDOSOKVS LDOSOKVS LDOSOKVS On 6.3.1H, for some reason, the password is .system6 instead of .lsidos.To disable password checking in LDOS IV v6.31, try MEMORY (A="N",B=128) Files .Password ----- --------- TRSHD*/DCT .P3UF (this may be valid only for TRSHD4 series) Model I TRSDOS Back-Door password on TRSDOS 2.3: NV36 and/or AF19 Master Password "P3UF" C Code To Computer TRS-80 Passwords written by Tim Mann |
by Leonard Yates (with a little help from Gary Bryce)
| Back in the August 1984 issue of SYDTRUG NEWS, Gary Bryce presented an article on creating self-booting disks using NEWDOS/80. The Model I mods worked well but,as he said at the end of the item, had not been verified on the Model III. Well, to get a Model III data disk to self-boot, you'll have to proceed as follow (I'll make this complete so you don't have to refer to the original article): | |
| 1. | FORMAT a data disk and copy the /CMD file to be made self-booting to it. If it's the only file on the disk (apart from BOOT/SYS and DIR/SYS), chances are it will have only one extent (as revealed by DIR dn1 A). If it has more than one extent, it's probably more than 32 granules long (Super Utility 3.2 is the longest program I've been able to self-boot). |
| 2. | Using the DFS option of SUPERZAP, note the DRS of relative sector 0 of the /CMD file on the data disk. Next, using the DD option of SUPERZAP, and responding with the drive number and DRS noted above, record the TRS and TRK (in HEX) of the /CMD file on the data disk. |
| 3. | Using the DFS option again, zap FRS 1 of BOOT/SYS (of the data disk) as follows: |
| Byte 05 - TRS of /CMD file (will be 05H if it's the only USR file on the disk, and hence won't need to be changed). Byte 06 - TRK of /CMD file (will be 00H...etc.). Byte 3E - change from C8H to C9H. | |
| Note: If the /CMD file is the only USR file on the data disk, TRS will be 05H and TRK will be 00H. BOOT/SYS is normally set up to load SYS0/SYS which always occupies from sector 05 of track 0; for a nonsystem (data) disk, the first USR file will occupy this space. Note also that on NEWDOS/80 system and data disks for the Model III, sector 1 of BOOT/SYS is a duplicate of sector 0 (required for booting on the Model III) These changes are made to sector 1 only. Further, if your /CMD program is the only USR file on the data disk, the only zap needed is to byte 3E of FRS 1 of BOOT/SYS. | |
| 4. | Mount the self-booting data disk on drive 0 and press RESET. The disk will BOOT and the /CMD file will load and execute. |
| Regardless of what the documentation says, high memory cannot be set using a CMD "HIMEM,(decimal address)" command. The string storage area is still going to the top of 48k, even though you may have set HIMEM at 34000. |
| The only way to set high memory from BASIC is to place a poke at the beginning of the program - before any string or variable definitions are made. To calculate the poke values needed, find the beginning address of the routine. Divide this number by 256. The most significant (MSB) byte of the address will be the integer value of your answer. Multiply the decimal portion of the answer by 256 to find the least significant byte (LSB). On a Model I or III: |
POKE 16561,LSB : POKE 16562,MSB: CLEAR 50 |
| This will reset all pointers, and set memory to address calculated. The CLEAR 50 can be what ever value you need for your program. It is not necessary - and wasteful to clear more memory than needed. |
| Note - String garbage collection will be done at fewer intervals when the maximum amount of memory has been cleared. |
| Functions to Read, Test, & Change bits: |
DEF FNReadBit (Address,Bit) = INT(PEEK(Address)/2^Bit)-2 * INT(PEEK(Address)/2^(Bit+1))
DEF FNResetBit (Address,Bit) = PEEK(Address) - FNReadBit(Address,Bit) * 2^Bit
DEF FNSetBit (Address,Bit) = PEEK(Address) + (1-FNReadBit(Address,Bit)) * 2^Bit
DEF FNToggleBit (Address,Bit) = FNResetBit(Address,Bit) + FNSetBit(Address,Bit) - peek(Address)
109 -- Bit 1==> Type-Ahead
Set = Enabled
Reset = Disabled
116 -- Bit 5==> Caps
Set = Upper Only
Reset = Upper/Lower
121 -- Bit 7==> Spooler
Set = Despooling
Reset = Paused
124 -- Bit 4==> Break Key
Set = Disabled
Reset = Enabled
127 -- Bit 4==> Clock Display
Set = Display On
Reset = Display Off
127 -- Bit 6==> Cursor Control
Set = Non-Blinking
Reset = Blinking
For example to turn the clock display on from BASIC use the statement:
POKE 127,FNSetBit(127,4).
|
|
Print string of number without a leading space: Call with A set to the number.
DEF FNST$(A)=RIGHT$(STR$(A),LEN(STR$(A))-1)
|
Function to display the current DOS version:
DEF FNVersion$="TRSDOS Version " + LEFT$(HEX$(PEEK(133)),1)+
"." + RIGHT$(HEX$(PEEK(133)),1) + "."+HEX$(PEEK(59))
|
Function to display the current date in 'Day, Mon ##, 19##' format:
DEF FNDay$=MID$("SunMonTueWedThuFriSat",(((PEEK(55)AND 14)/2)-1)*3+1,3)+
", "+MID$("JanFebMarAprMayJunJulAugSepOctNovDec",(PEEK(53)-1)*3+1,3)+
" "+RIGHT$(" "+FNST$(PEEK(52))+", 19"+FNST$(PEEK(51))
|
|
Print appropiate article in front of a word: Call with A$ = to the word that you want the article in front of.
DEF FNARTICLE$(A$)="A"+LEFT$("n",INSTR("AEIOUaeiou",LEFT$(A$,1)))+" "+A$
|
|
Display a menu number in reverse video: Call with A = to menu number to display.
DEF FNNUM$(A)="{"+CHR$(16)+FNST$(A)+CHR$(17)"} "
|
|
Condense the TIME or DATE strings to 4 bytes: Call with A$ = to TIME$ or DATE$.
DEF FNTIMEDATE$(A$)=MKS$(VAL(LEFT$(A$,2)+MID$(A$,4,2)+RIGHT$(A$,2)))
|
|
Expand time or date string as condense above: Call with A$ = Condensed string -- B$ = seperator, '/' or ':'.
DEF FNEXPAND$(A$,B$)=STRING$(6-LEN(FNST$(CVS(A$))),48) +
LEFT$(FNST$(CVS(A$)),(LEN(FNST$(CVS(A$)))-4))+B$ +
LEFT$(RIGHT$(FNST$(CVS(A$)),4),2)+B$ +
RIGHT$(FNST$(CVS(A$)),2)
|
|
Pad string on right or left to a specific length: Call with A$ = String -- A = maximum length to output
DEF FNRSPC$(A$,A)=LEFT$(A$+SPACE$(A),A)
DEF FNLSPC$(A$,A)=RIGHT$(SPACE$(A)+A$,A)
|
| These remarks are an attempt to explain how you may create CMD files, the only purpose for which is to have more disk space available for data files or whatever. Using CMDFILE you merely call for sys6 or sys7, depending where the routine you wish is located, and then give the overlay number when requested. These numbers may be found by reading a download of sys1 with the extended debugger. To make it easier I am listing them below: |
Append 31 Attrib 51
Auto 11 Boot A9
Build 33 Clock 17
Copy 32 Create 13
Date 15 Debug 14
Device 61 Dir 21
Do 91 Dump 71
Filter 66 Free 22
Kill 18 Lib 19
Link 62 List 41
Load 81 Memory 1E
Prot 52 Purge 72
Rename 53 Reset 63
Route 64 Run 82
Set 65 Spool A2
System A1 Time 16
Trace 1A Verify 1B
Xfer 73
|
| I'll leave it to you to figure out to which sys file each of these belongs, reminding you that it is obligatorily sys6 or sys7. Let's assume you wish to create a CMD file of the Copy command. Merely enter the number 32 when you are requested. It is not necessary to change addresses or transfer addresses, since you will be using the command file exactly as you would have used the library routine. Save the file with a different name since if you call 'Copy' the parsing routine will load the routine from sys6 and not your Copy/Cmd file. In any case, you would only wish to create these CMD files to replace sys6 and sys7, reducing the overhead on your disk. This is especially useful for users with only disk drive. Since these routines, when changed into CMD files, will occupy a full gran of 5 sec- tors (6 on double density), it is clear that if you create too many such files, you will have defeated the purpose of elimin- ating the sys6 & sys7 files! As for names of the corresponding files, I should opt for names similar enough to the library commands to avoid confusion with yourself, Ccopy for Copy, Ddir for Dir, etc. |
| Finally, for those who wish to better understand the principle employed with the library, I will explain how a routine is parsed and then loaded and run from its sys file. When you enter a command, it is parsed by sys1, and a table with the names of all the lib routines, each followed by the index no. shown above. Following that number is an 80 or a C0, which tells the system to look for the in sys6 or sys7. Within the sys6 or sys7 file a search is made for the index number. This number is followed by the starting address of the routine once loaded and the relative sector number and relative byte where the routine is located within the sys file. The routine is loaded and executed. |
| I hope these remarks will assist any interested users in better understanding both my idea of creating command files to save space, and of the library routines themselves. |
by Adam Rubin [71320,1052] - June 17, 1987
| This file explains how to modify your hard disk to get a granule size of 1 kilobyte. It assumes you're using a Radio Shack 5-meg Hard Disk (26-1130), TRSDOS 6.2 or LS-DOS 6.3, and the Radio Shack hard disk drivers that were included with TRSDOS 6.2.0, and that your hard disk is assigned as drives 0, 1, 2, and 3. Please read ALL of this file, and make sure you understand it, before you try to do anything! | |||||||||||||||
| You've probably noticed that when you first set up your hard disk, space for files was allocated in units (granules) of 16 sectors, or 4K. As a result, any file stored takes up at least 4K of space. It's possible to change the DOS's description of the drive so that space is allocated in units of 1K, which means that there will be less wasted space when storing each file. | |||||||||||||||
| On the other hand, reducing the granule size from 4K to 1K introduces other problems. For example, it's possible for a 12K file to be stored in 12 separate extents of 1K each, which would take considerably longer to access than, say, 3 extents of 4K each. Also, additional directory entries are needed when there are more than four extents, so there's more chance of filling up all the directory entries before the disk itself is full. Since each extent of a file can be no more than 32 granules, a minimum of one extent for each 32K of a file is necessary, and so any file longer than 4 times 32K, or 128K, will take up at least two directory entries. With these in mind, it's possible that part, or all, of your system would be better off with the granule size left at 4K. | |||||||||||||||
| As mentioned above, this file assumes you're using the same setup that I am. If your system is different, it may be possible to adapt the method described here, but you'd have to determine that on your own. | |||||||||||||||
| The procedure described below will alter the Drive Control Table (DCT) for the chosen drive(s) to indicate 4 sectors per granule, 8 granules per cylinder. (Remember that 8 is the maximum number of granules allowed per cylinder.) Since, as mentioned above, files may require more extents, and possibly additional directory entries, it's necessary to reformat the drive. | |||||||||||||||
| After you've modified your hard disk, you don't have to repeat this whole procedure to reformat one or more of the drives. Boot with the boot diskette created by the steps below (don't forget SYSTEM (SYSTEM=4) if you're reformatting :0), backup the files, use TRSFORM6 to reformat the drive, list BOOT/SYS as explained below (again, this is essential!), DATECONV if necessary, and restore your files. | |||||||||||||||
| You can use the procedure below to change one, several, or all of the drives on your HD to 1K granules. (Any changes to the HD won't affect floppy disks; they'll still be formatted as six sectors (1.5K) per granule.) If, sometime later, you'd like to change an additional drive to use 1K granules, just repeat the procedure described below for that drive. If you'd like to change a drive back to 4K granules, the same procedure also applies, but use the unmodified TRSHD6/DCT instead of TRSHD6A. | |||||||||||||||
| If you're using a 4P and have installed some sort of HD boot scheme, reread its documentation CAREFULLY before doing anything! It may be necessary to re-install the boot routine after modifying the hard disk. | |||||||||||||||
| If any of the drives you're changing are also used by LDOS 5.x, the procedure gets somewhat trickier. My suggestion for that is to modify the CONFIG/SYS.CCC file on your LDOS hard disk boot diskette, by changing DCT+8 for the affected drives from 2F to E3 to reflect the change. | |||||||||||||||
| The method in this file appears to work as described. However, I do not accept responsibility for any consequences of using the information in this file, and anything you do must be done at your own risk. | |||||||||||||||
| Here's how to modify your hard disk for 1K granules: | |||||||||||||||
| 1) | Make a backup of your current hard disk boot diskette. This will become your new boot diskette once you've finished this whole procedure. Make sure it has TRSHD6/DCT, TRSFORM6/CMD, and, if you're using 6.3, DATECONV/CMD. | ||||||||||||||
| 2) |
Create a patch file called TRSHD6A/FIX with these four lines:D02,EE=CD 56 33 F02,EE=3D 0F 0F D01,66=CB 3A CB 3A 87 87 3D 0F 0F C9 F01,66=00 00 00 00 00 00 00 00 00 00then RENAME TRSHD6/DCT.DRIVER:f TO TRSHD6A/DCT(where "f" is the drive containing the backup of the boot diskette), and PATCH TRSHD6A/DCT:f USING TRSHD6Ato patch it with the patch file. | ||||||||||||||
| 3) | Reboot your system with this backup of the boot diskette. | ||||||||||||||
| 4) | TypeSYSTEM (SYSTEM=4)to make the floppy your system drive while you change the hard disk. During all of step 5, therefore, you'll have to refer to what's usually :0 as :4. | ||||||||||||||
| 5) |
For each drive to change (which I'll call drive "d" here),
| ||||||||||||||
| 6) | TypeSYSTEM (SYSTEM=4)to make the hard disk your system drive again. | ||||||||||||||
| 7) | TypeSYSGEN (DRIVE=4)to write the updated configuration file to the floppy disk. | ||||||||||||||
| 8) | The floppy disk is now your new boot diskette. Label it, and make several backups of it. Do NOT use your old boot diskette any more, as it won't work. | ||||||||||||||
| This article will describe and explain the important features of the Model-III TRSDOS directory. You'll see that it is quite similar in most respects to the Model-I directory except for the way in which the DOS SYSTEM files are handled. | |
| As in the Model-I, the directory is located on Track #17 (11H), and occupies the entire track. Because of the Model-III's double density format, this amounts to 18, 256 byte sectors. The first sector (#0) contains the Granule Allocation Table (GAT), the diskette Master Password encode, the diskette name and any AUTO command which may be active. Sector #1 contains the Hash Index Table (HIT) and the information by which TRSDOS is able to locate the SYSTEM files. The remaining sixteen sectors of the directory track contain the directory entries for the diskettes user files, five entries per sector. | |
| Let's take a look at Track #17 in detail: | |
| 1. |
Sector #0 (the GAT sector) - The first 40 bytes (00H to 27H) make up the GAT and represent Tracks 0 to 39 on the diskette. Each byte is a "bit map" of the allocated granules in the corresponding track. Bits 0 through 5 represent the 6 granules of the track and bits 6 and 7 are not used (always 0). Thus, a fully allocated track would appear as a '3F' in the GAT. In binary this would be 00111111. If a byte is '25', a binary 00100101, it means that the first, third and sixth granules are allocated. Bytes CEH and CFH of Sector #0 are the encoded Master Password for the diskette. This is normally D38F for "PASSWORD". Bytes D0H - DFH are the diskette's name in ASCII and the creation date in MM/DD/YY format. Bytes E0H - FFH are used to store any AUTO command which may have been set up for the diskette. If byte E0H is a '0D' (carriage return), no AUTO command is in effect. |
| 2. |
Sector #1 (the HIT sector) - The first 80 bytes (00H to 4FH) make up the Hash Index Table (HIT). Each non-zero byte is the hash code for an active file in the directory, and its position in the HIT indicates in which sector and where in the sector the directory entry is located. For example, on a standard Radio Shack TRSDOS diskette, the first two bytes are 'F0' and 'F4', which are the hash codes for BASIC/CMD and CONVERT/CMD. A glance at Sector #2 will confirm that these files are the first two entries in that sector. The Model-III uses the same algorithm as the Model-I for computing hash codes. Bytes E0H - FDH are used to store the size and location of the TRSDOS SYSTEM files. There are 15 pairs of bytes and each pair represent one of the SYS files. The first byte of the pair contains the granule offset and the size of the file in granules. The second byte of the pair is the number of the track in HEX where the file starts. To see how this works, let's take a look at bytes E4H-E5H which are '4210'. The '42' is 01000010 in binary notation. Because the byte has two pieces of information embedded in it, we'll write it as 010 00010. The '00010' is the granule count for the file, which is TWO. The '010' is the granule offset from the start of the track which is also TWO. Remember that a granule is three sectors in the Model-III. The second byte of the pair is '10' which means that the file starts on Track #16 (10H). Putting it all together, we see that the file starts on Track #16 (10H), beginning on Sector #6 (offset of TWO granules) and occupies TWO granules or six sectors. This particular file, by the way, is very similar to SYS2/SYS on the Model-I. The fifteen pairs of bytes in this area represent the TRSDOS resident module and fourteen overlay modules making up the entire DOS. The sixteenth pair is presently 'FFFF' and is not in use, no doubt being reserved for a future overlay, like a spooler (just a guess). Since the user never calls the DOS modules directly, they need not have names and the information in these byte pairs is all that TRSDOS needs in order to locate them when program execution calls for them. |
| 3. |
Sectors #2 through #17 (Named directory entries) - There is room for five, three line (48 byte) directory entries on each of these sixteen sectors. This gives a total capacity of 80 named files. The sixteenth line on each sector is not used, so Radio Shack placed a '(c) 1980 Tandy' on it as a filler. Let's look at the first entry in Sector #2 to see how it is constructed. This is the entry for BASIC/CMD and it looks like this:
5E08 5000 0042 4153 4943 2020 2043 4D44 0000 EF5C 1200 0E06 FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFFThe first byte, '5E', contains the file type, its visibility and protection level. In binary this is 01011110 and we'll write it as 0 1 0 1 1 110 to make it easier to break it down. Bits 0-2 are the protection level. In this case, it is 6 (EXECute only). Bit 3 is the visibility bit. A '1' means that the file is invisible, as in this case. If bit 4 is a '1', the file is an active file and has a corresponding HIT entry. Bit 5 is usually '0', but if it should be a '1', it means that the file has a backup limitation. Radio Shack has said in a newsletter that certain programs like Scripsit and VisiCalc will be limited to two backup copies. Whether this can circumvented by setting bit 5 to '0', I have no idea. Might be worth trying. If bit 6 is a '1', the file is a SYSTEM file. If it is a '0', it is a USER file. If the Model-III TRSDOS has been set up using the same methods as the Model-I, bit 7 will be '0' for a Primary directory entry and will be a '1' for an EXTENDED directory entry. I don't know if this is true for the Model-III. If not, a file will be limited to 12 extents. In any case, bit 7 is '0' for all my files. The second and third bytes are simply the file creation month and year in HEX, in this case '08 50', meaning 08/80. The fourth byte shows the location of the EOF byte in the file's final sector. The fifth byte is the Logical Record Length of the file (00 means 256 bytes). The sixth through the sixteenth bytes are the file name in ASCII, in this example, BASIC CMD. Bytes 17-18 and 19-20 are the UPDATE and ACCESS password encodes, respectively. For this file, we see '0000 EF5C'. 'EF5C' is the code for NO password, so BASIC/CMD has an UPDATE password assigned but no access password. Bytes 21-22 indicate the total number of sectors in the file in LSB-MSB format. So BASIC/CMD has 18 (12H) sectors. The next 26 byte are arranged in pairs and are used for the file EXTENTS. 'FFFF' indicates no further extents. The first byte is the number in HEX where the extent begins. In our example, this is '0E' meaning Track #14. The second byte of the pair contains the file's granule count and offset, encoded in exactly the same way as for the TRSDOS system modules. For BASIC/CMD, this byte is '06' which is 000 00110 in binary notation. Thus BASIC/CMD occupies 6 granules and starts at the beginning of the track (no offset). |
by Jeffrey Brenton [73105,532]
|
TRSDOS 6.x is an advanced version of the LDOS operating system designed for use on all-RAM computers using the Z80 processor. TRSDOS 6.x supports a variety of disk types, although only a few are documented in the official Tandy documentation. Drive types supported include: 5" mini-floppy in single- and double-density, single- and double-sided, with cylinder counts of up to 96. 8" floppy in single- and double-density, single- and double-sided and 77 cylinders. Hard (or "rigid") drives of various sizes, cylinder and head counts. |
| All that is required to take advantage of these disk types is the hardware itself and the proper "driver" to control it. Full support for all 5" drive types is included with the basic TRSDOS system, but only 40-track, single sided operation is documented. |
| To use a double-sided drive under TRSDOS, all that is necessary (apart from the drive itself) is to format the diskette for two sides. In non-Tandy versions of LDOS 6.x, the FORMAT utility will prompt the user for the number of sides to format, however Tandy asked that this prompt be bypassed due to the fact that they do not sell a double-sided drive for the model 4. You can still format for two sides, though. All that is necessary is to specify "SIDES=2" in the parameter section of your command line. |
Thus:
FORMAT :1 (cyl=80,sides=2)will format drive 1 for 80 tracks and 2 sides. FORMAT will ask for disk name and master password. |
If you wish to then use this double-sided diskette as your "boot" diskette, you *must* be sure that SYS0/SYS begins with the first sector of a cylinder. The only way to guarantee this is to back it up to the blank diskette *first*. To do this, use the command:
BACKUP SYS0/SYS:0 :1 (S)Follow that with: BACKUP SYS/SYS:0 :1 (NEW) |
| to get the rest of the system files transfered properly. You can backup any other files that you want (or need) to the diskette. Remember! Unless you backup the system files to a blank diskette *before* using it for anything else, LDOS/TRSDOS 6.x will assume that the diskette is a data diskette and will refuse to install the system files. If you inadvertantly use COPY before installing the system files, you will have to re-format the diskette. |