Code triple faulting on loading of DS
Posted: Thu Jul 09, 2020 7:37 am
Hello,
In my trampoline, it is loaded and gets to PMode, but but triple fault as soon as I load a data segment. Here is the code
The core starting code on the BSP relocates the PMode code to 0x10000, the RMode code to 0x9000, the GDT to 0x600, and the GDT pointer to 0x500.
Thanks,
nexos
In my trampoline, it is loaded and gets to PMode, but but triple fault as soon as I load a data segment. Here is the code
Code: Select all
; ApStart.asm - contains AP startup code
; Distributed with NexOS, licensed under the AGPL v3.0
; See LICENSE
section .text
global realModeAP
global realModeAPend
global pmodeAP
global pmodeAPend
bits 16 ; We are in real mode
realModeAP:
mov ax, 0
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
cli
mov si, 0x500
lgdt [ds:si]
mov eax, cr0
or eax, 1
mov cr0, eax
jmp 0x08:0x10000
realModeAPend:
bits 32
pmodeAP:
mov ax, 10h
mov ds, ax ; Triple faults here
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
hlt
pmodeAPend:Thanks,
nexos