Well, I've been working on dynamic heap allocation. It took me quite a while as it required me to use the memory map which I had to set up to figure out which pages I am able to use and which I should leave as they are.
What are pages?
Pages are basically chunks of memory. They are usually the same size and can be used for many different tasks. One of the most common tasks is to let every process think they own the entire address space while in reality there is only 10MiB of physical memory in place. Also,h this must be shared between processes which makes it even more complex.
And how did you get this memory map?
The memory map was provided to me by grub. Grub uses the BIOS to figure out what can be used and what can't be used. It provides areas, which might overlap. Because this map is so unreliable in some regions I decided to set up my own memory map, in a much more flexible style.
What kind of style is that?
I chose to give each physical page an owner. This can be used in the future to decide whether or not a process can actually access it. This is all dumped into an array, which is currently, 2MiB in size.
2MiB? That's huge!
I know, especially if you have only 10 MiB of memory, however those PC's are rarely ever found these days, and the smallest I have found is 64 MiB, so the table is only about 3-4% of the actual amount of physical memory.
And why was this so hard?
Well, I kind of made a small error in the memory map, and because of that I started writing data into my code. And if there's anything that's difficult to detect, it's writing data into code.
I solved it now, and since the code has passed every test suite I think it's time for a new tag, called Indev-0.0.2. It marks the current commit, as being the latest "stable" indev release.
So what can we see coming in the future?
Well, I think in the near future paging will start happening, and once that's done, I think I'll start worrying about elf loading the core image, and of course jump into that image.
When that's done the planning isn't fixed and but I think I'll (or hope it's we'll by that time) be working on getting into usermode. Once that's done I will probably start worrying about drivers and such but I don't know for sure.
No comments:
Post a Comment