diff --git a/Makefile b/Makefile index 4cd2c1be..039578e3 100644 --- a/Makefile +++ b/Makefile @@ -104,3 +104,6 @@ baremetal-test: baremetal-test-rv64: @make -C zCore baremetal-test-rv64 arch=riscv64 mode=release linux=1 ROOTPROC=$(ROOTPROC) | tee -a stdout-baremetal-test-rv64 | tee stdout-rv64 +## JUST FOR TEST, delete it later +run: + cargo run -p zircon-loader -- prebuilt/zircon/x64 LOG=warn:TERM=xterm-256color:console.shell=true:virtcon.disable=true \ No newline at end of file diff --git a/zircon-loader/Cargo.toml b/zircon-loader/Cargo.toml index eeb1f1f8..a4c809ec 100644 --- a/zircon-loader/Cargo.toml +++ b/zircon-loader/Cargo.toml @@ -20,4 +20,5 @@ async-std = { version = "1.9", features = ["attributes"], optional = true } [features] default = ["std"] -std = ["env_logger", "structopt", "async-std", "kernel-hal-unix", "zircon-object/aspace-separate"] +std = ["env_logger", "structopt", "async-std", "kernel-hal-unix", + "zircon-object/aspace-separate", "zircon-syscall/std"] diff --git a/zircon-syscall/Cargo.toml b/zircon-syscall/Cargo.toml index 86fde9de..6699d22f 100644 --- a/zircon-syscall/Cargo.toml +++ b/zircon-syscall/Cargo.toml @@ -8,7 +8,11 @@ description = "Zircon syscalls implementation" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -#hypervisor = ["zircon-object/hypervisor"] +# hypervisor = ["zircon-object/hypervisor"] +default = [] +deny-page-fault = [] +std = ["deny-page-fault"] + [dependencies] log = "0.4" @@ -18,3 +22,4 @@ numeric-enum-macro = "0.2" zircon-object = { path = "../zircon-object" } kernel-hal = { path = "../kernel-hal" } futures = { version = "0.3", default-features = false, features = ["alloc", "async-await"] } + diff --git a/zircon-syscall/src/vmar.rs b/zircon-syscall/src/vmar.rs index af700900..0251f99a 100644 --- a/zircon-syscall/src/vmar.rs +++ b/zircon-syscall/src/vmar.rs @@ -128,12 +128,16 @@ impl Syscall<'_> { mapping_flags.set(MMUFlags::READ, options.contains(VmOptions::PERM_READ)); mapping_flags.set(MMUFlags::WRITE, options.contains(VmOptions::PERM_WRITE)); mapping_flags.set(MMUFlags::EXECUTE, options.contains(VmOptions::PERM_EXECUTE)); - info!( - "mmuflags: {:?}, is_specific {:?}", - mapping_flags, is_specific - ); let overwrite = options.contains(VmOptions::SPECIFIC_OVERWRITE); + #[cfg(feature = "deny-page-fault")] + let map_range = true; + #[cfg(not(feature = "deny-page-fault"))] let map_range = options.contains(VmOptions::MAP_RANGE); + + info!( + "mmuflags: {:?}, is_specific {:?}, overwrite {:?}, map_range {:?}", + mapping_flags, is_specific, overwrite, map_range + ); if map_range && overwrite { return Err(ZxError::INVALID_ARGS); }