1
0
mirror of https://gitlab.os-k.eu/os-k-team/os-k.git synced 2023-08-25 14:03:10 +02:00
os-k/boot/loader/mem/structures.inc

63 lines
2.9 KiB
PHP
Raw Normal View History

;=----------------------------------------------------------------------------=;
; GNU GPL OS/K ;
; ;
; Desc: Memory Design Structures ;
; (x86_64 architecture only) ;
; ;
; ;
; Copyright © 2018-2019 The OS/K Team ;
; ;
; This file is part of OS/K. ;
; ;
; OS/K is free software: you can redistribute it and/or modify ;
; it under the terms of the GNU General Public License as published by ;
; the Free Software Foundation, either version 3 of the License, or ;
; (at your option) any later version. ;
; ;
; OS/K is distributed in the hope that it will be useful, ;
; but WITHOUT ANY WARRANTY; without even the implied warranty of ;
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;
; GNU General Public License for more details. ;
; ;
; You should have received a copy of the GNU General Public License ;
; along with OS/K. If not, see <https://www.gnu.org/licenses/>. ;
;=----------------------------------------------------------------------------=;
[BITS 32]
2019-03-25 23:10:06 +01:00
extern kernelEnd
global newKernelEnd
[section .text]
KERNEL_STACK equ kernelEnd + 4096 * 2 * 1024 ; 8MB of stack
newKernelEnd dq 0x0
[section .rodata]
;; GDT WITH DOC
ALIGN 4096
GDT64:
;; Null selector within 64 bits
.null:
dq 0x0 ; Zero entry
;; 64-bit code selector (ring 0)
.code: equ $ - GDT64
dq (1<<43) | (1<<44) | (1<<47) | (1<<53)
; | | | |
; | | | `------ 64-bit selector
; | | `---------------- Present selector
; | `-------------------------- Descriptor type
; `------------------------------------ Executable segment
.pointer:
dw $ - GDT64 - 1
dq GDT64
2019-03-25 23:10:06 +01:00
;; EMPTY PAGE TABLES (identity of the first 1GiB)
[section .bss]
ALIGN 4096
PML4_table:
resb 4096
PDP_table:
resb 4096
PD_table:
2019-03-28 10:34:18 +01:00
times MAX_MEMORY resb 4096