Compare commits

..

3 Commits

Author SHA1 Message Date
Jeremy Soller fb5185cdd5 Merge branch 'master' into 'master'
Add optional and backwards-compatible MBR support in the bootloader

See merge request redox-os/redox!1227
2020-01-14 13:34:59 +00:00
4lDO2 f6276291ae Add the somehow-deleted qemu_no_build. 2020-01-14 21:56:09 +11:00
4lDO2 a66af97a99 Add make recipes for MBR-partitioned BIOS disks. 2020-01-14 21:50:16 +11:00
2 changed files with 21 additions and 0 deletions

View File

@ -5,6 +5,17 @@ build/bootloader: bootloader/$(ARCH)/**
build/harddrive.bin: build/filesystem.bin bootloader/$(ARCH)/**
nasm -f bin -o $@ -D ARCH_$(ARCH) -D FILESYSTEM=$< -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm
build/harddrive-mbr.bin: build/filesystem.bin bootloader/$(ARCH)/**
# TODO: Determine the correct size
nasm -f bin -o build/bootsector.bin -D ARCH_$(ARCH) -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm
dd if=/dev/zero of=$@.partial bs=1M count=384
parted -s -a minimal $@.partial mklabel msdos
parted -s -a minimal $@.partial mkpart primary 2048s 786431s
dd if=build/bootsector.bin of=$@.partial bs=1 count=446 conv=notrunc
dd if=build/bootsector.bin of=$@.partial bs=512 skip=1 seek=1 conv=notrunc
dd if=$< of=$@.partial bs=1M seek=1 conv=notrunc
mv $@.partial $@
build/livedisk.bin: build/kernel_live bootloader/$(ARCH)/**
nasm -f bin -o $@ -D ARCH_$(ARCH) -D KERNEL=$< -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm

View File

@ -57,6 +57,16 @@ qemu_no_build: build/extra.bin
-drive file=build/harddrive.bin,format=raw \
-drive file=build/extra.bin,format=raw
qemu_mbr: build/harddrive-mbr.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/harddrive-mbr.bin,format=raw \
-drive file=build/extra.bin,format=raw
qemu_mbr_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/harddrive-mbr.bin,format=raw \
-drive file=build/extra.bin,format=raw
qemu_efi: build/harddrive-efi.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-bios /usr/share/OVMF/OVMF_CODE.fd \