summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/kdrive/linux/linux.c23
-rw-r--r--hw/kdrive/src/kdrive.c7
-rw-r--r--hw/kdrive/src/kdrive.h1
3 files changed, 22 insertions, 9 deletions
diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c
index 04a9ea817..03ae22fee 100644
--- a/hw/kdrive/linux/linux.c
+++ b/hw/kdrive/linux/linux.c
@@ -75,16 +75,21 @@ LinuxInit ()
FatalError("LinuxInit: Server must be suid root\n");
}
- if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0)
- {
- FatalError(
- "LinuxInit: Cannot open /dev/tty0 (%s)\n",
- strerror(errno));
- }
- if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) ||
- (vtno == -1))
+ if (kdVirtualTerminal >= 0)
+ vtno = kdVirtualTerminal;
+ else
{
- FatalError("xf86OpenConsole: Cannot find a free VT\n");
+ if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0)
+ {
+ FatalError(
+ "LinuxInit: Cannot open /dev/tty0 (%s)\n",
+ strerror(errno));
+ }
+ if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) ||
+ (vtno == -1))
+ {
+ FatalError("xf86OpenConsole: Cannot find a free VT\n");
+ }
}
close(fd);
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 5eba38823..ec881126f 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -53,6 +53,7 @@ Bool kdEmulateMiddleButton;
Bool kdDisableZaphod;
Bool kdEnabled;
int kdSubpixelOrder;
+int kdVirtualTerminal = -1;
Bool kdSwitchPending;
DDXPointRec kdOrigin;
@@ -342,6 +343,7 @@ ddxUseMsg()
ErrorF("-videoTest Start the server, pause momentarily and exit\n");
ErrorF("-origin X,Y Locates the next screen in the the virtual screen (Xinerama)\n");
ErrorF("-mouse path[,n] Filename of mouse device, n is number of buttons\n");
+ ErrorF("vtxx Use virtual terminal xx instead of the next available\n");
ErrorF("\n");
}
@@ -738,6 +740,11 @@ KdProcessArgument (int argc, char **argv, int i)
UseMsg ();
return 2;
}
+ if (!strncmp (argv[i], "vt", 2) &&
+ sscanf (argv[i], "vt%2d", &kdVirtualTerminal) == 1)
+ {
+ return 1;
+ }
#ifdef PSEUDO8
return p8ProcessArgument (argc, argv, i);
#else
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index b33b710ed..f25f59c9d 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -309,6 +309,7 @@ extern Bool kdEnabled;
extern Bool kdSwitchPending;
extern Bool kdEmulateMiddleButton;
extern Bool kdDisableZaphod;
+extern int kdVirtualTerminal;
extern KdOsFuncs *kdOsFuncs;
#define KdGetScreenPriv(pScreen) ((KdPrivScreenPtr) \