Commit fb5185cd authored by Jeremy Soller's avatar Jeremy Soller

Merge branch 'master' into 'master'

Add optional and backwards-compatible MBR support in the bootloader

See merge request redox-os/redox!1227
parents d5dd998b f6276291
Pipeline #6813 failed with stage
in 8 minutes and 19 seconds
......@@ -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
......
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment