-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy pathrun_tui.ps1
61 lines (53 loc) · 1.13 KB
/
run_tui.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
$dir = Get-Location
. "$dir\funcs.ps1"
$use_em = $FALSE;
$ncpu = 8;
$bcpu = 0;
$showhelp = $FALSE;
for ($count = 0 ; $count -lt $args.count ; $count ++ ){
$marg = $args[$count]
if ( $marg -eq '-e'){
$use_em = $TRUE;
}
elseif ( $marg -eq '-n'){
$ncpu = $args[$count+1];
$count ++;
}
elseif ( $marg -eq '-b'){
$bcpu = $args[$count+1];
$count ++;
}
else {
$showhelp = $TRUE;
}
}
if ( $use_em -eq $TRUE ){
$HCPU = "vp64"
$HABI = "VP64"
$HOS = "Windows"
}
if ( $bcpu -eq 0 ){
. "$dir\stop.ps1"
}
if ( $ncpu -gt 16){
$ncpu = 16
}
if ( $showhelp -eq $TRUE ){
Write-Output "[-n cnt] number of nodes";
Write-Output "[-b base] base offset";
Write-Output "[-e] emulator mode";
Write-Output "[-h] help";
}
else {
$cpus = $ncpu;
for ($cpu = $cpus - 1; $cpu -ge 0; $cpu--){
$links=""
for ($lcpu = 0; $lcpu -lt $cpus; $lcpu++)
{
$c1 = zero_pad $cpu
$c2 = zero_pad $lcpu
$links += add_link $c1 $c2 $links
}
boot_cpu_tui $cpu "$links"
}
}