-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·40 lines (31 loc) · 750 Bytes
/
Copy pathrun.sh
File metadata and controls
executable file
·40 lines (31 loc) · 750 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
40
#! /usr/bin/bash
KSRC_DIR="leos-kernel"
ARCH_TARGET="x86-leos-kernel"
K_NAME="leos-kernel"
BOOT_DIR="leos-boot"
IMG_NAME="kernel.img"
HOST="mac"
MKBOOTIMG=$BOOT_DIR/mkbootimg-$HOST
# compile the kernel
cd $KSRC_DIR
cargo b
if [ $? -ne 0 ]; then
echo "Cargo error."
exit 1
fi
cd ..
# remove old kernel binary
rm $BOOT_DIR/initrd/$K_NAME
# move the kernel to initrd
mv target/$ARCH_TARGET/debug/$K_NAME $BOOT_DIR/initrd/
if [ $? -ne 0 ]; then
echo "error moving kernel"
exit 1
fi
# make the acutal boot image
$MKBOOTIMG $BOOT_DIR/leos.json $BOOT_DIR/$IMG_NAME
if [ $? -ne 0 ]; then
echo "error creating boot image"
exit 1
fi
qemu-system-x86_64 $BOOT_DIR/$IMG_NAME -debugcon stdio # -smp 2 # smp = multicore and the amount of cores