Talk:Simtec USB technical
I don't think the following is correct :
MassFS presents the drive as a single file of filetype DOSDisc. This is then openable using DOSFS. This means native (FileCore) formatted flash drives aren't supported, though it might be possible using a FileCore image filing system such as FCFS. It doesn't support devices over 2GB (due to the limitations of the RISC OS image filing systems) and doesn't provide any means to access the raw sector data of such devices. It appears devices larger than 2GB aren't recognised even if they have a partition smaller than 2GB.
Filing systems which, typically, get their data from physical medium wishing to support image filing systems on that medium, they always implement a FileCore instance (including MassFS). When accessing the FS registered with FileCore, FileCore will always look first at the contents of disc/hardware medium/whatever gets offered via its interface to see if it isn't a FileCore formated medium.
If so, it will deal with it automatically and no ImageFS gets a change to do anything. There are no 2GB limits in this case.
If not (and only then), it will ask all ImageFS around (via the Service Call IdentifyDisc) if someone else recognizes the format. When an ImageFS acknowledges the format layout, the disc will get a filetype from the ImageFS (not the host FS !) and the ImageFS reads/writes to that medium with a FileSwitch handle. So only in this situation you have the 2 GB limit.
So summerized:
- MassFS presents the drive as a single file of filetype DOSDisc : incorrect, it is DosFS recognizing the format and also giving the DOSDisc filetype. If you would have a Macintosh HFS disc layout on your USB stick, it would be MacFS setting the filetype MacDisc.
- This means native (FileCore) formatted flash drives aren't supported, though it might be possible using a FileCore image filing system such as FCFS. : incorrect. When you have a FileCore layout on your MassFS disc, FileCore will deal it before any ImageFS can do it. In fact, I'm pretty sure about this because I've banged a FileCore disc contents on an USB stick and in an A9home I got a working FileCore disc.
- It doesn't support devices over 2GB (due to the limitations of the RISC OS image filing systems) and doesn't provide any means to access the raw sector data of such devices. It appears devices larger than 2GB aren't recognised even if they have a partition smaller than 2GB. : generally speaking this is incorrect, When it is FileCore formated medium there is no 2GB limit and also for ImageFS which doesn't use a FileSwitch handle to access the medium (e.g. using the information passed in the Service IdentifyDisc call sent), like MacFS, Win95FS, ...
Filing systems which, typically, get their data from physical medium wishing to support image filing systems on that medium, they always implement a FileCore instance (including MassFS). When accessing the FS registered with FileCore, FileCore will always look first at the contents of disc/hardware medium/whatever gets offered via its interface to see if it isn't a FileCore formated medium.
- This isn't true in the case of MassFS on Simtec USB cards. It only makes use of FileSwitch and presents a single file of MassFS::discname.$ (which is why it's possible to access sectors of it with OS_GBPB 2/4, which won't work on a FileCore disc). This is then handed over to the image FS subsystem. It never goes anywhere near FileCore. I think, though I can't check now, that it's filetyped as DOSDisc by MassFS which then causes DOSFS to pick it up. Service_IdentifyDisc only works for FileCore discs (requires a FileCore disc record) so it can't use this mechanism to pass around the foreign format.
- Jason Tribbeck said on csa.hardware a day or two ago that there's a version of MassFS that supports >2GB discs on the A9home. This may well be radically different: I haven't seen it. I have used a Simtec USB card with MassFS 1.00 and it behaves as described.
- Caliston 12:53, 25 Apr 2006 (BST)
- With all respect, I'm really sure on what I'm talking about. Have a look at the FileCore instances (*modules), there is one instance made by USB Mass storage module (I can't remember its name, I don't have Simtec USB hardware here right now). It is just because you don't have a FileCore formated USB stick that FileCore will offer this data via a FileSwitch file handle and that you're able to read and write it via OS_GBPB). FileCore can do this because it passes on the read/write requests via the FileCore instance made by the USB Mass storage module. This is e.g. done by ADFS so that as soon as you put a DOS formated floppy in your drive, you can access it via OS_Find/OS_GPBP on sector level.
- Service_IdentifyDisc gets sent by FileCore as soon it is not recognizing disc image and will make up a disc record which is initially 640 KByte big. This is partially based on what the FileCore instance is offering. Interested ImageFS (or other modules, it does not really have to an ImageFS at this point) can read the disc image via a FileCore SWI and when they recognize it, they, not the host FS like USB MassFS, set the filetype which then will kick the ImageFS into live registered for that filetype. It is this mechanism allowing not only to support FAT but also HFS or other disc formats. That ImageFS will only have a FileSwitch filehandle, implemented by FileCore, to read/write the disc but if it is clever, it can go beyond the 2 GByte limit by using the information given at IdentifyDisc (or if it really knows what the source is, do direct disc read calls - like in this case, direct USB related calls eliminating FileSwitch/FileCore overhead).
- Like I said, I've made a FileCore formated USB stick using the Simtec USB stack basically by dumping a correct FileCore disc image to the USB stick using OS_Find & OS_GBPB. After a disconnect and resticking the stick in the USB port, I got a working FileCore disc, not a DOS disc (including long filenames using the standard RISC OS 4). If your story is really like you're telling, how come that this does work ?
- Feel free to check this info with your sources. I've implemented a couple RISC OS FS (includig a known ImageFS one) to know how this stuff works.
- joty 20:56, 25 Apr 2006 (CET)
[taken to email]
- joty says:
- So basically we were both right and I didn't realise I was actually playing with a recent version of MassFS and you were talking about the existing MassFS version on e.g. UniPod. So my comments are applicable to the yet-unreleased version of MassFS.
- :-)
- That all clear up things.
- Caliston 18:39, 30 Apr 2006 (BST)
- joty says: