Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically tell that Linux is in PAE or non-PAE mode?

Need to create a script to check to see if the kernel is in PAE mode or not. Surely, it is not enough to just check if the /proc/cpuinfo flags have this 'pae' setting.

We must know if the PAE mechanism has actually been not only implemented, but activated as well.

Because the PAE kernel is now the new default, and that if you need a non-PAE kernel, one has to make another kernel nowadays.

  1. In other word, how do we tell if a kernel is non-PAE on a CPU having PAE (is one of two possible conditions to test for).

  2. Other is, how to tell if a kernel is PAE on a CPU having no PAE-support.

And there's no way to tell if CONFIG_HIGHMEM or CONFIG_PAE kernel configuration option was used in a typical secured kernel.

like image 793
John Greene Avatar asked Nov 13 '22 15:11

John Greene


1 Answers

Usually, CONFIG_PAE can be discovered in your /boot/config-*, like this:

$ cat /boot/config-$(uname -r) | grep PAE
  CONFIG_X86_PAE=y

Do you not have access to the that file?

like image 68
Michael Galaxy Avatar answered Dec 05 '22 12:12

Michael Galaxy