pmm initialized values return to 0
Posted: Thu Aug 18, 2016 4:40 pm
Hello,
I'm currently working on a pmm for my small kernel project and I'm running into an issue when initializing the values. When I call pmm_init, the values for the maximum number of blocks and blocks used are set using the memory available passed by the multiboot info structure. I've checked to ensure these are properly set by returning some of the values from the init function, but if I try to use some getter functions to check the values later, they return 0. It seems like the moment the init function finishes and goes out of scope the values immediately go back to being 0 but I'm not quite sure why that is happening. Any thoughts?
Here is a gist with relevant portions of my main.c along with the output I get at the top as well as my full pmm.c: https://gist.github.com/StevenLaabs/366 ... 7d95d02bd4
Thank you in advance.
Another note: I've tried initializing the variables to some non-zero values when they are first declared and they seem to keep that value, so nothing is overwriting them and it is as if nothing is being changed when pmm_init is called. I've set breakpoints and output values from within the init and am sure it is being called and that the values are correct while within scope of the function.
I'm currently working on a pmm for my small kernel project and I'm running into an issue when initializing the values. When I call pmm_init, the values for the maximum number of blocks and blocks used are set using the memory available passed by the multiboot info structure. I've checked to ensure these are properly set by returning some of the values from the init function, but if I try to use some getter functions to check the values later, they return 0. It seems like the moment the init function finishes and goes out of scope the values immediately go back to being 0 but I'm not quite sure why that is happening. Any thoughts?
Here is a gist with relevant portions of my main.c along with the output I get at the top as well as my full pmm.c: https://gist.github.com/StevenLaabs/366 ... 7d95d02bd4
Thank you in advance.
Another note: I've tried initializing the variables to some non-zero values when they are first declared and they seem to keep that value, so nothing is overwriting them and it is as if nothing is being changed when pmm_init is called. I've set breakpoints and output values from within the init and am sure it is being called and that the values are correct while within scope of the function.