Skip to content

Commit e9fbd5c

Browse files
committed
feat: impl symlink
1 parent 8b487e3 commit e9fbd5c

File tree

29 files changed

+493
-379
lines changed

29 files changed

+493
-379
lines changed

Cargo.lock

Lines changed: 93 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ logging = { path = "crates/logging" }
4949
signal = { path = "crates/signal" }
5050
sync = { path = "crates/sync" }
5151

52-
polyhal = { version = "0.2.3", features = ["logger", "trap"] }
53-
polyhal-boot = { version = "0.2.3" }
54-
polyhal-trap = { version = "0.2.3" }
52+
polyhal = { version = "0.2.4", features = ["logger", "trap"] }
53+
polyhal-boot = { version = "0.2.4" }
54+
polyhal-trap = { version = "0.2.4" }
5555
fdt-parser = { version = "0.4.12" }
5656

5757
syscalls = { git = "https://github.com/jasonwhite/syscalls.git", default-features = false }

README.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
## How to use this project
44

5-
Install build package.
6-
7-
```shell
8-
cargo install --git https://github.com/Byte-OS/cargo-byteos
9-
```
10-
115
Run with make file.
126

137
```shell
@@ -21,18 +15,6 @@ make PLATFORM=x86_64-qemu run
2115
make PLATFORM=loongarch64-qemu run
2216
```
2317

24-
You can find available modules using the following command.
25-
26-
```shell
27-
byteos patch list
28-
29-
# Download and patch in Cargo.toml
30-
byteos patch add arch
31-
32-
# remove patch and delete folder
33-
byteos patch remove arch
34-
```
35-
3618
## byteos.yaml
3719

3820
> byteos.yaml is a configuration file for the ByteOS.

byteos.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ bin:
1212
riscv64-qemu:
1313
target: "riscv64gc-unknown-none-elf"
1414
configs:
15-
driver: "kramdisk"
15+
driver: "kvirtio"
1616
riscv64-vf2:
1717
target: "riscv64imac-unknown-none-elf"
1818
configs:
@@ -21,7 +21,7 @@ bin:
2121
x86_64-qemu:
2222
target: "x86_64-unknown-none"
2323
configs:
24-
driver: "kvirtio,kramdisk"
24+
driver: "kvirtio"
2525
x86_64-generic:
2626
target: "x86_64-unknown-none"
2727
configs:

crates/devices/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ fdt-parser = { workspace = true }
1313
linkme = { version = "0.3.22", features = ["used_linker"] }
1414
log = "0.4"
1515
sync = { workspace = true }
16-
virtio-drivers = { git = "https://github.com/rcore-os/virtio-drivers", rev = "61ece50" }
1716
timestamp = { git = "https://github.com/Byte-OS/timestamp.git" }
1817
runtime = { workspace = true }

driver/kramdisk/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ edition = "2021"
77

88
[dependencies]
99
log = "0.4"
10-
virtio-drivers = { git = "https://github.com/rcore-os/virtio-drivers", rev = "61ece50" }
1110
devices = { workspace = true }

driver/kvirtio/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ edition = "2021"
77

88
[dependencies]
99
log = "0.4"
10-
virtio-drivers = { git = "https://github.com/rcore-os/virtio-drivers", rev = "61ece50" }
10+
# virtio-drivers = { git = "https://github.com/rcore-os/virtio-drivers", rev = "61ece50" }
11+
virtio-drivers = { version = "0.8" }
1112
devices = { workspace = true }

driver/kvirtio/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ use virtio_drivers::transport::{
2727

2828
#[cfg(any(target_arch = "x86_64"))]
2929
use devices::ALL_DEVICES;
30+
#[cfg(any(target_arch = "x86_64"))]
31+
use virtio_drivers::transport::pci::bus::MmioCam;
3032

3133
#[cfg(any(target_arch = "x86_64"))]
3234
use virtio_drivers::transport::pci::{
@@ -79,7 +81,7 @@ fn virtio_device(transport: MmioTransport, node: &Node) -> Arc<dyn Driver> {
7981
fn enumerate_pci(mmconfig_base: *mut u8) {
8082
info!("mmconfig_base = {:#x}", mmconfig_base as usize);
8183

82-
let mut pci_root = unsafe { PciRoot::new(mmconfig_base, Cam::Ecam) };
84+
let mut pci_root = unsafe { PciRoot::<MmioCam>::new(MmioCam::new(mmconfig_base, Cam::Ecam)) };
8385
for (device_function, info) in pci_root.enumerate_bus(0) {
8486
let (status, command) = pci_root.get_status_command(device_function);
8587
info!(
@@ -97,7 +99,7 @@ fn enumerate_pci(mmconfig_base: *mut u8) {
9799
dump_bar_contents(&mut pci_root, device_function, 4);
98100

99101
let mut transport =
100-
PciTransport::new::<HalImpl>(&mut pci_root, device_function).unwrap();
102+
PciTransport::new::<HalImpl, MmioCam>(&mut pci_root, device_function).unwrap();
101103
info!(
102104
"Detected virtio PCI device with device type {:?}, features {:#018x}",
103105
transport.device_type(),
@@ -127,7 +129,7 @@ fn virtio_device_probe(transport: impl Transport + 'static) {
127129
}
128130

129131
#[cfg(any(target_arch = "x86_64"))]
130-
fn dump_bar_contents(root: &mut PciRoot, device_function: DeviceFunction, bar_index: u8) {
132+
fn dump_bar_contents(root: &mut PciRoot<MmioCam>, device_function: DeviceFunction, bar_index: u8) {
131133
let bar_info = root.bar_info(device_function, bar_index).unwrap();
132134
trace!("Dumping bar {}: {:#x?}", bar_index, bar_info);
133135
if let BarInfo::Memory { address, size, .. } = bar_info {

driver/kvirtio/src/virtio_impl.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ unsafe impl Hal for HalImpl {
3636
}
3737

3838
unsafe fn mmio_phys_to_virt(paddr: PhysAddr, _size: usize) -> NonNull<u8> {
39-
warn!("phys to virt");
4039
NonNull::new((usize::from(paddr) | VIRT_ADDR_START) as *mut u8).unwrap()
4140
}
4241

filesystem/devfs/src/tty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ impl INodeInterface for Tty {
3737
}
3838
Ok(rlen)
3939
} else {
40-
// VfsError::Blocking
4140
if let Some(c) = get_char() {
4241
buffer[0] = c as u8;
4342
Ok(1)

0 commit comments

Comments
 (0)