$headless = 0;
while (@ARGV) {
my ($arg) = shift (@ARGV);
- if ($arg =~ /--(bochs|qemu|vmware)$/) {
+ if ($arg =~ /--(bochs|qemu|gsx)$/) {
$sim = $1;
} elsif ($arg =~ /--(monitor|gdb)$/) {
$debug = $1;
close (SRC);
exit 0;
+ } else {
+ die "unknown option `$arg'\n";
}
}
usage ();
print "Available options:\n";
print " --bochs Use Bochs as simulator (default)\n";
print " --qemu Use qemu as simulator\n";
- print " --vmware Use VMware Workstation as simulator\n";
+ print " --gsx Use VMware GSX Server 3.x as simulator\n";
print " --monitor Debug with simulator's monitor\n";
print " --gdb Debug with gdb\n";
print " --mem=MB Run VM with MB megabytes of physical memory\n";
push (@cmd, '-S') if $debug eq 'monitor';
push (@cmd, '-s') if $debug eq 'gdb';
run_command (@cmd);
- } elsif ($sim eq 'vmware') {
- print "warning: --$debug not supported by VMware Workstation, ignoring"
+ } elsif ($sim eq 'gsx') {
+ print "warning: --$debug not supported by VMware GSX Server, ignoring"
if $debug ne '';
open (VMX, ">pintos.vmx") or die "pintos.vmx: create: $!\n";
chmod 0777 & ~umask, "pintos.vmx";
print VMX "#! /usr/bin/vmware -G\n";
print VMX "config.version = 6\n";
- print VMX "gui.powerOnAtStartUp = TRUE\n";
- print VMX "gui.exitAtPowerOff = TRUE\n";
print VMX "guestOS = \"linux\"\n";
- print VMX "floppy0.fileName = \"null.bin\"\n";
- print VMX "floppy0.fileType = \"file\"\n";
+ print VMX "floppy0.present = FALSE\n";
if (! -e 'null.bin') {
open (NULL, ">null.bin") or die "null.bin: create: $!\n";
}
close (VMX);
- run_command ("./pintos.vmx");
+ use Cwd;
+ $vmx = getcwd () . "/pintos.vmx";
+ system ("vmware-cmd -s register $vmx >&/dev/null");
+ system ("vmware-cmd $vmx stop hard >&/dev/null");
+ system ("vmware -l -G -x -q $vmx");
+ system ("vmware-cmd $vmx stop hard >&/dev/null");
}
}