Fix implementation of clone and exec. Now the init process can load and execute the pci driver

This commit is contained in:
Jeremy Soller 2016-09-15 08:35:07 -06:00
parent b01a918556
commit 33e098c124
9 changed files with 233 additions and 78 deletions

View file

@ -1,6 +1,6 @@
use arch::externs::memset;
use arch::paging::{ActivePageTable, InactivePageTable, Page, PageIter, VirtualAddress};
use arch::paging::entry::EntryFlags;
use arch::paging::entry::{self, EntryFlags};
use arch::paging::temporary_page::TemporaryPage;
#[derive(Debug)]
@ -31,6 +31,10 @@ impl Memory {
self.size
}
pub fn flags(&self) -> EntryFlags {
self.flags
}
pub fn pages(&self) -> PageIter {
let start_page = Page::containing_address(self.start);
let end_page = Page::containing_address(VirtualAddress::new(self.start.get() + self.size - 1));
@ -57,7 +61,7 @@ impl Memory {
}
if clear {
assert!(flush);
assert!(flush && self.flags.contains(entry::WRITABLE));
unsafe { memset(self.start_address().get() as *mut u8, 0, self.size); }
}
}