Re: [9fans] Mouse jumps in vmware

2008-12-11 Thread Skip Tavakkolian
 Maybe
 someone will be motivated to fill in the rest
 using the latest and greatest VMware API
 instead of one from seven and a half years ago.

Russ, is this the right API? 

http://open-vm-tools.sourceforge.net/




Re: [9fans] Mouse jumps in vmware

2008-12-11 Thread Russ Cox
On Thu, Dec 11, 2008 at 10:47 AM, Skip Tavakkolian 9...@9netics.com wrote:
 Maybe
 someone will be motivated to fill in the rest
 using the latest and greatest VMware API
 instead of one from seven and a half years ago.

 Russ, is this the right API?

 http://open-vm-tools.sourceforge.net/

Presumably that code uses the right API.

Russ



Re: [9fans] Mouse jumps in vmware

2008-12-11 Thread Rodolfo kix Garcia

Ummm,

I am not sure if the problem is vmware-tools, probably not (and Plan 9 
is not the problem too).


I am using linux + plan9port + acme and I get the same problem ...

I am confused... BSOD @ me

Skip Tavakkolian escribió:

Maybe
someone will be motivated to fill in the rest
using the latest and greatest VMware API
instead of one from seven and a half years ago.



Russ, is this the right API? 


http://open-vm-tools.sourceforge.net/


  





Re: [9fans] Mouse jumps in vmware

2008-12-09 Thread Russ Cox
 Wrong: http://open-vm-tools.sourceforge.net/

  Now maybe somebody will release the code for the /bin/aux/vm* vmware
  tools so we can fix them.

In order to get the information that I used to
write aux/vmware, I signed an NDA that prohibits
me from releasing the source code, regardless
of what VMware has done in the interim.  At the
time, that was the only way to get the information.

That said, the mechanism for backdoor calls into
VMware has completely changed at least twice
since I wrote aux/vmware, which is why it no longer
works very well.  It's no loss to start from scratch.
If I thought the program was still useful today, I might
try to get permission to release it.  But it's just not
useful anymore in any real sense.

Also, the program is pretty small:

vx32% wc *.[chs] mkfile
 84 2061683 all.h
 27  49 289 asmbackdoor.s
 34  83 539 backdoor.c
 16  33 217 calls.c
6421303   10148 fs.c
176 3262224 inout.c
 33  46 392 isvmware.c
 10  13  98 mousepoll.c
224 5513677 msgchan.c
 44  69 554 vmmousepoll.c
 12  11 177 mkfile
   13022690   19998 total
vx32%

I have attached fs.c, which is quite generic
and has no VMware-specific goo.  Maybe
someone will be motivated to fill in the rest
using the latest and greatest VMware API
instead of one from seven and a half years ago.
Or maybe Uriel will just keep whining.

Russ
#include all.h
#include fcall.h
#include thread.h
#include 9p.h

char *mtpt = /mnt/vmware;
char *srvname;
uint time0;

enum
{
	Qroot = 0,
	Qmousepoint,
	Qsnarf,
	Qgui,
	Qdev,
	Qtime,
	Qbintime,
	Qmsg,
};

typedef struct Tab Tab;
struct Tab
{
	int qid;
	char *name;
	uint perm;
	uint vers;
	void (*open)(Req*);
	void (*read)(Req*);
	void (*write)(Req*);
	void (*close)(Fid*);
};

static void
mousepointread(Req *r)
{
	char buf[32];
	Point p;

	p = getmousepoint();
	snprint(buf, sizeof buf, %11d %11d , p.x, p.y);
	readstr(r, buf);
	respond(r, nil);
}

static void
mousepointwrite(Req *r)
{
	char buf[32], *f[3];
	int nf, n;
	Point p;

	n = r-ifcall.count;
	if(n = sizeof buf){
		respond(r, write too large);
		return;
	}
	memmove(buf, r-ifcall.data, n);
	buf[n] = '\0';
	nf = tokenize(buf, f, nelem(f));
	if(nf != 2){
		respond(r, bad point format);
		return;
	}
	p.x = atoi(f[0]);
	p.y = atoi(f[1]);
	setmousepoint(p);
	respond(r, nil);
}

static void
timeread(Req *r)
{
	char buf[32];
	uint sec, microsec, lag;

	gettime(sec, microsec, lag);
	snprint(buf, sizeof buf, %11d , sec);
	readstr(r, buf);
	respond(r, nil);
}

static uvlong uvorder = 0x0001020304050607ULL;
static uchar*
vlong2le(uchar *t, vlong from)
{
	uchar *f, *o;
	int i;

	f = (uchar*)from;
	o = (uchar*)uvorder;
	for(i = 0; i  sizeof(vlong); i++)
		t[i] = f[o[i]];
	return t+sizeof(vlong);
}

static void
bintimeread(Req *r)
{
	uchar *b;
	int i, n;
	uint sec, microsec, lag;
	vlong nsec;

	b = (uchar*)r-ofcall.data;
	n = r-ifcall.count;

	i = 0;
	if(n = 8){
		gettime(sec, microsec, lag);
		nsec = sec*10LL+microsec*1000LL;
		vlong2le(b, nsec);
		i = 8;
	}
	if(n = 16){
		vlong2le(b+8, nsec);
		i = 16;
	}
	if(n = 24){
		vlong2le(b+16, 10LL);
		i = 24;
	}
	r-ofcall.count = i;
	respond(r, nil);
}

char *snarf;
int nsnarf;
char *tsnarf;
int ntsnarf;

static void
snarfread(Req *r)
{
	int i;

	if(r-ifcall.offset == 0){
		if(snarf)
			free(snarf);
		nsnarf = getsnarflength();
		snarf = emalloc9p(nsnarf+4+1);
		for(i=0; insnarf; i+=4)
			*(uint*)(snarf+i) = getsnarfpiece();
		snarf[nsnarf] = '\0';
		nsnarf = strlen(snarf);	/* there's extra crap because we have to transfer 4 bytes at a time */
	}

	readbuf(r, snarf, nsnarf);
	respond(r, nil);
}

static void
snarfwrite(Req *r)
{
	if(r-ifcall.offset == 0){
		free(tsnarf);
		tsnarf = nil;
		ntsnarf = 0;
	}
	if(r-ifcall.offset  100*1024){
		respond(r, snarf buffer too long);
		return;
	}
	tsnarf = erealloc9p(tsnarf, ntsnarf+r-ifcall.count);
	memmove(tsnarf+ntsnarf, r-ifcall.data, r-ifcall.count);
	ntsnarf += r-ifcall.count;
	r-ofcall.count = r-ifcall.count;
	respond(r, nil);
}

static void
snarfclose(Fid *fid)
{
	int i;

	if((fid-omode3) == OREAD)
		return;

	setsnarflength(ntsnarf);
	for(i=0; intsnarf; i+=4)
		setsnarfpiece(*(uint*)(tsnarf+i));
	free(tsnarf);
	tsnarf = nil;
	ntsnarf = 0;
}

typedef struct Bit Bit;
struct Bit 
{
	char *name;
	uint bit;
};

Bit guibit[] = {
	autograb,	1,
	autorelease,	2,
	autoscroll,	4,
	autoraise,	8,
	copypaste,	0x10,
	hidecursor,	0x20,
	fullscreen,	0x40,
	tofullscreen,	0x80,
	towindow,	0x100,
	autoraise-disabled,	0x200,
	synctime,	0x400,
};

static void
guiread(Req *r)
{
	int i;
	char *s;
	Fmt fmt;
	uint val;

	val = getguistate();
	fmtstrinit(fmt);
	for(i=0; inelem(guibit); i++)
		fmtprint(fmt, %s %s\n, guibit[i].name, (val  guibit[i].bit) ? on : off);
	s = fmtstrflush(fmt);
	readstr(r, s);
	free(s);
	respond(r, nil);
}

static void
guiwrite(Req *r)
{
	int i, on;
	uint v;
	Cmdbuf *cb;

	cb = parsecmd(r-ifcall.data, r-ifcall.count);
	

Re: [9fans] Mouse jumps in vmware

2008-12-07 Thread Rodolfo kix Garcia

Hi Lucio,

I am happy with vmware. Is very good environment for my plan9, because 
my wifi card is not supported, ...


the problem is vmware is to avoid comments about it.

[EMAIL PROTECTED] escribió:

Yes, I know, the problem is vmware :-)



No, the problem is _not_ vmware.  At least to the extent that vmware
is just another hardware model.  The only really unfortunate thing
about vmware is that they are holding a few cards close to their chest
with a view to making a bit of a profit.  It may not be to one's
greatest advantage, but it seems legitimate to me and above the of
criticism levelled in the above.

++L

PS: I'm a contented small time user of vmware's ESX Server 3i.  All
the products from vmware (not many, I must confess) I have had
occasion to use and in keeping with impressions gained while
monitoring dicussions on the Xen developers' mailing list, convince me
that vmware strive for professionalism, understandably within the
limits set by the marketplace.  It's my personal opinion that none of
the equivalent tools available today are in the same league, so I
can't resist defending what I consider to be the market leader; feel
free to correct me (privately, preferably).


  





Re: [9fans] Mouse jumps in vmware

2008-12-07 Thread lucio
 I am happy with vmware. Is very good environment for my plan9, because 
 my wifi card is not supported, ...

No offence intended or taken, I just thought that vmware generally get
an undeservedly bad rap on this list :-)

++L




Re: [9fans] Mouse jumps in vmware

2008-12-07 Thread Rodolfo kix Garcia
I tryed xen, qemu and vmware ... and IMO vmware is better for my plan9 
virtual machines.


In other thread (probably long) ... we need think about to support any 
emulated software. We are not many people and write drivers is a hard 
work. I am not sure what is the rate of 9fans using real/emulated hardware.


[EMAIL PROTECTED] escribió:
I am happy with vmware. Is very good environment for my plan9, because 
my wifi card is not supported, ...



No offence intended or taken, I just thought that vmware generally get
an undeservedly bad rap on this list :-)

++L


  





Re: [9fans] Mouse jumps in vmware

2008-12-07 Thread Uriel
On Sun, Dec 7, 2008 at 9:44 AM,  [EMAIL PROTECTED] wrote:
 Yes, I know, the problem is vmware :-)

 No, the problem is _not_ vmware.  At least to the extent that vmware
 is just another hardware model.  The only really unfortunate thing
 about vmware is that they are holding a few cards close to their chest
 with a view to making a bit of a profit.  It may not be to one's
 greatest advantage, but it seems legitimate to me and above the of
 criticism levelled in the above.

Wrong: http://open-vm-tools.sourceforge.net/

Now maybe somebody will release the code for the /bin/aux/vm* vmware
tools so we can fix them.

Peace

uriel - Not holding his breath.

 ++L

 PS: I'm a contented small time user of vmware's ESX Server 3i.  All
 the products from vmware (not many, I must confess) I have had
 occasion to use and in keeping with impressions gained while
 monitoring dicussions on the Xen developers' mailing list, convince me
 that vmware strive for professionalism, understandably within the
 limits set by the marketplace.  It's my personal opinion that none of
 the equivalent tools available today are in the same league, so I
 can't resist defending what I consider to be the market leader; feel
 free to correct me (privately, preferably).






Re: [9fans] Mouse jumps in vmware

2008-12-07 Thread erik quanstrom
 We are not many people and write drivers is a hard 
 work.

why not give it a shot?

writing drivers is the most straightforward and rewarding
part of my job.

- erik




Re: [9fans] Mouse jumps in vmware

2008-12-07 Thread Richard Miller
 writing drivers is the most straightforward

Have you found some devices with fully documented programming interfaces,
which actually behave as the documentation describes?  Lucky man.

 and rewarding
 part of my job.

There I agree with you.  But I like solving puzzles.




Re: [9fans] Mouse jumps in vmware

2008-12-07 Thread erik quanstrom
 writing drivers is the most straightforward
 
 Have you found some devices with fully documented programming interfaces,
 which actually behave as the documentation describes?  Lucky man.

sure.  intel writes good documentation these days.

- erik