Added mock rootfs
parent
cb8fe6ed34
commit
f43637b726
1
Makefile
1
Makefile
|
@ -24,4 +24,5 @@ qemu: $(BUILD_DIR)/bios.img
|
||||||
-cpu host \
|
-cpu host \
|
||||||
-drive file="$<",format=raw
|
-drive file="$<",format=raw
|
||||||
|
|
||||||
|
include make/filesystem
|
||||||
include make/bios
|
include make/bios
|
|
@ -46,11 +46,12 @@ $(BUILD_DIR)/bios.bin: $(wildcard $(BIOS_SRC)/*.asm) $(BUILD_DIR)/bios.elf
|
||||||
"$(BIOS_SRC)/main.asm"
|
"$(BIOS_SRC)/main.asm"
|
||||||
|
|
||||||
# Build demo disk image
|
# Build demo disk image
|
||||||
$(BUILD_DIR)/bios.img: $(BUILD_DIR)/bios.bin
|
$(BUILD_DIR)/bios.img: $(BUILD_DIR)/bios.bin $(BUILD_DIR)/filesystem.img
|
||||||
rm -f "$@.partial"
|
rm -f "$@.partial"
|
||||||
fallocate -l 256MiB "$@.partial"
|
fallocate -l 256MiB "$@.partial"
|
||||||
parted -s -a minimal "$@.partial" mklabel msdos
|
parted -s -a minimal "$@.partial" mklabel msdos
|
||||||
parted -s -a minimal "$@.partial" mkpart primary 2MiB 100%
|
parted -s -a minimal "$@.partial" mkpart primary 2MiB 100%
|
||||||
dd if="$<" of="$@.partial" bs=1 count=512 conv=notrunc
|
dd if="$<" of="$@.partial" bs=1 count=512 conv=notrunc
|
||||||
dd if="$<" of="$@.partial" bs=512 skip=1 seek=1 conv=notrunc
|
dd if="$<" of="$@.partial" bs=512 skip=1 seek=1 conv=notrunc
|
||||||
|
dd if="$(BUILD_DIR)/filesystem.img" of="$@.partial" bs=1MiB seek=2 conv=notrunc
|
||||||
mv "$@.partial" "$@"
|
mv "$@.partial" "$@"
|
|
@ -0,0 +1,13 @@
|
||||||
|
$(BUILD_DIR)/filesystem:
|
||||||
|
@mkdir -p $(BUILD_DIR)
|
||||||
|
rm -f $@.partial
|
||||||
|
mkdir $@.partial
|
||||||
|
fallocate -l 1MiB $@.partial/kernel
|
||||||
|
mv $@.partial $@
|
||||||
|
|
||||||
|
$(BUILD_DIR)/filesystem.img: $(BUILD_DIR)/filesystem
|
||||||
|
@mkdir -p $(BUILD_DIR)
|
||||||
|
rm -f $@.partial
|
||||||
|
fallocate -l 254MiB $@.partial
|
||||||
|
redoxfs-ar $@.partial $<
|
||||||
|
mv $@.partial $@
|
Loading…
Reference in New Issue