Menu
NEWDOS/80
NEWDOS/80 Zaps have been moved to the NEWDOS/80 Page
DOSPLUS
DOSPLUS Zaps have been moved to the DOSPLUS Page
LDOS
Using LDOS as a Host (Communications)
LDOS v5.1.x /SYS File Guide
Creating /CMD Files from LDOS LIB Commands
Increasing The Number of Drives in LDOS
Booting A Double-Sided Diskette Under LDOS 5.1.x and 6.x
Reading Model 4 TRSDOS or Model III LDOS disk on NEWDOS/80
Using TRSDOS or LDOS to Write Protect
Trading Files Between LDOS6.2 and NEWDOS/80 v2
Configuring LDOS like NEWDOS/80
TRSDOS
Guided Tour Through The Model III TRSDOS Directory
Reading Model 4 TRSDOS or Model III LDOS disk on NEWDOS/80
Formatting A Double-Sided Diskette Under TRSDOS 6.x
Defeating TRSDOS v6.x Backup Protection
Using TRSDOS or LDOS to Write Protect
TRSDOS 6.2 Routine Addresses
Running SYSTEM Commands from Model 4 BASIC
Renaming DOS Commands
HARD DRIVE
Using a Single Hard Drive with 2 Operating Systems
Initializing Hard Drives under Model IV DOS’s
Change The Minimum Cluster Size on R/S Hard Drives
Booting a Model 4P from a Hard Drive
Changing TRSDOS 6.2.1 to Boot a Model 4P from a Hard Drive
MISC.
Passwords (ALL DOS’S)
Setting MEMORY SIZE inside DOS BASIC
System functions that can be accomplished in BASIC
System functions that can be accomplished in BASIC

Using a Single Hard Drive with 2 Operating Systems
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.

How to use LDOS for Host Work – 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 
          LINK *CL *DO 
					

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.

LDOS 5.1.x for the Model III System Files and Purposes – LDOS Manual
SYS0/SYS Mandatory     Resident part of the operating system. Must be present on any bootable disk
SYS1/SYS Mandatory LDOS command interpreter, routines for processing the @FEXT system vector, routines for processing the @FSPEC system vector, routines for processing the @PARAM system vector. Must be available on all SYSTEM disks.
SYS2/SYS Mandatory Opening or initializing disk files and logical devices. Contains routines for checking the availability of a disk pack (services the @CKDRV system vector), and routines for hashing file specifications and passwords Must be available on all SYSTEM disks.
SYS3/SYS Mandatory All system routines needed to close files and logical devices. Contains the routines needed to service the @FNAME system vector. Must be available on all SYSTEM disks.
SYS4/SYS Optional System error dictionary. If removed from a SYSTEM disk, all errors will say “SYS ERROR”. Note: Very Small; May Not Be Worth Deleting
SYS5/SYS Optional LDOS DEBUG command. May be deleted if you don’t need to use DEBUG. If you purge SYS5/SYS you may as well purge SYS9/SYS too.
SYS6/SYS Optional Contains all routines necessary to service the LIBrary “A” commands (primary library functions). May be removed but would leave very limited use of LDOS.
SYS7/SYS Optional Contains all routines necessary to service the LIBrary “B” commands. May be deleted if you don’t need those specific commands.
SYS8/SYS Mandatory Needed to dynamically allocate file space used when writing files.
SYS9/SYS Optional Contains the routines necessary to service the EXTended debugging commands available after a DEBUG (EXT) is performed. May be purged if you will not need the extended debugging commands. If you purge SYS5/SYS you may as well purge SYS9/SYS too.
SYS10/SYS Mandatory Contains the procedures necessary to service “KILL” and contains the routines to service the @DODIR system vector. It should remain on your working SYSTEM diskettes.
SYS11/SYS Optional Contains all procedures to perform JCL If you purge SYS6/SYS you may as well purge SYS11/SYS too.
LBASIC/CMD Mandatory if Keeping BASIC
LBASIC/OV1 Optional Needed for Renumbering or Cross-Referencing (not sure which)
LBASIC/OV2 Optional Needed for Renumbering or Cross-Referencing (not sure which)
LBASIC/OV3     Mandatory if Keeping BASIC

Increasing The Number of Drives in LDOS – Frank Durda IV

To turn floppies 2 & 3 on immediately, but only for the current session:

system (drive=2,enable)
system (drive=3,enable)

To make this permanent, SYSGEN these settings or make these commands part of the boot jcl.

Initializing Hard Drives under Model IV DOS’s – 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.

Passwords (ALL DOS’S)
 
TRSDOS Passwords (Model I)
Back-Door password on TRSDOS 2.3 NV36 and/or AF19
Master Password P3UF
Other TRSDOS 2.3 passwords F3GUM, RVCOOK, UBETT, WKIA
 
TRSDOS Passwords (HD4)
Files Password
—– ——–
TRSHD*/DCT      .P3UF
 
LDOS Passwords – 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
*/ov? 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
 
Disabling Password Checking
LDOS v6.3.1 (Model 4) MEMORY (A=”N”,B=128)
 
C Code To Compute TRS-80 Passwords – Tim Mann

/* trspwhash
 * Usage:  trspwhash password	  // Hash a password
 *         trspwhash -u 0xhash    // Unhash a password to letters
 *         trspwhash -n 0xhash    // Unhash a password to letters and digits
 */
#include 

unsigned int
pwhash(unsigned char pw[8])
{
    unsigned char *p = &pw[7];
    unsigned int count = 8;
    unsigned int hl, t1, t2;

    hl = 0xffff;
    do {
	t1 = hl & 0x07;
	t2 = hl & 0xff;
	hl = (t1 << 13) ^ (t1 << 9) ^ (t1 << 2) ^
	     (t2 << 8) ^ (t2 << 4)  ^ (t2 >> 3) ^
             (hl >> 8) ^ (*p-- << 8);
    } while (--count);
    return hl;
}

void
usage()
{
    fprintf(stderr, "usage: trspwhash [-u | -n] arg\n");
    exit(1);
}

int
main(int argc, char **argv)
{
    unsigned int goal;
    unsigned char pw[17];
    int i;
    if (argc == 2) {
	strncpy(pw, argv[1], 8);
	pw[8] = '\0';
	strncat(pw, "        ");
	for (i = 0; i < 8; i++) {
	    if (islower(pw[i])) pw[i] = toupper(pw[i]);
	}
	printf("%04x\n", pwhash(pw));
    } else if (argc == 3 && strcmp(argv[1], "-u") == 0) {
	goal = strtoul(argv[2], (void*)0, 0);
	strcpy(pw, "        ");
	for (;;) {
	    if (pwhash(pw) == goal) printf("%s\n", pw);
	    i = 0;
	    for (;;) {
		switch (pw[i]) {
		  case ' ':
		    pw[i] = 'A';
		    break;
		  case 'Z':
		    pw[i] = 'A';
		    i++;
		    if (i == 8) exit(0);
		    continue;
		  default:
		    pw[i]++;
		    break;
		}
		break;
	    }
	}
    } else if (argc == 3 && strcmp(argv[1], "-n") == 0) {
	goal = strtoul(argv[2], (void*)0, 0);
	strcpy(pw, "        ");
	for (;;) {
	    if (pwhash(pw) == goal) printf("%s\n", pw);
	    i = 0;
	    for (;;) {
		switch (pw[i]) {
		  case ' ':
		    pw[i] = 'A';
		    break;
		  case 'Z':
		    pw[i] = '0';
		    break;
		  case '9':
		    pw[i] = 'A';
		    i++;
		    if (i == 8) exit(0);
		    continue;
		  default:
		    pw[i]++;
		    break;
		}
		break;
	    }
	}
    } else {
	usage();
    }
    return 0;
}
							

 
Removing TRSDOS v1.3 Password - By Tom Price
For those of you who have used the basic version of SUPERZAP from NEWDOS 2.1 to peek at the directory of the MODEL-III TRSDOS, you may have noticed that the password encode for a null (blank) password is EF5C rather than the old familiar 9642 from the MODEL-I. This is caused by Radio Shack using a slightly different algorithm to encode the passwords (they changed two bytes in the code), but the system works in much the same way. This article will explain three ways to get around the password system if you have a need to do so. The first two will require the above mentioned SUPERZAP, which is all we have until someone comes up with a version tailored to the MODEL-III's double density disk structure. the third method doesn't require any utility program at all and can be used by anyone.
1. ZAPPING THE DIRECTORY - Use SUPERZAP to select track 1B, sector 4. This will bring you to the first sector of the directory. Then, use the ";" key to page through the directory until you find the programs you want. The first four bytes of the second line of each directory entry are the update and access password encodes respectively and, on an unprotected file, they will be EF5C EF5C. To remove the passwords on a protected file, just zap EF5C into the entry in place of Whatever you find there. just like the MODEL-I. Don't waste any time looking for the SYS Files. They aren't listed by name in the directory and don't have passwords anyway. I'll explain about that in a future article.
2. DISABLING PASSWORD CHECKING - You can dispense with passwords altogether if you want to. Use SUPERZAP to bring up track 1A, sector 2. Then use the MOD function of SUPERZAP to change relative byte DE from 28 to 18. Press and type 'Y' to write the modified sector back to the diskette. From now on, all passwords will be ignored when accessing files if this diskette is used in drive #0.
3. THE MASTER PASSWORD - If you don't have SUPERZAP or don't want to make any modifications to TRSDOS, you can access any file regardless of protection by using a master password to over-ride all other passwords. One such password is "NYXB". This acts as a master key to unlock any file and can be used if you have a diskette with a master password other than "PASSWORD".

System functions that can be accomplished in BASIC
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)
						

Creating /CMD Files from LDOS LIB Commands
There has been some confusion engendered about my suggestion on the LDOS board recently about the possibility of creating cmd files from individual library routines. I probably assumed a greater understanding of the system than was justified. Therefore, 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.

Changing The Minimum Cluster Size on Radio Shack Hard Drives - Adam Rubin - 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 00
						


then

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 TRSHD6A
						


to patch it with the patch file.

3) Reboot your system with this backup of the boot diskette.
4) Type

SYSTEM (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),

A) BACKUP *all* the files on that drive.
B)

SYSTEM (DRIVE=d,DISABLE,DRIVER="TRSHD6A")
								


and answer the prompts. (Make sure you're using TRSHD6A, not TRSHD6.) With the setup I have, the drive select address is 1 for all drives, each drive uses one head, and the starting head number is the logical drive number plus one. The starting head number for what's normally drive :0 (which is currently :4) is 1.

C)

TRSFORM6 :d
								


and answer the prompts. Disk name is up to you, and so is the disk master password. Unless you'd previously specified something else, the disk's current master password is probably PASSWORD. For "Manual lockout of tracks?", answer N. The appropriate portion of your hard drive will be reformatted, which takes a few minutes.

D)

LIST BOOT/SYS.LSIDOS:d (HEX)
								

to allocate the remainder of the space necessary for BOOT/SYS. This is ESSENTIAL, since TRSFORM6 assumes an unmodified driver, and you've thrown its calculations off by modifying TRSHD6/DCT.

E) If you're using 6.3,

DATECONV :d


F) Restore your files back onto the hard disk.
G) Repeat steps 5A-5F for each drive to be changed.
6) Type

SYSTEM (SYSTEM=4)
						


to make the hard disk your system drive again.

7) Type

SYSGEN (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.

Guided Tour Through The Model III TRSDOS Directory
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 FFFF
						


The 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).

Formatting A Double-Sided Diskette Under TRSDOS 6.x / LDOS 5.1.x and 6.x - Jeffrey Brenton
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.

Defeating TRSDOS v6.x Backup Protection
To defeat backup protection on TRSDOS 6.x disks:

10 OPEN "R",1,"BOOT/SYS.LSIDOS:0"
20 GET 1, 3: POKE VARPTR (#1) + 198,0
30 PUT 1,3: CLOSE: END
						

Reading a Model 4 TRSDOS 6.0 or a Model III LDOS disk on NEWDOS/80
To read a Model 4 TRSDOS 6.0 or a Model III LDOS disk directly on NEWDOS/80 V.2, use this PDRIVE setting:

TI=A, TD=E, TC=40, SPT=18, TSR=3, GPL=6, DSL=12, DGA=2
						

Running SYSTEM Commands from Model 4 BASIC - Colin Dunn
You can execute DOS commands from BASIC by using the RUN library command of TRSDOS.
Example: SYSTEM"RUN COMM *CL" will run the COMM/CMD program.
Note: SYSTEM"COMM *CL" will result in an error message - you MUST use the RUN command.

Renaming DOS Commands - Colin Dunn
If you hate the commands that the Shack set up for TRSDOS 6.x, you can change them!!! Using your file editor, read in SYS1/SYS.LSIDOS. The DOS commands are contained within the file. You can change the bytes of the commands to get a new command. If the command falls short of 6 characters, fill the rest of the space with 20H (32 decimal). Example: Change DIR to D, REMOVE to K.

Using TRSDOS or LDOS to Write Protect
To use LDOS or TRSDOS 6.x to write-protect disks in drive 1:

From LDOS READY type: SYSTEM (DRIVE=1, WP=Y) (or WP=N to unprotect).
From TRSDOS READY type: WP (DRIVE=1) (or WP to unprotect).
						

Addresses of TRSDOS 6.2 Routines - Colin Dunn
Ah, the glory of rebelling against the untrue statements in the TRSDOS 6.2 manual. The manual says that you should not call any DOS routines without using the SVC's (LD A,x and RST 28H). Why not escape this waste of source and use a CALL xxxxH instruction? It is also faster because DOS won't need to look up the SVC's in the table. The Shack would scream if us programmers were making TRSDOS 6.2 run faster than a snail...but is it worth the pain of the scream to save the ENDLESS pain of RST 28H instructions? Also, now that we have the addresses to all the SVC's, let's get the disassemblers into action and disassemble this DOS 6.2 thing and disseminate the good new undocumented addresses. One catch is that this is not guaranteed to work on DOSes other than 6.20. DO NOT USE TRSDOS 6.21 has it has a bug that erases parts of files on the disk! It just totally ignores the granule allocation table! Well, I think I've said enough of this crap, so let's get to business. The rules for calling the DOS routines are the same as for the SVC's, except instead of LD A,x and RST 28H you CALL xxxxH. The registers must be the same on entry. The exit conditions remain the same. It is still advisable to PUSH AF when calling DOS routines because the routines may internally use AF. For an explanation of the routines (DOS names have been used in this file), see your copy of the Model 4 TRSDOS manual.
@IPL: 1BF2H
@KEY: 0628H
@DSP: 0642H
@GET: 0638H
@PUT: 0645H
@CTL: 0623H
@PRT: 063DH
@WHERE: 1979H
@KBD: 0635H
@KEYIN: 0585H
@DSPLY: 052DH
@LOGER: 0503H
@LOGOT: 0500H
@MSG: 0530H
@PRINT: 0528H
@VDCTL: 0B99H
@PAUSE: 0382H
@PARAM: 1987H
@DATE: 07A8H
@TIME: 078DH
@CHNIO: 0689H
@ABORT: 1B08H
@EXIT: 1B0BH
SVC #23 (012EH in the table) is undefined. It points to 1AF4H (displays SYSTEM ERROR 2BH)
@CMNDI: 197EH
@CMNDR: 197BH
@ERROR: 1B0FH
@DEBUG: 19A0H
@CKTSK: 1CF5H
@ADTSK: 1CDAH
@RMTSK: 1CD7H
@RPTSK: 1CEBH
@KLTSK: 1CD0H
@CKDRV: 1993H
@DODIR: 19AFH
@RAMDIR: 19ACH
SVC #36-39 (0148H-014FH in the table) are undefined. These locations contain 1AF4H (a call that returns SYSTEM ERROR 2BH, SVC PARAMETER ERROR)
@DCSTAT: 19B5H
@SLCT: 19BCH
@DCINIT: 19C0H
@DCRES: 19C4H
@RSTOR: 19C8H
@STEPI: 19CCH
@SEEK: 19D0H
@RSLCT: 19D4H
@RDHDR: 19D8H
@RDSEC: 19F4H
@VRSEC: 19DCH
@RDTRK: 19E0H
@HDFMT: 19E4H
@WRSEC: 19E8H
@WRSSC: 19ECH
@WRTRK: 19F0H
@RENAM: 1996H
@REMOV: 19A6H
@INIT: 198DH
@OPEN: 198AH
@CLOSE: 1999H
@BKSP: 1486H
@CKEOF: 158FH
@LOC: 14B3H
@LOF: 14DEH
@PEOF: 14A2H
@POSN: 1434H
@READ: 1513H
@REW: 149BH
@RREAD: 1473H
@RWRIT: 13ADH
@SEEKSC: 1421H
@SKIP: 1430H
@VER: 1560H
@WEOF: 14ECH
@WRITE: 1531H
@LOAD: 1B38H
@RUN: 1B1DH
@FSPEC: 1981H
@FEXT: 1984H
@FNAME: 199CH
@GTDCT: 1A1EH
@GTDCB: 1990H
@GTMOD: 19B2H
SVC #84 RETURNS SYS ERROR 2B - LOCATION IN TABLE IS 01A8H
@RDSSC: 18D8H
SVC #86 IS A MYSTERY SVC NOT LISTED IN THE MANUAL. IT CALLS A ROUTINE AT 1874 HEX THAT I CAN'T FIGURE OUT. ANYONE KNOW WHAT THIS ONE'S FOR?
@DIRRD: 18BBH
@DIRWR: 1803H
SVC #89 IS ANOTHER MYSTERY THAT JUMPS TO ADDRESS 1875 HEX.
@MUL8: 190AH
@DIV16: 06C9H
SVC #92 RETURNS SYS ERROR 2B - LOCATION IN TABLE IS 01B8H
@DIV8: 1927H
@DIV16: 06E3H
SVC #95 RETURNS SYS ERROR 2B - LOCATION IN TABLE IS 01BEH
@DECHEX: 03E1H
@HEXDEC: 06F6H
@HEX8: 07C2H
@HEX16: 07BDH
@HIGH$: 1948H
@FLAGS: 196AH
@BANK: 0877H
@BREAK: 196FH
@SOUND: 0392H
@CLS: 0545H
@CKBRKC: 0553H
SVC'S #107-#127 are free for you to use. SVC #107 is found in location 01D6H. Each one after that is found two bytes later. You can use the following formula to calculate exact locations (under DOS 6.20):
LOC=0100H+SVC*2
Where SVC is the number of the SVC you wish to program. You CAN program OVER the DOS SVC's, but should you use this practice, use the @IPL SVC (#000, address 1BF2H) to exit your program. If you don't wish to reboot, store the original SVC table in a buffer as follows:

LD HL,0100H
LD DE,BUFFER
LD BC,0100H
LDIR
					

The SVC table is 256 bytes long and is ALWAYS found on a page boundary (even multiples of 100 hex). Should the SVC table get moved, you can get its starting address by using this code...

LD A,101
RST 28H
LD A,(IY+26)
LD H,A
LD L,0
; NOW HL HAS THE ADDRESS - MSB IS IN H, LSB ALWAYS ZERO.
					

NOTE: If the SVC table got moved, the addresses provided above would be wrong.

Trading Files Between LDOS6.2 and NEWDOS/80 v2.0 - Chris Anderson
One of the things I quickly discovered as I began working with my new Model 4P was that there was going to be a need to move data back and forth between my old NEWDOS disks and LDOS6 disks. The following procedure is very straightforward, and will work without hassle for those important data files.
Note: The following procedure requires at least two drives!
NEWDOS80 V2 to LDOS6.2
1) Boot under LDOS6.2.
2) Format a disk SSSD, 35 tracks. You MUST use single side, single density and 35 tracks, regardless of the type of drive you are actually using!
3) Boot NEWDOS80 V2. (Note, if you are a 4P owner, and are having problems booting NEWDOS, see the info file on this topic)
4) Set the PDRIVE for the drive where the LDOS disk resides to TI=A,TD=A,TC=35,SPT=10,GPL=2,DDSL=17,DDGA=2.
5) Use the normal NEWDOS Copy command to copy the file from your NEWDOS80 disk to the LDOS disk.
6) Reboot the system using LDOS6.2.
7) Use the RESET command or TSK/CMD if you have several copied files) to CLOSE each of the copied files. NEWDOS is not familiar with the open/closed status, and will leave each file open when copying it over to LDOS.
That's all there is to the job in that direction. Going the other way is just as easy.
LDOS6.2 to NEWDOS80 V2
Perform the steps above in the following order:
1) Boot in 6.2
2) Format as noted above. Then, copy files as desired to the newly formatted disk while still in LDOS.
3) Boot NEWDOS.
4) Set PDRIVE as noted above.
5) Use normal NEWDOS copy command to move files from the LDOS disk to the NEWDOS disk.
Provided you have a Model 4 (and not a 4P) you may also find that it is fairly fast to use Multidos for this sort of thing.

Configuring LDOS like NEWDOS/80 - Rowan Evans
At last we have some questions to answer on LDOS!! The first one comes from a Newdos 80 user, who wants to know "How to configure LDOS, and what all the /DVR and /FLT files do", and the second from a TRSDOS 6.x user who wants to access the system status flags from within a BASIC program.
Configuring LDOS.
The first thing that should be done to configure LDOS for the system you use is to list the options that your system needs- e.g. Double Density, Printer Driver, etc. The easiest way to do this is to list your current Newdos configuration, or if you don't use Newdos, your hardware and its requirements.
1. Using an existing Newdos system configuration list.
I have listed the Newdos configuration options below and their LDOS counterparts. Items marked + cannot be SYSGENed under LDOS. Items marked * can be done if a driver or filter is written.
SYSTEM LDOS
+AA Password enable - LDOS passwords are always enabled, with the option of a "Global" password to allow access to ANY file (password is "RS0LT0FF").
AB Run only - this is possible under LDOS by forcing a non-breakable AUTO with the SYSTEM option BREAK=N.
AC Debounce routine On/Off - LDOS does its debounce through the KI/DVR, so by disabling it, debounce is disabled.
AD "JKL" screen print On/Off - This is also a function of the KI/DVR.
AE "123" invokes debug -press instead once debug is activated.
AF "DFG" invokes miniDOS -install LDOS' MINIDOS/FLT then by pressing and then another key, several minidos functions are available -
<CLEAR> & "C" - Clock on/off.
<CLEAR> & "D" - Enter Debug.
<CLEAR> & "F" - Free space on all active drives.
<CLEAR> & "K" - Kill a file.
<CLEAR> & "P" - Send a character to the printer.
<CLEAR> & "Q" - Directory of selected disk drive.
<CLEAR> & "R" - Repeat last DOS command.
<CLEAR> & "T" - Send form feed to printer.
AG Break key status - use LDOS' command SYSTEM (BREAK=ON/OFF).
AH Not defined in Newdos 80 version 2.
AI Lower case modification installed in computer - LDOS senses this automatically at power up/reset.
AJ Keyboard intercept routine active (debounce on/off, repeat on/off and 'JKL','123' and 'DFG' are activated solely by interrupts) -the LDOS *KI driver is used to activate these functions, either SET *KI KI/DVR or RESET *KI.
AK Not defined in Newdos 80 version 2.
AL Number of drives on the system -use LDOS' command SYSTEM (DRIVE=n,ENABLE/DISABLE)to set the correct number and address of the drives in the system.
*AM number of retries for disk I/O -only possible to alter if you write a driver routine for a specific drive there are several example disk drivers published in various magazines.
+AN default drive for the directory command -LDOS doesn't allow this, instead typing just DIR will give the directories for ALL currently mounted (and enabled) disk drives in the system.
+AO first drive to write a default filedto (ie where the user has not specified the drive number in the command) -LDOS allows this via the SYSTEM (DRIVE=n,WP) command to software write protect any drive that you don't want to write a file to.
AP DOS high memory value to be inserted at bootup -use the LDOS command MEMORY (HIGH=X'nnnn') then do a SYSTEM (SYSGEN).
AQ CLEAR key enable/disable -no equivalent function in LDOS apart from the *KI driver.
+AR password enable/disable for full disk backup -LDOS does not allow the enabling and disabling of passwords like Newdos however the LDOS BACKUP can be subverted to allow the full disk backup of a disk with an unknown password.
*AS BASIC converts quoted strings to upper case - no equivalent function in LDOS.
+AT do files will only accept string input requests from the /JCL file, single key inputs will be requested from the keyboard - LDOS /JCL files do not allow this, however the LDOS JCL does allow for //KEYIN and //INPUT to get keyboard input during execution of a do file.
*AU repeat key function on/off - no equivalent function in LDOS.
*AV wait for specified number of milliseconds before repeating the last key held down - no equivalent function in LDOS.
AW write with verify disk I/O retries - no equivalent function in LDOS.
*AX number specified is that of the highest printable ASCII character to be sent to the printer -dhis can be done through an LDOS filter.
AY ask operator for time and date on/off - LDOS allows the time and date questions to be bypassed (under version 5.1.x) by using the commands SYSTEM (DATE=ON/OFF) and SYSTEM (TIME=ON/OFF).
AZ force the operator to re-input time and date after reset on/off - no equivalent function in LDOS.
BA reset disables VDU display on/off - this can be done by doing a ROUTE *DO NIL and then a SYSTEM (SYSGEN).
*BB 50/60 Hz clock notification - see TIME50 in the LDOS Quarterly Vol 2 Number 5 page 22 to fix the Mod III real time clock. NOTE -this notification does NOTHING under Newdos 80 - refer to the manual!!!
BC operator pause/cancel chaining on/off - no equivalent function in LDOS.
+BD operator override of AUTO command on/off -done in LDOS when the AUTO command is set up by issuing the command - AUTO *command.
*BE enable/disable dos 'R' repeat command - can be done by patch to MINIDOS/FLT if desired.
BF lower case driver activate - not needed.
BG set keyboard to lower case -done by pressing + 0 and then doing SYSTEM (SYSGEN).
BH enable/disable cursor blinking -dse the command SYSTEM (BLINK=ON/OFF) or SYSTEM (BLINK=LARGE/SMALL).
BI set the cursor to specified character - use the command SYSTEM (BLINK=).
BJ system speed up control - use the LDOS command SYSTEM (FAST/SLOW) which not only changes the timing loops like Newdos,but also will change the CPU speed if the speed mod is addressed through port 254 and is switched on using 1 and off using 0.
BK enable/disable command WRDIRP and the W and C functions of DIRCHECK - no equivalent function in LDOS as the disk format from Mod I to III to 4 are IDENTICAL in double density
BM enable/disable separate verify pass during format - no equivalent function in LDOS.
+BN write single density disk data address mark for either Model I TRSDOS or Model III Newdos 80 - use the LDOS utility REPAIR (ALIEN).
2. Having chosen the required configuration alternatives, install them into LDOS by issuing the necessary commands.
3. When you are certain that all your chosen functions are operational, type SYSTEM (SYSGEN) to get LDOS to create a configuration file and write it to drive 0. Please note that EVERYTHING in high memory (including SYSRESed /SYS files) will be included in this file, so ensure that you have sufficient room on the floppy to save the file.
4. Once the configuration file is written, power down and then back up again to get a cold start of the system. I have found that some configurations will appear OK if a warm start test is done, but not if a cold start test is done - particularly if the disk is a SOLED double density boot disk.
A typical configuration for a system with 3 drives is -
PDUBL - for double density.
SET *KI KI (TYPE,JKL) - type-ahead, JKL, etc.
SYSTEM (BLINK=143) - blinking block cursor.
SYSTEM (DRIVE=3,DISABLE) - drives 0, 1 & 2 only.
SYSTEM (DRIVE=2,STEP=1) - drive 2 is 12 m/s step.
SYSTEM (TYPE) - activate type-ahead.
FILTER *KI MINIDOS - activate MiniDOS.
FILTER *PR PR (ADDLF) - add linefeeds to printer.
ZSHELL - Misosys command processor.
Then type -

	SYSTEM (SYSGEN)
					

Booting a Model 4P from a Hard Drive - Gary Phillips - December 22, 1987
The following patch files can be used to permit a model 4P to boot directly from a hard disk that uses the standard Radio Shack 8X300 or WD1010 controller board. They use the code and technique that was originated by Adam Rubin for TRSDOS 6.2, but have been modified for LS-DOS 6.3. I have tested them with a standard RS 5 Meg drive, using either the original TRSHD6 driver or the Misosys RSHARD6 driver software. You should also read Adam's original HDBOOT.DOC file before applying these two patches. (See DL6 IN CIS for that file.)
The HDSYS0/FIX patch should be applied to the SYS0/SYS file on your hard disk. The HDBOOT/FIX patch must have the xx, yy, and zz bytes filled in from your DCT before applying it. Be sure that your hard disk is completely backed up before applying these patches, because if you have difficulty you could lose data! Remember, too, that once you have applied these patches, you should NOT use backup to copy /SYS files to or from the hard disk. Your 4P will automatically boot from the hard disk when it is powered on or reset, unless you hold down the F2 key while booting. (If you have an XLR8er board, you may need a couple of tries on a cold boot because the cold start speed of the XLR8er is a bit slow.)
Note that the xx and yy values must be entered in hexadecimal. For a RS 5 Meg drive, xx is 32 sectors/cylinder or hex 20, for example.
If you have your HD system partition configured as drive 0 (by booting from a configuration floppy) you can obtain the zz values by using DEBUG to look at address x'0373' through x'0378', which is DCT+3 for drive 0 under LS-DOS 6.x for the Model 4.

. HDSYS0 - Patch to SYS0/SYS of LS-DOS 6.3 to permit direct
. booting of Model 4P from RS HD  - originated by Adam Rubin
. 6.3 level K mods. by Gary Phillips, 08/12/87, rev. 08/22/87
. Apply via PATCH SYS0/SYS.LSIDOS using HDSYS0/FIX
.
d0c,b9=00 00 00
f0c,b9=31 80 03
d0d,07=c3 8f 1e
f0d,07=00 00 00
d0e,a0=00 00 00
f0e,a0=c2 a0 19
d0e,e2=00
f0e,e2=c0
d0f,14=fe
f0f,14=0c
. eop
.
. HDBOOT - Patch to BOOT/SYS of LS-DOS 6.3 to permit direct
. booting of model 4P from RS HD - originated by Adam Rubin
. --adapted for 6.3 level K by Gary Phillips   --08/12/87
. Apply via PATCH BOOT/SYS.LSIDOS using HDBOOT/FIX
. Before using this patch, you must substitute:
.   for xx, number of sectors per cylinder of drive 0 (hex)
.    for yy, number of sectors per gran under your driver (hex)
.    for zz, the values of DCT+3 to DCT+8 for drive 0
.
d00,4d=xx 00 00 00 00 00 00 00
f00,4d=12 fd cb 04 6e 28 01 87
d00,5a=yy
f00,5a=06
d00,9f=c3 43
f00,9f=70 04
d01,41=18 0d f9 43 zz zz zz zz zz zz 00 00 00 00 00
f01,41=1e 00 cd 74 43 3a cd 12 e6 20 21 74 04 b6 77
d01,6f=18 2c 00
f01,6f=c3 38 02
d01,7c=c3
f01,7c=96
d01,80=00 00
f01,80=e6 1c
d01,96=00 00 00 00 00 00 00 21 43 43 11 71 04 01 08 00
f01,96=01 f4 81 ed 41 0d 3e 18 ed 51 cd d9 43 db f0 cb
d01,a6=ed b0 c3 38 02 f3 cd c3 43 3a 78 00 d3 84 fb 3e
f01,a6=47 20 fa 7b d3 f2 3e 81 d3 f4 d5 11 02 c1 3e 80
d01,b6=05 c0 3a 79 04 92 3e 06 28 01 af a7 c9 e5 d5 3e
f01,b6=cd d9 43 3e c0 d3 e4 db f0 a3 28 fb ed a2 7a d3
d01,c6=85 d3 84 d3 9c 4b 5a 16 00 06 0c 3e 02 cf f5 af
f01,c6=f4 ed a2 20 fa 18 fe d1 d1 af d3 e4 3e 81 d3 f4
d01,d6=d3 9c 3e 86 d3 84 f1 d1 e1
f01,d6=db f0 c9 d3 f0 06 18 10 fe
d01,f9=3e 09 90 28 ad af c9
f01,f9=00 00 00 00 00 00 00
. eop
						

Changing TRSDOS 6.2.1 to Boot a Model 4P from a Hard Drive
This file describes modifications to TRSDOS 6.2.1 to enable a TRS-80 Model 4P to boot directly from a Radio Shack 5-megabyte hard disk drive. You will need a file or sector editor to modify your hard disk.
NOTICE: Changing any operating system, especially at this level, is a dangerous operation. If anything in this file is not absolutely clear to you, do NOT attempt any modifications by yourself.
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 any modifications must be made at your own risk.
System Requirements:
1) TRS-80 Model 4P ONLY, not Model 4 or 4D.
2) TRSDOS 6.2.1.
3) Radio Shack 5-meg hard disk drive. This method might work on other drives with a WD1000 or WD1010 controller, but has not been tested. Any hard drive used must meet the following conditions: TRSDOS logical drive :0 must lie entirely under the first head (head 1) on the hard drive. On this drive, logical cylinder and sector numbers must be identical to physical track and sector numbers.
4) Use of Radio Shack hard disk drivers when running under TRSDOS 6.2.1. Other drivers have not been tested.
Instructions:
All references to drive :0 refer to the first logical (and physical) drive on your hard disk.
1) Boot the hard disk system with your usual boot diskette. If there is an AUTO command on your boot diskette, write it down.
2) Backup all files from the hard disk onto floppies.
3) Use SYSGEN to create a CONFIG/SYS file on logical drive :0.
4) Fill in the values marked "xx," "yy," and "zz zz zz..." in the table of changes to BOOT/SYS.
5) Using a file or sector editor, CAREFULLY change the files SYS0/SYS and BOOT/SYS on logical drive :0 as specified in the tables below.
To restore the original BOOT/SYS and SYS0/SYS files, either while changing them or at any time afterwards, reboot using your boot diskette and backup SYS0/SYS from the boot diskette to :0.
6) Exit from your file or sector editor to "TRSDOS Ready." If there was an AUTO command on your boot diskette, store it on drive :0.
7) Remove all floppy disks from the drives and press RESET. In a few seconds, you should see the familiar Tandy logo. If so, you are finished modifying your system.
8) If your system does not boot properly, reboot with your boot diskette (hold down while pressing RESET), and restore SYS0/SYS and BOOT/SYS from the boot diskette to the hard disk (see step 5 above). You may either abandon the entire project, or attempt it again.
When using the modifications in this file, a few restrictions apply:
1) The system will attempt to boot from the hard drive if it is turned on. To boot from a floppy, hold down the key while pressing RESET.
2) When booting, if the hard drive is not completely up to speed you may see either a screenful of garbage or "The floppy disk drive is not ready." Press RESET, and the system should boot properly.
3) The CONFIG/SYS file must be loaded when booting from the hard drive, and cannot be suppressed. If it cannot be loaded, the system will not boot.
In that case, you must boot with the boot diskette, and use SYSGEN to create a valid CONFIG/SYS file on the hard disk's drive :0
You may change your system configuration at any time, as long as it meets the requirements above. Merely boot the system from the hard drive, establish the new configuration, and re-SYSGEN.
4) When booting from the hard drive, you cannot enter DEBUG by holding down the key, as this would prevent CONFIG/SYS from being loaded. To enter DEBUG in this manner, boot from a floppy.
Of course, once you are at the "TRSDOS Ready" prompt, DEBUG may be used as desired.
5) An AUTO command may be installed on the hard disk's drive :0. To fix a runaway AUTO command, reboot with your boot diskette.
6) Do not move the modified SYS0/SYS from hard drive :0 onto another disk. SYS0/SYS and BOOT/SYS have been modified for hard drive boot, and BACKUP will alter the non-existent bootstrap step rate of BOOT/SYS, rendering the copy unusable for booting either a floppy or hard disk system.
Changes to SYS0/SYS.LSIDOS

Record,Byte     From        To
-----------     ----        --
0C,B0           31 80 03    00 00 00
0C,FE           00 00 00    C3 86 1E
0E,7A           C2 A0 19    00 00 00
0E,C0           C0          00
0E,F2           0C          FE
					

Changes to BOOT/SYS.LSIDOS

Record,Byte     From             To
-----------     ----             --
00,4D           12 FD...01 87    xx 00 00 00 00 00 00 00
00,5A           06               yy
00,9F           70 04            C3 43
01,41           1E 00...B6 77    18 0D F9 43 zz zz zz zz zz zz 00 00 00 00 00
01,6F           C3 38 02         18 2C 00
01,7C           96               C3
01,80           E6 1C            00 00
01,F9           00 00...00 00    3E 09 90 28 AD AF C9

01,96 thru 01,DE
        From:   01 F4 81 ... 18 10 FE
        To:     00 00 00 00 00 00 00 21 43 43 11 71 04 01 08 00 ED B0 C3 38
                02 F3 CD C3 43 3A 78 00 D3 84 FB 3E 05 C0 3A 79 04 92 3E 06
                28 01 AF A7 C9 E5 D5 3E 85 D3 84 D3 9C 4B 5A 16 00 06 0C 3E
                02 CF F5 AF D3 9C 3E 86 D3 84 F1 D1 E1
					

For "xx," "yy," and "zz zz zz...," substitute the appropriate values for drive :0 of your hard disk system.
xx = Sectors per cylinder, in hexadecimal. For example, thirty-two sectors per cylinder would be 20 hex.
yy = Sectors per granule, in hexadecimal. For example, sixteen sectors per granule would be 10 hex.
zz zz zz... = values of DCT+3 through DCT+8 for hard disk drive :0. Boot the hard disk system with your boot diskette, and use DEBUG to examine the Drive Code table for drive :0.

Setting MEMORY SIZE inside DOS BASIC
If you are in Model I DOS BASIC and forgot to set Memory Size. Do the following, and it will re-set the memory size. While it will say LEVEL II BASIC it will still be DOS BASIC.

                SYSTEM

                *? /177
						

1 Comments

  1. I’m trying to make a copy of my TRSDOS v6 disk, and the basic code listed here to defeat the backup protection doesn’t seem to be working. I load BASIC, enter the code and run it, then I get a “File access denied in line 20” error. I double checked the code and it’s correct. The disk is not write protected.

    Any idea on this?

    EDIT FROM IRA – Turns out that the user was trying to use a TRSDOS patch on LDOS. The above patch does not work on LDOS.

Leave a Comment.