PCI driver WIP

This commit is contained in:
Jeremy Soller 2016-09-11 15:56:48 -06:00
parent f05cc96db1
commit c9a4b3882c
16 changed files with 400 additions and 7 deletions

View file

@ -32,6 +32,8 @@ pub enum Call {
GetPid = 20,
/// Set process break
Brk = 45,
/// Set process I/O privilege level
Iopl = 110,
/// Yield to scheduler
SchedYield = 158
}
@ -49,6 +51,7 @@ impl Call {
11 => Ok(Call::Exec),
20 => Ok(Call::GetPid),
45 => Ok(Call::Brk),
110 => Ok(Call::Iopl),
158 => Ok(Call::SchedYield),
_ => Err(Error::NoCall)
}
@ -106,6 +109,7 @@ pub fn handle(a: usize, b: usize, c: usize, d: usize, e: usize, _f: usize) -> Re
Call::Exec => exec(convert_slice(b as *const u8, c)?, convert_slice(d as *const [usize; 2], e)?),
Call::GetPid => getpid(),
Call::Brk => brk(b),
Call::Iopl => iopl(b),
Call::SchedYield => sched_yield()
}
}

View file

@ -105,6 +105,11 @@ pub fn getpid() -> Result<usize> {
Ok(context.id)
}
pub fn iopl(_level: usize) -> Result<usize> {
//TODO
Ok(0)
}
pub fn sched_yield() -> Result<usize> {
unsafe { context::switch(); }
Ok(0)