.NONUMBER .LM 0 ^PY^- .PAGE SIZE 58,85 .LM 10 .RM 75 .NO FILL .NO JUSTIFY # .SKIP 5 .CENTER The RSX Multi-Tasker .CENTER November, 1986 .SKIP .CENTER ^IS144^G"All the News that Fits, We Print"^IS204^G .SKIP .CENTER Fine Realtime Commentary Since 1975 .SKIP 6 .CENTER ^&Table of Contents\& .SKIP 2 .TAB STOPS 60 The Editor's Corner RSX-1 Free PCs - Get 'Em While They Last RSX-1 Submitting Articles to the Multi-Tasker RSX-3 Answer to Last Month's Quiz RSX-3 And That's The Way Things Are RSX-4 The Bag of Tricks: MACRO-11 RSX-4 RMDEMO Enhancements RSX-6 Rebuilding Device Drivers RSX-9 Free Software RSX-13 Files-11 On Disk Structure Specification RSX-14 .JUSTIFY .FILL .PAGE .COMMENT .COMMENT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .COMMENT The Editor's Corner .COMMENT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .COMMENT # .SKIP 5 .AUTOPARAGRAPH .CENTER ^&The Editor's Corner\& .SKIP .CENTER Bruce R. Mitchell .SKIP 2 By the time you read this, the Fall 1986 Symposium will be over. This issue is being submitted to print in late September, so the first reports you'll be reading on the Fall Symposium will be appearing in the December issue. This issue marks the launching of a new, ongoing education project for the RSX SIG. Over the next year, as space permits, the Multi-Tasker will reprint some of the 'landmark' RSX technical papers and articles from the past. This series will include the original ACM paper on the RSX operating system by Dave Cutler, the exposition on SAV by Paul Bezeredi, the topological walk to an ODL by John Covert, the mathematics of RSX-11 by Ralph Stamerjohn, and other fundamental RSX articles which are now difficult to find. This month's article is the Files-11 disk specification. There are also new articles for your enjoyment and edification. There are patches to RMD to enhance the functionality and correct the worst-case POOL statistics loss. There is an article dealing with the eternal problem of adding devices already present in a system without doing a complete SYSgen. There is a short article dealing with free software (although I rather tend to think it deals with system security). And there's a reminder in the Bag of Tricks about a PDP-11 architecture 'feature' we sometimes tend to forget. The editor wishes to thank each and every respondent to the call for more articles. Keep those articles coming; I've got a little something for all submittors. And don't forget to send in your entries for the puzzle contest from last month's issue. They're beginning to roll on in now, but not as many as I expected, so keep them coming. And now, ladies and gentlemen, here's this month's dollop of food for thought. .TEST PAGE 5 .SKIP 2 .CENTER ----- Free PCs - Get 'Em While They Last ----- No doubt many of you wonder how the Multi-Tasker is published each month. Currently, it goes something like this: .SKIP - Editor accepts manuscripts up to 3rd week of the month .BREAK - Editor types manuscripts in to big RUNOFF file .BREAK - Shortly before deadline, editor makes frantic final edits .BREAK - Editor runs out final copy on letter-quality printer .BREAK - Editor (often Express) mails in final copy to DECUS HQ .BREAK - Editor breathes huge sigh of relief .BREAK - DECUS HQ adds article headers and page numbers .BREAK - DECUS HQ sends final copy to printers And that's how the Multi-Tasker gets published every month. The Communications Committee, however, has a new and different idea. The idea goes something like this: .SKIP - DECUS buys each newsletter editor a PC, .BREAK ####################################a printer, .BREAK ####################################a 2400 baud modem, .BREAK ####################################and pays for a phone line. .BREAK - Contributors call the PC and KERMIT / EDT / DECnet in articles .BREAK - Editors prepare newsletters in a standard format using PCs .BREAK - Editors dial up a DECUS VAX and KERMIT / DECnet in newsletters Sounds good, no? No doubt it sounds very good in some quarters. Editors would have a Rainbow or Professional to play with when not sending out the newsletters. And the cost is not actually very high; if the equipment costs $2,500 per editor, over 23 newsletters the cost is $57,500. Plus phone line installation and ongoing expenses, of course. But from whence cometh this money? Newsletter subscription profits? Probably not. For argument, let's say it comes out of symposia fees. That's the biggest moneymaker. Attendance is in the 6,000 range, times 2 per year. That means attendees pay an extra $5 for this project. If true ... and this is only one project ... ever wonder why symposium registration fees keep going up? Five bucks here, five bucks there ... it does add up. Now, with DECUS purportedly cutting expenses all over, some thought leads to a few interesting questions. .SKIP Is standardization of newsletter formats necessary? .BREAK Is standardization of newsletter formats even desirable? .BREAK Will newsletter subscriptions increase as a result? .BREAK Will this reduce paid manpower which gets the newsletters out? .BREAK ^IS144^GHas this project been reviewed by a disinterested member panel?^IS204^G .BREAK Would this money be better spent elsewhere? Little perks for volunteers are fine. Volunteers make DECUS run. But is this project necessary? Or desirable? ^IS144^GThis^IS204^G editor doesn't think so. Maybe ^IS144^Gyou^IS204^G, the members-at-large, don't think so either. If not, you ^IS144^Gcan^IS204^G do something about it. Write to Bob Curley. He's on the Board of Directors. He's spearheading a project to improve communications between the membership and the leadership. He's an end user. He'll listen. .SKIP Robert F. Curley .BREAK Department of Radiation Therapy .BREAK University of Pennsylvania .BREAK Room 410 .BREAK 133 South 36th Street .BREAK Philadelphia, PA .BREAK 19104-3246 Write now. Don't put it off or it will never get done. Tell him that you support this project or don't support it. Tell him that you like the way DECUS is going or that you don't like it. Tell him that you get your money's worth from symposia. Tell him that you don't attend symposia because they're too expensive. Tell him that you don't care. But do tell him something. .TEST PAGE 5 .SKIP 2 .CENTER ----- Submitting Articles to the Multi-Tasker ----- Please do submit machine readable media when it's possible. RX01, RX02 or RX50 diskette, or 800/1600 BPI 9 channel magtape are best. Any format is acceptable except ROLLIN, PRESRV or VMS backup. ANSI, BRU and DOS FLX formats are well-liked by the Editor's tape drive. Submissions which aren't machine readable take longer to get into print. The editor is lazy and types mass quantities only once a month when progress reports are due. If you preformat a submission in RUNOFF format, please set left margin 10, right margin 75, and when changing margins use incremental changes rather than absolute. The editor blesses you for the consideration. Send all submissions to: .SKIP .NO FILL .NO JUSTIFY Bruce R. Mitchell Machine Intelligence and Industrial Magic PO Box 816 Byron, MN 55920 .JUSTIFY .FILL .TEST PAGE 5 .SKIP 2 .CENTER ----- Answer to Last Month's Quiz ----- In the RSX Brain Teaser. But you'll have to ferret it out yourself. .TEST PAGE 5 .SKIP 2 .CENTER ----- And That's The Way Things Are ----- _... this month in Pool Lowbegone, where all the Digital sales reps sell strong, all the IBM sales reps are good-looking, and the RSX SIG is above average. .COMMENT .COMMENT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .COMMENT The Bag of Tricks .COMMENT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .COMMENT .TEST PAGE 15 .SKIP 6 .CENTER ^&The Bag of Tricks: MACRO-11\& .SKIP .CENTER Bruce R. Mitchell .CENTER Machine Intelligence and Industrial Magic .CENTER PO Box 816 .CENTER Byron, MN###55920 .SKIP From time to time, assembly language programmers tend to find themselves in situations where they are climbing the walls in search of a program fault. This is sometimes due to an insufficient knowledge of PDP-11 architecture, in which the programmer ^IS144^Gexpects^IS204^G the machine to do something it is ^IS144^Gnot^IS204^G supposed to do. There is one peculiarity in the PDP-11 architecture that has probably been encountered accidentally by more programmers than any other, and we're going to take a look at it this month. Examine the following segment of code, which the programmer intended to read all the logical blocks on a disk, one at a time: .SKIP 2 .NO FILL .NO JUSTIFY CLR READPB+Q.IOPL+6 ; Clear high word of LBN 2word CLR READPB+Q.IOPL+8. ; Set up for disk LBN 0 10$: DIR$ _#READPB ; Read the next logical block TSTB IOSTAT ; Did the read succeed? BMI 20$ ; If not, go process the error ... processing of disk block information ... INC READPB+Q.IOPL+8. ; Bump the LBN doubleword by 1 ADC READPB+Q.IOPL+6 ; Add carry, for real big files BR 10$ ; And go look at the next block .JUSTIFY .FILL .SKIP When this code is tested, it runs fine on all disks the programmer cares to try. Six months later, however, a site licensed for the program containing this code complains that the program never finishes. "Those idiots are doing something wrong," thinks the programmer as he flies out to check out the problem. "If users would just read the documentation! Oh well, nothing like a few more frequent flyer miles." On site, the programmer checks out the task with various disks. The task runs fine. "There's something wrong with your data!", he chortles gleefully, and leaves. As he goes out the door, the site's VP-Engineering is already having a nice chat with his Legal Department. Let us gloss over a short but painful episode in the programmer's career. The upshot of it is that he returns on the next plane. Back on site, he discovers that the task runs fine on small disks, but appears to loop forever when procesing large disks. The symptom is that the program never ends up at 20$ with error code IE.BLK, which is expected when attempting to read past end-of-disk. It loops forever on big disks. But little disks work just fine. Why does this problem occur? If you already know the answer, you can skip on to the next article. If you don't, this may be an eye-opener and cause you to rewrite some of your own code. The programmer expected the INC instruction to set the carry bit at block number 177777 (65,535) when BLKADD+2 rolled over to 0. The carry bit would then be added to the high word of BLKADD, making the doubleword (1,0) or 65,536. This is a common expectation; it is, however, incorrect. The PDP-11 INC and DEC instructions ^IS144^Gdo not^IS204^G set the carry bit. It is now evident why the program runs on "small" disks. It works correctly for any disk smaller than 65,536 blocks. On larger disks, it cycles through blocks 0 to 65,535 repeatedly. The fix? Replace the INC instruction with ADD _#1,
in cases where it is important that the carry bit be set correctly. .COMMENT .COMMENT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .COMMENT RMDEMO Enhancements .COMMENT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .COMMENT .TEST PAGE 15 .SKIP 6 .CENTER ^&RMDEMO Enhancements\& .SKIP .CENTER John L. Newcomb .CENTER Hallmark Cards, Inc. .CENTER 25 Bacon Road .CENTER Enfield, CT 06082 .SKIP The time has come. I have procrastinated for as long as I can. The guilt is too much to bear. After many years of benefiting from DECUS supplied software, I am ready to offer a token of our appreciation: Enhancements for RMD. RMD has two display pages (I and M) that contain information about mass storage devices. By default, RMD chooses these devices by following the DCB chain, although at build time the user may specify any or all devices via global patches in the RMD build file. At runtime, whenever you desire RMD to display information on a device that is not one of the default devices, you must change the designation with the DEVICEx= command. This must be done each time RMD is invoked. I'm sure this is as annoying to you as it is to me. Changing the default devices by rebuilding RMD each time is not a viable alternative. The larger the number of devices SYSgenned into each system just aggravates the problem. The changes I have made to RMD offer a solution to this problem. I have tested the modifications on RSX-11M+, versions 2.1D and 3.0B. Because I have used the DEC supplied GIN$ directive, these changes should work on any RSX that has the GIN$ directive available. After applying the SLP files listed below and rebuilding, RMD displays information on any mass storage device that has a local or global assignment to the mnemonics DV0: thru DV5: . The mnemonics DVx: correspond to the RMD DEVICEx command. A local assignment for a terminal running RMD overrides a global assignment. We make global assignments in our system startup file and then users may make their own local assignments. For any RMD 'DEVICE' that does not have a corresponding DV: assignment, RMD displays the information for the default device. This is also the case for 'invalid' assignments such as 'ASN TT4:=DV2:'. I am not aware of any device conflict in using the DV: mnemonic. If there is a conflict, any mnemonic may be substituted in the SLP file for the RMDXCM.MAC module and then used in ASN statements. Users can now invoke RMD without having to change device designations each time. There have been several inquiries published requesting a fix to RMD to retain the 'worst case POOL statistics' when switching pages. I plead guilty to having the fix (as simple as it is) for a long time (say since M V3.2 days). DEC has also come up with a 'fix' for version 3.0, so if you have the problem and are running any system from M V3.2 to M+ V2.1, inclusive, do the following: In the module MDCOM.MAC, delete the following lines: .SKIP 2 .NO FILL .NO JUSTIFY $MDWPL::.WORD 0 ; WORST CASE LARGEST POOL FRAGMENT $MDWPT::.WORD 0 ; SMALLEST POOL HAS GONE TO $MDWPF::.WORD 0 ; MOST NUMBER OF FRAGMENTS SO FAR .JUSTIFY .FILL .SKIP In the module RMDXCM.MAC, insert the above lines deleted from the module MDCOM.MAC. Then pick-up with step 2 below. Do the following steps for the source modules you have changed. The source files are in [14,10]. .LIST .LE Apply the following SLP patches to the appropriate source. .LE Assemble the module. The Macro command line may be obtained by examining the file [14,24]RMDASM.CMD . If you use the command lines from the file don't forget to make the assignments for IN:, OU:, and LI: . .LE Replace the object files in [1,24]RMD.OLB using the commands: .SKIP SET /UIC=[1,24] .BREAK LBR RMD.OLB/-EP/RP=[14,10]module name,module name,etc .LE Rebuild RMD using 'TKB @RMDBLD'. .LE VMR REMove the old task and VMR INStall the new task if necessary. .LE REMove the old task and INStall the new task in the running system if necessary. .END LIST Here are the SLP patches to be applied to RMD source file [14,10]RMDEMO.MAC: .SKIP 2 .NO FILL .NO JUSTIFY RMDEMO.MAC/AU=RMDEMO.MAC -/SCPAD/,,/;JLN/ GL.BUF: .BLKW 6 ; GLUN$ BUFFER GN.BUF: .BLKW 6 ; GIN$ BUFFER -/.MCALL/,,/;JLN/ .MCALL GLUN$S,GIN$S -/40$:/,,/;JLN/ GLUN$S _#$DLUN, _#GL.BUF ; GLUN$ on TI: BCS EXJ ; Skip, GLUN$ failed # ; This loop handles global assignments of type DVnn: # CLR R0 ; Counts DV units CLR R1 ; RMD table offset MOV _#6, R2 ; 6 units max # LP: GIN$S _#GI.GAS, _#GN.BUF, _#6, _#"DV, R0, _#0, _#0 BCS 100$ ; Skip, GIN$ failed # BIT _#DV.DIR, GN.BUF+4 ; Directory device? BEQ 100$ ; If not, don't do it # MOV GN.BUF, $MDDEV(R1) ; Load device name MOVB GN.BUF+2, $MDDEV+2(R1) ; Load unit number # 100$: INC R0 ; Do next DV unit ADD _#6, R1 ; Point at next entry SOB R2, LP ; And loop until done # ; This loop handles local assignments of type DVnn: # CLR R0 ; Counts DV units CLR R1 ; RMD table offset MOVB GL.BUF+G.LUNU, R3 ; Load TI: unit _# MOV _#6, R2 ; 6 units max # LP2: GIN$S _#GI.GAS, _#GN.BUF, _#6, _#"DV, R0, _#"TT, R3 BCS 200$ ; Skip, GIN$ failed # BIT _#DV.DIR, GN.BUF+4 ; Directory device? BEQ 200$ ; If not, don't do it # MOV GN.BUF, $MDDEV(R1) ; Load device name MOVB GN.BUF+2, $MDDEV+2(R1) ; Load unit number # 200$: INC R0 ; Do next DV unit ADD _#6, R1 ; Point at next entry SOB R2, LP2 ; And loop until done # EXJ: / .JUSTIFY .FILL .SKIP And here are the SLP patches to be applied to RMD source file [14,10]RMDXCM.MAC: .SKIP 2 .NO FILL .NO JUSTIFY RMDXCM.MAC/AU=RMDXCM.MAC -/$MDDEV:/,.+12,/;JLN/ $MDDEV::.ASCII /DV/ ; Device name .WORD 0 ; Unit number .WORD 0 ; Device UCB address .ASCII /DV/ .WORD 1, 0 .ASCII /DV/ .WORD 2, 0 .ASCII /DV/ .WORD 3, 0 .ASCII /DV/ .WORD 4, 0 .ASCII /DV/ .WORD 5, 0 / .JUSTIFY .FILL .SKIP 2 ^IS144^GThe patches described by John won't work on RSX-11S/M; GIN$ isn't available. However, for S/M, the same effect is available via ALUN$, then GLUN$ to DVnn: on a fake LUN; much the same information is returned. Coding is left as an exercise for the reader. --- The Editor^IS204^G .COMMENT .COMMENT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .COMMENT Rebuilding Device Drivers .COMMENT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .COMMENT .TEST PAGE 15 .SKIP 6 .CENTER ^&Rebuilding Device Drivers\& .SKIP .CENTER Gerald Burgess .CENTER McDonnell Douglas .CENTER PO Box 2637 .CENTER Garden Grove, CA###92642-2637 .SKIP Here is a nifty little command file I have found quite useful when installing foreign devices that emulate DEC devices. Recently I was adding an SI 9761 disk drive to a PDP-11/70 which already supported DEC RM03s. Both devices require the use of the DR device driver. One of the RM03s is my boot device and thus DRDRV is loaded at VMR time. I was therefore looking at yet another SYSGEN. Instead, I performed section H of SYSGEN, wrote and ran this command file. The new device driver is loaded and brought online during system startup. The system is now up and running with a DEC RM03 system disk and an SI 9761 data disk. In the event you need to add a DEC emulated device like I did, here is a sample execution of "RENAMEDRV.CMD" : .SKIP 2 .NO FILL .NO JUSTIFY >@RENAMEDRV RENAMEDRV -- Cmd file to rename a device driver >* Enter new driver name [S: R:2-2]: QA >* Create new driver ? [Y/N]: Y >* Assemble new driver ? [Y/N]: Y >* Build new driver ? [Y/N]: Y >* Enter old driver name [S: R:2-2]: DR >* Enter old driver code filename [S: R:5-5 D:"DRDRV"]: DR >* Enter old driver database filename [S: R:5-5 D:"DRTAB"]: DR >* Enter new driver code filename [S: R:5-5 D:"QADRV"]: QA >* Enter new driver database filename [S: R:5-5 D:"QADRV"]: QA # RENAMEDRV -- Creating QATAB.MAC DR1:[11,10]QATAB.MAC;1 336 lines [EOB] RENAMEDRV -- Creating QADRV.MAC DR1:[11,10]QADRV.MAC;1 1313 lines [EOB] RENAMEDRV -- Making device assignments RENAMEDRV -- Assembling driver RENAMEDRV -- Building driver RENAMEDRV -- STOP @ .JUSTIFY .FILL .SKIP And here is the source text for the indirect command file itself: .SKIP 2 .NO FILL .NO JUSTIFY _.; RENAMEDRV -- Cmd file to rename a device driver _.; Gerald Burgess May 1986 _.; .ENABLE GLOBAL .ENABLE SUBSTITUTION .ENABLE QUIET .OPEN TI: .DATA RENAMEDRV -- Cmd file to rename a device driver .CLOSE .ASKS [2:2] NEW Enter new driver name .ASK EDT Create new driver .ASK ASM Assemble new driver .ASK BLD Build new driver .SETL ASMBLD ASM!BLD .SETL ANY ASMBLD!EDT .IFF ANY .GOTO DONE .IFF EDT .IFT ASMBLD .GOTO ASMBLD .ASKS [2:2] OLD Enter old driver name .SETS OLDDV OLD+"DRV" .SETS OLDTB OLD+"TAB" .SETS NEWDV NEW+"DRV" .SETS NEWTB NEW+"TAB" .ASKS [5:5:OLDDV] OLDDV Enter old driver code filename .ASKS [5:5:OLDTB] OLDTB Enter old driver database filename .ASKS [5:5:NEWDV] NEWDV Enter new driver code filename .ASKS [5:5:NEWTB] NEWTB Enter new driver database filename .SETS OLDDV OLDDV+".MAC" .SETS OLDTB OLDTB+".MAC" .SETS NEWDV NEWDV+".MAC" .SETS NEWTB NEWTB+".MAC" .OPEN RENAMEDRV.EDT .DATA S/'OLD'/<>/W/NOTYPE .DATA S/<><>/<>DR/W/NOTYPE .DATA S/<>IVE/DRIVE/W/NOTYPE .DATA S/AD<>ESS/ADDRESS/W/NOTYPE .DATA S/<>Y/DRY/W/NOTYPE .DATA S/A<>/ADR/W/NOTYPE .DATA S/.EN<>/.ENDR/W/NOTYPE .DATA S/S3.<>L/S3.DRL/W/NOTYPE .DATA S/<>/'NEW'/W/NOTYPE .DATA EX .CLOSE .OPEN TI: .DATA RENAMEDRV -- Creating 'NEWTB' .CLOSE EDT 'NEWTB'='OLDTB',RENAMEDRV.EDT .OPEN TI: .DATA RENAMEDRV -- Creating 'NEWDV' .CLOSE EDT 'NEWDV'='OLDDV',RENAMEDRV.EDT .IFF ASMBLD .GOTO DONE _.ASMBLD: .OPEN TI: .DATA RENAMEDRV -- Making device assignments .CLOSE ASN SY:=LB: .WAIT ASN ASN SY:=IN: .WAIT ASN ASN SY:=OU: .WAIT ASN ASN SY:=LS: .WAIT ASN _.ASM: .IFF ASM .GOTO BLD .OPEN TI: .DATA RENAMEDRV -- Assembling driver .CLOSE SET /UIC=[11,10] .WAIT SET .OPEN 'NEW'MC.MAC .DATA LD$'NEW'=0 ; ** 'NEW'DRV IS LOADABLE ** .CLOSE PIP 'NEW'MC.MAC/AP=RSXMC.MAC .WAIT PIP .OPEN [200,200]'NEW'DRVASM.CMD _.DATA ; _.DATA ; 'NEW'DRVASM.CMD -- Loadable 'NEW': driver command file _.DATA ; _.DATA ; Created on '' at '