mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2025-12-23 22:47:55 -05:00
restructure build scripts
This commit is contained in:
27
README.md
27
README.md
@@ -66,12 +66,10 @@ x86) before running on bare metal.
|
||||
## Building and Running
|
||||
|
||||
### Prerequisites
|
||||
You will need QEMU for aarch64 emulation, dosfstools to create the virtual file system
|
||||
and gcc-aarch64-linux-gnu to compile bash for the image.
|
||||
You will need QEMU for aarch64 emulation and dosfstools to create the virtual file system.
|
||||
|
||||
```bash
|
||||
# Install QEMU (Ubuntu/Debian), dosfstools and gcc-aarch64-linux-gnu
|
||||
sudo apt install qemu-system-aarch64 dosfstools gcc-aarch64-linux-gnu
|
||||
sudo apt install qemu-system-aarch64 dosfstools
|
||||
```
|
||||
|
||||
Additionally you will need a version of the [aarch64-none-elf](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) toolchain installed.
|
||||
@@ -87,6 +85,27 @@ Run the following command
|
||||
nix shell nixpkgs#pkgsCross.aarch64-embedded.stdenv.cc nixpkgs#pkgsCross.aarch64-embedded.stdenv.cc.bintools
|
||||
```
|
||||
|
||||
### Preparing the image
|
||||
|
||||
First, run the following script to prepare the binaries for the image:
|
||||
```bash
|
||||
./scripts/build-deps.sh
|
||||
```
|
||||
|
||||
This will download and build the necessary dependencies for the kernel and put them
|
||||
into the `build` directory.
|
||||
|
||||
Once that is done, you can create the image using the following command:
|
||||
```bash
|
||||
sudo ./scripts/create-image.sh
|
||||
```
|
||||
|
||||
This will create an image file named `moss.img` in the root directory of the project,
|
||||
format it as VFAT 32 and create the necessary files and directories for the kernel.
|
||||
|
||||
This script needs to run with sudo to mount the image through a loop device,
|
||||
which is required to properly create the image for the kernel to work.
|
||||
|
||||
### Running via QEMU
|
||||
|
||||
To build the kernel and launch it in QEMU:
|
||||
|
||||
Reference in New Issue
Block a user