You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, you would have to map the apps one page higher. Right now page 0 is read only, so writing to a NULL pointer will cause an exception. To also case an exception on read you should have nothing mapped there (an empty mapped page with no access rights works too but is wasted memory).
Note that a few places in the code assume that the apps starts at 0, the linker script, the processes size, how a processes memory gets copied in fork etc.
This fix would also make a nice programming assignment, so it could be intentional to have apps at page 0.
It seems that NULL pointer is mapped into user space pagetable, such that the below code works!
Would it be better to prevent this? Ideally we shall map a guard map at virtual address 0.
I can make a change if there are no objections.
The text was updated successfully, but these errors were encountered: