shithub: 9scripts

Download patch

ref: 7923e9afe0182b0a723e80f93b0eec30020549ca
parent: 69ecee789dbd0ca7c637cd27e97a64c998dd47f6
author: glenda <glenda@9front.local>
date: Thu Feb 25 16:53:50 EST 2021

added script

--- /dev/null
+++ b/util/fscale
@@ -1,0 +1,38 @@
+#!/bin/rc
+# by mischief
+
+fn x86_speed {
+	if(! io -wM 0x19A $1 >[2]/dev/null){
+		echo unsupported processor
+		exit unsupported
+	}
+}
+
+fn x86_slow {
+	x86_speed 0x12
+}
+
+fn x86_fast {
+	x86_speed 0x0
+}
+
+arch=()
+
+switch $objtype {
+case 386 amd64
+	arch=x86
+case *
+	echo unsupported architecture
+	exit unsupported
+}
+
+switch $1 {
+case off
+	$arch^_slow
+case on
+	$arch^_fast
+case *
+	echo invalid mode
+	exit invalid
+}
+