-
Notifications
You must be signed in to change notification settings - Fork 27
treewide: nuke old repo and replace with rewrite from @phip1611 #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
d3473f7 to
a43ff67
Compare
Wasabi375
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First off I want to say that this looks great and I'm all for merging this. Thanks for the great work.
That said, I'm not a maintainer here so please feel free to ignore my comments (especially the style based ones if you don't agree).
thanks, your review was already very helpful! |
de7fd3b to
76bde4a
Compare
## TL;DR
As discussed [0], this is my 100% rewrite of the crate. It is 100% spec
compliant, highly configurable (usable in kernel drivers) while still
preserving a very simple entry-level abstraction that "just works".
**It also runs on real hardware now!** The original code wasn't mature
enough for all the caveats. Further, we have one common abstraction for
x86 port I/O and MMIO.
## Background
As part of a learning project, I conducted an in-depth exploration of
UART 16550 devices and driver development. During this process, I
identified a key limitation in the current crate: the inability to
configure the baud rate. This functionality is essential for real
hardware usage, and addressing it was my primary motivation.
As I continued, I recognized additional areas for improvement.
Incremental changes quickly proved insufficient to meet the standards
of code quality, completeness, and maintainability I aimed for.
Consequently, I undertook a full rewrite, resulting in a driver that
is fully spec-compliant while maintaining seamless and idiomatic Rust
integration.
While I could release this as a separate crate, I prefer not to fragment
the ecosystem - especially given that rust-osdev already maintains a
crate in this space. **I fully acknowledge that this presents a "take it
or leave it" ("friss oder stirb") scenario** 😞 . That said, I am eager to
collaborate toward a solution that serves the community effectively,
and I am confident this rewrite provides a strong, forward-looking
foundation.
## Notes about Real Hardware Tests
To properly operate with real hardware, I had to specifically
investigate the behavior and especially adapt try_send_bytes()
and test_loopback().
Further, the source and the destination must agree on the baud
rate. Tests in VMs would behave differently (have fewer caveats),
especially as the baud rate is mostly irrelevant there.
## About API and Implementation
Please look into `lib.rs`, I suggest using `cargo doc`. A small except from README is also here:
[0] https://rust-osdev.zulipchat.com/#narrow/channel/426430-general/topic/uart.2016550.20.2F.20serial/near/566528969
This is a basic integration test that runs the code in a VM machine that uses a x86 port I/O backed UART16550.
TL;DR
As discussed [0], this is my 100% rewrite of the crate. It is 100% spec
complete, highly configurable (usable in kernel drivers) while still
preserving a very simple entry-level abstraction that "just works".
It also runs on real hardware now! The original code wasn't mature
enough for all the caveats. Further, we have one common abstraction for
x86 port I/O and MMIO.
Background
As part of a learning project, I conducted an in-depth exploration of
UART 16550 devices and driver development. During this process, I
identified a key limitation in the current crate: the inability to
configure the baud rate. This functionality is essential for real
hardware usage, and addressing it was my primary motivation.
As I continued, I recognized additional areas for improvement.
Incremental changes quickly proved insufficient to meet the standards
of code quality, completeness, and maintainability I aimed for.
Consequently, I undertook a full rewrite, resulting in a driver that
is fully spec-compliant while maintaining seamless and idiomatic Rust
integration.
While I could release this as a separate crate, I prefer not to fragment
the ecosystem - especially given that rust-osdev already maintains a
crate in this space. I fully acknowledge that this presents a "take it
or leave it" ("friss oder stirb") scenario 😞 . That said, I am eager to
collaborate toward a solution that serves the community effectively,
and I am confident this rewrite provides a strong, forward-looking
foundation.
Notes about Real Hardware Tests
To properly operate with real hardware, I had to specifically
investigate the behavior and especially adapt try_send_bytes()
and test_loopback().
Further, the source and the destination must agree on the baud
rate. Tests in VMs would behave differently (have fewer caveats),
especially as the baud rate is mostly irrelevant there.
About API and Implementation
Please look into
lib.rs, I suggest usingcargo doc. A small except from README is also here:Example (Minimalistic)
lib.rsExample (More low-level control)
lib.rsHints for Reviewers
I tested this on real hardware, in QEMU, and in Cloud Hypervisor. I
suggest checking this out and using
cargo doc --opento get a niceoverview.
I didn't use a LLM to write the code, only for this cover letter
(commit message) to improve it.
Steps to Undraft
[0] https://rust-osdev.zulipchat.com/#narrow/channel/426430-general/topic/uart.2016550.20.2F.20serial/near/566528969
Closes #37 #38 #30