feat(filesystem): 引入Umount系统调用 (#719)

* feat(filesystem): 引入Umount系统调用

* 将所有ENOSYS误用更正

* 修复了一个使同一个挂载点可以挂载2个文件系统的bug

* 统一注释,增强程序稳定性,统一接口。注意:Umount时在fatfs的路径要使用大写,此受限于当前文件系统设计。
This commit is contained in:
Samuel Dai
2024-04-15 13:02:04 +08:00
committed by GitHub
parent ceeb2e943c
commit 1074eb34e7
46 changed files with 1274 additions and 463 deletions

View File

@ -34,14 +34,14 @@ impl X86_64KVMArch {
// Check to see if CPU is Intel (“GenuineIntel”).
if let Some(vi) = cpuid.get_vendor_info() {
if vi.as_str() != "GenuineIntel" {
return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP);
return Err(SystemError::ENOSYS);
}
}
// Check processor supports for Virtual Machine Extension (VMX) technology
// CPUID.1:ECX.VMX[bit 5] = 1 (Intel Manual: 24.6 Discovering Support for VMX)
if let Some(fi) = cpuid.get_feature_info() {
if !fi.has_vmx() {
return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP);
return Err(SystemError::ENOSYS);
}
}
Ok(())

View File

@ -15,7 +15,7 @@ pub fn check_ept_features() -> Result<(), SystemError> {
const MTRR_ENABLE_BIT: u64 = 1 << 11;
let ia32_mtrr_def_type = unsafe { msr::rdmsr(msr::IA32_MTRR_DEF_TYPE) };
if (ia32_mtrr_def_type & MTRR_ENABLE_BIT) == 0 {
return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP);
return Err(SystemError::ENOSYS);
}
Ok(())
}

View File

@ -419,7 +419,7 @@ impl Vcpu for VmxVcpu {
}
Err(e) => {
kdebug!("[-] CPU does not support Intel VMX: {:?}", e);
return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP);
return Err(SystemError::ENOSYS);
}
};
@ -429,7 +429,7 @@ impl Vcpu for VmxVcpu {
}
Err(_) => {
kdebug!("[-] VMX operation is not supported on this processor.");
return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP);
return Err(SystemError::ENOSYS);
}
}
@ -574,12 +574,12 @@ pub fn has_intel_vmx_support() -> Result<(), SystemError> {
let cpuid = CpuId::new();
if let Some(vi) = cpuid.get_vendor_info() {
if vi.as_str() != "GenuineIntel" {
return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP);
return Err(SystemError::ENOSYS);
}
}
if let Some(fi) = cpuid.get_feature_info() {
if !fi.has_vmx() {
return Err(SystemError::EOPNOTSUPP_OR_ENOTSUP);
return Err(SystemError::ENOSYS);
}
}
Ok(())