设备驱动模型:完善platform bus相关内容。并注册串口到sysfs (#403)

* 完成初始化platform bus
* 删除旧的sysfs
* 把uart驱动移动到tty/serial文件夹下
* 完成将串口挂载到sysfs
* 修复vfs系统调用未能follow symlink的问题
* 修复shell未能正确获取pwd的问题
This commit is contained in:
LoGin
2023-10-20 22:11:33 +08:00
committed by GitHub
parent 06d5e24726
commit a03c4f9dee
61 changed files with 2904 additions and 1325 deletions

View File

@ -3,11 +3,12 @@ use crate::driver::base::block::block_device::{BlockDevice, BlockId};
use crate::driver::base::block::disk_info::Partition;
use crate::driver::base::block::SeekFrom;
use crate::driver::base::device::bus::Bus;
use crate::driver::base::device::driver::Driver;
use crate::driver::base::device::{Device, DeviceType, IdTable};
use crate::driver::base::kobject::{KObjType, KObject, KObjectState};
use crate::driver::base::kset::KSet;
use crate::driver::disk::ahci::HBA_PxIS_TFES;
use crate::driver::Driver;
use crate::filesystem::kernfs::KernFSInode;
use crate::filesystem::mbr::MbrDiskPartionTable;
use crate::include::bindings::bindings::verify_area;
@ -489,6 +490,10 @@ impl KObject for LockedAhciDisk {
fn set_parent(&self, _parent: Option<Weak<dyn KObject>>) {
todo!()
}
fn set_kobj_type(&self, _ktype: Option<&'static dyn KObjType>) {
todo!()
}
}
impl Device for LockedAhciDisk {
@ -504,6 +509,10 @@ impl Device for LockedAhciDisk {
todo!("LockedAhciDisk::bus()")
}
fn set_bus(&self, _bus: Option<Arc<dyn Bus>>) {
todo!("LockedAhciDisk::set_bus()")
}
fn driver(&self) -> Option<Arc<dyn Driver>> {
todo!("LockedAhciDisk::driver()")
}
@ -512,9 +521,21 @@ impl Device for LockedAhciDisk {
false
}
fn set_driver(&self, _driver: Option<Arc<dyn Driver>>) {
fn set_driver(&self, _driver: Option<Weak<dyn Driver>>) {
todo!("LockedAhciDisk::set_driver()")
}
fn can_match(&self) -> bool {
todo!()
}
fn set_can_match(&self, _can_match: bool) {
todo!()
}
fn state_synced(&self) -> bool {
todo!()
}
}
impl BlockDevice for LockedAhciDisk {