Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Johnny Billquist <bqt@softjar.se>
Subject: Re: Access to RSTS/E IOPAGE Registers
Date: Sat, 26 Jan 2013 00:39:04 +0100	[thread overview]
Message-ID: <kdv52o$viq$1@Iltempo.Update.UU.SE> (raw)
In-Reply-To: <51028a73.830126357@nntp.aioe.org>

On 2013-01-25 14:43, paramucho wrote:
> On Wed, 23 Jan 2013 20:53:58 +0100, Johnny Billquist <bqt@softjar.se>
> wrote:
>
>> On 2013-01-23 15:11, paramucho wrote:
>
>>> 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 should have pointed out that the simple emulator I'm sketching at
> the moment would not attempt to translate between RT-11 file
> structures and RSX file and record structures. That's a different
> task, and substantially more complex.

I'll strip the rest of this subject, and just make this comment:
Aha. I see. Well, sure, that is certainly doable, and a lot easier. Not 
that your files will be very useful under RSX, but you already know that.

> The only way that that RT-11 programs running in the emulator could
> work with native RSX file and record structures would be if they were
> identical in the first place, or if an external conversion process
> took place.

Right.

>>> 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.
>
> So much for my huge knowledge of RSX--FCS.

:-)

> I was looking for FCS source, and ended up looking at FCP source code,
> which then rewired my tiny brain.

LB:[50,10] should be where you find FCS sources, unless my brain fails me.

>>> 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).
>
> I'm not sure what you mean. My sketched emulator wouldn't have
> anything to do with RTEM at all.

I guess a confusion between us. I came here from Hartmut's comments on 
doing RSX I/O from RT-11 and asking what he missed, and I expanded on 
this in the context of RTEM, which have a utility called FIP, which do 
allow access to RSX files from RT-11, and that obviously it must do it 
in one of the two ways I've mentioned.

>> 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.
>
> As you say, FIP is a a special case which is specifically written to
> handle both file and record systems in some manner. There may well be
> hidden little trap doors in the emulated workspace to call RTEM.TSK to
> handle FCS. I've already noted device vector @#250 providing some kind
> of entry point. Testing with something like a system call trace is
> required to answer this kind of question, although an intelligent
> PDP-11 instruction dump of FIP would also provide a number of clues.
> (and DUMP.SAV is an example of a program which could be used
> meaningfully in RTX.TSK).

Well, since FIP is an RT-11 program to start with, why not run DUMP.SAV 
directly, and look at it?

> I'm never quite sure whether RSX supports stream files. If it did then
> it might be possible to share text files in that manner.

The answer is somewhat complex. Let's just say that it don't.
To be a bit more specific, FCS don't, but RMS do. But almost no tools or 
system utilities use RMS to start with, so it's a support used extremely 
little.

>>> 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.
>
> Sorry, poor RSX terminology again, I meant the file headers, and I
> confess I haven't looked at how you do that under RSX because I used
> RMS to do it under VAX/VMS. It wouldn't be a high priority for a first
> version of RTX.TSK.

The file header is actually located in INDEXF.SYS. But the way to read 
that information is through QIO. That is what IO.RAT and IO.WAT does.
(Read/Write attributes)
The directory file as such only holds the file name, and file id. 
Nothing more. It's just a simple mapping from name to FID.

>>> 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.)
>
> This code is running under an RSX emulator running under RUST/XM, so I
> translate some info to be more meaningful in that environment.

Ok. Just to make it clear. The DID should be better represented as 
(4,4,0) here, or possibly (if you want to try to be fancy, but 
potentially incorrect) "000000.DIR".

>> 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.
>
> Yes, the trace it's reporting a world that exists somewhere between
> the RSX app and the RUST operating system. There is no RSX file
> structure available in RUST. RSX programs run out of RT-11 directories
> and use files in RSX directories. I fudge the record-level
> descriptors, based on file types. But that's a whole different story.

Aha. So IO.FNA in RUST pretty much ignores the DID field then, I assume?

>>> 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...
>
> The execution address, 34740, seems to be higher than most of the FCS
> code in PIP.TXT. Another way to check would be to perform the same
> kind of operation with a different RSX utility and see whether the
> same call was issued.

I'd say that the EFN pretty much already gives it away. FCS only uses 
one EFN, and that was 40, as shown earlier. (40 being the default, but 
you can get it to use another if you want to.)
Different files can (of course) also use different EFNs, but you 
normally don't.

>>> 34754   wtse    efn=2
>>
>> And obviously just waiting for it to complete. Silly code. Why not a
>> QIOW in this case?
>
> That's what happens when people write library code and then spend a
> decade altering it. It becomes a mess of conditionals and noisey,
> incomprehensible jibber jabber...

:-)

>>> !
>>> ! 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.
>
> As above, record-level translation is a separate issue.
>
> All RT-11 programs do their own record operations. RT-11 does not
> provide any system-level file-to-record functionality. RT-11 I/O is
> restricted to the equivalent of RSX virtual/logical block I/O. That's
> it.

Right.

> Now, it wouldn't be too hard to feed the input from a variable length
> RSX text file to an RT-11 program as a stream file, just so long as
> the access is strictly sequential--and that's usually the case.
> Likewise for output.

Yup. But you'd need to do the blocking/deblocking somewhere.

> But, it starts taking a lot of space when you have to deal with
> multiple files, and it gets really icky if a program detaches a file
> and later reattaches and keeps going from where it left off.

Yes.

> Then you have things like MACRO libraries which have mixed record
> types.
>
> All that said, in the example above PIP.TSK happily sends the RT-11
> file RUST.COM to the terminal in a coherent way. But that's the
> exception.

Hmm. What do you return back for the IO.RAT function in RUST?

	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


  reply	other threads:[~2013-01-25 23:39 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-26 13:22 Access to RSTS/E IOPAGE Registers Jerome H. Fine
2012-12-26 15:35 ` Bill Gunshannon
2012-12-27  0:10   ` glen herrmannsfeldt
2012-12-27 21:13     ` Johnny Billquist
2012-12-27 21:25       ` glen herrmannsfeldt
2012-12-27 21:37         ` Johnny Billquist
2012-12-27 13:38   ` Jerome H. Fine
2012-12-27 21:16 ` Johnny Billquist
2012-12-28  6:32   ` paramucho
2012-12-28 15:01     ` Johnny Billquist
2012-12-30  2:04       ` paramucho
2012-12-30  3:25         ` Johnny Billquist
2012-12-30 18:25 ` jgharston
2012-12-30 21:44   ` Johnny Billquist
2012-12-31  0:34   ` Jerome H. Fine
2012-12-31  0:52     ` Johnny Billquist
2012-12-31 16:04     ` paramucho
2012-12-31 16:23       ` Bob Eager
2012-12-31 16:33         ` Johnny Billquist
2013-01-01  3:28         ` paramucho
2012-12-31 16:30       ` Johnny Billquist
2013-01-01  4:55         ` paramucho
2013-01-01 18:37           ` Johnny Billquist
2013-01-13  8:01             ` paramucho
2013-01-13 14:13               ` Johnny Billquist
2013-01-14  6:30                 ` paramucho
2013-01-14 11:50                   ` Johnny Billquist
2013-01-15 14:20                     ` paramucho
2013-01-15 21:10                       ` Johnny Billquist
2013-01-16  3:25                         ` Jerome H. Fine
2013-01-16  4:39                           ` Johnny Billquist
2013-01-16 13:43                         ` paramucho
2013-01-16 18:59                           ` Johnny Billquist
2013-01-17 11:56                             ` paramucho
2013-01-22  9:53                       ` Hartmut Brandt
2013-01-22 13:52                         ` Johnny Billquist
2013-01-23 14:11                           ` paramucho
2013-01-23 19:53                             ` Johnny Billquist
2013-01-25 13:43                               ` paramucho
2013-01-25 23:39                                 ` Johnny Billquist [this message]
2013-01-28  7:47                                   ` paramucho
2013-01-28 18:06                                     ` Johnny Billquist
2013-01-30 12:16                                       ` paramucho
2013-01-30 18:50                                         ` Johnny Billquist
2013-02-02 12:51                                           ` paramucho
2013-02-02 16:15                                             ` Johnny Billquist
2013-02-03 16:16                                               ` Jerome H. Fine
2013-02-04 12:03                                               ` paramucho
2013-02-04 16:58                                                 ` Johnny Billquist
2013-02-15 12:34                                                   ` paramucho
2013-02-15 13:08                                                     ` Johnny Billquist
2013-02-15 15:15                                                       ` paramucho
2013-02-15 16:04                                                         ` Johnny Billquist
2013-02-17 13:02                                                           ` paramucho
2013-02-17 13:43                                                             ` Johnny Billquist
2013-02-19 14:09                                                               ` paramucho
2013-02-20 11:18                                                                 ` paramucho
2013-02-21  0:23                                                                   ` Johnny Billquist
2013-02-21  0:22                                                                 ` Johnny Billquist
2013-02-24 14:10                                                                   ` paramucho
2013-02-24 15:00                                                                     ` Johnny Billquist
2013-03-06 15:33                                                                       ` paramucho
2013-03-06 23:51                                                                         ` Johnny Billquist
2013-03-20 10:15                                                                           ` paramucho
2013-03-20 13:01                                                                             ` Johnny Billquist
2013-03-20 21:42                                                                               ` Johnny Billquist
2013-04-14 16:48                                                                                 ` paramucho
2013-04-14 18:28                                                                                   ` Johnny Billquist
2013-04-15 10:30                                                                                     ` Johnny Billquist
2013-03-20 17:33                                                                             ` Jerome H. Fine
2013-03-25 15:55                                                                             ` paramucho
2013-03-06 15:33                                                                       ` paramucho
2013-02-24 14:12                                                                   ` paramucho
2013-01-23 14:10                         ` paramucho
2013-01-14  9:13                 ` Hartmut Brandt
2013-01-14  8:08 ` John Santos
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox