My grub-probed free memory address is off. Why?
Posted: Thu Jan 21, 2010 11:13 am
Hello fellow developers.
I've recently started programming my own OS in C/assembler. The Bare Bones article pretty much set me up.
In my current phase I'm trying to get the memory management up and running. So I access the provided multiboot_memory_map structure (from multiboot.h) for those whose 'type' is 1, and thereby not reserved.
My actual problem arises when I try to set up my virtual memory (just using a simple linked list at first). The address provided from the 'addr' field is somewhat off.. In my perception. If I use it as it is then I overwrite my running kernel code at some point. I have interpreted 'addr' as the starting address of the free memory available, which then spans the amount of bytes specified in the 'len' field.
As of now I'm using a hack (multiplying 'addr' by 4, haha I know) but I would like to know why the offset is off?
Thank you very much in advance.
I've recently started programming my own OS in C/assembler. The Bare Bones article pretty much set me up.
In my current phase I'm trying to get the memory management up and running. So I access the provided multiboot_memory_map structure (from multiboot.h) for those whose 'type' is 1, and thereby not reserved.
My actual problem arises when I try to set up my virtual memory (just using a simple linked list at first). The address provided from the 'addr' field is somewhat off.. In my perception. If I use it as it is then I overwrite my running kernel code at some point. I have interpreted 'addr' as the starting address of the free memory available, which then spans the amount of bytes specified in the 'len' field.
As of now I'm using a hack (multiplying 'addr' by 4, haha I know) but I would like to know why the offset is off?
Thank you very much in advance.