MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / init

Function init

kernel/src/gdt.rs:118–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116}
117
118pub fn init() {
119 use x86_64::instructions::segmentation::{Segment, CS, DS};
120 use x86_64::instructions::tables::load_tss;
121
122 GDT.0.load();
123 unsafe {
124 CS::set_reg(GDT.1.code_selector);
125 DS::set_reg(GDT.1.data_selector);
126 load_tss(GDT.1.tss_selector);
127 }
128}
129
130pub fn get_kernel_segments() -> (SegmentSelector, SegmentSelector) {
131 (GDT.1.code_selector, GDT.1.data_selector)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected