Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
543 changes: 286 additions & 257 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions crates/pds/pl031-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
name = "microkit-http-server-example-pl031-driver"
version = "0.1.0"
authors = ["Nick Spinale <nick.spinale@coliasgroup.com>"]
edition = "2021"
edition = "2024"
license = "BSD-2-Clause"

[dependencies]
sel4-microkit = { git = "https://github.com/seL4/rust-sel4" }
sel4-microkit-driver-adapters = { git = "https://github.com/seL4/rust-sel4" }
sel4-pl031-driver = { git = "https://github.com/seL4/rust-sel4" }

[dependencies.sel4-microkit-driver-adapters]
git = "https://github.com/seL4/rust-sel4"
2 changes: 1 addition & 1 deletion crates/pds/pl031-driver/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#![no_std]
#![no_main]

use sel4_microkit::{memory_region_symbol, protection_domain, Channel, Handler};
use sel4_microkit::{Channel, Handler, memory_region_symbol, protection_domain};
use sel4_microkit_driver_adapters::rtc::driver::HandlerImpl;
use sel4_pl031_driver::Driver;

Expand Down
29 changes: 19 additions & 10 deletions crates/pds/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
name = "microkit-http-server-example-server"
version = "0.1.0"
authors = ["Nick Spinale <nick.spinale@coliasgroup.com>"]
edition = "2021"
edition = "2024"
license = "BSD-2-Clause"

[dependencies]
async-unsync = { version = "0.3.0", default-features = false }
futures = { version = "0.3.28", default-features = false, features = ["async-await", "alloc"] }
log = "0.4.17"
futures = { version = "0.3.31", default-features = false, features = ["async-await", "alloc"] }
log = "0.4.28"
microkit-http-server-example-server-core = { path = "core", features = [] }
one-shot-mutex = "0.2.1"
rtcc = "0.3.2"
rtcc = "0.4.0"
sel4 = { git = "https://github.com/seL4/rust-sel4" }
sel4-abstract-allocator = { git = "https://github.com/seL4/rust-sel4" }
sel4-async-block-io = { git = "https://github.com/seL4/rust-sel4" }
Expand All @@ -33,24 +33,33 @@ sel4-driver-interfaces = { git = "https://github.com/seL4/rust-sel4" }
sel4-immediate-sync-once-cell = { git = "https://github.com/seL4/rust-sel4" }
sel4-logging = { git = "https://github.com/seL4/rust-sel4" }
sel4-microkit = { git = "https://github.com/seL4/rust-sel4", features = ["alloc"] }
sel4-microkit-driver-adapters = { git = "https://github.com/seL4/rust-sel4" }
sel4-newlib = { git = "https://github.com/seL4/rust-sel4", features = ["nosys", "all-symbols"] }
sel4-shared-memory = { git = "https://github.com/seL4/rust-sel4" }
sel4-shared-ring-buffer = { git = "https://github.com/seL4/rust-sel4" }
sel4-shared-ring-buffer-block-io = { git = "https://github.com/seL4/rust-sel4" }
sel4-shared-ring-buffer-smoltcp = { git = "https://github.com/seL4/rust-sel4" }

[dependencies.sel4-async-single-threaded-executor]
git = "https://github.com/seL4/rust-sel4"

[dependencies.sel4-microkit-driver-adapters]
git = "https://github.com/seL4/rust-sel4"

[dependencies.sel4-newlib]
git = "https://github.com/seL4/rust-sel4"
features = ["detect-libc", "link-libc", "link-libnosys", "all-symbols"]

[dependencies.sel4-shared-ring-buffer-block-io]
git = "https://github.com/seL4/rust-sel4"

[dependencies.sel4-shared-ring-buffer-block-io-types]
git = "https://github.com/seL4/rust-sel4"

[dependencies.sel4-shared-ring-buffer-bookkeeping]
git = "https://github.com/seL4/rust-sel4"

[dependencies.sel4-shared-ring-buffer-smoltcp]
git = "https://github.com/seL4/rust-sel4"

[dependencies.smoltcp]
version = "0.11.0"
version = "0.12.0"
default-features = false
features = [
"proto-ipv4",
Expand All @@ -63,4 +72,4 @@ features = [
]

[build-dependencies]
rcgen = "0.13.1"
rcgen = "0.14.5"
2 changes: 1 addition & 1 deletion crates/pds/server/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ fn main() {
let cert_path = PathBuf::from(&out_dir).join("cert.pem");
fs::write(cert_path, cert.cert.pem()).unwrap();
let priv_path = PathBuf::from(&out_dir).join("priv.pem");
fs::write(priv_path, cert.key_pair.serialize_pem()).unwrap();
fs::write(priv_path, cert.signing_key.serialize_pem()).unwrap();
}
18 changes: 10 additions & 8 deletions crates/pds/server/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,33 @@
name = "microkit-http-server-example-server-core"
version = "0.1.0"
authors = ["Nick Spinale <nick.spinale@coliasgroup.com>"]
edition = "2021"
edition = "2024"
license = "BSD-2-Clause"

[dependencies]
embedded-io-async = "0.6.1"
futures = { version = "0.3.28", default-features = false, features = ["async-await", "alloc"] }
httparse = { version = "1.8.0", default-features = false }
log = "0.4.17"
embedded-io-async = "0.7.0"
futures = { version = "0.3.31", default-features = false, features = ["async-await", "alloc"] }
httparse = { version = "1.10.1", default-features = false }
log = "0.4.28"
rustls = { version = "0.23.5", default-features = false, features = ["logging", "ring", "tls12"] }
rustls-pemfile = { version = "2.0.0", default-features = false }
sel4-async-block-io = { git = "https://github.com/seL4/rust-sel4" }
sel4-async-block-io-fat = { git = "https://github.com/seL4/rust-sel4" }
sel4-async-io = { git = "https://github.com/seL4/rust-sel4" }
sel4-async-network = { git = "https://github.com/seL4/rust-sel4" }
sel4-async-network-rustls = { git = "https://github.com/seL4/rust-sel4" }
sel4-async-network-rustls-utils = { git = "https://github.com/seL4/rust-sel4" }
sel4-async-time = { git = "https://github.com/seL4/rust-sel4" }
sel4-async-unsync = { git = "https://github.com/seL4/rust-sel4" }
sel4-panicking-env = { git = "https://github.com/seL4/rust-sel4" }
webpki-roots = "0.26"
webpki-roots = "1.0.3"

[dependencies.sel4-async-network-rustls-utils]
git = "https://github.com/seL4/rust-sel4"

[dependencies.sel4-async-single-threaded-executor]
git = "https://github.com/seL4/rust-sel4"

[dependencies.smoltcp]
version = "0.11.0"
version = "0.12.0"
default-features = false
features = ["proto-ipv4", "proto-dhcpv4", "proto-dns", "socket-dhcpv4", "socket-dns", "socket-tcp"]
18 changes: 9 additions & 9 deletions crates/pds/server/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ use core::time::Duration;
use embedded_io_async::ReadExactError;
use futures::future::{self, LocalBoxFuture};
use futures::task::LocalSpawnExt;
use rustls::ServerConfig;
use rustls::pki_types::{PrivateKeyDer, UnixTime};
use rustls::version::TLS12;
use rustls::ServerConfig;

use sel4_async_block_io::{access::ReadOnly, constant_block_sizes, BlockIO};
use sel4_async_block_io::{BlockIO, access::ReadOnly, constant_block_sizes};
use sel4_async_block_io_fat as fat;
use sel4_async_io::EmbeddedIOAsyncAdapter;
use sel4_async_network::{ManagedInterface, TcpSocket, TcpSocketError};
Expand Down Expand Up @@ -153,13 +153,13 @@ fn mk_tls_config(
now_unix_time: Duration,
now_fn: impl 'static + Send + Sync + Fn() -> Instant,
) -> ServerConfig {
let cert_der = match rustls_pemfile::read_one_from_slice(cert_pem.as_bytes())
.unwrap()
.unwrap()
.0
{
rustls_pemfile::Item::X509Certificate(cert) => cert,
_ => panic!(),
let rustls_pemfile::Item::X509Certificate(cert_der) =
rustls_pemfile::read_one_from_slice(cert_pem.as_bytes())
.unwrap()
.unwrap()
.0
else {
panic!()
};

let key_der = match rustls_pemfile::read_one_from_slice(priv_pem.as_bytes())
Expand Down
2 changes: 1 addition & 1 deletion crates/pds/server/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use one_shot_mutex::sync::OneShotMutex;
use smoltcp::iface::Config;
use smoltcp::time::Instant as SmoltcpInstant;

use sel4_abstract_allocator::basic::BasicAllocator;
use sel4_abstract_allocator::WithAlignmentBound;
use sel4_abstract_allocator::basic::BasicAllocator;
use sel4_async_block_io::{access::ReadOnly, constant_block_sizes::BlockSize512};
use sel4_async_network::{DhcpOverrides, ManagedInterface};
use sel4_async_single_threaded_executor::{LocalPool, LocalSpawner};
Expand Down
6 changes: 3 additions & 3 deletions crates/pds/server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ use smoltcp::iface::Config;
use smoltcp::phy::{Device, DeviceCapabilities, Medium};
use smoltcp::wire::{EthernetAddress, HardwareAddress};

use sel4_abstract_allocator::basic::BasicAllocator;
use sel4_abstract_allocator::WithAlignmentBound;
use sel4_abstract_allocator::basic::BasicAllocator;
use sel4_async_block_io::{
constant_block_sizes::BlockSize512, disk::Disk, BlockSize, CachedBlockIO, ConstantBlockSize,
BlockSize, CachedBlockIO, ConstantBlockSize, constant_block_sizes::BlockSize512, disk::Disk,
};
use sel4_async_time::Instant;
use sel4_driver_interfaces::block::GetBlockDeviceLayout;
use sel4_driver_interfaces::net::GetNetDeviceMeta;
use sel4_driver_interfaces::timer::{Clock, DefaultTimer};
use sel4_logging::{LevelFilter, Logger, LoggerBuilder};
use sel4_microkit::{memory_region_symbol, protection_domain, Handler};
use sel4_microkit::{Handler, memory_region_symbol, protection_domain};
use sel4_microkit_driver_adapters::block::client::Client as BlockClient;
use sel4_microkit_driver_adapters::net::client::Client as NetClient;
use sel4_microkit_driver_adapters::rtc::client::Client as RtcClient;
Expand Down
6 changes: 4 additions & 2 deletions crates/pds/sp804-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
name = "microkit-http-server-example-sp804-driver"
version = "0.1.0"
authors = ["Nick Spinale <nick.spinale@coliasgroup.com>"]
edition = "2021"
edition = "2024"
license = "BSD-2-Clause"

[dependencies]
sel4-driver-interfaces = { git = "https://github.com/seL4/rust-sel4" }
sel4-microkit = { git = "https://github.com/seL4/rust-sel4" }
sel4-microkit-driver-adapters = { git = "https://github.com/seL4/rust-sel4" }
sel4-sp804-driver = { git = "https://github.com/seL4/rust-sel4" }

[dependencies.sel4-microkit-driver-adapters]
git = "https://github.com/seL4/rust-sel4"
2 changes: 1 addition & 1 deletion crates/pds/sp804-driver/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#![no_main]

use sel4_driver_interfaces::timer::SingleTimer;
use sel4_microkit::{memory_region_symbol, protection_domain, Channel, Handler};
use sel4_microkit::{Channel, Handler, memory_region_symbol, protection_domain};
use sel4_microkit_driver_adapters::timer::driver::HandlerImpl;
use sel4_sp804_driver::Driver;

Expand Down
10 changes: 6 additions & 4 deletions crates/pds/virtio-blk-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@
name = "microkit-http-server-example-virtio-blk-driver"
version = "0.1.0"
authors = ["Nick Spinale <nick.spinale@coliasgroup.com>"]
edition = "2021"
edition = "2024"
license = "BSD-2-Clause"

[dependencies]
log = "0.4.17"
log = "0.4.28"
sel4 = { git = "https://github.com/seL4/rust-sel4" }
sel4-abstract-allocator = { git = "https://github.com/seL4/rust-sel4" }
sel4-driver-interfaces = { git = "https://github.com/seL4/rust-sel4" }
sel4-immediate-sync-once-cell = { git = "https://github.com/seL4/rust-sel4" }
sel4-logging = { git = "https://github.com/seL4/rust-sel4" }
sel4-microkit = { git = "https://github.com/seL4/rust-sel4" }
sel4-microkit-driver-adapters = { git = "https://github.com/seL4/rust-sel4" }
sel4-shared-memory = { git = "https://github.com/seL4/rust-sel4" }
sel4-shared-ring-buffer = { git = "https://github.com/seL4/rust-sel4" }
sel4-virtio-blk = { git = "https://github.com/seL4/rust-sel4" }
sel4-virtio-hal-impl = { git = "https://github.com/seL4/rust-sel4" }
virtio-drivers = { version = "0.7.2", default-features = false }
virtio-drivers = { version = "0.12.0", default-features = false }

[dependencies.sel4-microkit-driver-adapters]
git = "https://github.com/seL4/rust-sel4"

[dependencies.sel4-shared-ring-buffer-block-io-types]
git = "https://github.com/seL4/rust-sel4"
1 change: 1 addition & 0 deletions crates/pds/virtio-blk-driver/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ pub mod channels {
}

pub const VIRTIO_BLK_MMIO_OFFSET: usize = 0xc00;
pub const VIRTIO_BLK_MMIO_SIZE: usize = 0x200;
pub const VIRTIO_BLK_DRIVER_DMA_SIZE: usize = 0x200_000;
pub const VIRTIO_BLK_CLIENT_DMA_SIZE: usize = 0x200_000;
13 changes: 7 additions & 6 deletions crates/pds/virtio-blk-driver/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ use core::ptr::NonNull;
use virtio_drivers::{
device::blk::*,
transport::{
mmio::{MmioTransport, VirtIOHeader},
DeviceType, Transport,
mmio::{MmioTransport, VirtIOHeader},
},
};

use sel4_microkit::{
memory_region_symbol, protection_domain, var, Channel, ChannelSet, Handler, Infallible,
MessageInfo,
Channel, ChannelSet, Handler, Infallible, MessageInfo, memory_region_symbol, protection_domain,
var,
};
use sel4_microkit_driver_adapters::block::driver::handle_client_request;
use sel4_shared_memory::SharedMemoryRef;
use sel4_shared_ring_buffer::{roles::Use, RingBuffers};
use sel4_shared_ring_buffer::{RingBuffers, roles::Use};
use sel4_shared_ring_buffer_block_io_types::{
BlockIORequest, BlockIORequestStatus, BlockIORequestType,
};
Expand Down Expand Up @@ -58,7 +58,8 @@ fn init() -> HandlerImpl {
as *mut VirtIOHeader,
)
.unwrap();
let transport = unsafe { MmioTransport::new(header) }.unwrap();
let transport =
unsafe { MmioTransport::new(header, config::VIRTIO_BLK_MMIO_SIZE) }.unwrap();
assert_eq!(transport.device_type(), DeviceType::Block);
VirtIOBlk::<HalImpl, MmioTransport>::new(transport).unwrap()
};
Expand Down Expand Up @@ -90,7 +91,7 @@ fn init() -> HandlerImpl {
}

struct HandlerImpl {
dev: VirtIOBlk<HalImpl, MmioTransport>,
dev: VirtIOBlk<HalImpl, MmioTransport<'static>>,
client_region: SharedMemoryRef<'static, [u8]>,
ring_buffers: RingBuffers<'static, Use, fn(), BlockIORequest>,
pending: BTreeMap<u16, Pin<Box<PendingEntry>>>,
Expand Down
10 changes: 6 additions & 4 deletions crates/pds/virtio-net-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@
name = "microkit-http-server-example-virtio-net-driver"
version = "0.1.0"
authors = ["Nick Spinale <nick.spinale@coliasgroup.com>"]
edition = "2021"
edition = "2024"
license = "BSD-2-Clause"

[dependencies]
log = "0.4.17"
log = "0.4.28"
sel4 = { git = "https://github.com/seL4/rust-sel4" }
sel4-abstract-allocator = { git = "https://github.com/seL4/rust-sel4" }
sel4-immediate-sync-once-cell = { git = "https://github.com/seL4/rust-sel4" }
sel4-logging = { git = "https://github.com/seL4/rust-sel4" }
sel4-microkit = { git = "https://github.com/seL4/rust-sel4" }
sel4-microkit-driver-adapters = { git = "https://github.com/seL4/rust-sel4" }
sel4-shared-memory = { git = "https://github.com/seL4/rust-sel4" }
sel4-shared-ring-buffer = { git = "https://github.com/seL4/rust-sel4" }
sel4-virtio-hal-impl = { git = "https://github.com/seL4/rust-sel4" }
sel4-virtio-net = { git = "https://github.com/seL4/rust-sel4" }
virtio-drivers = { version = "0.7.2", default-features = false, features = ["alloc"] }
virtio-drivers = { version = "0.12.0", default-features = false, features = ["alloc"] }

[dependencies.sel4-microkit-driver-adapters]
git = "https://github.com/seL4/rust-sel4"
1 change: 1 addition & 0 deletions crates/pds/virtio-net-driver/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ pub mod channels {
}

pub const VIRTIO_NET_MMIO_OFFSET: usize = 0xe00;
pub const VIRTIO_NET_MMIO_SIZE: usize = 0x200;
pub const VIRTIO_NET_DRIVER_DMA_SIZE: usize = 0x200_000;
pub const VIRTIO_NET_CLIENT_DMA_SIZE: usize = 0x200_000;
9 changes: 5 additions & 4 deletions crates/pds/virtio-net-driver/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ use core::ptr::NonNull;
use virtio_drivers::{
device::net::*,
transport::{
mmio::{MmioTransport, VirtIOHeader},
DeviceType, Transport,
mmio::{MmioTransport, VirtIOHeader},
},
};

use sel4_microkit::{memory_region_symbol, protection_domain, var};
use sel4_microkit_driver_adapters::net::driver::HandlerImpl;
use sel4_shared_memory::SharedMemoryRef;
use sel4_shared_ring_buffer::{roles::Use, RingBuffers};
use sel4_shared_ring_buffer::{RingBuffers, roles::Use};
use sel4_virtio_hal_impl::HalImpl;
use sel4_virtio_net::DeviceWrapper;

Expand All @@ -34,7 +34,7 @@ const NET_BUFFER_LEN: usize = 2048;
#[protection_domain(
heap_size = 512 * 1024,
)]
fn init() -> HandlerImpl<DeviceWrapper<HalImpl, MmioTransport>> {
fn init() -> HandlerImpl<DeviceWrapper<HalImpl, MmioTransport<'static>>> {
HalImpl::init(
config::VIRTIO_NET_DRIVER_DMA_SIZE,
*var!(virtio_net_driver_dma_vaddr: usize = 0),
Expand All @@ -47,7 +47,8 @@ fn init() -> HandlerImpl<DeviceWrapper<HalImpl, MmioTransport>> {
as *mut VirtIOHeader,
)
.unwrap();
let transport = unsafe { MmioTransport::new(header) }.unwrap();
let transport =
unsafe { MmioTransport::new(header, config::VIRTIO_NET_MMIO_SIZE) }.unwrap();
assert_eq!(transport.device_type(), DeviceType::Network);
VirtIONet::<HalImpl, MmioTransport, NET_QUEUE_SIZE>::new(transport, NET_BUFFER_LEN).unwrap()
};
Expand Down
Loading