Error occured from the 32-bit protect mode to long mode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
TYDQSoft
Posts: 8
Joined: Sun Mar 17, 2024 9:11 am
Libera.chat IRC: TYDQSoft

Error occured from the 32-bit protect mode to long mode

Post by TYDQSoft »

This is the error occured when my kernel is boot from the 32-bit protect mode to long mode,the error information is on the below for you to look up:

Code: Select all

check_exception old: 0xffffffff new 0x6
     0: v=06 e=0000 i=0 cpl=0 IP=0010:000000000001000d pc=000000000001000d SP=0018:000000000007fefc env->regs[R_EAX]=00000000507bf0ff
EAX=507bf0ff EBX=00010000 ECX=0000002a EDX=000003c0
ESI=00000000 EDI=000b8fa0 EBP=0007fefc ESP=0007fefc
EIP=0001000d EFL=00000046 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
CS =0010 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
DS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
FS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
GS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     000010b0 00000020
IDT=     00000000 00000000
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000000 CCD=00000000 CCO=ADDB
EFER=0000000000000000
check_exception old: 0xffffffff new 0xd
     1: v=0d e=0032 i=0 cpl=0 IP=0010:000000000001000d pc=000000000001000d SP=0018:000000000007fefc env->regs[R_EAX]=00000000507bf0ff
EAX=507bf0ff EBX=00010000 ECX=0000002a EDX=000003c0
ESI=00000000 EDI=000b8fa0 EBP=0007fefc ESP=0007fefc
EIP=0001000d EFL=00000046 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
CS =0010 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
DS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
FS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
GS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     000010b0 00000020
IDT=     00000000 00000000
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000000 CCD=00000000 CCO=ADDB
EFER=0000000000000000
check_exception old: 0xd new 0xd
     2: v=08 e=0000 i=0 cpl=0 IP=0010:000000000001000d pc=000000000001000d SP=0018:000000000007fefc env->regs[R_EAX]=00000000507bf0ff
EAX=507bf0ff EBX=00010000 ECX=0000002a EDX=000003c0
ESI=00000000 EDI=000b8fa0 EBP=0007fefc ESP=0007fefc
EIP=0001000d EFL=00000046 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
CS =0010 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
DS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
FS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
GS =0018 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     000010b0 00000020
IDT=     00000000 00000000
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000000 CCD=00000000 CCO=ADDB
EFER=0000000000000000
check_exception old: 0x8 new 0xd
The kernel which file is attached in this post is written in pascal but the boot.asm is totally written in assembly language,I don't know where the position that error occurs is.I truly don't know why the kernel cannot jump to long mode(64 bit mode),please download this PascalBootStrap.zip,look the code because the code is too many to solve my kernel error!
nullplan
Member
Member
Posts: 1779
Joined: Wed Aug 30, 2017 8:24 am

Re: Error occured from the 32-bit protect mode to long mode

Post by nullplan »

TYDQSoft wrote:The kernel which file is attached in this post is written in pascal but the boot.asm is totally written in assembly language,
You haven't attached anything to the post.
TYDQSoft wrote:I don't know where the position that error occurs is.
The debug output says IP is at 0x1000d. That should be just after the start of the kernel image.
Carpe diem!
Post Reply