/DragonOS/kernel/src/driver/base/block/ |
H A D | manager.rs | 57 pub fn register(&self, dev: Arc<dyn BlockDevice>) -> Result<(), SystemError> { in register() 59 let dev_name = dev.dev_name(); in register() 63 inner.disks.insert(dev_name.clone(), dev.clone()); in register() 70 self.check_partitions(&dev).inspect_err(|_| out_remove())?; in register() 75 fn check_partitions(&self, dev: &Arc<dyn BlockDevice>) -> Result<(), SystemError> { in check_partitions() 76 if self.check_mbr(dev).is_ok() { in check_partitions() 81 self.register_entire_disk_as_gendisk(dev) in check_partitions() 84 fn check_mbr(&self, dev: &Arc<dyn BlockDevice>) -> Result<(), SystemError> { in check_mbr() 85 let mbr = MbrDiskPartionTable::from_disk(dev.clone())?; in check_mbr() 88 self.register_gendisk_with_range(dev, p.try_into()?)?; in check_mbr() [all …]
|
/DragonOS/kernel/src/driver/base/device/ |
H A D | dd.rs | 47 pub fn device_attach(&self, dev: &Arc<dyn Device>) -> Result<bool, SystemError> { in device_attach() 48 return self.do_device_attach(dev, false); in device_attach() 51 pub fn device_initial_probe(&self, dev: &Arc<dyn Device>) -> Result<bool, SystemError> { in device_initial_probe() 52 return self.do_device_attach(dev, true); in device_initial_probe() 58 dev: &Arc<dyn Device>, in do_device_attach() 65 if dev.is_dead() { in do_device_attach() 69 warn!("do_device_attach: dev: '{}'", dev.name()); in do_device_attach() 74 if dev.driver().is_some() { in do_device_attach() 75 if self.device_is_bound(dev) { in do_device_attach() 78 dev.name() in do_device_attach() [all …]
|
H A D | mod.rs | 421 let dev = kobj.cast::<dyn Device>().unwrap(); in release() localVariable 434 dev.release(); in release() 500 if let Some(ref dev) = deivce_parent { in add_device() 504 dev.name() in add_device() 676 fn device_platform_notify(&self, dev: &Arc<dyn Device>) { in device_platform_notify() 677 acpi_device_notify(dev); in device_platform_notify() 678 software_node_notify(dev); in device_platform_notify() 682 fn add_class_symlinks(&self, dev: &Arc<dyn Device>) -> Result<(), SystemError> { in add_class_symlinks() 683 let class = dev.class(); in add_class_symlinks() 699 let dev_kobj = dev.clone() as Arc<dyn KObject>; in add_class_symlinks() [all …]
|
H A D | bus.rs | 194 for dev in guard.iter() { in find_device() 195 if matcher.match_device(dev, data) { in find_device() 196 return Some(dev.clone()); in find_device() 265 pub fn add_device(&self, dev: &Arc<dyn Device>) -> Result<(), SystemError> { in add_device() 266 let bus = dev.bus().and_then(|bus| bus.upgrade()); in add_device() 268 device_manager().add_groups(dev, bus.dev_groups())?; in add_device() 275 let dev_kobj = dev.clone() as Arc<dyn KObject>; in add_device() 280 dev.name(), in add_device() 287 bus.subsystem().add_device_to_vec(dev)?; in add_device() 443 for dev in bus.subsystem().devices().iter() { in rescan_devices() [all …]
|
H A D | driver.rs | 166 .find(|dev| matcher.match_device(dev, data)) in find_device_slow() 234 pub fn driver_sysfs_add(&self, dev: &Arc<dyn Device>) -> Result<(), SystemError> { in driver_sysfs_add() 235 if let Some(bus) = dev.bus().and_then(|bus| bus.upgrade()) { in driver_sysfs_add() 238 .call_chain(BusNotifyEvent::BindDriver, Some(dev), None); in driver_sysfs_add() 240 let driver_kobj = dev.driver().unwrap() as Arc<dyn KObject>; in driver_sysfs_add() 241 let device_kobj = dev.clone() as Arc<dyn KObject>; in driver_sysfs_add() 244 sysfs_instance().remove_link(&driver_kobj, dev.name()); in driver_sysfs_add() 261 if let Err(e) = device_manager().create_file(dev, &DeviceAttrCoredump) { in driver_sysfs_add()
|
/DragonOS/kernel/src/driver/virtio/ |
H A D | sysfs.rs | 191 pub fn device_add(&self, dev: Arc<dyn VirtIODevice>) -> Result<(), SystemError> { in device_add() 192 dev.set_bus(Some(Arc::downgrade(&(virtio_bus() as Arc<dyn Bus>)))); in device_add() 193 device_manager().device_default_initialize(&(dev.clone() as Arc<dyn Device>)); in device_add() 196 dev.set_virtio_device_index(virtio_index); in device_add() 197 dev.set_device_name(format!("virtio{}", virtio_index.data())); in device_add() 199 device_manager().add_device(dev.clone() as Arc<dyn Device>)?; in device_add() 201 .add_groups(&(dev.clone() as Arc<dyn Device>), &[&VirtIODeviceAttrGroup]); in device_add() 203 self.setup_irq(&dev).ok(); in device_add() 211 fn setup_irq(&self, dev: &Arc<dyn VirtIODevice>) -> Result<(), SystemError> { in setup_irq() 212 let irq = dev.irq().ok_or(SystemError::EINVAL)?; in setup_irq() [all …]
|
/DragonOS/kernel/src/driver/rtc/ |
H A D | class.rs | 84 pub(super) fn rtc_register_device(dev: &Arc<RtcGeneralDevice>) -> Result<(), SystemError> { in rtc_register_device() 85 device_manager().add_device(dev.clone())?; in rtc_register_device() 86 register_default_rtc(dev.clone()); in rtc_register_device() 88 rtc_hctosys(dev); in rtc_register_device() 92 fn rtc_hctosys(dev: &Arc<RtcGeneralDevice>) { in rtc_hctosys() 93 let r = rtc_read_time(dev); in rtc_hctosys() 95 dev.set_hc2sys_result(Err(e)); in rtc_hctosys() 102 dev.set_hc2sys_result(r); in rtc_hctosys()
|
H A D | rtc_cmos.rs | 72 let dev = device in probe() localVariable 78 if dev.id_table() != self.id_table().unwrap() { in probe() 93 let general_rtc_device: Arc<RtcGeneralDevice> = rtc_general_device_create(&dev, None); in probe() 220 fn read_time(&self, dev: &Arc<dyn RtcDevice>) -> Result<RtcTime, SystemError> { in read_time() 221 dev.class_ops().read_time(dev) in read_time() 224 fn set_time(&self, dev: &Arc<dyn RtcDevice>, time: &RtcTime) -> Result<(), SystemError> { in set_time() 225 dev.class_ops().set_time(dev, time) in set_time()
|
/DragonOS/user/port/binutils/2.38/ |
H A D | Dockerfile | 15 libgmp-dev \ 16 libmpc-dev \ 17 libmpfr-dev \ 18 libncurses5-dev \ 27 zlib1g-dev \
|
H A D | build.sh | 31 libgmp3-dev \ 32 libmpc-dev \ 33 libmpfr-dev \
|
/DragonOS/tools/ |
H A D | bootstrap.sh | 66 llvm-dev libclang-dev clang gcc-multilib \ 67 gcc build-essential fdisk dosfstools dnsmasq bridge-utils iptables libssl-dev pkg-config \ 111 …dev-util/pkgconf sys-apps/which app-arch/unzip sys-apps/util-linux sys-fs/dosfstools sys-devel/gcc… 304 if hash 2>/dev/null zypper; then 307 elif hash 2>/dev/null apt-get; then 310 elif hash 2>/dev/null dnf; then 313 elif hash 2>/dev/null emerge; then 316 elif hash 2>/dev/null eopkg; then 319 elif hash 2>/dev/null pacman; then 322 elif hash 2>/dev/null pkg; then [all …]
|
H A D | build_in_docker.sh | 3 …MKNOD -v $(pwd):/data -v /dev:/dev -v dragonos-build-cargo:/root/.cargo/registry --name dragonos-b…
|
H A D | write_disk_image.sh | 115 mkdir -p ${root_folder}/bin/disk_mount/dev 118 touch ${root_folder}/bin/disk_mount/dev/keyboard.dev 157 …${GRUB_PATH_I386_LEGACY_INSTALL} --target=i386-pc --boot-directory=${boot_folder} /dev/$LOOP_DEVICE 168 …${GRUB_PATH_I386_LEGACY_INSTALL} --target=i386-pc --boot-directory=${boot_folder} /dev/$LOOP_DEVICE
|
/DragonOS/kernel/src/driver/pci/ |
H A D | attr.rs | 51 let dev = _kobj in show() localVariable 57 return sysfs_emit_str(_buf, &format!("0x{:04x}", dev.vendor())); in show() 82 let dev = _kobj in show() localVariable 88 return sysfs_emit_str(_buf, &format!("0x{:04x}", dev.device_id())); in show() 113 let dev = _kobj in show() localVariable 119 return sysfs_emit_str(_buf, &format!("0x{:04x}", dev.subsystem_vendor())); in show() 144 let dev = _kobj in show() localVariable 150 return sysfs_emit_str(_buf, &format!("0x{:04x}", dev.subsystem_device())); in show()
|
H A D | dev_id.rs | 44 pub fn match_dev(&self, dev: &Arc<dyn PciDevice>) -> bool { in match_dev() 45 if let Some(d_data) = &dev.dynid().special_data { in match_dev() 49 return s_data.match_dev(dev.dynid().special_data); in match_dev() 51 let d_id = dev.dynid(); in match_dev()
|
H A D | driver.rs | 58 fn match_dev(&self, dev: &Arc<dyn PciDevice>) -> Option<Arc<PciDeviceID>> { in match_dev() 60 if i.match_dev(dev) { in match_dev()
|
/DragonOS/kernel/src/arch/x86_64/driver/ |
H A D | rtc.rs | 238 fn read_time(&self, dev: &Arc<dyn RtcDevice>) -> Result<RtcTime, SystemError> { in read_time() 240 let dev = dev in read_time() localVariable 245 let _guard = dev.ops_mutex.lock(); in read_time() 250 let status_register_b: u8 = dev.read_cmos(0x0B); // 读取状态寄存器B in read_time() 257 res.year = dev.read_cmos(CMOSTimeSelector::Year as u8) as i32; in read_time() 258 res.month = dev.read_cmos(CMOSTimeSelector::Month as u8) as i32; in read_time() 259 res.mday = dev.read_cmos(CMOSTimeSelector::Day as u8) as i32; in read_time() 260 res.hour = dev.read_cmos(CMOSTimeSelector::Hour as u8) as i32; in read_time() 261 res.minute = dev.read_cmos(CMOSTimeSelector::Minute as u8) as i32; in read_time() 262 res.second = dev.read_cmos(CMOSTimeSelector::Second as u8) as i32; in read_time() [all …]
|
/DragonOS/user/port/gcc/11.3.0/ |
H A D | build-hosted.sh | 33 libgmp3-dev \ 34 libmpc-dev \ 35 libmpfr-dev \
|
/DragonOS/docs/introduction/ |
H A D | build_system.md | 83 - llvm-dev 84 - libclang-dev 109 sudo apt install -y autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \ 111 zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev libsdl2-dev \
|
/DragonOS/.github/workflows/ |
H A D | makefile.yml | 15 container: dragonos/dragonos-dev:v1.5 38 container: dragonos/dragonos-dev:v1.5 59 container: dragonos/dragonos-dev:v1.5 81 container: dragonos/dragonos-dev:v1.5
|
/DragonOS/kernel/src/driver/net/ |
H A D | mod.rs | 111 fn register_netdevice(dev: Arc<dyn NetDevice>) -> Result<(), SystemError> { in register_netdevice() 113 netdev_register_kobject(dev.clone())?; in register_netdevice() 116 dev.set_net_state(NetDeivceState::__LINK_STATE_PRESENT); in register_netdevice()
|
/DragonOS/kernel/src/exception/ |
H A D | msi.rs | 78 dev: Option<Arc<dyn Device>>, field 96 dev: Option<Arc<dyn Device>>, in new() 104 dev, in new()
|
/DragonOS/tools/qemu/ |
H A D | ifup-nat | 15 if brctl show | grep "^$BRIDGE" &> /dev/null; then 44 ps -ef | grep "dnsmasq" | grep -v "grep" &> /dev/null
|
/DragonOS/kernel/src/driver/pci/test/ |
H A D | pt_driver.rs | 94 if guard.devices.iter().any(|dev| Arc::ptr_eq(dev, &device)) { in add_device() 103 guard.devices.retain(|dev| !Arc::ptr_eq(dev, device)); in delete_device()
|
/DragonOS/kernel/src/driver/input/serio/i8042/ |
H A D | i8042_driver.rs | 113 if guard.devices.iter().any(|dev| Arc::ptr_eq(dev, &device)) { in add_device() 122 guard.devices.retain(|dev| !Arc::ptr_eq(dev, device)); in delete_device()
|