moving away from GRUB
Posted: Tue Mar 27, 2007 12:19 am
A member on our dev team developed a FAT12 bootstrap which will load our kernel in real mode, so I decided to merge the second boot strap with the kernel's kernel entry which was formerly designed for GRUB. So I got rid of the multiboot header and added code to enable the A20 gate and enter pmode (also loading a temporary GDT which will be modified later on) however when i compiled and linked everything and loaded it on to a floppy image and tried it on Bochs the kernel.bin was loaded but nothing happened after that. I did a little debuging and found out that every thing up to enabling the A20 gate seems to work fine but I can't check its normal operation after that.
So I decided to make a test kernel entry file that will just print helloworld on to the screen and it work..fwew!
So I decided to link that with the rest of the kenrel files nowing that what should happen is that "hello world" would be printed on screen but nothing else will happen. I was wrong...I couldn't get it to link. Found out that my link.ld script doesn't allow (I'm lost at this point so I might not make sense but..) the following in my kernel entry code:
SECTION .data
hello db 'hello world'
I am compiling the asm file as follows:
nasm -f aout kernel_ent -o kernel_ent.o
aout so I can link it.
The script links it so the output is binary and the kernel will be loaded at 1MB.
I get the following error when I link the files:
relocation truncated to fit: 16 against '.data'
what do I need to add to my script to fix this problem.
Thanks in advance
Yours,
Kenneth
So I decided to make a test kernel entry file that will just print helloworld on to the screen and it work..fwew!
So I decided to link that with the rest of the kenrel files nowing that what should happen is that "hello world" would be printed on screen but nothing else will happen. I was wrong...I couldn't get it to link. Found out that my link.ld script doesn't allow (I'm lost at this point so I might not make sense but..) the following in my kernel entry code:
SECTION .data
hello db 'hello world'
I am compiling the asm file as follows:
nasm -f aout kernel_ent -o kernel_ent.o
aout so I can link it.
The script links it so the output is binary and the kernel will be loaded at 1MB.
I get the following error when I link the files:
relocation truncated to fit: 16 against '.data'
what do I need to add to my script to fix this problem.
Thanks in advance
Yours,
Kenneth