Skip to content

Commit

Permalink
Keep the GDT around longer
Browse files Browse the repository at this point in the history
This is a fix for release builds on x86_64.
  • Loading branch information
YtvwlD committed Dec 1, 2023
1 parent cd1dc42 commit 2772488
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/boot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,8 @@ impl EntryPoint {
.limit_granularity_4kb()
.db() // 32bit
.finish();
let gdt = DescriptorTablePointer::new_from_slice(
&[Descriptor::NULL, code_segment, data_segment]
);
let gdt_array = [Descriptor::NULL, code_segment, data_segment];
let gdt = DescriptorTablePointer::new_from_slice(&gdt_array);

unsafe {
x86::dtables::lgdt(&gdt);
Expand Down

0 comments on commit 2772488

Please sign in to comment.