In the final step i am not able to run my ISO image on QEMU, but have no problems when just running the kernel.
I have been running this code on windows the WSL (Windows Sub-system for Linux) with no other issues. No errors appear when running the grub-mkrescue command and same with QEMU.
When launching the ISO in QEMU, I get the booting from CD/DVD text, and it goes straight to the grub minimal bash. The code is exactly the same as the Bare Bones tutorial, with compilations through a Makefile listed here:
Code: Select all
SRCDIR := src
TMPDIR := tmp
BINDIR := bin
ISODIR := iso
COMPILER := cross/bin/i686-elf
myos.iso: myos.bin
@sudo grub-mkrescue -o $(BINDIR)/myos.iso $(ISODIR)
myos.bin: kernel.o boot.o
@$(COMPILER)-gcc -T $(SRCDIR)/linker.ld -o $(BINDIR)/myos.bin -ffreestanding -O2 -nostdlib $(TMPDIR)/boot.o $(TMPDIR)/kernel.o -lgcc
@cp $(BINDIR)/myos.bin $(ISODIR)/boot/myos.bin
@grub-file --is-x86-multiboot $(BINDIR)/myos.bin
boot.o:
@$(COMPILER)-as $(SRCDIR)/boot.s -o $(TMPDIR)/boot.o
kernel.o:
@$(COMPILER)-gcc -c $(SRCDIR)/kernel.c -o $(TMPDIR)/kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra
# if you want C++ instead; uncomment this
# i686-elf-g++ -c kernel.cpp -o kernel.o -ffreestanding -O2 -Wall -Wextra -fno-exceptions -fno-rtti
.PHONY: clean q qw
qw:
qemu-system-i386 -kernel $(ISODIR)/boot/myos.bin
q:
qemu-system-i386 -cdrom $(BINDIR)/myos.iso
clean:
rm -rf $(TMPDIR)/*I have installed grub-pc-bin many times.
Is WSL the correct option for a windows user, or should I be taking a different approach.

