Draft
Conversation
Lazily read the Vendor-Specific Capabilities?Currently, vendor-specific capabilities are eagerly read and kept in a vector. This is likely suboptimal. Ideally, we should get some type that we can call functions on to get u32s from. SunriseOS/libuser/src/pci/capabilities.rs Lines 124 to 134 in 32af349 This comment was generated by todo based on a
|
Remove the InPointer/InBuffer/OutPointer/OutBuffer types as they did not have a reason to exist in the new object system. Instead, the pop_buffer family of function now return a raw reference, whose lifetime is selected by the caller. This simplifies the code a fair bit.
Share the PCI implementation across multiple drivers by moving it to libuser.
The GetSystemTick syscall returns a monotonic up-counter representing a frequency of 19200000 Hz. Note that none of our clocks actually run at this frequency (HPET is likely to have a much higher frequency, while PIT is likely to have a much, much, much lower frequency). As such, we have to do some maths. In order to implement GetSystemTick, the KERNEL_TIMER_INFO now contains a get_tick function pointer. When the kernel timer gets selected, it should provide an implementation of that function as a parameter to set_kernel_timer_info.
Turns out, the spec we were basic our PCI implementation on previously was probably a draft. After updating to a more correct spec, things started working a lot better, unsurprisingly.
We now support auto-selected (smart) buffers. When the user fetches an interface containing methods with smart-buffers, it will fetch the Pointer Buffer Size. Depending on whether the smart buffer fits the pointer buffer or not, it will be passed as either a Pointer or a Buffer. In order to implement this, a simple dispatch for Control messages was implemented. The QueryPointerBufferSize function was implemented as well. The pointer buffer size is fetched and cached on interface creation. Only interfaces actually containing smart buffers will fetch this information, to avoid doing a bunch of useless IPC requests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let's talk to the internet!
Currently,
virtiois able to talk to a TCP server.virtiois all hardcoded though, so what's left to do is:virtiointo two services:virtioproper andvirtio-net.virtiois responsible for handling the generic virtio interface. All the virtio devices are owned by thevirtiosysmodule, which will expose an IPC interface to interact with them (Feature negociation, setting up the virtqueues, pushing/popping buffers, waiting for an event, etc...)virtio-netwill contain the drivier for virtio-net interfaces, the glue to make it work withsmoltcp, and expose an IPC interfacebsdwhich will expose the BSD Socket interface we're all familiar with.bsdinterface on top of smoltcp. Smoltcp's interface is very different from the standard BSD socket, so we might need to do quite a bit of glue here.shellto test the implementation.