I'm porting Linux to a new architecture and I'm dealing now with the mmu. Under the file mm/bootmem,c, there is a function called init_bootmem_core. Basically, it reserves all the physical page frames at boot time. I have a question regarding the value it returns.
mapsize = bootmap_bytes(end - start);
bootmap_bytes divides the result of (end - start) by 8 and rounds it up. The "end" value, is the last physical_frame_number of the physical memory and "start" is the first. My question is the following: How are we dividing by 8 to get the size of the reserved space? I mean, (end - start) is just the number of frames. Therefore, we should multiply (end - start) by the page frame size to get the number of bytes in total. What's the trick here? Thank you!