PCI driver WIP
This commit is contained in:
parent
f05cc96db1
commit
c9a4b3882c
16 changed files with 400 additions and 7 deletions
|
@ -121,7 +121,7 @@ pub extern fn userspace_init() {
|
|||
assert_eq!(syscall::open(b"debug:", 0), Ok(1));
|
||||
assert_eq!(syscall::open(b"debug:", 0), Ok(2));
|
||||
|
||||
syscall::exec(b"initfs:bin/init", &[]).expect("failed to execute initfs:init");
|
||||
syscall::exec(b"initfs:bin/pcid", &[]).expect("failed to execute initfs:init");
|
||||
|
||||
panic!("initfs:init returned")
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ impl InitFsScheme {
|
|||
let mut files: BTreeMap<&'static [u8], &'static [u8]> = BTreeMap::new();
|
||||
|
||||
files.insert(b"bin/init", include_bytes!("../../build/userspace/init"));
|
||||
files.insert(b"bin/pcid", include_bytes!("../../build/userspace/pcid"));
|
||||
files.insert(b"etc/init.rc", b"echo testing\n");
|
||||
|
||||
InitFsScheme {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue