How does the operating system read the page size from hardware?
Books on operating systems usually mentions that the page size is decided by the processor architecture, for example Intel x86 supports 4KB page size. I have a perception that when we were installing an operating system on our hardware, the OS had read the page size of 4KB from hardware and logically divided the virtual address space into 4KB size pages and memory into frames respectively.
If my perception is true, from where or from which location in hardware does the operating system read this value of 4KB from the processor? What mechanism does the OS use to determine the page size provided by hardware? Can anybody enlighten me on this? How (On What Basis) Intel decides to keep 4KB page size.
kernel memory hardware virtual-memory intel
add a comment |
Books on operating systems usually mentions that the page size is decided by the processor architecture, for example Intel x86 supports 4KB page size. I have a perception that when we were installing an operating system on our hardware, the OS had read the page size of 4KB from hardware and logically divided the virtual address space into 4KB size pages and memory into frames respectively.
If my perception is true, from where or from which location in hardware does the operating system read this value of 4KB from the processor? What mechanism does the OS use to determine the page size provided by hardware? Can anybody enlighten me on this? How (On What Basis) Intel decides to keep 4KB page size.
kernel memory hardware virtual-memory intel
Wow that’s a significant edit — “how does Intel decide to keep 4KB page size?” is a rather different matter than “how does the operating system read the page size?”
– Stephen Kitt
Jan 22 at 14:58
add a comment |
Books on operating systems usually mentions that the page size is decided by the processor architecture, for example Intel x86 supports 4KB page size. I have a perception that when we were installing an operating system on our hardware, the OS had read the page size of 4KB from hardware and logically divided the virtual address space into 4KB size pages and memory into frames respectively.
If my perception is true, from where or from which location in hardware does the operating system read this value of 4KB from the processor? What mechanism does the OS use to determine the page size provided by hardware? Can anybody enlighten me on this? How (On What Basis) Intel decides to keep 4KB page size.
kernel memory hardware virtual-memory intel
Books on operating systems usually mentions that the page size is decided by the processor architecture, for example Intel x86 supports 4KB page size. I have a perception that when we were installing an operating system on our hardware, the OS had read the page size of 4KB from hardware and logically divided the virtual address space into 4KB size pages and memory into frames respectively.
If my perception is true, from where or from which location in hardware does the operating system read this value of 4KB from the processor? What mechanism does the OS use to determine the page size provided by hardware? Can anybody enlighten me on this? How (On What Basis) Intel decides to keep 4KB page size.
kernel memory hardware virtual-memory intel
kernel memory hardware virtual-memory intel
edited Jan 22 at 15:00
Stephen Kitt
169k24380458
169k24380458
asked Jan 22 at 14:41
user127956user127956
115
115
Wow that’s a significant edit — “how does Intel decide to keep 4KB page size?” is a rather different matter than “how does the operating system read the page size?”
– Stephen Kitt
Jan 22 at 14:58
add a comment |
Wow that’s a significant edit — “how does Intel decide to keep 4KB page size?” is a rather different matter than “how does the operating system read the page size?”
– Stephen Kitt
Jan 22 at 14:58
Wow that’s a significant edit — “how does Intel decide to keep 4KB page size?” is a rather different matter than “how does the operating system read the page size?”
– Stephen Kitt
Jan 22 at 14:58
Wow that’s a significant edit — “how does Intel decide to keep 4KB page size?” is a rather different matter than “how does the operating system read the page size?”
– Stephen Kitt
Jan 22 at 14:58
add a comment |
1 Answer
1
active
oldest
votes
Operating systems hard code the page size depending on the architecture (and in some cases, build-time kernel configuration). For example, on x86 the basic page size is always 4KiB — this is a property of the CPU architecture; on Linux you’ll see this defined in include/asm/page_types
. On 64-bit ARM, the page size can be configured at build-time as 4KiB, 16KiB or 64KiB. Some architectures multiple page sizes at runtime (e.g. huge pages on x86), but all the sizes are known ahead of time and the base size is fixed.
On Linux, the canonical definition of the page size is PAGE_SIZE
, and you get it by including asm/page.h
, which is architecture-specific (which might pull in other headers, as happens on x86). Elixir provides a handy list of all the PAGE_SIZE
definitions.
Most architectures supported by the Linux kernel support 4KiB pages; the exceptions are Alpha, ARC, some Motorola 68k systems, OpenRISC and 64-bit SPARC, which all use 8KiB pages. Many architectures can be configured to use other pages sizes.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f495987%2fhow-does-the-operating-system-read-the-page-size-from-hardware%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Operating systems hard code the page size depending on the architecture (and in some cases, build-time kernel configuration). For example, on x86 the basic page size is always 4KiB — this is a property of the CPU architecture; on Linux you’ll see this defined in include/asm/page_types
. On 64-bit ARM, the page size can be configured at build-time as 4KiB, 16KiB or 64KiB. Some architectures multiple page sizes at runtime (e.g. huge pages on x86), but all the sizes are known ahead of time and the base size is fixed.
On Linux, the canonical definition of the page size is PAGE_SIZE
, and you get it by including asm/page.h
, which is architecture-specific (which might pull in other headers, as happens on x86). Elixir provides a handy list of all the PAGE_SIZE
definitions.
Most architectures supported by the Linux kernel support 4KiB pages; the exceptions are Alpha, ARC, some Motorola 68k systems, OpenRISC and 64-bit SPARC, which all use 8KiB pages. Many architectures can be configured to use other pages sizes.
add a comment |
Operating systems hard code the page size depending on the architecture (and in some cases, build-time kernel configuration). For example, on x86 the basic page size is always 4KiB — this is a property of the CPU architecture; on Linux you’ll see this defined in include/asm/page_types
. On 64-bit ARM, the page size can be configured at build-time as 4KiB, 16KiB or 64KiB. Some architectures multiple page sizes at runtime (e.g. huge pages on x86), but all the sizes are known ahead of time and the base size is fixed.
On Linux, the canonical definition of the page size is PAGE_SIZE
, and you get it by including asm/page.h
, which is architecture-specific (which might pull in other headers, as happens on x86). Elixir provides a handy list of all the PAGE_SIZE
definitions.
Most architectures supported by the Linux kernel support 4KiB pages; the exceptions are Alpha, ARC, some Motorola 68k systems, OpenRISC and 64-bit SPARC, which all use 8KiB pages. Many architectures can be configured to use other pages sizes.
add a comment |
Operating systems hard code the page size depending on the architecture (and in some cases, build-time kernel configuration). For example, on x86 the basic page size is always 4KiB — this is a property of the CPU architecture; on Linux you’ll see this defined in include/asm/page_types
. On 64-bit ARM, the page size can be configured at build-time as 4KiB, 16KiB or 64KiB. Some architectures multiple page sizes at runtime (e.g. huge pages on x86), but all the sizes are known ahead of time and the base size is fixed.
On Linux, the canonical definition of the page size is PAGE_SIZE
, and you get it by including asm/page.h
, which is architecture-specific (which might pull in other headers, as happens on x86). Elixir provides a handy list of all the PAGE_SIZE
definitions.
Most architectures supported by the Linux kernel support 4KiB pages; the exceptions are Alpha, ARC, some Motorola 68k systems, OpenRISC and 64-bit SPARC, which all use 8KiB pages. Many architectures can be configured to use other pages sizes.
Operating systems hard code the page size depending on the architecture (and in some cases, build-time kernel configuration). For example, on x86 the basic page size is always 4KiB — this is a property of the CPU architecture; on Linux you’ll see this defined in include/asm/page_types
. On 64-bit ARM, the page size can be configured at build-time as 4KiB, 16KiB or 64KiB. Some architectures multiple page sizes at runtime (e.g. huge pages on x86), but all the sizes are known ahead of time and the base size is fixed.
On Linux, the canonical definition of the page size is PAGE_SIZE
, and you get it by including asm/page.h
, which is architecture-specific (which might pull in other headers, as happens on x86). Elixir provides a handy list of all the PAGE_SIZE
definitions.
Most architectures supported by the Linux kernel support 4KiB pages; the exceptions are Alpha, ARC, some Motorola 68k systems, OpenRISC and 64-bit SPARC, which all use 8KiB pages. Many architectures can be configured to use other pages sizes.
edited Jan 22 at 15:42
answered Jan 22 at 14:52
Stephen KittStephen Kitt
169k24380458
169k24380458
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f495987%2fhow-does-the-operating-system-read-the-page-size-from-hardware%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Wow that’s a significant edit — “how does Intel decide to keep 4KB page size?” is a rather different matter than “how does the operating system read the page size?”
– Stephen Kitt
Jan 22 at 14:58