File tree Expand file tree Collapse file tree 2 files changed +11
-22
lines changed
Expand file tree Collapse file tree 2 files changed +11
-22
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,11 @@ x86) before running on bare metal.
6666## Building and Running
6767
6868### Prerequisites
69- You will need QEMU for aarch64 emulation and dosfstools to create the virtual file system.
69+ You will need QEMU for aarch64 emulation, dosfstools and mtools to create the
70+ virtual file system.
7071
7172``` bash
72- sudo apt install qemu-system-aarch64 dosfstools
73+ sudo apt install qemu-system-aarch64 dosfstools mtools
7374```
7475
7576Additionally you will need a version of the [ aarch64-none-elf] ( https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain ) toolchain installed.
@@ -100,14 +101,12 @@ into the `build` directory.
100101
101102Once that is done, you can create the image using the following command:
102103``` bash
103- sudo ./scripts/create-image.sh
104+ ./scripts/create-image.sh
104105```
105106
106- This will create an image file named ` moss.img ` in the root directory of the project,
107- format it as VFAT 32 and create the necessary files and directories for the kernel.
108-
109- This script needs to run with sudo to mount the image through a loop device,
110- which is required to properly create the image for the kernel to work.
107+ This will create an image file named ` moss.img ` in the root directory of the
108+ project, format it as VFAT 32 and create the necessary files and directories for
109+ the kernel.
111110
112111### Running via QEMU
113112
Original file line number Diff line number Diff line change @@ -5,23 +5,13 @@ base="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd )"
55pushd " $base " & > /dev/null || exit 1
66
77img=" $base /moss.img"
8- mount=" $base /build/mount"
9-
10- mkdir -p " $mount "
118
129dd if=/dev/zero of=" $img " bs=1M count=128
1310mkfs.vfat -F 32 " $img "
1411
15- if ! mountpoint -q " $mount " ; then
16- mount -o loop " $img " " $mount "
17- fi
18-
19- mkdir -p " $mount /bin"
20- mkdir -p " $mount /dev"
12+ mmd -i " $img " ::/bin
13+ mmd -i " $img " ::/dev
2114
22- cp " $ base /build/bin" /* " $mount /bin"
15+ mcopy -i " $img " " $ base /build/bin" /* " :: /bin"
2316
24- if mountpoint -q " $mount " ; then
25- umount " $mount "
26- fi
27- popd & > /dev/null || exit 1
17+ popd & > /dev/null || exit 1
You can’t perform that action at this time.
0 commit comments