Virtual PC 2007/2004 Additions shared folder insight

Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Forum rules
Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Post Reply
veso266
FTP Access
Posts: 113
Joined: Thu May 29, 2014 10:39 am
Location: Ljubljana Slovenia

Virtual PC 2007/2004 Additions shared folder insight

Post by veso266 »

Hi there
today I was playing with Shared folders in DOS 6.22 on VPC 2007 using 2004 Guest Additions (fshare.exe) app and was wondering what makes it tick

Shared folders work a bit diferently on VPC than on VirtualBox or Vmware where they are using SMB to share files

So I am wondering were VPC 2004 Additions ever open sourced or source code (at least from fshare.exe) is somewhere to be found as I wonder what command does fshare.exe (in guest) have to send to VPC 2007/2004 for it to know that shared folders are installed and it allows you to chose a folder to share and what does VPC need to send to the guest for it to show that drive and files on it, essentially what protocol they use for Shared folders

So if anyone has any idea/insight about this please share it

I know VPC is old and it doesn't even work on 64 bit Win10 but still its shared folders always fascinated me

os2fan2
User avatar
Donator
Posts: 1268
Joined: Sun Dec 30, 2007 8:12 am
Location: Brisbane, Queensland
Contact:

Re: Virtual PC 2007/2004 Additions shared folder insight

Post by os2fan2 »

Apparently, the magic of getting a client to send a request to the host is to use a magic bop (ie a bad operation), that causes a system fault. This is the magic used in OS/2, for vmdisks.

The alternate is that there are magic interrupts in the emulated bios that wake the machine up.

tcc can apparently tell if it's running in a virtual pc.

veso266
FTP Access
Posts: 113
Joined: Thu May 29, 2014 10:39 am
Location: Ljubljana Slovenia

Re: Virtual PC 2007/2004 Additions shared folder insight

Post by veso266 »

os2fan2 wrote:Apparently, the magic of getting a client to send a request to the host is to use a magic bop (ie a bad operation), that causes a system fault. This is the magic used in OS/2, for vmdisks.

The alternate is that there are magic interrupts in the emulated bios that wake the machine up.

tcc can apparently tell if it's running in a virtual pc.
:)
any PoC (sample C/C++ program would be a better word for that) to test that?
let's say telling VPC 2007 that shared folders are enabled

would be great if someone had source for fshare.exe

AlphaBeta
User avatar
Donator
Posts: 2137
Joined: Sun Aug 12, 2012 4:33 pm
Location: Czechia

Re: Virtual PC 2007/2004 Additions shared folder insight

Post by AlphaBeta »

Are you sure that fshare.exe doesn't just implement the interface of whatever network adapter is emulated by Virtual PC and use the SMB protocol to communicate with the host? I don't think they would go through the struggle of deploying some awkward mechanism just to have shared folders in DOS. It does use SMB for Windows guests, so it only makes sense to use it for MS-DOS guests as well.
AlphaBeta, stop brainwashing me immediately!

Image

veso266
FTP Access
Posts: 113
Joined: Thu May 29, 2014 10:39 am
Location: Ljubljana Slovenia

Re: Virtual PC 2007/2004 Additions shared folder insight

Post by veso266 »

AlphaBeta wrote:Are you sure that fshare.exe doesn't just implement the interface of whatever network adapter is emulated by Virtual PC and use the SMB protocol to communicate with the host? I don't think they would go through the struggle of deploying some awkward mechanism just to have shared folders in DOS. It does use SMB for Windows guests, so it only makes sense to use it for MS-DOS guests as well.
maybe it does, but it doesn't have its own IP in DOS and its mounted automaticly
I always had to use net use <driveLetter> \\computerName in VirtualBox and VmWare to acsess shared folders, but never in VPC

os2fan2
User avatar
Donator
Posts: 1268
Joined: Sun Dec 30, 2007 8:12 am
Location: Brisbane, Queensland
Contact:

Re: Virtual PC 2007/2004 Additions shared folder insight

Post by os2fan2 »

Have you thought of running fshare or the OS/2 equiv fsfilter.sys through some sort of debugger or decompiler?

OS/2 also has fsaccess.exe, which appears to be the OS/2 side of things.

rififi
FTP Access
Posts: 64
Joined: Mon Dec 24, 2007 6:07 pm

Re: Virtual PC 2007/2004 Additions shared folder insight

Post by rififi »

fshare.exe is using invalid asm instructions, which are caught by VirtualPC to do the required action.
Those instructions are bytes sequences 0x0f 0x3f xx yy or 0x0f 0xc7 0xc8 xx yy

veso266
FTP Access
Posts: 113
Joined: Thu May 29, 2014 10:39 am
Location: Ljubljana Slovenia

Re: Virtual PC 2007/2004 Additions shared folder insight

Post by veso266 »

rififi wrote:fshare.exe is using invalid asm instructions, which are caught by VirtualPC to do the required action.
Those instructions are bytes sequences 0x0f 0x3f xx yy or 0x0f 0xc7 0xc8 xx yy
neat Now I just have to figure out how to send them
in BC++3.1 something like:
asm {
0x0f ax
}
but this would work x64 CPU has EAX and windows 7 is using protected mode and VPC is Virtualizer so I can't call hardware direcly from BC++?
using Dos 6.22 and BC++3.1 (one that has Turbo Vision built in (BTW: what is the diference between Turbo C++ and Brodland C++ is it Turbo Vision includsion?)) for testing

veso266
FTP Access
Posts: 113
Joined: Thu May 29, 2014 10:39 am
Location: Ljubljana Slovenia

Re: Virtual PC 2007/2004 Additions shared folder insight

Post by veso266 »

OK some update
I tried calling BIOS interupts with geninterrupt(int interupt number) included in dos.h like this
geninterrupt(15); //0x0f -> 15
geninterrupt(63); //0x3f -> 63
I gues I miss xx,yy in here, not sure what would that be

geninterrupt(15); //0x0f -> 15
geninterrupt(199); //0xc7 -> 199
geninterrupt(200); //0xc8 -> 200
I gues I miss xx,yy in here, not sure what would that be

but MS DOS just halts and I can't even CTRL+ALT+DELETE to restart, gues I called something wierd

Post Reply