shithub: vmxsmp

Download patch

ref: e0e889fb69a6d4d3f2332244ef4f79f900a66d84
parent: 2c9eeaf3cfd204ee49d676e8716445bb563249cd
author: glenda <glenda@fileserver>
date: Mon Dec 29 23:23:56 EST 2025

runvm change

--- a/runvm
+++ b/runvm
@@ -1,32 +1,33 @@
 #!/bin/rc
- 
-#vmx -c /dev/text -n /net/ether0 -d $home/obsd.img -M 1024M $home/bsd.mp 'tty=com1'
 
-#vmx -D -c /dev/text -x 2 -d $home/obsd.img -M 1024M $home/bsd.mp >[2] out2
-#$home/killvmx.rc
-vmx -x 1 -D -w text -d $home/obsd.img -M 1024M $home/bsd.mp  
-$home/killvmx.rc
- 
-#vmx -D -c /dev/text -M 512M -d $home/alpine.iso -m $home/boot/initramfs-virt  $home/boot/vmlinuz-virt 'console=ttyS0,115200'
-#vmx -n /net/ether0 -c /dev/text -M 512M -d $home/alpine.iso -m $home/boot/initramfs-virt  $home/boot/vmlinuz-virt 'console=ttyS0,115200'
-#vmx -D -n /net/ether0 -c /dev/text -M 512M -d $home/alpine.iso -d $home/test.img -m $home/boot/initramfs-virt  $home/vmlinuz-lts 'console=ttyS0,115200'
+oldfont=$font
+font=/lib/font/bit/vga/vga.font
 
-### Alpine install
-# vmx -D -n /net/ether0 -w text -M 1024M -d $home/alpine.iso -d $home/linux.img -m $home/initramfs-lts $home/vmlinuz-lts 'console=tty0,115200'
+args=$*(2-)
 
-### Alpine boot
-#vmx -D -c /dev/text -x 2 -M 1024M -d $home/linux.img -m $home/initramfs-lts $home/vmlinuz-lts 'console=ttyS0,115200 root=/dev/vda3 rootfstype=ext4 psmouse.proto=bare clocksource=kvm-clock'
-#$home/killvmx.rc
+switch($1){
 
-/bin/vmx -w text -x 2 -n /net/ether0 -M 1024M -d $home/linux.img -m $home/initramfs-lts $home/vmlinuz-lts 'console=tty0,115200 root=/dev/vda3 rootfstype=ext4 psmouse.proto=bare'
-$home/killvmx.rc
+case alpineinstall
+	echo 'Downloading alpine...'
+    hget https://dl-cdn.alpinelinux.org/alpine/v3.23/releases/x86_64/alpine-extended-3.23.2-x86_64.iso > alpine.iso
+	echo 'Mounting iso...'
+	9660srv 
+	mount /srv/9660 /n/9660 alpine.iso 
+	echo 'Copying initramfs/vmlinuz...'
+	cat /n/9660/boot/initramfs-lts > initramfs-lts
+	cat /n/9660/boot/vmlinuz-lts > vmlinuz-lts
+	echo 'Creating disk...'
+	dd -if /dev/zero -of disk.img -bs 1 -count 1 -seek 5368709119
+	echo 'Booting the virtual machine'
+	vmx -w text $args -n /net/ether0 -M 1024M -d alpine.iso -d disk.img -m initramfs-lts vmlinuz-lts 'console=tty0,115200'
 
-#vmx -w 1024x768 -M 1G /amd64/9pc64
-#vmx -w 1024x768 -M 1G -d $home/obsd.img $home/bsd.mp 
+case alpinerun
+	vmx -w text $args -n /net/ether0 -M 1024M -d disk.img -m initramfs-lts vmlinuz-lts 'console=tty0,11520 root=/dev/vda3 rootfstype=ext4'
 
-#vmx -D -n /net/ether0 -w 1024x768 -M 1024M -d /sys/src/cmd/vmx/install.iso /amd64/9pc64  '*apicdebug=1 mouseport=ps2' >[2] out_vga
-#$home/killvmx.rc
+case *
+    echo 'usage: script [alpineinstall|alpinerun]'
+}
 
-#vmx -w text -n /net/ether0 -d /sys/src/cmd/vmx/install.iso -M 1024M /amd64/9pc64 '*apicdebug=1 mouseport=ps2' >[2] out_cons
-#$home/killvmx.rc
-#vmx -C /dev/text /amd64/9pc64 'console=1 b115200' 
\ No newline at end of file
+kill vmx | rc
+
+font=$oldfont
\ No newline at end of file
--- a/vmtime.c
+++ /dev/null
@@ -1,19 +1,0 @@
-/*
- * vmtime.c - Unified VM timing for vmx
- */
-
-#include <u.h>
-#include <libc.h>
-#include <tos.h>
-#include <thread.h>
-#include "dat.h"
-#include "fns.h"
-
-static uvlong tsc_freq; 
-static int initialized;
-
-extern vlong cached_tscoff;
- 
-
-
- 
--