From: Johnny Billquist <bqt@softjar.se>
Subject: Re: QBUS Prototyping
Date: Sat, 17 Apr 2010 23:00:24 +0200 [thread overview]
Message-ID: <hqd7h9$u2l$1@Iltempo.Update.UU.SE> (raw)
In-Reply-To: <hqb94a$j67$1@naig.caltech.edu>
glen herrmannsfeldt wrote:
> In alt.sys.pdp11 Johnny Billquist <bqt@softjar.se> wrote:
> (snip about NFS where I wrote)
>
>>> That, and that it lets you see any files that could be under
>>> the mount point.
>
>> Part of the fact that you export disks, and not file systems, yes. The
>> files "hidden" by a mount point are still there on the disk.
>> It might seem a bit weird if you look at it from a certain angle,
>> but it makes perfect sense from another angle. :-)
>
> But also it is where you see that an NFS server works at a lower
> level, in terms of file systems, than the client.
Hmm. Maybe we have been talking past each other. I have never (to my
knowledge) claimed that the server work at a high level. On the
ocntrary. My problem is exactly that the server is working at a low
level. Had the server been working at a high level, I believe it would
be easy.
Meaning a lot of intelligence must go into the client, which means (in
this case) the RSX side, where we least can afford it.
>>> A problem well known in the Apple world. In Macintosh file systems,
>>> files have a data fork (the normal part) and resource fork
>>> (where data like you mention goes). It is normally handled in
>>> NFS, or on other file systems, with an extra file somewhere.
>>> The ones I remember put an extra subdirectory in each directory,
>>> sometimes with a hidden name (such as .RESOURCE_FORK) and put
>>> the data in there. Not great, but it does work. It could
>>> also be done with another file in the same directory with a
>>> different name.
>
>> Ugh! Hmm, yes, that could be doable, but definitely not a nice
>> or neat solution.
>
>> It runs the risk of people messing with those "extra" directories
>> and files on the other end.
>
> Well, the client (on said system) could block access to the special
> directories or files. They would be visible on other systems, though.
It's not the client side that worries me here, but the server side.
Those files will be native files and directories on the server, meaning
you can access them directly there, and mess things up when the client
then use them.
> In the NFS file system model, section 1.4.3 of NFSv4:
>
> "The server filesystem is hierarchical with the regular files
> contained within being treated as opaque byte streams."
>
> It seems that NFSv4 allows UTF8 coding for file names, but file
> data is considered opaque (to the server).
UTF-8 is a totally different issue, which have nothing to do with this.
UTF-8 is just a way of coding Unicode into 8-bit bytes. If your
filenames consist of 8-bit bytes, and all values are allowable, then you
can parse your filename as UTF-8, if you wish to do so. You can also
parse it as LATIN-1, and get a different file name for the same sequence
of bytes. It's all just a question of interpretation, and not something
the file system have any clue about how you do/want to do.
As for my "problem", the quoted paragraph pretty nicely wraps it up.
Files are treated as opaque byte streams. In RSX, files are not opaque
byte streams...
> From the NFSv3 specifications:
>
> "NFS servers are dumb and NFS clients are smart. It is the clients
> that do the work requried to convert generalized file access that
> the servers provide into a file access method that is useful to
> applications and users."
Indeed. And I believe that is the same between NFSv3 and NFSv4.
And my problem is exactly that placing a lot of smarts in the NFS client
is difficult.
>>>> Second, depending on the contents of that data, the file is processed
>>>> differently. For example, a normal text file in RSX is actually
>>>> represented by a 2-byte length field, followed by the data. No CR or LF
>>>> is included in the record. And records are aligned on even addresses.
>>>> So, if you read a text file over NFS, you need to fake something for the
>>>> meta-data, and then you need to read the lines from the file, and at
>>>> each LF, you need to split the data up.
>
>>> I believe that there are systems that convert between LF terminated
>>> and CRLF terminated records while doing NFS I/O. Not that I would
>>> do that, though.
>
>> Hmm. It would be nice if you could name a system that do, so that I
>> could check it out.
>
> I have used two NFS implementations for DOS/Windows systems.
> PCNFS from Sun, in the MSDOS days, and SFU3.5 (services for unix)
> written by Interix and available free from Microsoft.
> (It works with Win2K, XP, and Server 2003.) I believe both support
> client side (and mount time option) to convert between CRLF and LF
> terminated lines. Many systems, such as current Linux, include
> the unix2dos and dos2unix programs to convert to/from CRLF
> terminated lines.
I've used SFU, and if I remember right, it does not do any translations
at all. Files accessed from Unix will have CR+LF line endings if they
are text files, while files accessed from Windows (and created on Unix)
will be files with only LF at line ends.
Hopefully, the tools used accepts both kind of line endings, but
occasionally things get rather ugly when you have this setup.
There is also a Unix-like environment you can run on Windows (the names
escapes me at the moment), but that one cause the same issues as well.
> Presumably such mount points should not be used for executable
> files, unless the NFS client can figure that out and not translate
> them. Also, the conversion is also needed, for example, if
> files are transfered through tape, direct mounting of disks
> (such as USB drives), or other file transfer methods.
They work very fine for executables. The binary file transports
perfectly between Unix and Windows. It's the text files that causes issues.
But for RSX the problem is much worse, since RSX have a whole bunch of
different file formats, and basically none of them match particularly
well to Unix.
The two that do are fixed length binary files, and STREAM files. The
latter are only understood by RMS, and not FCS though, which limits
their usability.
>>>> However, NFS don't actually read a record at a time, but reads
>>>> a disk block at a time.
>
>>> I believe that the client can read any size desired up to the
>>> server specified maximum. Commonly that would be a multiple
>>> of the disk block size, but I don't believe that is required.
>
>> I was pretty sure it was disk blocks. Yes, you can specify that it
>> should be multiples of 512 byte blocks, but that's just for higher
>> throughput. NFS will adjust to the lower value of the two sides when
>> client and server talk.
>
> The NFS READ and WRITE requests take a byte offset and byte
> length specifier. There are complications due to EOF, which it
> seems where improved in NFSv3, but at least back to NFSv2 they
> are specified at byte boundaries.
Ok. I had to read through the NFS rfc. Yet are right, the operations are
not on blocks, but bytes. However, that helps nothing. What would have
helped would have been if they had operated on records...
In RSX, basic operations are done on blocks. And a block is 512 bytes
when we talk disks.
However, each program has then a library which deals with the unblocking
of data, unlike in Unix, where the kernel does this.
So, user applications always expects to see raw disk blocks, with the
record information in them. And then the user program deblocks the data,
presenting a record at the time to the application. This code is eoither
FCS or RMS in RSX, and it's a library that you can either link into your
own code, or else use as a shared library. This code is the part that do
all the filename parsing, the directory lookups, directory
manipulations, and so on. And this code also is the one managing the
meta-data for the files, and decide how to interpret the contents of the
file, based on the meta data.
So, if you read a text file from Unix, and expect to present it to an
RSX application, you need to read some (unknown) amount of data from the
Unix server, pack this into a 512 byte block for the RSX operation, with
record lengths between the record of data, and padded appropriately, and
pass that 512 byte block to the user application.
And the exact offset from which to read is also unknown, except for
offset 0.
>>>> And with each line split, the LF removed, and 2 bytes
>>>> of length added, plus a possible padding byte, means that a disk block
>>>> from NFS will end up being slightly more that one disk block under RSX.
>>>> And of course, the opposite needs to be done when writing.
>>>> And you don't even know if it actually is a text file, for which this
>>>> should be done.
>
>>> The client should know that an process accordingly.
>
>> The client would need to know, no matter how. The point is that the
>> length of the file possible changes as an effect, and by how much is
>> impossible to know except by processing the whole file. And if I'm right
>> about blocks, it would introduce an extra level of buffering, since
>> you'd need to repack disk blocks, and one block access might result in
>> two accesses to the other end, and so on.
>
> As above, any such conversions are done by the NFS client.
Exactly. And that means the code inside RSX. Which needs to then read
through the whole file to calculate the actual length of the file, once
the conversions have been done, in order to then be able to give a
correct file size, and end pointer to the user application. That means a
lot of work just because you open the file. Meaning very slow, and
reading through a lot of file for nothing. On the client side. Which
also means a lot of network traffic.
> It seems that IBM has gone through this with z/OS (previously MVS)
> and NFS. See: httpL//publibz.boulder.ibm.com/epubs/pdf/cpn1ug00.pdf
Ah, yes. Reading through that paper now.
And they have to deal with exactly the same issues, and the solution is
the same. For the server side, serving from VMS to Unix systems, they
have to linearly read through a file to find the correct point, since
they also deal with records, and no streams of bytes.
In that case, the intelligence have to be in the server, since it's the
z/OS responsibility to make it look the same way as a Unix file, even
though the backend store is not.
And the same goes in reverse too. It is the z/OS client which have to
serialize/deserialize data and so on, to adopt to the stream byte view,
while the application locally wants to play with records...
I causes serious performance problems, as well as being lots of code.
I'm not saying it can't be done, just that I'm not to keen on
implementing this all.
>>>> And changing the lengths also mean that any seeks cannot be
>>>> converted at all, since you don't know where that actually is
>>>> on the file because of record length differences.
>
> Yes this problem is well known, even for text files in standard C.
> Note the restrictions on fseek/ftell.
Yes. But the fact that the problem is known will in no way make it solved.
Let's play with the fseek/ftell here for a second. C stipulates that you
can only do fseek to a value previously returned by ftell.
So, we have a (two actually) C compilers on RSX. You you call ftell in
them, you�ll get some value back, which is based on what FCS thinks.
This will basically be a value telling a block, and a byte offset within
that block, to which you then can do an fseek.
Assuming we were to use NFS here, you would still get such a coded value
by ftell. When you then call fseek, you'd be passing that same value in
again. Giving a disk block, and an offset within that disk block where
the record starts.
However, the file, served over NFS don't actually look like this. It is
a stream of bytes, remember? So you would have to start reading from the
beginning of the file, catching each LF, mark that as a record
separator, round up your position to where the next record would start,
and keep counting until you hit the right disk block, and right offset,
when (hopefully) and record would begin.
All to fulfill the very restrictive definition on how fseek/ftell are
assured to work in C.
>>> Personally, I believe that you shouldn't change the length.
>>> Write the bytes as seen by the client, and leave it up to other
>>> systems to process accordingly. This problem should also occur with
>>> some IBM systems, where record structure is not stored in the file,
>>> but otherwise known. I haven't used NFS on such systems to know
>>> how it is done, though.
>
>> Ok. So totall non-interoperability over NFS. What should I do with files
>> that were created on one side, when they are accessed on the other side?
>> Pretend they don't exist? That can cause interesting problems of its own.
>
> It seems that there are some "pretend they don't exist" problems
> already. One comes with case sensitivity. If the server has two
> files with names that differ only in case, how can they be
> accessed by a case insensitive client (DOS/Windows or Macintosh,
> including OS X)? Or the name may be too long for the client.
Indeed. But should I do that for *all* files, just because I might have
to do it for some?
>> Pretend they are fixed length files? But NFS (and Unix) measure file
>> length in bytes, while RSX measure it in blocks. Or should I pretend
>> they are STREAM files? Which makes them rather difficult to play with,
>> but which might be more approriate, except when we really talk about
>> binary files, which might make sense to say that they are fixed length
>> files.
>
> The opaque model for NFS seems to indicate that your write data
> blocks to the server, and read them back. Is this format only
> for text files? So programs running on RSX can read disk blocks
> directly and process accordingly? That would allow for conversion
> programs to be written for either side.
Oh sure. If you aren't really interested in NFS as a file system, but
just as a file transportation device, then sure. But why use NFS in that
case. FTP will work equally fine.
In RSX, programs *always* read/write disk blocks. There is nothing else.
All else are code that exist inside the user program.
>>>> I could go on about binary files as well, where you can hit
>>>> the same problems...
>>>> And then we have things like owners and file protections,
>>>> which don't map right...
>
> Owner and file protection is also well known. (Especially for
> DOS which has none of either.) In some cases special servers
> exist to do the conversion, but otherwise NFS works with numeric
> UID and GID and the usual unix rwx protections. As well as I
> remember, the rwx idea came from DEC systems, so might work
> with RSX.
Exist, yes. Map right, no. In RSX, user and group identities are only 8
bits. And you have four access bits for each category, not 3 like in
Unix. And some of those bits have meanings that don't translate.
And user and group are tightly connected in RSX. A user is actually
identified by the user and group value as a combination. You can have
different users with the same user field value, but different group
values. They are different users in RSX, unlike in Unix.
You could say that uids (in RSX) are gid local.
>>> If it is done in the file system before that limitation occurs,
>>> then it shouldn't be a problem. I don't know the RSX file
>>> access code at all, though. There is, as I said, the problem of
>>> programs not allowing for enough characters in a file name.
>
>> The filename mangling is done before the ACP is ever hit. It's all
>> inside the user program code. No chance of catching it before that. In
>> many cases, it's even mangled at compilation time.
>
> I believe this is an old problem, too. Consider, for example,
> the 8.3 file name mapping done by windows. Ugly, but it does work.
Like I said from the start - I don't consider filename issues to be a
problem. That part is easy...
But since you brought it up, I thought I'd just explain a little about
how it works in RSX.
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
next prev parent reply other threads:[~2010-04-17 21:00 UTC|newest]
Thread overview: 146+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-08 13:52 QBUS Prototyping Bill Gunshannon
2010-04-08 14:38 ` Scott Dorsey
2010-04-08 14:58 ` Al Kossow
2010-04-08 15:44 ` Bill Gunshannon
2010-04-08 20:46 ` John Wallace
2010-04-08 21:01 ` Bill Gunshannon
2010-04-08 21:58 ` Rob Jarratt
2010-04-08 23:00 ` John Wallace
2010-04-09 11:22 ` David Riley
2010-04-09 18:08 ` Johnny Billquist
2010-04-09 18:22 ` Bill Gunshannon
2010-04-10 19:29 ` Johnny Billquist
2010-04-10 21:05 ` Bill Gunshannon
2010-04-11 9:50 ` Johnny Billquist
2010-04-11 14:13 ` Bill Gunshannon
2010-04-09 19:20 ` glen herrmannsfeldt
2010-04-11 22:08 ` Dennis Boone
2010-04-12 11:41 ` dsnyder
2010-04-12 14:46 ` Al Kossow
2010-04-13 11:08 ` dsnyder
2010-04-15 17:27 ` Scott Dorsey
2010-04-15 18:29 ` Al Kossow
2010-04-09 19:14 ` glen herrmannsfeldt
2010-04-09 20:02 ` John Wallace
2010-04-09 20:28 ` David Riley
2010-04-10 1:28 ` glen herrmannsfeldt
2010-04-14 22:28 ` Bob Koehler
2010-04-08 21:59 ` glen herrmannsfeldt
2010-04-08 22:38 ` Bill Gunshannon
2010-04-11 10:16 ` glen herrmannsfeldt
2010-04-11 14:24 ` Bill Gunshannon
2010-04-11 17:10 ` glen herrmannsfeldt
2010-04-12 21:25 ` Johnny Billquist
2010-04-12 22:02 ` John Wallace
2010-04-13 7:34 ` Johnny Billquist
2010-04-19 2:25 ` John Santos
2010-04-19 11:50 ` John Wallace
2010-04-19 10:50 ` VAXman-
2010-04-24 14:55 ` Bill Gunshannon
2010-04-12 22:33 ` glen herrmannsfeldt
2010-04-13 7:53 ` Johnny Billquist
2010-04-13 12:01 ` glen herrmannsfeldt
2010-04-16 23:44 ` Johnny Billquist
2010-04-17 3:15 ` glen herrmannsfeldt
2010-04-17 21:00 ` Johnny Billquist [this message]
2010-04-18 0:31 ` glen herrmannsfeldt
2010-04-18 13:23 ` Johnny Billquist
2010-04-18 16:58 ` glen herrmannsfeldt
2010-04-18 23:02 ` Johnny Billquist
2010-04-19 1:39 ` glen herrmannsfeldt
2010-04-19 20:22 ` Johnny Billquist
2010-04-19 21:27 ` glen herrmannsfeldt
2010-04-20 19:36 ` Hans Bachner
2010-04-24 15:36 ` Steven Schweda
2010-04-25 3:55 ` Johnny Billquist
2010-04-25 5:32 ` Steven Schweda
2010-04-25 11:33 ` Johnny Billquist
2010-04-25 12:17 ` glen herrmannsfeldt
2010-04-25 13:31 ` Johnny Billquist
2010-04-25 14:01 ` Steven Schweda
2010-04-25 21:58 ` Johnny Billquist
2010-04-25 13:58 ` Steven Schweda
2010-04-25 21:47 ` Johnny Billquist
2010-04-26 15:40 ` Bob Koehler
2010-04-27 7:37 ` Johnny Billquist
2010-04-27 7:58 ` Bob Eager
2010-04-27 14:56 ` Bob Koehler
2010-04-28 9:06 ` Johnny Billquist
2010-04-28 12:34 ` Bob Eager
2010-04-28 14:51 ` Bob Koehler
2010-04-29 0:18 ` Johnny Billquist
2010-04-29 15:16 ` Bob Koehler
2010-04-27 14:53 ` Bob Koehler
2010-04-28 9:11 ` Johnny Billquist
2010-04-28 14:52 ` Bob Koehler
2010-04-29 0:20 ` Johnny Billquist
2010-04-29 1:15 ` Johnny Billquist
2010-04-29 7:01 ` John Wallace
2010-04-29 11:19 ` Jerome H. Fine
2010-04-29 18:38 ` glen herrmannsfeldt
2010-04-29 19:53 ` Jerome H. Fine
2010-04-29 20:35 ` glen herrmannsfeldt
2010-04-29 21:43 ` Bob Eager
2010-04-30 0:23 ` Johnny Billquist
2010-04-30 1:39 ` glen herrmannsfeldt
2010-04-30 0:19 ` Johnny Billquist
2010-04-30 15:04 ` Bob Koehler
2010-04-30 0:09 ` Johnny Billquist
2010-04-30 0:51 ` Johnny Billquist
2010-04-30 0:58 ` Johnny Billquist
2010-04-30 11:44 ` Jerome H. Fine
2010-04-30 14:59 ` Bob Koehler
2010-04-30 18:34 ` glen herrmannsfeldt
2010-04-29 15:19 ` Bob Koehler
2010-04-30 0:42 ` Johnny Billquist
2010-04-30 0:04 ` Johnny Billquist
2010-04-29 15:17 ` Bob Koehler
2010-04-27 15:43 ` jjh
2010-04-27 16:04 ` Richard B. Gilbert
2010-04-28 9:20 ` Johnny Billquist
2010-04-28 16:12 ` Richard B. Gilbert
2010-04-27 22:27 ` Bob Koehler
2010-04-28 9:18 ` Johnny Billquist
2011-04-18 13:00 ` Bob Koehler
2011-04-18 15:06 ` Johnny Billquist
2011-04-18 12:56 ` Bob Koehler
2011-04-18 15:07 ` Johnny Billquist
2011-04-18 17:26 ` Michael Moroney
2011-04-18 17:53 ` Bob Koehler
2011-04-19 3:35 ` Johnny Billquist
2011-04-19 15:34 ` Michael Moroney
2011-04-19 16:47 ` Johnny Billquist
2011-04-18 17:49 ` Bob Koehler
2011-04-19 3:36 ` Johnny Billquist
2011-04-18 12:52 ` Bob Koehler
2011-04-18 15:11 ` Johnny Billquist
2011-04-18 17:51 ` Bob Koehler
2011-04-19 10:29 ` FTP is 40 years old Paul Sture
2010-04-09 14:39 ` QBUS Prototyping Bob Koehler
2010-04-09 16:00 ` Bill Gunshannon
2010-04-09 23:16 ` John E. Malmberg
2010-04-15 6:12 ` Antti Louko
2010-04-15 16:24 ` Run.PDP
2010-04-15 16:46 ` Al Kossow
2010-04-15 17:24 ` glen herrmannsfeldt
2010-04-15 17:20 ` glen herrmannsfeldt
2010-04-16 23:54 ` Johnny Billquist
2010-04-16 21:59 ` Bob Koehler
2010-04-16 23:56 ` Johnny Billquist
2010-04-17 9:24 ` jjh
2010-04-17 9:56 ` glen herrmannsfeldt
2010-04-17 21:04 ` Johnny Billquist
2010-04-24 15:54 ` Bill Gunshannon
2010-04-24 15:52 ` Bill Gunshannon
2010-04-25 4:00 ` Johnny Billquist
2010-04-25 6:29 ` glen herrmannsfeldt
2010-04-25 7:42 ` Wilm Boerhout
2010-04-25 19:57 ` Antti Louko
2010-04-25 11:40 ` Johnny Billquist
2010-04-25 21:47 ` John Wallace
2010-04-26 0:32 ` Johnny Billquist
2010-04-15 17:19 ` Scott Dorsey
2010-04-09 1:00 ` Richard
2010-04-09 11:34 ` David Riley
2010-04-09 21:24 ` Richard
2010-04-08 20:18 ` JF Mezei
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