carmaa/inception

Page no. calculation above 4GiB

Closed this issue · 0 comments

Another small (more cosmetic) bug I found in inception is the way you
compute the page number in which the signature is found:

mask = 0xfffff000 # Mask away the lower bits to find the page number
page = int((address & mask) / cfg.PAGESIZE)

That works up to 4 GiB - when using it with more RAM either the mask
needs a change or just do division without rest:

page = int((address) // cfg.PAGESIZE)