Before I can fully test the Memory Manager, I'm writing the memdmp() function to display a section of memory on the kprintf console. Unfortunately this means working out more of an implementation of printf than I had bothered before.
In a way, this is a good thing because it's the one part of the my OS that, until now, was not written by me and subject to third-party copyright and license.
Also thought, I wonder if Bochs can have an additional output stream that I could (ab)use to give me the kernel output on a separate stream/window. I could make the OS output it through the serial port, which I guess a real machine would use.
Another thought I had earlier, create a macro for malloc when allocating structures. The macro would call a version of malloc that wrote the name and length of the structure somewhere so that memdmp() could display a lot more. Could this be extended to the definition of structs so that the kernel had a table of all the fields in each struct so knew how to interpret "all" the data in memory?
2013-07-06
2013-07-05
2013-07-05 - Memory Manager Progress
Finally finished typing up the memory manager implementation and fixing some of the issues in it. It now compiles and appears to be OK.
2013-07-01
2013-07-01 - Memory Manager (Version 2)
My recent long train journey provided an opportunity to write down the implementation of a memory manager, one which uses a linked list of free blocks and where every block has a header and a footer. I read about something like this somewhere, but I don't remember where. It should work very well for lots of things, however, for small allocations, the size of the header and footer introduce a significant space inefficiency.
Anyway, I'll get the implementation in and see how it goes. I think I have a problem with my footer structure not being a multiple of 16 bytes, and I'm not sure if I should worry about putting the used blocks into a linked list of their own, or only worrying about the free blocks. If I need a map of the memory, I can walk the structures.
Anyway, I'll get the implementation in and see how it goes. I think I have a problem with my footer structure not being a multiple of 16 bytes, and I'm not sure if I should worry about putting the used blocks into a linked list of their own, or only worrying about the free blocks. If I need a map of the memory, I can walk the structures.
Subscribe to:
Posts (Atom)