maxdev1 / ghost

Ghost, a micro-kernel based hobby operating system.
http://ghostkernel.org/
GNU General Public License v3.0
560 stars 57 forks source link

New physical bitmap allocator #33

Closed maxdev1 closed 2 years ago

maxdev1 commented 2 years ago

The old one was very static and always had a fixed-size; it basically always occupied the memory required for mapping 4GiB. Also, the bitmap was copied to kernel space so memory was wasted again.

With the new allocator, first the total amount of physical memory is counted, then an array of multiple bitmaps is created which only cover the allocatable memory range. Each of them has its own lock to improve multi-core performance.

The memory setup sequence of the loader was also simplified and documented with this.