-
Notifications
You must be signed in to change notification settings - Fork 98
/
run_tui.ps1
74 lines (65 loc) · 1.4 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
62
63
64
65
66
67
68
69
70
71
72
73
74
$HCPU = "x86_64"
$HABI = "WIN64"
$HOS = "Windows"
$dir = Get-Location
. "$dir\funcs.ps1"
#################################################
#
# start of header
#
#################################################
$use_em = $FALSE;
$ncpu = 10;
$bcpu = 0;
$showhelp = $FALSE;
$front = $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 ++;
}
elseif ( $marg -eq '-f'){
$front = $TRUE;
}
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 $cpu $lcpu $links
}
boot_cpu_tui $front $cpu "$links"
}
}