-
Notifications
You must be signed in to change notification settings - Fork 109
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
Prevent a serial RX overflow if the port is in FIFO mode #307
base: master
Are you sure you want to change the base?
Conversation
DrChat
commented
Apr 16, 2024
- If the guest's serial port is in FIFO mode and is almost full, throttle new inputs so that an RX overflow error isn't triggered. This is necessary because a host process on the other end is much faster than the guest, so it can easily overflow the port and cause the guest to discard data.
- Open named pipes in an asynchronous mode, just so something is not required to connect to the pipe on startup. This has been a useful change for me, but if it is too problematic I can remove it.
if ((BX_SER_THIS s[port].line_status.rxdata_ready == 0) || | ||
(BX_SER_THIS s[port].fifo_cntl.enable)) { | ||
((BX_SER_THIS s[port].fifo_cntl.enable) && (BX_SER_THIS s[port].rx_fifo_end < 15))) { |
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.
Not sure what your thoughts are on applying this to BX_SER_MODE_RAW
- that's the only odd one out here.
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.
I never tried the pipe-server / pipe-client mode, so I can only confirm that this code compiles without issues.
@vruppert I've confirmed that it all works locally, though I cannot confirm if it breaks anyone's expectations. |
is this PR still relevant or already should be dropped ? |
I haven't worked with serial port for a long time and I never tried the "pipe" modes. At the moment I have no chance to test it. |
The fix on line 1545 is definitely still relevant. Let me follow up and drop the other changes :) |