zap8600 wrote:
But how exactly do I read the block header. Do you have an example?
The block header is part of your allocator. You create the block header, so you get to decide how to read it.
zap8600 wrote:
How do I locate these pages?
On many systems, the firmware will tell you where to find memory (e.g. UEFI boot services or a device tree). But if you're only concerned about the Raspberry Pi 4, you can look up a memory map and hardcode the addresses. Keep in mind your kernel will be loaded somewhere in that memory, so you can't blindly assume all memory in the memory map will be available!
zap8600 wrote:
How do I mark them?
However you like. For example, if your physical memory manager uses a bitmap to track available memory, you might clear the bit corresponding to the page.
zap8600 wrote:
How I get the address?
However you like. For example, if your physical memory manager uses a bitmap to track available memory, you might multiply the bit offset by the page size to get the physical address.
zap8600 wrote:
How do I make a page table?
Reserve some memory somewhere (perhaps a special .bss section in your binary?) and fill it out according to the ARMv7-A manual.
The wiki has some information that may help you. (In 32-bit mode, ARMv8 CPUs are compatible with ARMv7.)
zap8600 wrote:
Do you have an example?
Which part are you looking for an example of?