I started following Phil’s guides a few months ago when I had the itch to write a kernel. After I had completed everything he had written with the 1st edition, he abandoned it to move on to a 2nd edition - just my luck. I’m glad he’s still pushing out regular updates with the 2nd edition, the 1st edition was starting to become out-of-date. For example - one of the most important parts for writing a kernel in Rust is the global_allocator attribute, which was stabilized a little over a month ago, with a number of changes that are incompatible with the 1st edition’s code (IIRC - it’s been a little while since I looked at the memory allocation post).
I’m interested to see how he approaches the memory management and remapping of the kernel in the 2nd edition. One thing that bothered me about the 1st edition was that he shows you how to implement a simple “bump” heap allocator, without a “free” function. Instead of completing that allocator and adding “free”, he instead linked to his other linked-list allocator without going into its implementation details. I scoffed and decided to write my own heap allocator, using the buddy allocation method. I even started writing a blog post about it - maybe I’ll get off my ass and finish it one of these days, I’m sure it would prove useful to someone.
I started following Phil’s guides a few months ago when I had the itch to write a kernel. After I had completed everything he had written with the 1st edition, he abandoned it to move on to a 2nd edition - just my luck. I’m glad he’s still pushing out regular updates with the 2nd edition, the 1st edition was starting to become out-of-date. For example - one of the most important parts for writing a kernel in Rust is the
global_allocatorattribute, which was stabilized a little over a month ago, with a number of changes that are incompatible with the 1st edition’s code (IIRC - it’s been a little while since I looked at the memory allocation post).I’m interested to see how he approaches the memory management and remapping of the kernel in the 2nd edition. One thing that bothered me about the 1st edition was that he shows you how to implement a simple “bump” heap allocator, without a “free” function. Instead of completing that allocator and adding “free”, he instead linked to his other linked-list allocator without going into its implementation details. I scoffed and decided to write my own heap allocator, using the buddy allocation method. I even started writing a blog post about it - maybe I’ll get off my ass and finish it one of these days, I’m sure it would prove useful to someone.
please write about it! I have implemented a bitmap allocate but it has limited utility. A buddy system could basically be your allocator for all.