How to map memory to -2GB region.
Posted: Sun Oct 04, 2020 9:39 am
Hello,
I have an issue about making my 64-bit kernel and bootstrap map address 0xB8000 to 0xFFFFFFFF800B8000.
I would say my issue is more of a misunderstanding (or straight up not understanding) of the paging system.
This is the current state of my code.
I have tried using the code below but quickly realized I was just overwriting two entries with the "0xFFFFFFFF80000003" value.
I have struggled to find an answer for this problem and this topic in general.
I will provide any necessary information if asked.
Any and all help is appreciated
Thank you
I have an issue about making my 64-bit kernel and bootstrap map address 0xB8000 to 0xFFFFFFFF800B8000.
I would say my issue is more of a misunderstanding (or straight up not understanding) of the paging system.
This is the current state of my code.
Code: Select all
__rt0_64:
cli
;--------------------------------------
; Nullifies the segment registers.
;--------------------------------------
mov ax, 0
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
;-; what do?
.stop:
;--------------------------------------
; Blocks interrupts and halts.
;--------------------------------------
cli
Code: Select all
mov rbx, 0xFFFFFFFF80000003
mov ecx, 512
.identity_map:
;--------------------------------------
; Identity maps the first 2MB.
;--------------------------------------
mov qword [edi], rbx
add rbx, 0x1000
add edi, 8
loop __rt0_64.identity_map
mov dword [0xFFFFFFFF800B8000], 0xf0f0f0f0
I will provide any necessary information if asked.
Any and all help is appreciated
Thank you