1 ;------------------------------------------------------------------------------
3 ; Emits Page Tables for 1:1 mapping of the addresses 0 - 0x100000000 (4GB)
5 ; Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
6 ; This program and the accompanying materials
7 ; are licensed and made available under the terms and conditions of the BSD License
8 ; which accompanies this distribution. The full text of the license may be found at
9 ; http://opensource.org/licenses/bsd-license.php
11 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 ;------------------------------------------------------------------------------
18 %define ALIGN_TOP_TO_4K_FOR_PAGING
20 %define PAGE_PRESENT 0x01
21 %define PAGE_READ_WRITE 0x02
22 %define PAGE_USER_SUPERVISOR 0x04
23 %define PAGE_WRITE_THROUGH 0x08
24 %define PAGE_CACHE_DISABLE 0x010
25 %define PAGE_ACCESSED 0x020
26 %define PAGE_DIRTY 0x040
27 %define PAGE_PAT 0x080
28 %define PAGE_GLOBAL 0x0100
29 %define PAGE_2M_MBO 0x080
30 %define PAGE_2M_PAT 0x01000
32 %define PAGE_2M_PDE_ATTR (PAGE_2M_MBO + \
38 %define PAGE_PDP_ATTR (PAGE_ACCESSED + \
42 %define PGTBLS_OFFSET(x) ((x) - TopLevelPageDirectory)
43 %define PGTBLS_ADDR(x) (ADDR_OF(TopLevelPageDirectory) + (x))
45 %define PDP(offset) (ADDR_OF(TopLevelPageDirectory) + (offset) + \
47 %define PTE_2MB(x) ((x << 21) + PAGE_2M_PDE_ATTR)
49 TopLevelPageDirectory:
52 ; Top level Page Directory Pointers (1 * 512GB entry)
58 ; Next level Page Directory Pointers (4 * 1GB entries => 4GB)
60 TIMES 0x1000-PGTBLS_OFFSET($) DB 0
68 ; Page Table Entries (2048 * 2MB entries => 4GB)
70 TIMES 0x2000-PGTBLS_OFFSET($) DB 0