From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: 1164f8,5e74e0b23842db90 X-Google-NewGroupId: yes X-Google-Attributes: gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.81.225 with SMTP id d1mr306290pay.25.1358970845032; Wed, 23 Jan 2013 11:54:05 -0800 (PST) Path: 6ni12494pbd.1!nntp.google.com!npeer03.iad.highwinds-media.com!feed-me.highwinds-media.com!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!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: Wed, 23 Jan 2013 20:53:58 +0100 Organization: Update Computer Club Message-ID: References: <50e0dd7c$0$281$14726298@news.sunsite.dk> <50e1b4b8.51590248@nntp.aioe.org> <50e357ee.3109505@nntp.aioe.org> <50f2699f.912543@nntp.aioe.org> <50f3a15f.22274290@nntp.aioe.org> <50f5628f.137262066@nntp.aioe.org> <5103ed41.658822127@nntp.aioe.org> NNTP-Posting-Host: 74.125.57.33 Mime-Version: 1.0 X-Trace: Iltempo.Update.UU.SE 1358970844 24744 74.125.57.33 (23 Jan 2013 19:54:04 GMT) X-Complaints-To: newsmaster@Update.UU.SE NNTP-Posting-Date: Wed, 23 Jan 2013 19:54:04 +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: <5103ed41.658822127@nntp.aioe.org> X-Received-Bytes: 11672 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2013-01-23 15:11, paramucho wrote: > On Tue, 22 Jan 2013 14:52:41 +0100, Johnny Billquist > wrote: > > >>> So, in your RSX RT-emulator you set up everything, read the RT-11 program >>> into the right spot in memory (you must link the RSX program in a way that >>> the addresses usually occupied by RT programs are free) and just execute >>> it. As the RT program is calling its system by executing EMTs the emulator >>> will get them, translate them and do the right things (hopefully). This >>> works, of course, only with RT programs that don't try to reach into the >>> operating system directly... >> >> What you describe is perfectly valid, Harti. >> However, you need to dig deeper. Once you have your RT-11 environment, >> then what? You will be able to run RT-11 programs. So you have MACRO-11 >> for RT-11, the LINKER, and all other tools just as any standard RT-11 >> environment have. You can then write additional RT-11 programs, even >> though this is actually an emulated RT-11 environment running under RSX. >> But let's now assume that you write a program under RT-11, which in fact >> would like to access files outside of the RT-11 environment, and >> actually read a file from the host RSX environment. >> This is the problem talked about. >> >> You could do this in atleast two ways. >> 1) Use the RSX EMT to do I/O. However, since most parts of file >> operations in RSX is done by a library and not by system calls, this >> means you need to get the whole RSX file I/O library ported over to >> RT-11, in order to use this properly. (And with "ported" I mean >> compiled, linked and put in a library, as well as getting all the macro >> definitions from RSX over.) >> 2) Create some new system calls, that your RT-11 program can use to read >> files from the RSX environment. Your emulator would then catch those >> calls as well, and do the appropriate work for you, and perform the I/O, >> though the RSX libraries, inside the emulator. > > From what he says, I think Harti did access local native RSX files. I don't think there was any question about that part... :-) > The first option you outline is how I implemented RT-11 emulator I did > for VAX/VMS because I had all the room in the world. Directory > operations were translated into RMS calls and I used QIO for a lot of > the read/write. The translation code I now use with Windows uses > essentially the same work flow. As I noted, it's the translation of > file system semantics that takes up a lot more development time and a > lot more space. It can get quite tricky. I don't recall exactly how things look in VMS. There are sometimes small differences to RSX, so I prefer to keep it to RSX here for simple reasons... It is not that you couldn't just do the QIO from your RT-11 program. Sure you could. However, that would leave you with a lot of post-processing to be done in the RT-11 program, which would have to be aware of RSX file structures and what not. "Directory" operations in RSX are rather simplistic. You can search the directory, enter and delete entries, and that is about it. In order to locate a file, you first need to search the MFD, looking for either your file, or your directory. And then do another search in your directory, for your file. In case you have several levels of directories, this is a rather iterative process. And everything after that point deals with file ids, which you use for all manipulations of the file. And of course, you then have the LUN, which you use for all operations on an open file. And all of these steps are done using QIO in RSX. Or else you can call a library routine in FCS or RMS, which does all those QIOs for you, along with a lot of interpretations of data in between. However, if you don't add any new services at the emulator level, then you instead have to understand RSX files and file structures at the application level. > I guess that RTEM.TSK uses this approach. RTEM.TSK would be a standard > RSX image linked to FCP. It could use PLAS calls to map the emulated > RT-11 image and monitor. It could translate RT-11 I/O by packaging up > the system call data in some high memory buffer and then remapping the > RSX code to handle the operation using FCP. What is FCP? It's not a component of RSX. Are you in fact meaning FCS? If so, this would exactly describe my second option. The first option implies linking FCS into all the RT-11 images running under RTEM. > The second option, adding new calls, would defeat the original purpose > of emulation if apps had to use the new calls. The RSX file system is not available natively in either case, so I fail to see your point (ie. any generic RT-11 program running under RTEM cannot access the RSX file system). You have a special program (FIP.SAV in this case), which can access the RSX file system. FIP.SAV can either do that by having a copy of FCS, and do the RSX QIOs. There are some additional headaches with this, since FCS expects, and uses some fixed areas in your memory for its structures, which might very well conflict with RT-11. The other option is to have FIP use system calls that goes down to RTEM, which then performs services for FIP, such as file access operations. In this case, the file operations, as well as translation of semantics, data structures, and everything else, is code in RTEM, which is already an RSX task, linked to FCS. Of course, apart from the file operations provided by the QIO interface, all disk blocks read in must also be massaged, as the actual file content structure in RSX is very different from RT-11. RSX have these records, which can be of various lengths, span physical blocks, have format information embedded, and so on... You cannot feed that directory to an RT-11 program and expect anything meaningful to come out of it. > There is a third option. A simple RT-11 emulator really only needs to > open a very small number of record formats. RT-11 programs don't use > any of the RSX record formats except block I/O for disk-like devices > and character I/O to terminals. FCP is not required to manage this > simple kind of I/O. It can all be done with QIO. That kind of approach would not even let you read a normal text file from RSX into RT-11. > Directory searchs require that host directories need to be translated > into RT-11 directory structures. I do that with Windows directories, > and it's pretty straight-forward. It would take longer with RSX > because you'd have to read the index files to get the creation date > info etc. You don't do that by reading the directory file or INDEXF.SYS. That is done by QIO functions to the F11ACP. > It's not hard to work out what FCP does if you use a system trace. > Here's an excerpt from RSX PIP.TSK running under the RUST/XM RSX > emulator running under V11 on Windows (in this case RSX system calls > are translated into RT-11/RUST calls). > > ! > ! PIP finds RUST.COM > ! > 26456 alun lun=3 dev=SY: > 26620 glun lun=3 buf=15370 > 20426 qiow (fna) fun=11 mod=0 lun=3 efn=40 pri=0 isb=15420 ast=0 > p1=0 p2=0 p3=0 p4=0 p5=0 p6=1654 > fid=. nam=001004.dir;1 sta=0 nxt=0 > did=dd.ft dev=SY: This is locating the UFD in the MFD. Your presentation of the DID is weird. The DID is a a file id. Essentially three 16-bit numbers, which tells in which file to search for the other file, given by the NAM field. And the MFD is, by the way, always FID (4,4,0). (And FID and DID is the same type of information, just two different fields.) P6 points to a FNAM structure, which I'm sure you know... > 26456 alun lun=3 dev=SY: > 26620 glun lun=3 buf=15370 > 20426 qiow (fna) fun=11 mod=0 lun=3 efn=40 pri=0 isb=15420 ast=0 > p1=0 p2=0 p3=0 p4=0 p5=0 p6=1654 > fid=. nam=rust.com;0 sta=100006 nxt=0 > did=001004.dir dev=SY: Did you do a translation of the DID into a file name here? Because the DID here should just be the resulting FID from the previous IO.FNA you have above. Same story as above otherwise. And this could in theory be repeated additional times, if you had a hierarchical directory structure. > 30556k .purge chan=1 > 30620k .lookup chan=1 dblk=54052=sy:rust.com (eve) seq=0 > 22776k .readw chan=1 buf=70106 wcnt=1000 crtn=0 blk=12 > 22776k .readw chan=1 buf=66054 wcnt=1000 crtn=0 blk=14 > 22776k .readw chan=1 buf=64022 wcnt=1000 crtn=0 blk=16 This looks very RT-11is to me. :-) > 34740 qio (rat) fun=26 mod=0 lun=3 efn=2 pri=0 isb=1724 ast=0 > p1=1654 p2=3600 p3=0 p4=0 p5=0 p6=0 > fid=rust.com This is reading some metadata from the file. However, based on the event flag, this is not done by FCS, but the application program itself. Could be anything from record type, record attributes, record length, file dates, file size, owner, or something else... > 34754 wtse efn=2 And obviously just waiting for it to complete. Silly code. Why not a QIOW in this case? > ! > ! PIP opens RUST.COM using ACR > ! > 26456 alun lun=3 dev=SY: > 26620 glun lun=3 buf=15370 > 20426 qiow (acr) fun=15 mod=0 lun=3 efn=40 pri=0 isb=15420 ast=0 > p1=1654 p2=334 p3=0 p4=0 p5=100400 p6=0 > fid=rust.com Access the file for read. > 20426 qiow (rvb) fun=21 mod=0 lun=3 efn=40 pri=0 isb=36620 ast=0 > p1=36640 p2=1000 p3=0 p4=0 p5=1 p6=0 And read the first block. (P1 -> Address to place data, P2 = Size, P5,P6 is block number) For something like a text file, FCS will, after this, start handing out data to the program from the FCS-internal disk buffer, one record at a time. And when the first block is exhausted, FCS will read in the next one, and continue. Johnny