ok, i checked the OSFAQ and followed all instruction and did the osdever sample c. and it just put weird symbles on all of my computers.
;==P and then the pi symble is what was displayed when it was supose to be "Hello Booting....Done"
need help with text in pmode
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
Re:need help with text in pmode
What compiler and linker options did you use, and what does a small code snipplet of the printing routines look like?
It sounds like the "Hello Booting.. Done" string is being stored in what is called the data section of the ELF32. The linker normaly gets told where the text, data, and other sections will be so it creates hard links instead of using position independant code that would instead create a relative link such as a relative to the current EIP. If the data section is instead loaded somewhere else you can end up with that problem. This is also just one of many possible problems, but it is the first I would check.
A possible solution could be to use a linker script such as in this post.
http://www.mega-tokyo.com/forum/index.p ... adid=10144
It sounds like the "Hello Booting.. Done" string is being stored in what is called the data section of the ELF32. The linker normaly gets told where the text, data, and other sections will be so it creates hard links instead of using position independant code that would instead create a relative link such as a relative to the current EIP. If the data section is instead loaded somewhere else you can end up with that problem. This is also just one of many possible problems, but it is the first I would check.
A possible solution could be to use a linker script such as in this post.
http://www.mega-tokyo.com/forum/index.p ... adid=10144
Re:need help with text in pmode
im using FASM, and DJGPP with link.ld. FASM is just for the int 10h and boot code. DJGPP for the K_PRINT functin and K_MAIN function.
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
Re:need help with text in pmode
http://www.mega-tokyo.com/osfaq/How%20d ... %20my%20OS
Make the kernel print the address of the string you are trying to display. Check that with the kernel image. See if it is trying to load something outside of the kernel image or from the wrong place.
Use objdump or whatever program you have to dump out the sections and find where the string is stored and use that to debug it.
Make the kernel print the address of the string you are trying to display. Check that with the kernel image. See if it is trying to load something outside of the kernel image or from the wrong place.
Use objdump or whatever program you have to dump out the sections and find where the string is stored and use that to debug it.
Re:need help with text in pmode
here is my code:
all i added was k_main
Code: Select all
K_main()
{
???k_print(0x07, ?Hello Booting....Done?);
???for(;;);
}
k_print(int colour, char *string)
{
char *video=(char*)0xB8000;
while(*string!=0)
{
*video=*string;
string++;
video++;
*video=colour;
video++;
}
}
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
Re:need help with text in pmode
Check the linker script, or how you specify the physical address of the data section.
If you use an a-out kludge check the address fields of the Multiboot header.
http://www.gnu.org/software/grub/manual ... cification
Try writting some code to do a binary search in memory for the string, then write a routine to print the address pointed to by "Hello Booting..Done", see if they match up or do not.
char *str = "Hello Booting..Done";
k_printnum((unsigned int)str);
Find 'h' 'e' 'l' 'l' 'o' in memory, print address.
If you use an a-out kludge check the address fields of the Multiboot header.
http://www.gnu.org/software/grub/manual ... cification
Try writting some code to do a binary search in memory for the string, then write a routine to print the address pointed to by "Hello Booting..Done", see if they match up or do not.
char *str = "Hello Booting..Done";
k_printnum((unsigned int)str);
Find 'h' 'e' 'l' 'l' 'o' in memory, print address.