Author Topic: Shared folders IFS for VBox Additions, the test version  (Read 106152 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Shared folders IFS for VBox Additions, the test version
« Reply #105 on: July 05, 2019, 01:00:20 am »
The feature added is path translation: long <-> short filenames for OS/2 VDM.

I found that feature very interesting for testing purposes. If it causes problems, it would be more useful to document the problems instead of just fearing the worst.

I'm attaching a screenshot of a shared folder on virtualbox from a Windows host. OS/2 sees the files, and DOS also sees the abbreviated as 8.3 file names.

But opening "winfile" is a different story for me. If I run winfile (WinOS2 session) and point it to the W: drive (The one shared from the VirtalBox host) it will trap OS/2.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #106 on: July 05, 2019, 03:05:16 am »
Simplest would be some type of switch, parameter or environment variable to enable/disable the long name conversion.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #107 on: July 05, 2019, 08:41:06 am »
2Doug Bissett: No, no LFN API in OS/2 VDM, so I'm not going to provide LFN to VDM. I'm just shorten filenames, so that they will be available
to DOS/win16 programs, and convert short filenames back to long ones, so they could be accessed. Why it could lead to problems? This feature in fact, was ported from fat32.ifs, where I added the similar code for exFAT. Now I adapted the same code for vboxfs.ifs. As far as I can see, I don't see any problems it may cause, so far.

2Dave Yeo: Yes, I plan to make a command line switch to disable that in the future, but not yet. Just in case someone does not like this. So far, I saw only one reason to not do that. Imagine, you have both "My documents" and "Mydoc~3D" directories in the root directory. Then under DOS, the first one will be abbreviated to the second name, and the second name will be inaccessible. If that's not desired, you'd better avoid creating file names ending at ...~<Number>. But such names are usually not needed. So, it is unlikely if you'd ocassionally create such a file/dir.

2Martin Iturbide: So, DOS window works for you, but "winfile" traps? Strange, because "winfile" works fine for me. Could you provide
any logs? (Enable logging with "/d" switch to vboxfs.ifs, redirect COM port to a host pipe, and connect with a terminal emulator. So far,
I only aware of "putty" being able to connect to a named pipe, but Putty does not seem to have output saved into a log file. But you can
try). I start "progman" first, and run "winfile" from a Program Manager icon. Works fine for me.

PS: So far, command.com and Norton Commander work fine for me. Though, when I try to start Volkov Commander,
I get an IPE in OS/2 kernel. Seems to be a VBox bug.
« Last Edit: July 05, 2019, 12:26:47 pm by Valery Sedletski »

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #108 on: July 05, 2019, 12:03:26 pm »
BTW, you'd better use this build: ftp://osfree.org/upload/vbox/additions/VBoxAdditions-os2-x86-5.0.51.r203.zip

It contains a small fix for a starting point for a counter which is after a tilde. It was zeroed-out sometimes incorrectly, so
some dirs or files were inaccessible (ERROR_PATH_NOT_FOUND). Now it should work.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #109 on: July 05, 2019, 03:10:55 pm »
2Martin Iturbide: I just found that if I start "svn up" in the VBox source directory, and then enter the same directory with FC/2, I get
a trap. Maybe, you have the same with "winfile.exe", so you're accessing the same directory with some other program at the same
time? Also, please check that it doesn't trap if opened with "winfile.exe" only. You can try several times, to discard false results.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #110 on: July 05, 2019, 05:14:07 pm »
2Dave Yeo: Yes, I plan to make a command line switch to disable that in the future, but not yet. Just in case someone does not like this. So far, I saw only one reason to not do that. Imagine, you have both "My documents" and "Mydoc~3D" directories in the root directory. Then under DOS, the first one will be abbreviated to the second name, and the second name will be inaccessible. If that's not desired, you'd better avoid creating file names ending at ...~<Number>. But such names are usually not needed. So, it is unlikely if you'd ocassionally create such a file/dir.

I can see another problem as documented in the screenshots that Martin provided:
there is a directory called "VBoxAdditions-os2-x86-5.0.51.r200". This directory name is "shortened" to "VBOXA~29.R20".
Obviously, the translation algorithm misinterprets everything after the last dot as a filename extension even though it is a directory. Additionally, the "extension" r200 is clipped to r20 because for a DOS filename extension only 3 characters are allowed.

I'd say that for a directory name, there should NEVER be an extension (but I am not sure how DOS handles a dot in a directory name). No matter what DOS does it would be much safer to never assume that a directory name has an extension and handle dots in directory names just as an ordinary character.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #111 on: July 05, 2019, 05:35:56 pm »
2Lars Erdman: This is how file name shortening algorithm works: It removes first several leading dots from name, and leaves three characters
after last dot as an extension (and skips characters in between). So, thanslation algorithm does not misinterpret anything.

It is safe to use extension for directories in DOS. Yes, originally, there were a convention that directories doesn't have an extension. But that convention was widely "violated". "Violated" is not anything bad. Directory, in any file system, including FAT, is a file, containing the list of directory entries (excluding some exotic file systems, which don't include FAT). So, any directory can have any name, with or without extension. This is safe, because there is no difference, how files and directories are stored on the file system. And I used DOS and never saw any problems when having directories with extension. :-)

PS: Lars, this is not my own algorithm, it was invented before me by Henk Kelder and Ko Myung Hun. It was worked for at least, a decade before I joined the fat32.ifs project. Nobody still complained, so far. I only enhanced this algorithm for exFAT (as exFAT, opposite to VFAT, does not contain short file names along with long ones. So, I added a bit of new code, generating the short file names from long ones, and restoring them back. The idea was got from http://freedos-32.sourceforge.net/lean/specification.php -- see "Fabricating a short file name").
« Last Edit: July 05, 2019, 05:45:32 pm by Valery Sedletski »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Shared folders IFS for VBox Additions, the test version
« Reply #112 on: July 05, 2019, 10:22:56 pm »
Hi Valerius

I updated to r203 and still get a trap on winfile. I rebooted, open the WinOS2 program manager, run the winfile from the icon, selected the E: drive (that was automounted) and trap (attached screenshot).

Now it also seems that my VM got worst, now even on OS/2 when I try to access the shared file it traps (trap2).

I want to do logging to the COM port  but I don't know how to do it.
Quote
(Enable logging with "/d" switch to vboxfs.ifs, redirect COM port to a host pipe, and connect with a terminal emulator. So far, I only aware of "putty" being able to connect to a named pipe, but Putty does not seem to have output saved into a log file. But you can try).

Do you have some documentation/link on how to do that??

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #113 on: July 05, 2019, 11:51:02 pm »
2Martin Iturbide: Of course, I have some documentation on debugging, in docs/debug.txt file on the Additions ISO. It is unfinished, though.
But here is described, how to setup a log buffer in ArcaOS. If you have windows host, you'll need Putty:

https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

Then you need to set up a COM port emulation in VBox, with mapping to a host-side named pipe. You can use this tutorial:

https://stackoverflow.com/questions/37728628/connection-through-com-port-between-host-and-guest-in-virtualbox

And also, you need to add the "/d" switch in VBoxFS.ifs, to enable COM port logging.

PS: I'm sorry, but your trap screens are useless, because this is a trap in 32-bit code, so I cannot determine, in which segment this code is located (like in 16-bit case). For having additional info, please install a debug kernel (e.g., OS/4 kernel), together with .sym files for that kernel and VBoxFS.ifs/VBoxGuest.sys. (The symbol files should be supplied together with the kernel. Also, there are .sym files for the Additions on the Addiitions ISO).

If something is not clear, feel free to ask me :)

Quote from: Martin
Now it also seems that my VM got worst, now even on OS/2 when I try to access the shared file it traps (trap2).

You have a trap even in OS/2 on the real hardware? Which file and what it is shared with?
« Last Edit: July 06, 2019, 12:04:04 am by Valery Sedletski »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Shared folders IFS for VBox Additions, the test version
« Reply #114 on: July 06, 2019, 04:20:11 pm »
Hi

I will check the documentation to produce a better log.


Quote from: Martin
Now it also seems that my VM got worst, now even on OS/2 when I try to access the shared file it traps (trap2).

You have a trap even in OS/2 on the real hardware? Which file and what it is shared with?

I was not clear enough with this. Before, my VM only trapped with WinFile, now it also traps on the OS/2 command line (inside the same VM).

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #115 on: July 06, 2019, 07:23:50 pm »
Hi all!

I uploaded the new version:

ftp://osfree.org/upload/vbox/additions/VBoxAdditions-os2-x86-5.0.51.r208.zip

Since now, you can disable the file name translation feature short <-> long with the "/h" or "-h" flag:

Quote
ifs=d:\os2\boot\VBoxFS.ifs /h

If "/h" or "-h" is set, long file names are just skipped in DOS sessions (the same behaviour like in HPFS/JFS).
Just in case someone likes this behaviour more, or just disable file name translation for stability (I have a bug
somewhere which can cause traps, in filename translation feature, So, if you add the "/h" switch, it should be
more stable until I fix the bug) and performance (file name translation use some CPU time) reasons.

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #116 on: July 07, 2019, 01:37:00 am »
Hi all again!

I fixed the trap in TranslateName function (in code translating filenames short <-> long). Now it seems to be stable.
The  link is:

ftp://osfree.org/upload/vbox/additions/VBoxAdditions-os2-x86-5.0.51.r209.zip

2Martin: does this build trap for you, when you using windows file manager?

mauro

  • Sr. Member
  • ****
  • Posts: 408
  • Karma: +3/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #117 on: July 11, 2019, 06:10:06 pm »
Hi Valery, I've one among others who appreciated your job in these OS2 Guest Addition, fighting a little bit to install it due to my poor knowledge, but arrived to the end also thanks to your patient help.
I dealed with one previous version, think r204, and fighted a lot only for understanding what to do, the final result fitted enough my expectations except for the shared folder handling, which is then possible to me only acting from FC2 while it does not appear in WPS.
Reading here that you made some steps forward, I wonder if you suggest to try the latest version in case might have solved the WPS shared folder display (resulting empty in his WPS volume pane). I would try only if you believe this could solve the case, otherwise I keep the version that have installed months ago, also giving enough on my need.
Thank you

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #118 on: July 11, 2019, 10:11:46 pm »
2mauro: The problem with empty WPS folder didn't solved yet, so far. Though, last versions stability was enhanced since "months ago". So, some traps and hangs were fixed. Also, some new features were added, like shortening file names for VDM. So, I'd recommend to update your version to the latest one.  Updating always doesn't hurt. If you see something bad, you always have option to roll back to the previous version.
« Last Edit: July 11, 2019, 10:13:51 pm by Valery Sedletski »

mauro

  • Sr. Member
  • ****
  • Posts: 408
  • Karma: +3/-0
    • View Profile
Re: Shared folders IFS for VBox Additions, the test version
« Reply #119 on: July 12, 2019, 09:18:54 am »
if it will be only a matter of file replacing from old to new or some among them, without editing again the config.sys,  I'll try.
Thank you
« Last Edit: July 12, 2019, 01:54:41 pm by mauro »