Skip to content

Commit b2266f3

Browse files
committed
use set_reg method of CS, DS, ES and SS segment structs
1 parent 8339556 commit b2266f3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/binary/gdt.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use x86_64::{
2-
instructions::segmentation,
2+
instructions::segmentation::{Segment, CS, DS, ES, SS},
33
structures::{
44
gdt::{Descriptor, GlobalDescriptorTable},
55
paging::PhysFrame,
@@ -24,9 +24,9 @@ pub fn create_and_load(frame: PhysFrame) {
2424

2525
gdt.load();
2626
unsafe {
27-
segmentation::set_cs(code_selector);
28-
segmentation::load_ds(data_selector);
29-
segmentation::load_es(data_selector);
30-
segmentation::load_ss(data_selector);
27+
CS::set_reg(code_selector);
28+
DS::set_reg(data_selector);
29+
ES::set_reg(data_selector);
30+
SS::set_reg(data_selector);
3131
}
3232
}

0 commit comments

Comments
 (0)