Oberon Community Platform Forum
November 20, 2019, 07:51:02 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: File systems in UnixAOS, again. Another approach.  (Read 7452 times)
peasthope
Full Member
***
Posts: 100


WWW
« on: March 13, 2013, 04:18:51 PM »

Sorry to mention file systems again but this idea seems a possibility.

Now I understand that UnixAOS uses the relative file system based upon the host.  In principle at least, it should also be able to use a bare partition of the host.  This is an example from the database world.
    http://dev.mysql.com/doc/refman/5.0/en/innodb-raw-devices.html

I suppose that a primary question is whether the host system can allow an application to have direct access to a device.

Regards,           ... Peter E.


Logged
Bernhard T.
Administrator
Full Member
*****
Posts: 164


« Reply #1 on: April 04, 2013, 01:39:45 PM »

I suppose that a primary question is whether the host system can allow an application to have direct access to a device.

this is not really a problem in unix/linux. You can access any device with dd as super user.

If you modify the access rights/owner for the device (chown us:gr /dev/sdg2 ; chmod ug+rw /dev/sdg2)
it should be no problem at all also for an user us in group gr to access the raw device.

--
  Bernhard
« Last Edit: April 05, 2013, 09:10:24 AM by Bernhard T. » Logged
peasthope
Full Member
***
Posts: 100


WWW
« Reply #2 on: May 17, 2013, 07:08:23 PM »

Quote
it should be no problem at all also for an user us in group gr to access the raw device.

Software between Aos and the /dev/ mechanism would be needed.  Analogous to what Guenter has created to make the relative filesystem work.  The problem is more than trivial.

Regards,                 ... Peter E.

Logged
peasthope
Full Member
***
Posts: 100


WWW
« Reply #3 on: May 20, 2013, 03:25:47 PM »

P.s.

Quote
Software between Aos and the /dev/ mechanism

By analogy to terminology used by Guenter, the result would be
a relative device or relative partition.  As I imagine, it would allow
a genuine Aos filesystem in UnixAOS.  Might be a pipe dream but
might be possible.

Regards,       ... Peter E.
Logged
Bernhard T.
Administrator
Full Member
*****
Posts: 164


« Reply #4 on: May 23, 2013, 07:15:06 AM »

As I imagine, it would allow a genuine Aos filesystem in UnixAOS.  
Might be a pipe dream but might be possible.

This kind of software already exists for WinAos, see WinDisks.Mod and
http://www.ocp.inf.ethz.ch/wiki/Documentation/Miscellaneous#toc5

BTW: Did you try VirtualDisks.Install on the device?

--
  Bernhard
« Last Edit: May 23, 2013, 11:58:52 AM by Bernhard T. » Logged
peasthope
Full Member
***
Posts: 100


WWW
« Reply #5 on: May 24, 2013, 01:37:16 AM »

Bernhard,

Quote
Did you try VirtualDisks.Install on the device?

Suppose that a flash storage medium has a FAT partition containing a file intended to contain an AosFS.  The FatFS can be mounted in ETHNO, in AOS and in UnixAOS. 

You suggest that VirtualDisks will allow access to the AosFS in AOS on a generic PC and in UnixAOS on the OLPC XO?  Is that plausible?  VirtualDisks is not in NO and the AosFS-within-FAT-file can not be accessed there.

Thanks,           ... Peter E.
 
Logged
Bernhard T.
Administrator
Full Member
*****
Posts: 164


« Reply #6 on: May 24, 2013, 11:24:13 AM »

Quote
Did you try VirtualDisks.Install on the device?

Suppose that a flash storage medium has a FAT partition containing a file intended to contain an AosFS.  The FatFS can be mounted in ETHNO, in AOS and in UnixAOS. 

You suggest that VirtualDisks will allow access to the AosFS in AOS on a generic PC and in UnixAOS on the OLPC XO?  Is that plausible? 

I think it is. I don't know for sure under UnixAos and the OLPC XO, but I hope so also.

It is used in WinAOS to create the CD filesystem. I also used it in A2 to access an ISO image, which was residing on a FAT formatted USB Stick.

Quote
VirtualDisks is not in NO

I don't understand NO here. We are speaking about A2/AOS/UnixAOS/WinAos, but not about NO, aren't we?

Quote
and the AosFS-within-FAT-file can not be accessed there.

Why not? Since I don't have one at hand, I tried the following with some success:

Downloaded http://ftp://ftp.ethoberon.ethz.ch/Oberon/System3/Native/StdAlone/oberon0.dsk to an FAT-formatted USB stick and put it into directory ETHNO. As far as I remember this will be a floppy image, which might be mounted by VirtualDisks.

Then fired up A2 (not a current one, but one that is mostly functional).

Plugged in the USB-stick.
Used the Partition Tool (from the default Files->Partitions menu) to mount the sticks partition1 (USB0#1) with prefix USB.
Then I used "VirtualDisks.Install VD "USB:/ETHNO/oberon0.dsk" ~ having typed it into the Kernel.log window and activated by a middle-click on VirtualDisks.Install. And almost immediately I got a new entry in the Partition Tool showing me a new partition VD#0 of size 1429 KB. I tried to mount that, but got a trap.

I don't have the time to dig into it, but I am quite confident that this approach should work.

regards
--
  Bernhard
Logged
peasthope
Full Member
***
Posts: 100


WWW
« Reply #7 on: May 29, 2013, 05:10:44 PM »

Quote
... used it in A2 to access an ISO image, which was residing on a FAT formatted USB Stick.

Here there is a FAT formatted USB stick which Linux mounts as /media/9D7C-BB83.  In Linux, "touch FatFile" yields the empty file /media/9D7C-BB83/FatFile. 

Now in LinuxAos, Configuration.XML has this.
<Section name="Autostart">
      ...
      <Setting name="USB" value="FSTools.Mount 'USB' RelativeFileSystem /media/9D7C-BB83"/>

The File Manager shows USB:/FatFile as expected.

Then
  VirtualDisks.Install VD "USB:/FatFile" ~
  Disk VD registered
which also seems OK.

Quote
Used the Partition Tool (from the default Files->Partitions menu) ...

Here the Partition Tool shows this.
VD (Virtual Disk for file USB:/FatFile), removable
      Error: 0

Baffled for now.  Any further thoughts welcome.

Thanks,            ... Peter E.

Logged
peasthope
Full Member
***
Posts: 100


WWW
« Reply #8 on: June 06, 2013, 03:08:50 AM »

To my understanding,  VirtualDisks.Create /dev/sdb1/FatFile nbrOfBlocks ~ in UnixAos is analogous to mkdofs -C /dev/sdb1/FatFile <nbrOfBlocks> in *nix.  http://en.wikipedia.org/wiki/Loop_device is helpful.

Earlier,
Quote
"touch FatFile" yields the empty file /media/9D7C-BB83/FatFile.
Certainly AosFS could not be mounted in a file of 0 size.  That might explain Error: 0.

Before tackling VirtualDisks.Create I want to see mkdofs -C work reliably.  Will report again when there is progress.  

Regards,        ... Peter E.
« Last Edit: June 06, 2013, 03:20:11 AM by peasthope » Logged
Bernhard T.
Administrator
Full Member
*****
Posts: 164


« Reply #9 on: June 07, 2013, 11:22:50 AM »

Hi Peter,

there is a little help for VirtualDisks.Create in André Fischer's A2 user guide (p.67), see http://www.ocp.inf.ethz.ch/wiki/Documentation/Front?action=download&upname=A2Documentation.pdf
and a little bit in the source VirtualDisks.Mod ...
--
  Bernhard

« Last Edit: June 11, 2013, 03:44:01 PM by Bernhard T. » Logged
Bernhard T.
Administrator
Full Member
*****
Posts: 164


« Reply #10 on: June 11, 2013, 03:43:22 PM »

To my understanding,  VirtualDisks.Create /dev/sdb1/FatFile nbrOfBlocks ~ in UnixAos is analogous to mkdofs -C /dev/sdb1/FatFile <nbrOfBlocks> in *nix.  http://en.wikipedia.org/wiki/Loop_device is helpful.

as I can see (from Build.VMWare.Tool), it is slightly different:

Apparently VirtualDisks.Create HDD.img 204624 512~ creates a raw 200MB disk, which is installed by VirtualDisks.Install VD0 HDD.img~ and then partitioned by Partitions.Create VD0#1 76 9999~, then formatted by Partitions.Format VD0#1 AosFS 1024~, and finally mounted by FSTools.Mount VD AosFS VD0#1~

If I have understood it correctly, the whole device should be found under VD0#0. If you have the image of a partition, you should be able to VirtualDisks.Install VD HDD.img~ and mount it with FSTools.Mount VD AosFS VD#0~.

I did not try it in UnixAos, but I created an image for Oracle VirtualBox in WinAos, where the commands are the same.
--
  Bernhard
« Last Edit: June 17, 2013, 02:06:03 PM by Bernhard T. » Logged
peasthope
Full Member
***
Posts: 100


WWW
« Reply #11 on: July 18, 2013, 03:24:44 PM »

To recapitulate, the objective is to have a filesystem on a removable medium, which is accessible to both A2 and to UnixAOS.  Accessibility to NO also, is impossible without additional capability in NO.  The appeal of A2 is well established.  The appeal of UnixAOS is that it allows access to hardware which is not supported by A2.  The vast software of a Linux or Unix system can also be useful.

Quote
Apparently VirtualDisks.Create HDD.img 204624 512~ creates a raw 200MB disk, which is installed by VirtualDisks.Install VD0 HDD.img~ and then partitioned by Partitions.Create VD0#1 76 9999~, then formatted by Partitions.Format VD0#1 AosFS 1024~, and finally mounted by FSTools.Mount VD AosFS VD0#1~

OK; superficially at least I understand the concepts.  Thanks.

To apply to my objective,

put a FAT filesystem on a flash medium,
make a virtual disk there,
put the AosFS in the virtual disk and
configure the A2 system and the UnixAOS systems to mount the AosFS.


Certainly worth trying.  According to my experiment in using FAT as a primary working filesystem, described yesterday in the Oberon mailing list, two snags are possible.  A bug can prevent using the virtual disk as described.  Access to the AosFS on top of FAT might be intolerably slow for routine use.

Thanks for the feedback,          ... Peter E.



Logged
peasthope
Full Member
***
Posts: 100


WWW
« Reply #12 on: July 21, 2013, 05:08:40 PM »

Incidentally, I'm convinced that for efficient portability of data, UnixAOS needs to allow a relative partition as well as a relative filesystem.  Suppose that a natively installed A2 system has a flash store with an AosFS.  Imagine connecting that store to a UnixAOS and there finding /dev/sdb1 containing the AosFS.

At present we have "two solitudes".  A2 talks AosFS but not extN.  Linux and Unix talk extN but not AosFS.  Aside from a problem I encountered in Native Oberon, all these systems talk FAT but it is poor for some contemporary uses.  Meanwhile file systems designed specifically for flash storage are being adopted.  UBIFS, http://en.wikipedia.org/wiki/UBIFS, appears to be the most prevalent in Linux.

Regards,                    ... Peter E.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!