Create TSS and GDT modules and use a double fault stack

This commit is contained in:
Philipp Oppermann
2016-11-28 10:13:27 +01:00
parent b4bc47d5d9
commit 5f8de6e871
8 changed files with 320 additions and 17 deletions

View File

@@ -11,7 +11,7 @@ pub use self::entry::*;
use memory::{PAGE_SIZE, Frame, FrameAllocator};
use self::temporary_page::TemporaryPage;
pub use self::mapper::Mapper;
use core::ops::{Deref, DerefMut};
use core::ops::{Deref, DerefMut, Add};
use multiboot2::BootInformation;
mod entry;
@@ -37,7 +37,7 @@ impl Page {
Page { number: address / PAGE_SIZE }
}
fn start_address(&self) -> usize {
pub fn start_address(&self) -> usize {
self.number * PAGE_SIZE
}
@@ -62,6 +62,14 @@ impl Page {
}
}
impl Add<usize> for Page {
type Output = Page;
fn add(self, rhs: usize) -> Page {
Page { number: self.number + rhs }
}
}
pub struct PageIter {
start: Page,
end: Page,