From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,32247abf28da27d4 X-Google-NewGroupId: yes X-Google-Thread: 1164f8,32247abf28da27d4 X-Google-NewGroupId: yes X-Google-Thread: f7344,32247abf28da27d4 X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidd180ab3bd8,gid3717dac89a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news.glorb.com!news2.glorb.com!usenet.stanford.edu!news.ucr.edu!nntp-server.caltech.edu!not-for-mail From: glen herrmannsfeldt Newsgroups: alt.sys.pdp11,comp.sys.dec,comp.os.vms Subject: Re: QBUS Prototyping Date: Sat, 17 Apr 2010 03:15:22 +0000 (UTC) Organization: California Institute of Technology, Pasadena Message-ID: References: <8265dgFs33U3@mid.individual.net> <826bunFpn2U1@mid.individual.net> <21555570-8094-4f6f-b790-18566557980f@h27g2000yqm.googlegroups.com> <826uhoFu5dU1@mid.individual.net> <82747sFu5dU2@mid.individual.net> <82e4csF6ndU2@mid.individual.net> NNTP-Posting-Host: thalia.ugcs.caltech.edu X-Trace: naig.caltech.edu 1271474122 19655 131.215.176.116 (17 Apr 2010 03:15:22 GMT) X-Complaints-To: abuse@caltech.edu NNTP-Posting-Date: Sat, 17 Apr 2010 03:15:22 +0000 (UTC) User-Agent: tin/1.9.3-20080506 ("Dalintober") (UNIX) (Linux/2.6.26-2-686 (i686)) Xref: g2news2.google.com alt.sys.pdp11:1447 comp.sys.dec:1897 comp.os.vms:30270 In alt.sys.pdp11 Johnny Billquist 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. (someone wrote) >>>>> I've been considering implementing NFS for RSX, but so >>>>> far I've decided against it for that very reason. (snip of discussion of RSX filesystem data separate from the file) >> 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. 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). >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." >>> 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. 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. >>> 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. > Well, I might be wrong, and if I am, that would be great. >>> 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. 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 MVS has three different basic file record formats (RECFM), RECFM=F (fixed length), RECFM=V (variable length), and RECFM=U (undefined). For RECFM=F, and especially for FB (fixed blocked) all records are the same length, stored in the directory (TOC), with no record marks stored in the file. For RECFM=V (and VB) records and block have four byte headers indicating the lengths. RECFM=U (commonly used for executable files) the structure is transparent to the file system, but known to the client. >>> 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. >> 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. It seems now that with 64 bit NFS, allowing files longer than 4GB, and 32 bit clients, that can't process such files, that again files pretend not to exist. In the spec. they even note that this can happen while a file is open, at it crosses the 4GB boundary! > 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. >>> 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. >>> In VMS, this is solved by forcing files on NFS to always have the >>> STREAM_LF format. That is a possibility under RSX as well, since you do >>> have a STREAM format for RMS. However, FCS have no clue about that >>> format, and just about no program can deal with it. So it wouldn't be >>> very useful. I don't remember ever using NFS on VAX. I will have to get my VAX/VMS system running again. >> Well, I was suggesting it mostly such that it would only ever >> be read by the RSX system. That is, as a replacement for older >> disk hardware. It would be nice to be able to read/write from >> other systems, but not required. > For me personally, having an NFS implementation in RSX which can only > read/write/see/understand files created from RSX is rather meaningless. > If I need disk, I have no problems hanging another SCSI disk on my machine. > And the same is true for people with emulators. The number of people > with only old, legacy disks, but modern enough machines to be able to > run my TCP/IP will probably be extremely low. (snip on filename processing) >> 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. > And anything you implement, which would possibly be useful will only > step in at the ACP level. -- glen