-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompile_and_run.sh
More file actions
39 lines (32 loc) · 916 Bytes
/
compile_and_run.sh
File metadata and controls
39 lines (32 loc) · 916 Bytes
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
#!/bin/bash
echo "==================================="
echo "Virtual Memory Manager - Build Script"
echo "==================================="
# Compile main program
echo "Compiling vmm.c..."
gcc -o vmm vmm.c -lm -w
if [ $? -ne 0 ]; then
echo "Error: Failed to compile vmm.c"
exit 1
fi
echo "Successfully compiled vmm"
# Create programs directory if it doesn't exist
mkdir -p programs
# Check if config.txt exists
if [ ! -f config.txt ]; then
echo "Creating default config.txt..."
echo "64" > config.txt
echo "4" >> config.txt
echo "Created config.txt with 64KB memory and 4KB pages"
fi
echo ""
echo "==================================="
echo "Running Virtual Memory Manager..."
echo "==================================="
echo ""
# Run the program
./vmm
echo ""
echo "==================================="
echo "Done! Check visualization.html"
echo "==================================="