renew zbi, remove cmdline

This commit is contained in:
PanQL 2020-03-09 01:54:14 +08:00
parent 03a75d5f52
commit ef8c93e57a
7 changed files with 17 additions and 9 deletions

View File

@ -11,7 +11,7 @@ description = "Kernel HAL implementation for bare metal environment."
log = "0.4" log = "0.4"
spin = "0.5" spin = "0.5"
executor = { git = "https://github.com/PanQL/executor.git", rev = "1818b01" } executor = { git = "https://github.com/PanQL/executor.git", rev = "1818b01" }
trapframe = "0.1.3" trapframe = { git = "https://github.com/rcore-os/trapframe-rs.git", rev = "b0ce75d"}
core = { package = "core-futures-tls", version = "0.1.0" } core = { package = "core-futures-tls", version = "0.1.0" }
kernel-hal = { path = "../kernel-hal" } kernel-hal = { path = "../kernel-hal" }

View File

@ -9,4 +9,4 @@ description = "Kernel HAL interface definations."
[dependencies] [dependencies]
bitflags = "1.2" bitflags = "1.2"
trapframe = "0.1.3" trapframe = { git = "https://github.com/rcore-os/trapframe-rs.git", rev = "b0ce75d"}

BIN
prebuilt/zircon/fuchsia.zbi (Stored with Git LFS) Executable file → Normal file

Binary file not shown.

View File

@ -15,7 +15,7 @@ rboot = { path = "../rboot", default-features = false }
kernel-hal-bare = { path = "../kernel-hal-bare" } kernel-hal-bare = { path = "../kernel-hal-bare" }
lazy_static = { version = "1.4", features = ["spin_no_std" ] } lazy_static = { version = "1.4", features = ["spin_no_std" ] }
bitmap-allocator = { git = "https://github.com/rcore-os/bitmap-allocator" } bitmap-allocator = { git = "https://github.com/rcore-os/bitmap-allocator" }
trapframe = "0.1.3" trapframe = { git = "https://github.com/rcore-os/trapframe-rs.git", rev = "b0ce75d"}
greenthread-future = "0.1.0" greenthread-future = "0.1.0"
executor = { git = "https://github.com/PanQL/executor.git", rev="1818b01" } executor = { git = "https://github.com/PanQL/executor.git", rev="1818b01" }
core = { package = "core-futures-tls", version = "0.1.0" } core = { package = "core-futures-tls", version = "0.1.0" }

View File

@ -34,7 +34,7 @@ impl Handle {
} }
#[repr(C)] #[repr(C)]
#[derive(Default)] #[derive(Default, Debug)]
pub struct HandleBasicInfo { pub struct HandleBasicInfo {
pub koid: u64, pub koid: u64,
rights: u32, rights: u32,

View File

@ -42,7 +42,12 @@ pub struct Syscall<'a> {
impl Syscall<'_> { impl Syscall<'_> {
pub async fn syscall(&mut self, sys_type: SyscallType, args: [usize; 8]) -> isize { pub async fn syscall(&mut self, sys_type: SyscallType, args: [usize; 8]) -> isize {
info!("{:?}=> args={:x?}", sys_type, args); info!(
"{} {:?}=> args={:x?}",
(self.thread.clone() as Arc<dyn KernelObject>).name(),
sys_type,
args
);
let [a0, a1, a2, a3, a4, a5, a6, a7] = args; let [a0, a1, a2, a3, a4, a5, a6, a7] = args;
let ret = match sys_type { let ret = match sys_type {
SyscallType::HANDLE_DUPLICATE => self.sys_handle_duplicate(a0 as _, a1 as _, a2.into()), SyscallType::HANDLE_DUPLICATE => self.sys_handle_duplicate(a0 as _, a1 as _, a2.into()),

View File

@ -111,6 +111,8 @@ impl Syscall<'_> {
if buffer_size < 8 { if buffer_size < 8 {
return Err(ZxError::BUFFER_TOO_SMALL); return Err(ZxError::BUFFER_TOO_SMALL);
} }
let thread = self.thread.proc().get_object::<Thread>(handle_value)?;
assert!(Arc::ptr_eq(&thread, &self.thread));
let fsbase = UserInPtr::<u64>::from(ptr).read()?; let fsbase = UserInPtr::<u64>::from(ptr).read()?;
info!("to set fsbase as {:#x}", fsbase); info!("to set fsbase as {:#x}", fsbase);
self.regs.fsbase = fsbase as usize; self.regs.fsbase = fsbase as usize;
@ -179,8 +181,9 @@ impl Syscall<'_> {
UserOutPtr::<VmarInfo>::from(buffer).write(vmar.get_info())?; UserOutPtr::<VmarInfo>::from(buffer).write(vmar.get_info())?;
} }
ZxInfo::InfoHandleBasic => { ZxInfo::InfoHandleBasic => {
UserOutPtr::<HandleBasicInfo>::from(buffer) let info = self.thread.proc().get_handle_info(handle)?;
.write(self.thread.proc().get_handle_info(handle)?)?; info!("basic info: {:?}", info);
UserOutPtr::<HandleBasicInfo>::from(buffer).write(info)?;
} }
_ => { _ => {
warn!("not supported info topic"); warn!("not supported info topic");