Carnegie Mellon
Computer Science Department |
|
|
|
|
|
|
|
|
|
|
15-410 Project 4 Extended Console
Here is what we would like to see in terms of
virtual consoles.
Virtual Consoles
What "virtual consoles" means is that
the single physical screen and keyboard are
multiplexed by the operating system (that's you)
so that it looks as if there are multiple instances
of each one.
Output routines such as print() will paint a virtual
screen, which may or may not be visible, and keyboard
scancodes will result in characters being available
on various keyboard queues at various times.
From the user's point of view, there should
be multiple independent text consoles, and pressing
the Tab key on the keyboard should switch
the screen and keyboard "immediately" from one virtual
console to another (by "immediately" we mean that
this should happen promptly--not after the next timer
interrupt, after the next
readline() completes, etc.).
Threads belonging to a task
share a virtual console.
Each newly created task
will begin using the same virtual console as
its parent task.
If you wish to use a different
color combination for each virtual console,
they must all be reasonable.
A new system call, int new_console(void) ,
should determine if a request for a new console is
supportable, and, if so, should allocate an unused console
and switch all further console I/O of the calling task
to the new virtual console.
If any thread in a thread family has a console I/O
operation pending or in progress, new_console() should fail.
If too many virtual consoles are in use,
new_console() may fail. You should support
at least 8 virtual consoles.
Once a virtual console has no more threads or proceses
associated with it, it should be deleted from the Tab
key rotation after the user has had a chance to view the
contents once (it might be friendly for the kernel
to somehow indicate to the user that this is the last
viewing of the console and optionally for the kernel to
require a confirmatory keypress).
If nobody ever calls new_console() , the
operation of the console/keyboard system should be as it
was for P3. Also, user code should have no way of observing
it is not running on a P3 kernel without virtual
consoles (aside from the behavior of new_console() ).
In case you're wondering,
the number of lines available on the screen is
not deemed to be a "P3 kernel property"--in theory a "P3
kernel" could have any number of lines on the console as
long as the system call interface behaved correctly.
Utility Program
The update area contains a program called new_shell
which will use the new_console() system call to launch
a shell in a new console window.
Context
By the way, the Linux machines in the clusters support
virtual consoles...press
Control-Alt-F1,
Control-Alt-F2, etc.
Those virtual consoles are persistent rather than being
created and deleted as we are suggesting for P4.
|