tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Possible error in dtrace



Le 25/07/2018 à 19:33, Siddharth Muralee a écrit :
KERN_BASE is used only once in dtrace and no where else - if it indeed is
the same as VM_MIN_KERNEL_ADDRESS then we can just substitute it.
I didn't understand how VM_MAX_ADDRESS comes there.

Instead of taking the kernel min address, you can take the userland max
address. This userland max address is VM_MAX_ADDRESS.

Also why is KERNBASE > VM_MAX_KERNEL_ADDRESS in amd64 and equal to
VM_MIN_KERNEL_ADDRESS in i386(or did you mean VM_MAX_KERNEL_ADDRESS)

I did mean VM_MIN_KERNEL_ADDRESS. The reason is that on amd64 we are
required to put the kernel at the last 2GB of the VA space, because of the
mcmodel. So we have KERNBASE that is near the end of the VA space, and
VM_MIN_KERNEL_ADDRESS that is located before. The two areas are separate.

On i386 however we can put the kernel wherever we want, and by default we
chose to put it at VM_MIN_KERNEL_ADDRESS. So there, VM_MIN_KERNEL_ADDRESS
equals KERNBASE.


Home | Main Index | Thread Index | Old Index