Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86_64/gdt.rs panicked at 'attempt to create unaligned or null slice' #9

Open
elliott10 opened this issue Jan 20, 2022 · 1 comment

Comments

@elliott10
Copy link

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);
@elliott10
Copy link
Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant