-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
51 lines (42 loc) · 1.21 KB
/
build.sh
File metadata and controls
51 lines (42 loc) · 1.21 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
#!/bin/bash
# Modern build script for UNIA OS v2.0
set -e
echo "Building UNIA OS v2.0..."
# Ensure we have the right Rust toolchain
rustup default nightly
rustup update nightly
rustup component add rust-src --toolchain nightly
rustup component add llvm-tools-preview --toolchain nightly
rustup target add x86_64-unknown-none
# Install required tools
cargo install bootimage
cargo install cargo-xbuild
# Build kernel
echo "Building kernel..."
cd kernel
RUSTFLAGS="-C link-arg=-nostartfiles" cargo bootimage --target x86_64-unknown-none
# Create bootable image
echo "Creating bootable image..."
cp target/x86_64-unknown-none/debug/bootimage-unia-kernel.bin ../unia-os.bin
# Create QEMU launch script
cat > ../run_unia.sh << 'EOF'
#!/bin/bash
qemu-system-x86_64 \
-accel tcg \
-cpu qemu64 \
-m 512M \
-smp cores=4 \
-drive format=raw,file=unia-os.bin \
-vga std \
-device isa-debug-exit,iobase=0xf4,iosize=0x04 \
-device e1000,netdev=net0 \
-netdev user,id=net0 \
-audiodev coreaudio,id=snd0 \
-device intel-hda \
-device hda-duplex,audiodev=snd0 \
-serial stdio \
-no-reboot \
-no-shutdown
EOF
chmod +x ../run_unia.sh
echo "Build complete! Run ./run_unia.sh to start UNIA OS"