技术解析
我抄了 nongnu.askapache.com/grub/phcoder/multiboot.pdf 里面的 kernel ,然后:
i686-elf-gcc -c boot.S -march=i386
i686-elf-gcc -c kernel.c -march=i386
i686-elf-gcc boot.o kernel.o -o kernel -march=i386 -nostartfiles -nodefaultlibs
qemu-system-i386 kernel
结果报错说:
WARNING: Image format was not specified for 'kernel' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
是 pdf 里面的代码有什么问题吗,链接顺序错了,还是 qemu 不能当 bootloader ?