-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·59 lines (47 loc) · 1.88 KB
/
run.sh
File metadata and controls
executable file
·59 lines (47 loc) · 1.88 KB
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
#!/bin/bash
# AetherOS Build and Run Script
set -e
echo "=== Building Guest (aarch64) ==="
cd apps/hello_world
RUSTFLAGS="-C link-arg=-T$(pwd)/layout.ld -C link-arg=-n" cargo build --release --target aarch64-unknown-none
cd ../..
rust-objcopy -O binary target/aarch64-unknown-none/release/hello_world apps/hello_world/guest-aarch64.bin
echo "=== Building Guest (x86_64) ==="
cd apps/hello_world
# x86_64 shares the same layout.ld for flat binary
RUSTFLAGS="-C link-arg=-T$(pwd)/layout.ld -C link-arg=-n -C no-redzone=yes" cargo build --release --target x86_64-unknown-none
cd ../..
rust-objcopy -O binary target/x86_64-unknown-none/release/hello_world apps/hello_world/guest-x86_64.bin
ls -lh apps/hello_world/guest-*.bin
echo "=== Building WASM Test App ==="
cd apps/wasm_simple
cargo build --release --target wasm32-unknown-unknown
cd ../..
wasm_path="target/wasm32-unknown-unknown/release/wasm_simple.wasm"
echo "=== Creating Disk Image (with WASM) ==="
cargo run --release -p mkext2 -- "$wasm_path"
echo "=== Building Kernel ==="
# We default to aarch64 guest on aarch64 host for now in macos.rs
cargo build --release -p aether
# 3. Sign & Run (Platform Specific)
OS="$(uname -s)"
if [ "$OS" = "Darwin" ]; then
echo "=== Signing Kernel (macOS) ==="
codesign --entitlements kernel/entitlements.plist --force -s - target/release/aether
echo "=== Running AetherOS (macOS) ==="
./target/release/aether
elif [ "$OS" = "Linux" ]; then
echo "=== Running AetherOS (Linux) ==="
if [ -w /dev/kvm ]; then
./target/release/aether
else
echo "Warning: /dev/kvm is not writable. Trying sudo..."
sudo ./target/release/aether
fi
elif [[ "$OS" == CYGWIN* || "$OS" == MINGW* || "$OS" == MSYS* ]]; then
echo "=== Running AetherOS (Windows) ==="
./target/release/aether.exe
else
echo "Unknown OS: $OS. Attempting to run..."
./target/release/aether
fi