Hello. I am trying to print some text with my bootloader and my kernel written in C (loaded at 0x7e00) but it doesn't print the whole text. However, if I declare the following char* and fill it with some text and print all the characters inside it one by one, it works but it's not very practical:
Code:
char* message = (char*)0x80000;
It makes me think it's a memory related issue and I am unsure how I can fix it. I read a post on reddit made by a person with the same problem as me and one of the replies said the .text section is fully loaded:
Quote:
If it’s getting through any one of the function calls correctly, then .text is probably fully loaded, at least. Is the entire string there? Try pooping the second-to-last byte out into Bochs’ debug port before writing, and see if it matches the character it should. Idunno how it’s arranged pre-load, but .rodata usually comes after .text so that and .data would be the last things to load. You’re (oddly) not using .data to preinitialize your VGA stuff (all those init values are compile-time-constant), so you’ve lost one potential canary there. I’d also put a magic value within your image at the very end, and have the loader place one just after it. Then you can check that both sync up with what they should be, = you’re reasonably sure your entire kernel has loaded.
Here is my source code:
https://hastebin.com/ehogozibuc.cpp Kernel's main file
https://hastebin.com/emuhexaqob.cpp video.c (functions to play with video memory)
https://hastebin.com/tacavorolu.sql Bootloader
https://hastebin.com/fudowoyude Linker script
Any thoughts or suggestions? Sorry if this is a noobish question, I just started learning this kind of thing. Thanks in advance