trapframe-rs
trapframe-rs copied to clipboard
x86_64/gdt.rs panicked at 'attempt to create unaligned or null slice'
Occasionally an error occurs when the x86 64 arch boot:
panicked at 'attempt to create unaligned or null slice'
The location of the error occurs in x86_64/gdt.rs
39 let old_gdt = core::slice::from_raw_parts(gdtp.base.as_ptr::<u64>(), entry_count);
The memory address of gdt must be aligned, in order to solve this panick. Like:
.align 4
gdt_64:
.quad 0x0000000000000000 # Null Descriptor - should be present.
.quad 0x00209A0000000000 # 64-bit code descriptor (exec/read).
.quad 0x0000920000000000 # 64-bit data descriptor (read/write).