a38c3c0384
Fixes the code I introduced in hrev50114 for custom serial port baudrates. The idea there was based on FreeBSD implementation, but I missed a key detail: speed_t in BeOS (and Haiku) is only an 8 bit value. Note that BeOS does not have c_ispeed and c_ospeed fields, instead they are named c_ixxxxx and c_oxxxxx with a comment in termios.h saying that they are not used. So the renaming and moving of these fields isn't a problem. This means the previous code worked only for speed between 20 and 255 baud, quite the opposite of what I wanted to do, which is to enable access to fast baudrates. This new implementation exploits the fact that tcflag_t is 32 bit, but we never actually use more than 16 bits. Therefore, the high bits of each value were unused, and can be reclaimed to store the speed, by changing tcflag_t to 16 bits. The speed is then inserted as two 16 bit values that can be combined as a 32 bit one. The flag bits are not moved (on little endian systems), and the extra values are guaranteed to be set to 0 by any previous code that was compiled with 32 bit tcflag_t. Support for different speeds for input and output is now also possible (POSIX specifies separate functions for setting the input and output speeds, which is useful for some old terminals and modems, where it was useful to have a high baudrate for data to display on the screen, but things typed on the keyboard aren't quite as fast). If desired, we could now properly implement this in our serial drivers, but it isn't done here yet. Additional changes: - speed_t is now a 32bit type, allowing to pass large values to cfset(i,o)speed - fix some places where a baudrate enum value was incorrectly put in the c_ispeed and c_ospeed fields, this is not how they were meant to be used (it meant the default was to use a speed of 0, that means "hangup" the line, which I think no serial driver really implemented). - do not put baudrate enumeration values in c_iflag and c_oflag, they are meant to be used in c_cflag only, and conflict with other bits. Separate speeds for input and output can be done by setting the c_cflag value to CBAUD (indicating custom baudrates) and then setting the values in c_ispeed and c_ospeed. Fixes #18483 Change-Id: If63a24b5ced5edf6d051d921197db194def0c614 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7068 Reviewed-by: waddlesplash <waddlesplash@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk> |
||
---|---|---|
3rdparty | ||
build | ||
data | ||
docs | ||
headers | ||
src | ||
.editorconfig | ||
.gitignore | ||
.gitreview | ||
configure | ||
Jamfile | ||
Jamrules | ||
License.md | ||
ReadMe.Compiling.md | ||
ReadMe.md |
Haiku
Homepage | Mailing Lists | IRC Channels | Issue Tracker | API docs
Haiku is an open-source operating system that specifically targets personal computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful.
Goals
- Sensible defaults with minimal configuration required.
- Clean, clear, concise code.
- Unified desktop environment.
Trying Haiku
Haiku provides pre-built nightly images and release images. Haiku is compatible with a large variety of hardware, but in case you don't want to "take the plunge" and install Haiku on bare metal, you can install it on a virtual machine (VM) instead. If you've never used a VM before, you can follow one of the "Emulating Haiku" guides.
Compiling Haiku
See ReadMe.Compiling
.
Contributing
Haiku is a meritocratic open source project with a large variety of tasks. Even if you can't write code, you can still help! Haiku needs designers, (technical) writers, translators, testers... Get involved and help out!
Contributing code
If you're submitting a patch to us, please make sure you're following the patch submitting guidelines.
If you're having trouble finding something in the source tree, you can use one of our web-based source code browsers:
- https://xref.landonf.org/ (OpenGrok, provided by Landon Fuller)
- https://git.haiku-os.org/ (git, provided by Haiku, Inc.)
Contributing documentation
The main piece of documentation that still needs work are the API docs (found
in the tree at docs/user
). Just find an undocumented class, write
documentation for it, and submit a patch.
Contributing translations
See wiki:i18n.
Contributing software ports
See HaikuPorts.
Contributing to our infrastructure
See Infrastructure.