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
moving away from GRUB
- kenneth_phough
- Member
- Posts: 106
- Joined: Sun Sep 18, 2005 11:00 pm
- Location: Williamstown, MA; Worcester, MA; Yokohama, Japan
- Contact:
I found this:
http://www.osdev.org/phpBB2/viewtopic.p ... +truncated
when searching for "relocation AND truncated".
HTH
http://www.osdev.org/phpBB2/viewtopic.p ... +truncated
when searching for "relocation AND truncated".
HTH
- kenneth_phough
- Member
- Posts: 106
- Joined: Sun Sep 18, 2005 11:00 pm
- Location: Williamstown, MA; Worcester, MA; Yokohama, Japan
- Contact:
Should have searched the error msg...
Thanks a bunch!
But now I've encountered a new question...
What I am trying to do is create an asm file called kernel_ent.asm that will change the VGA monitor mode to 320x200 graphics then enable A20, load a temporary GDT and finally enter Pmode and doing a far jump to kmain();. However, if I have the first couple of lines in kernel_ent.asm work in a 16bit real mode but the rest in pmode do I still need to modify the linker script to work in real mode? And would that mean that once the OS is loaded in real mode and I move to pmode I would need to dynamically relocate the kernel to a higher memory?
Also the bootstrap load kernel.bin at 0x100000.
Thanks in advance,
Kenneth
Thanks a bunch!
But now I've encountered a new question...
What I am trying to do is create an asm file called kernel_ent.asm that will change the VGA monitor mode to 320x200 graphics then enable A20, load a temporary GDT and finally enter Pmode and doing a far jump to kmain();. However, if I have the first couple of lines in kernel_ent.asm work in a 16bit real mode but the rest in pmode do I still need to modify the linker script to work in real mode? And would that mean that once the OS is loaded in real mode and I move to pmode I would need to dynamically relocate the kernel to a higher memory?
Also the bootstrap load kernel.bin at 0x100000.
Thanks in advance,
Kenneth
- kenneth_phough
- Member
- Posts: 106
- Joined: Sun Sep 18, 2005 11:00 pm
- Location: Williamstown, MA; Worcester, MA; Yokohama, Japan
- Contact: