Problem with my custom boot loader, tried everything
Posted: Thu May 04, 2023 7:10 am
When I use my boot loader inline strings(char pointers) don't work, same with global variables
I've seen this issue with grub here https://stackoverflow.com/questions/186 ... e-accessed at stack overflow
but it does not work for me
I tried everything
What i know:
- pointers are pointing to a wrong memory address
- this only occurs when I use my own boot loader, it does not when I use qemu with -kernel flag
- probably something wrong with the linker
What I don't know is how to fix it
To reproduce run make
os does print "OS booted successfully", but only because it is stored in a char array, and not an inline string
those hex values are:
first one is a test if the function does it's thing - it should be 0x79F
second is the memory address of a char pointer, which is not pointing where it should
and the last one is where the rodata section starts, according to linker
I'm new to os development and c++ development (previously wrote mainly in c#), so please question every line of code I wrote
code available here: https://github.com/imicz-a/MyOs
Thanks for your help
I've seen this issue with grub here https://stackoverflow.com/questions/186 ... e-accessed at stack overflow
but it does not work for me
I tried everything
What i know:
- pointers are pointing to a wrong memory address
- this only occurs when I use my own boot loader, it does not when I use qemu with -kernel flag
- probably something wrong with the linker
What I don't know is how to fix it
To reproduce run make
os does print "OS booted successfully", but only because it is stored in a char array, and not an inline string
those hex values are:
first one is a test if the function does it's thing - it should be 0x79F
second is the memory address of a char pointer, which is not pointing where it should
and the last one is where the rodata section starts, according to linker
I'm new to os development and c++ development (previously wrote mainly in c#), so please question every line of code I wrote
code available here: https://github.com/imicz-a/MyOs
Thanks for your help