Hello.
I write MMU and in order not to damage the kernel when managing memory, I try to find the beginning and end of the kernel in memory.
And I would like to know if I'm doing everything right.
In my linker script, I declared startkernel and endkernel, did I place them correctly?
In the kmain() code, I output the values of these variables to serial.log(I output debugging information there), but I get huge addresses and it seems to me that I am wrong somewhere.
When running in qemu, it gives me 128 Mebibytes of RAM, while writing that the kernel is outside of RAM.
Thanks.
Do I find address of kernel correctly?
-
Octocontrabass
- Member

- Posts: 6280
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Do I find address of kernel correctly?
Output the address of the variables instead.mrjbom wrote:I output the values of these variables
Re: Do I find address of kernel correctly?
Thanks you.Octocontrabass wrote:Output the address of the variables instead.mrjbom wrote:I output the values of these variables
Can I ask you another question?
What is in this area of memory? What does it include? Variables of the kernel? Code?
Re: Do I find address of kernel correctly?
This area, as defined in your code, should encompass... actually, I don't know. You set startkernel before you set the address of the location counter. In any case, once you've made sure it encompasses the entire image, then all your code and static/global variables will be in there, but not your dynamically allocated objects (obviously).
Carpe diem!
Re: Do I find address of kernel correctly?
Am I installing startkernel in the wrong place? Where should it be? After . = 0x00100000;nullplan wrote:This area, as defined in your code, should encompass... actually, I don't know. You set startkernel before you set the address of the location counter. In any case, once you've made sure it encompasses the entire image, then all your code and static/global variables will be in there, but not your dynamically allocated objects (obviously).
