From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: d180ab3bd8,5e74e0b23842db90 X-Google-Attributes: gidd180ab3bd8,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.15.134 with SMTP id x6mr2890566pac.42.1361476274025; Thu, 21 Feb 2013 11:51:14 -0800 (PST) Path: ov8ni12459pbb.1!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!border1.nntp.hkg.giganews.com!news.netfront.net!newsgate.cuhk.edu.hk!goblin1!goblin.stu.neva.ru!feeds.phibee-telecom.net!de-l.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 Subject: Re: Access to RSTS/E IOPAGE Registers Date: Sun, 17 Feb 2013 14:43:24 +0100 Organization: Update Computer Club Message-ID: References: <51062c31.1068125772@nntp.aioe.org> <51090db1.102143963@nntp.aioe.org> <510d05c3.633956@nntp.aioe.org> <510fa014.171203983@nntp.aioe.org> <511e2731.130278790@nntp.aioe.org> <511e442b.137696544@nntp.aioe.org> <5120d34f.47638789@nntp.aioe.org> NNTP-Posting-Host: 178-83-31-172.dynamic.hispeed.ch Mime-Version: 1.0 X-Trace: Iltempo.Update.UU.SE 1361108605 16358 178.83.31.172 (17 Feb 2013 13:43:25 GMT) X-Complaints-To: newsmaster@Update.UU.SE NNTP-Posting-Date: Sun, 17 Feb 2013 13:43:25 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 In-Reply-To: <5120d34f.47638789@nntp.aioe.org> X-Received-Bytes: 10955 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2013-02-17 14:02, paramucho wrote: > On Fri, 15 Feb 2013 17:04:31 +0100, Johnny Billquist > wrote: > >>>> On 2013-02-15 13:34, paramucho wrote: >>>> >>>>> In fact, it turns out that it's necessary to get rid of an AST which >>>>> emulates an interrupt (for example the keyboard) with ASTX$ before the >>>>> "interrupt" code executes. That's because there's no guarantee that >>>>> the "interrupt" code will return along the path which issues an ASTX$. >>>>> It's a matter of rebuilding the AST stack. >>>> >>>> I'm not sure I understand the problem. >>>> So, you press a key. RSX generates an AST. You call the interrupt code >>>> in RT-11. Is RT-11 assuming that this is a real interrupt? Ie., do RT-11 >>>> return with an RTI? I would have thought you'd want to create an >>>> interrupt stack frame before calling into RT-11 in that case. >>>> Or are you stepping in at a higher level where the hardware interrupt >>>> have already been dealt with, and it's just a call into somewhere? Still >>>> seems weird if it don't do a return sooner or later? >>>> >>>> I must be missing something here. >>> >>> Yes, RT-11 (i.e. RUST/SJ) assumes its an interrupt, so I have to build >>> an interrupt stack (PC, PS). However, I need to get rid of the AST >>> stack frame first. >> >> Cool. But why get rid of the AST frame? Have the RTI return to your AST >> code, which then do the ASTX$ would be the natural thing, I would have >> thought. > > See below. > > However there is another reason as well. An AST blocks *all* other > ASTs, whereas an interrupt only blocks *some* other interrupts. For > example, a keyboard AST, which could take quite extensive processing, > can block a timer AST. Ah. Now, that is a very good point. Although code that spends lots of time in an interrupt handler is not very nice code to start with. But yeah, ASTs are all or nothing. >>> To do that I move the AST frame down the stack to make space for the >>> keyboard vector PC/PS. Then I execute ASTX$ which gets rid of the AST >>> frame and enters the keyboard ISR. And that works (most of the time). >> >> Hmm. It should work, except that you need to keep track of your stack. >> Some ASTs push some extra stuff on the stack, which I hope you are aware of. > > Yes, I get rid of the ISB address which comes with a QIO AST. Excellent. And other type of ASTs might have other information on the stack. And it might be more or less... > The one thing that did confuse me was that the documentation spoke > about the "event flag word" which ended up being *four* words in > practice. The ASTX system code cleared that up. Ayup. From LB:[11,10]DRATX.MAC (which implements the ASTX$ call) ; **-$DRATX-AST SERVICE EXIT ; ; THIS DIRECTIVE INSTRUCTS THE SYSTEM TO TERMINATE THE EXECUTION OF AN ; ASYNCHRONOUS SYSTEM TRAP SERVICE ROUTINE. IF ANOTHER AST IS QUEUED AND ; AST'S ARE NOT DISABLED, THEN THE NEXT AST IS EFFECTED IMMEDIATELY. ; ; DPB FORMAT: ; ; WD. 00 -- DIC(115.),DPB SIZE(1.). ; ; AT ISSUANCE THE TASK STACK CONTAINS: ; ; 14(SP)=EVENT FLAG MASK WORD FOR FLAGS 1.-16. ; 12(SP)=EVENT FLAG MASK WORD FOR FLAGS 17.-32. ; 10(SP)=EVENT FLAG MASK WORD FOR FLAGS 33.-48. ; 06(SP)=EVENT FLAG MASK WORD FOR FLAGS 49.-64. ; 04(SP)=PRE AST TASK PS. ; 02(SP)=PRE AST TASK PC. ; 00(SP)=PRE AST TASK DIRECTIVE STATUS WORD. >>> The keyboard interrupt usually returns, but may abort if two ^C's are >>> received. >> >> What do it do in that case? Jump to some random point, while just >> setting a new PSW? > > Standard operating procedure for program abort in an (unmapped) single > process RT-11/RUST system is to issue an abort I/O to each driver, > cancel timer requests etc and then restart the monitor. Abort can > occur in mainline or AST state. It's more dignified in RUST/XM etc. Very similar to OS/8 then (again). Although OS/8 is more simple, since it don't even use interrupts. It just restarts the monitor. And anything might do that for any good reason, including the terminal device driver detecting a ^C. > In RTX that would mean that an ASTX could be lost in an abort. Right. Not good. So you need to get rid of the AST completely before getting back to RT-11. Oh well. >>>> You should search through RSX11M.MAP to find which module this is, and >>>> where in that module. And then look at the code and figure out what is >>>> going on. >>>> >>>> Also, if you get to XDT, what you could do is just to do a crash dump, >>>> and then run the crash dump analyzer on the output after reboot, and >>>> find out more details on what happened, and why. >>> >>> I can't find CDA on any of the RSX .DSK files I have here. I'll keep >>> looking. >> >> Um... What version of RSX are you actually running? > > I am in a complete mess in that department. I've downloaded various > system disks over the years. I develop mostly under V11 which doesn't > support I/D space or MSCP, so I don't run M+ or large disks. Ouch. I'm way more rusty on 11M, since I haven't really played much with it in the last 20 years, and sometimes there are subtle differences, which are important. > The last system I managed to put together was in response to some > issues you were having with RMS a couple of years ago (I think). It > reports the following: > > RSX-11M V4.4 BL46 512.K MAPPED I remember that one. I was trying to figure out how RMS interacted with various device attributes. Rather old version. Ok... >> Maybe you've found a nice bug. There have been some bug fixes related to >> ASTs over the years, as far as I can remember. > > My guess is that I'm doing something naive like I did with the user > mode vector table for SVTK$. It should not be possible to crash RSX anyway. > It took me awhile to work out that I needed to use Set Multiple > Characteristics to set up full duplex mode. Before I worked that out I > tried having separate LUNs for for the keyboard and terminal output, > and I have not gone back to a single LUN. Well, you could have just done it in MCR. SET /FDX=TI: :-) > Keyboard input is asynchronous with an AST and passall. At present > terminal output is synchronous with no AST. The problem might be > related to this usage, but I can't imagine that what I've done there > would crash RSX. It can't be that easy. Such usage should be fine. Disregarding bugs, of course. > I've wrapped both keyboard and terminal output QIOs in DSAR/ENARs, but > that doesn't stop the intermittent bug. There is a also a chance that > I could have a bug in V11. I've started working on the driver which > talks to the RSX file system. Once that's done RTX.TSK will be > operative under E11 and SimH (and real hardware) which would further > test the bug. Wrapping the QIOs like that should not make a difference, and I'm glad to hear it don't. :-) > I have a question. RTX.TSK itself will go into [1,54], but I'm going > to need a separate RSX directory to hold the RTX.TSK system files and > applications--would there be any problems if I just chose a default > directory name such as [1,64] and use that? I can make the name > configurable in a .INI file, but I like to have a reliable default for > these things. Please keep in mind that under M+, most applications don't go in [1,54]. There are plenty of conventions here. [1,*] are system files. It might be meaningful to have a directory there for you, but then again, maybe not. [1,*] is somewhat a cesspool. :-) [1,1] is where libraries of all kind sits, along with some other stuff. [1,2] is where all help files are. [1,20] is prototypes for all kind of build files. [1,24] is build files. In M+, only binaries that are dependent on the kernel build sits in [1,54]. All kernel-independent binaries sits in [3,54]. Then you have the standalone system which is in [6,54]. Also, anything ending on [*,54] are for mapped systems. [*,50] is, I think, for unmapped systems. I have some vague memory of [*,64] also being for something specific, but I can't recall. Much of this is documented in some manual, which one I (of course) also don't remember. [5,*] is traditionally where DECnet sits around. [*,24] is build files in general, and object files. [*,34] is where list files are placed, along with map files. Also, in the latest version of M+, a user configurable utility UIC exists, which is a third place to put system binaries. A little like /usr/local/bin on RSX. If UTLUIC is defined, $ also searches there in addition to [1,54] and [3,54]. All UICs with a group number of 10 or less (octal) are considered system UICs, by the way. Mostly relevant for tasks running under those UICs, since you check protection words against the SYSTEM field for those. Johnny -- Johnny Billquist || "I'm on a bus || on a psychedelic trip email: bqt@softjar.se || Reading murder books pdp is alive! || tryin' to stay hip" - B. Idol