From: Ben Pfaff Date: Tue, 14 Sep 2004 21:27:11 +0000 (+0000) Subject: Improve VMware GSX Server support. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcf89ebe9fe61d0a1739bd48b7dd90905aab461d;p=pintos-anon Improve VMware GSX Server support. --- diff --git a/src/utils/pintos b/src/utils/pintos index 74b1c79..744889a 100755 --- a/src/utils/pintos +++ b/src/utils/pintos @@ -6,7 +6,7 @@ $mem = 4; $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; @@ -77,6 +77,8 @@ while (@ARGV) { close (SRC); exit 0; + } else { + die "unknown option `$arg'\n"; } } usage (); @@ -95,7 +97,7 @@ sub 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"; @@ -162,19 +164,16 @@ sub run_vm { 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"; @@ -208,7 +207,12 @@ sub run_vm { } 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"); } }