vmx: add -v|-w flag to control window creation behaviour
The -v flag now does not create a new rio window, while -w flag does (restores the old behaviour). This allows vmx to run under vncs and is in general mode aligned to other emulators and programs.front
parent
1bb96d542c
commit
c74458c98b
|
@ -24,7 +24,7 @@ vmx \- virtual PC
|
||||||
.I blockfile
|
.I blockfile
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
.B -v
|
.BR -v | -w
|
||||||
.I vga
|
.I vga
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
|
@ -61,6 +61,11 @@ argument.
|
||||||
If
|
If
|
||||||
.B -v
|
.B -v
|
||||||
is specified, a graphics device, PS/2 keyboard and mouse are simulated.
|
is specified, a graphics device, PS/2 keyboard and mouse are simulated.
|
||||||
|
The
|
||||||
|
.B -w
|
||||||
|
flag behaves the same as
|
||||||
|
.B -v
|
||||||
|
but also creates a new window for the screen.
|
||||||
Clicking on the screen "grabs" the mouse; pressing Ctrl and Alt simultaneously releases the grab.
|
Clicking on the screen "grabs" the mouse; pressing Ctrl and Alt simultaneously releases the grab.
|
||||||
Valid values for the argument are
|
Valid values for the argument are
|
||||||
.TP
|
.TP
|
||||||
|
|
|
@ -737,7 +737,7 @@ vgafbparse(char *fbstring)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
vgainit(void)
|
vgainit(int new)
|
||||||
{
|
{
|
||||||
char buf[512];
|
char buf[512];
|
||||||
int i;
|
int i;
|
||||||
|
@ -760,7 +760,7 @@ vgainit(void)
|
||||||
sysfatal("got nil ptr for framebuffer");
|
sysfatal("got nil ptr for framebuffer");
|
||||||
}
|
}
|
||||||
snprint(buf, sizeof(buf), "-dx %d -dy %d", maxw+50, maxh+50);
|
snprint(buf, sizeof(buf), "-dx %d -dy %d", maxw+50, maxh+50);
|
||||||
if(newwindow(buf) < 0 || initdraw(nil, nil, "vmx") < 0)
|
if((new && newwindow(buf) < 0) || initdraw(nil, nil, "vmx") < 0)
|
||||||
sysfatal("failed to initialize graphics: %r");
|
sysfatal("failed to initialize graphics: %r");
|
||||||
screeninit(1);
|
screeninit(1);
|
||||||
flushimage(display, 1);
|
flushimage(display, 1);
|
||||||
|
|
|
@ -504,7 +504,7 @@ sendnotif(void (*f)(void *), void *arg)
|
||||||
send(notifch, ¬if);
|
send(notifch, ¬if);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void vgainit(void);
|
extern void vgainit(int);
|
||||||
extern void pciinit(void);
|
extern void pciinit(void);
|
||||||
extern void pcibusmap(void);
|
extern void pcibusmap(void);
|
||||||
extern void cpuidinit(void);
|
extern void cpuidinit(void);
|
||||||
|
@ -574,7 +574,7 @@ usage(void)
|
||||||
for(p = blanks; *p != 0; p++)
|
for(p = blanks; *p != 0; p++)
|
||||||
*p = ' ';
|
*p = ' ';
|
||||||
fprint(2, "usage: %s [ -M mem ] [ -c com1rd[,com1wr] ] [ -C com2rd[,com2r] ] [ -n nic ]\n", argv0);
|
fprint(2, "usage: %s [ -M mem ] [ -c com1rd[,com1wr] ] [ -C com2rd[,com2r] ] [ -n nic ]\n", argv0);
|
||||||
fprint(2, " %s [ -d blockfile ] [ -m module ] [ -v vga ] [ -9 srv ] kernel [ args ... ]\n", blanks);
|
fprint(2, " %s [ -d blockfile ] [ -m module ] [ -v|-w vga ] [ -9 srv ] kernel [ args ... ]\n", blanks);
|
||||||
threadexitsall("usage");
|
threadexitsall("usage");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,6 +590,7 @@ threadmain(int argc, char **argv)
|
||||||
static uvlong gmemsz = 64*1024*1024;
|
static uvlong gmemsz = 64*1024*1024;
|
||||||
static char *srvname;
|
static char *srvname;
|
||||||
extern uintptr fbsz, fbaddr;
|
extern uintptr fbsz, fbaddr;
|
||||||
|
int newwin = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
quotefmtinstall();
|
quotefmtinstall();
|
||||||
|
@ -637,6 +638,8 @@ threadmain(int argc, char **argv)
|
||||||
gmemsz = siparse(EARGF(usage()));
|
gmemsz = siparse(EARGF(usage()));
|
||||||
if(gmemsz != (uintptr) gmemsz) sysfatal("too much memory for address space");
|
if(gmemsz != (uintptr) gmemsz) sysfatal("too much memory for address space");
|
||||||
break;
|
break;
|
||||||
|
case 'w':
|
||||||
|
newwin = 1;
|
||||||
case 'v':
|
case 'v':
|
||||||
vgafbparse(EARGF(usage()));
|
vgafbparse(EARGF(usage()));
|
||||||
break;
|
break;
|
||||||
|
@ -673,7 +676,7 @@ threadmain(int argc, char **argv)
|
||||||
loadkernel(argv[0]);
|
loadkernel(argv[0]);
|
||||||
pciinit();
|
pciinit();
|
||||||
|
|
||||||
vgainit();
|
vgainit(newwin);
|
||||||
for(i = 0; i < edevn; i++)
|
for(i = 0; i < edevn; i++)
|
||||||
if(edev[i](edevaux[i]) < 0)
|
if(edev[i](edevaux[i]) < 0)
|
||||||
sysfatal("%s: %r", edevt[i]);
|
sysfatal("%s: %r", edevt[i]);
|
||||||
|
|
Loading…
Reference in New Issue