-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck_boot.sh
More file actions
executable file
·32 lines (26 loc) · 820 Bytes
/
Copy pathcheck_boot.sh
File metadata and controls
executable file
·32 lines (26 loc) · 820 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
#!/bin/bash
# Check boot sector size and signature
echo "Checking boot sector..."
if [ ! -f boot.bin ]; then
echo "Error: boot.bin not found. Run 'make' first."
exit 1
fi
size=$(stat -c%s boot.bin)
echo "Boot sector size: $size bytes"
if [ $size -eq 512 ]; then
echo "✓ Boot sector is exactly 512 bytes"
else
echo "✗ Boot sector should be 512 bytes, but is $size bytes"
fi
# Check boot signature (bytes 511-512 should be 0x55 0xAA)
echo -n "Boot signature (bytes 511-512): "
tail -c 2 boot.bin | hexdump -C | head -1
# Check if signature is correct
if tail -c 2 boot.bin | hexdump -C | grep -q "55 aa"; then
echo "✓ Boot signature is correct (0x55 0xAA)"
else
echo "✗ Boot signature is incorrect"
fi
echo ""
echo "Boot sector content (first 64 bytes):"
hexdump -C boot.bin | head -5