From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: 9b70862339,b79b03565fd3002e X-Google-Attributes: gid9b70862339,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder1.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.Update.UU.SE!news.Update.UU.SE!not-for-mail From: Johnny Billquist Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec,comp.os.rsts,comp.os.vms Subject: Re: RMS-11 Date: Wed, 14 Sep 2011 20:55:56 +0200 Organization: Update Computer Club Message-ID: References: <4e6a5c5d.14357271@news.optusnet.com.au> <4e687c78.22576246@news.optusnet.com.au> <4e69f6f0.5762864@news.optusnet.com.au> <4e6a2166.43930162@news.optusnet.com.au> <4e6a3716.49482471@news.optusnet.com.au> <4e71c2e9.40726291@news.optusnet.com.au> NNTP-Posting-Host: 2620:0:105f:b:462a:60ff:fefb:aad8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: Iltempo.Update.UU.SE 1316026557 10798 2620:0:105f:b:462a:60ff:fefb:aad8 (14 Sep 2011 18:55:57 GMT) X-Complaints-To: newsmaster@Update.UU.SE NNTP-Posting-Date: Wed, 14 Sep 2011 18:55:57 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 In-Reply-To: <4e71c2e9.40726291@news.optusnet.com.au> Xref: g2news1.google.com alt.sys.pdp11:2428 vmsnet.pdp-11:681 comp.sys.dec:3830 comp.os.rsts:45 comp.os.vms:43440 Thanks. This all needs a lot of reading and thinking... (Obviously) I've been tracing through a lot of this myself as well... We'll see what I end up with. I'd be happy to continue this in private mail, since I suspect this is getting a bit too internal to be of much general interest. :-) Johnny On 2011-09-14 17.29, paramucho wrote: > On Fri, 09 Sep 2011 19:06:47 +0200, Johnny Billquist > wrote: > > It took me some time to organise all the RSX bits and pieces I had > around the place and to understand some RSX basics, but I finally > managed to get an RSX 4.4 system with RMS from an 4.2 system together > under my emulator. That meant I could compile using FLX to get stuff > in and out. Of course, once the tools were right the rest of it took > little time at all. > > I reduced the test program down to basically $OPEN of a fixed FAB and > NAM block with a name of "ZZ:Z.Z" which allowed me to use logical > names at run time. > > It was simple to find the address of the GLUN directive (using trace), > but it was, as I had suspected, tedious tracking RMS as it looked at > the various LUN flags (SEQ, SDI etc), so I implemented a "feelpoint" > in the emulator, a kind-of watchpoint which tracks any kind of > reference at all to a particular location (in fact I put the code in > the middle of the emulator's MMU VA translation routine). This let me > see every reference RMS made to LUN flags. > > In the code below I've set a breakpoint just following RMS's GLUN > directive. Using the TKB map I located the PSECT (shown with address > and length) and the closest global label (shown with address). Using > this information it should be pretty easy to set a breakpoint in this > code, even if there are small variations. > > ===================================================================== > ; The GLUN is emitted in psect R0OPFL in routine $OPNCM > > Psect: R0OPFL 12114 700 > Label: $OPNCM 12114 > > 15502 glun lun=1 buf=1126 > Break: PC=15502 OP=2 > 15502u 12623 pop (r3)+ | r6 store device name > SP 1126 2 126 N8 [V.] | r3 > R3 42612 105 212 KEB [.E] | s > 15504u 112613 225 213 W7C [..] | \ > 15504u 112613 movb (sp)+,(r3) | s store channel > 15506u 13702 mov @#56,r2 | s Work area > 15512u 15202 mov @-(r2),r2 | s RMS area? > 15514u 42716 bic #300,(sp) | s zap upper flags > > ; For the rest of the session I set my breakpoint on the next opcode. > ; The LUN characteristics are now on the top of the stack. > ; Thus they can be altered at this point before being moved into > ; internal RMS structures. RMS stores them twice, but it's the second > ; location which I think is the main one. > > 15520u 111662 movb (sp),177746(r2) | s store in RMS area > 2566 (fab area) > 15524u 16202 mov 177670(r2),r2 | s > 15530u 112662 movb (sp)+,6(r2) | s store it again > r2+6 = 41240 1010 > 15534u 32626 bit (sp)+,(sp)+ |41240f set the "feelpoint" > 15536u 12662 pop 24(r2) | > 15542u 111360 movb (r3),177776(r0) | > 15546u 14360 mov -(r3),177774(r0) | > 15552u 207 return | > > 41240f: > 41240 1010 > 14324u 116260 movb 6(r2),3(r0) | > > ============================================================== > ; In all the routines below 6(r4) holds the LUN class flags > ; I used a "feelpoint" on location 41240 to catch these references > > ; The first reference is in PSECT R0OPFL in the $OPNCM routine. > ; The first test is to see whether the LUN is record oriented... > > Psect: R0OPFL 12114 700 > Label: $OPNCM 12114 > > 12140u 132764 bitb #1,6(r4) | ; is it record oriented? > 12146u 1124 bne 12420 | ; no > 12150u 32765 bit #10000,177706(r5) | > 12156u 1402 beq 12164 | > 12160u 5710 tst (r0) | > 12162u 1016 bne 12220 | > 12164u 4767 call 24772 | > 12170u 103471 bcs 12354 | > 12172u 4767 call 25224 | > 12176u 103466 bcs 12354 | > 12200u 4767 call 24622 | > 12204u 103463 bcs 12354 | > 12206u 4767 call 26444 | > 12212u 4767 call 26224 | > 12216u 103456 bcs 12354 | > 12220u 132764 bitb #40,6(r4) | > 12226u 1047 bne 12346 | > 12230u 4767 call 21644 | > 12234u 16520 mov 177764(r5),(r0)+ | > 12240u 5046 clr -(sp) | > 12242u 10446 psh r4 | > 12244u 62716 add #32,(sp) | > 12250u 12746 psh #12374 | > 12254u 10610 mov sp,(r0) | > 12256u 12701 mov #177540,r1 | > 12262u 12702 mov #13000,r2 | > 12266u 4767 call 24404 | > 12272u 5226 inc (sp)+ | > 12274u 113616 movb @(sp)+,(sp) | > 12276u 103426 bcs 12354 | > 12300u 162716 sub #60,(sp) | > 12304u 62726 add #40,(sp)+ | > 12310u 103016 bcc 12346 | > 12312u 132764 bitb #40,7(r4) | > 12320u 1012 bne 12346 | > 12322u 12715 mov #177740,(r5) | > 12326u 116401 movb 50(r4),r1 | > 12332u 1410 beq 12354 | > 12334u 12715 mov #177500,(r5) | > 12340u 22701 cmp #40,r1 | > > etc > ================================== > > ; The next test is for sequential > > 12616u 16401 mov 6(r4),r1 | ; is it sequential > 12622u 32701 bit #40,r1 | ; no > 12626u 1454 beq 12760 | > 12630u 32701 bit #20000,r1 | > 12634u 1012 bne 12662 | > 12636u 12715 mov #175160,(r5) | > 12642u 22700 cmp #1377,r0 | > 12646u 103642 bcs 12354 | > 12650u 52714 bis #100000,(r4) | > 12654u 152764 bisb #10,33(r4) | > 12662u 10400 mov r4,r0 | > 12664u 62700 add #46,r0 | > 12670u 5010 clr (r0) | > 12672u 12740 mov #177777,-(r0) | > 12676u 11040 mov (r0),-(r0) | > 12700u 32701 bit #16400,r1 | > 12704u 1410 beq 12726 | > 12706u 32765 bit #1000,177706(r5) | > 12714u 1004 bne 12726 | > 12716u 5020 clr (r0)+ | > 12720u 5410 neg (r0) | > 12722u 52714 bis #4000,(r4) | > 12726u 5016 clr (sp) | > 12730u 16400 mov 14(r4),r0 | > 12734u 4767 call 21756 | > 12740u 32716 bit #3,(sp) | > 12744u 1002 bne 12752 | > 12746u 167 jmp 21340 | > 12752u 12716 mov #142,(sp) | > 12756u 414 br 13010 | > > ============================================================== > Psect: R0RXDI 24404 2062 > Label: $RXDID 24772 > > ; In this routine it excludes record oriented, etc. > > 25014u 132764 bitb #61,6(r4) | > 25022u 1066 bne 25200 | > 25024u 162703 sub #12,r3 | > 25030u 12713 mov #1,(r3) | > 25034u 12743 mov #15172,-(r3) | > 25040u 16002 mov 54(r0),r2 | > 25044u 116001 movb 52(r0),r1 | > 25050u 3425 ble 25124 | > 25052u 5301 dec r1 | > 25054u 10115 mov r1,(r5) | > 25056u 60215 add r2,(r5) | > 25060u 4767 call 25702 | > 25064u 103025 bcc 25140 | > 25066u 32323 bit (r3)+,(r3)+ | > 25070u 5013 clr (r3) | > 25072u 122712 cmpb #54,(r2) | > 25076u 1012 bne 25124 | > 25100u 10246 psh r2 | > 25102u 4767 call 26052 | > 25106u 12615 pop (r5) | > 25110u 103405 bcs 25124 | > 25112u 16002 mov 54(r0),r2 | > 25116u 4767 call 26052 | > 25122u 103003 bcc 25132 | > 25124u 12715 mov #177060,(r5) | > 25130u 474 br 25322 | > 25132u 52760 bis #1,72(r0) | > 25140u 4767 call 24622 | > 25144u 103006 bcc 25162 | > 25146u 22715 cmp #176440,(r5) | > 25152u 1002 bne 25160 | > 25154u 12715 mov #177020,(r5) | > 25160u 460 br 25322 | > 25162u 10003 mov r0,r3 | > 25164u 62703 add #24,r3 | > 25170u 12023 mov (r0)+,(r3)+ | > 25172u 12023 mov (r0)+,(r3)+ | > 25174u 11013 mov (r0),(r3) | > 25176u 34040 bit -(r0),-(r0) | > > ============================================================== > Psect R0RXDI 24404 2062 > Label $RXENT 24634 > > 24726u 132764 bitb #40,6(r4) | > 24734u 1407 beq 24754 | > 24736u 32765 bit #1,177706(r5) | > 24744u 1403 beq 24754 | > 24746u 52760 bis #4000,10(r0) | > 24754u 4767 call 24404 | > 24760u 12600 pop r0 | > 24762u 12760 mov #0,20(r0) | > 24770u 207 return | > > ETC > > 25536u 132764 bitb #40,6(r4) | > ... > > ========================================================== > > And of course there's a lot more of this. It's a tedious task walking > through it all, but the material will come in handy if an attempt is > made to patch RMS. > > I note that RMS immediately clears flags 100 and 200. That might mean > that they're available, but probably means that RMS is using them > internally for other conditions. > > By playing around with LUN flags on the top of the stack I was able to > watch whether RMS went on to use FNA or not. I'll have a bit more of a > look at that tomorrow. > > Hope this all makes some kind of sense... > > > Ian