# AMD64 Increasing Page Size



## emantec (Mar 19, 2016)

Hi,

I'm doing some testing on FreeBSD 9.0 and I would like to increase the page size to 16kb for AMD64 but I'm having trouble compiling a stable kernel.

I've updated PAGE_SHIFT to 14 and _NPCM to 12 and _NPCPV to 677 in pmap.h to stop the compiler error but after installation the kernel crashes instantly and I can't get a debugger to attach to see where the error occurred. I'm not sure what else I may need to change so any help would be greatly appreciated! 

Thanks.


----------



## emantec (Mar 19, 2016)

sidetone said:


> See sysctl(8) to edit /etc/sysctl.conf. FreeBSD 9.0 is no longer supported.



I'm not sure how editing sysctl.conf will help with changing page size? I've also tried on FreeBSD 10 with the same results.


----------



## Crivens (Mar 20, 2016)

What is it you try to accomplish with this?


----------



## emantec (Mar 20, 2016)

Crivens said:


> What is it you try to accomplish with this?


I'm doing research on an embedded system that is running FreeBSD with page size set to 16kb


----------



## Uniballer (Mar 21, 2016)

I could see some value in playing with the page replacement algorithms using larger pages, but don't really see how this will benefit an embedded system that is presumably not doing any "real" paging (just growing the stack and heap as needed).  Then again, your concept of an embedded system in this case may differ from mine.

You could probably fake it with some hacking, but IIRC the CPU hardware only directly supports 4KB and 2MB pages.  So you will have to write some pretty low-level memory management code to make this go.  You can check my recollections with this book: AMD64 Architecture Programmer’s Manual Volume 2: System Programming


----------

