I made a kernel called kernel_cpp.cpp
I use:
set DJGPP=C:\DJGPP\DJGPP.ENV
set PATH=C:\DJGPP\BIN;%PATH%
nasm -f aout kernel.asm -o kernel.o
gxx -c kernel_cpp.cpp -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions
ld -T link.ld -o kernel.bin kernel.o kernel_cpp.o
copy kernel.bin A:\kernel.bin
to compile it,but grub does not run it. Is the top the correct and how can you build bin files for grub.
C++ Kernel and Grub
-
Mr_Spam
Re:C++ Kernel and Grub
I think that u have to put in a multi-boot header into the start of the kernel? i'm not sure.
-
FireDemon
Re:C++ Kernel and Grub
I did that and it still keeps giving me:
Booting 'Simplified OS'
root (fd0)
Filesystem type is fat, using whole disk
kernel /kernel.bin
Error 13: Invalid or unsupported executable format
Press any key to continue...
Booting 'Simplified OS'
root (fd0)
Filesystem type is fat, using whole disk
kernel /kernel.bin
Error 13: Invalid or unsupported executable format
Press any key to continue...
Re:C++ Kernel and Grub
you can create a flat binary file with ld --oformat binary etc. read the grub tutorial at;
http://osdev.berlios.de/grub.html#multiboot
scroll down to yo see the heading
DJGPP COFF kernels and other file formats
http://osdev.berlios.de/grub.html#multiboot
scroll down to yo see the heading
DJGPP COFF kernels and other file formats
-- Stu --
-
FireDemon
Re:C++ Kernel and Grub
I fixed the problem.
The main reason was that the global variables made an offset to the main function.
;D >:(
??? ::)
:-[ :-X :-\ :-* :'(
The main reason was that the global variables made an offset to the main function.
