Okay, I have a simple (one assembly source file) kernel image for GRUB to boot, but it's telling me it's not a valid executable format! I'm compiling with NASM with an output of flat binary. I have a Multiboot header (just the required values). Here is my one assembly file
Code: Select all
[BITS 32]
%include "grub.inc"
start:
cli ; Block interrupts (they can awaken the CPU from halt!)
hlt ; Halt the CPU
ALIGN 4
mboot:
dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd MULTIBOOT_CHECKSUM
Here is "grub.inc"
Code: Select all
MULTIBOOT_PAGE_ALIGN equ 1<<0
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
Code: Select all
nasm -f bin -o kernel.bin ./kernel_entry.asm
I use qemu to boot the hdd with this call:
Code: Select all
qemu -hda ./SimpleKernel.hdd -m 128 "$@"
once in grub, I type "kernel /boot/kernel.bin" and I get this message:
I am using grub v0.97 (yes I know, it's old, but I had it laying around, and it was simple to install )Error 13: Invalid or unsupported executable format
Any help would be greatly appreciated!
Thanks,
Caleb