Skip to content
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

"Original" picocom #2

Open
npat-efault opened this issue Aug 25, 2015 · 4 comments
Open

"Original" picocom #2

npat-efault opened this issue Aug 25, 2015 · 4 comments

Comments

@npat-efault
Copy link

Hi,

I'm the original picocom author.

I'm writing just to let you know that an "arbitrary baudrates" feature has been added to the latest release of the original picocom (along with several other features). While the code is structured very differently than your fork, I added you in the CONTRIBUTORS file mentioning you as the origin of the feature.

Thanks for helping make picocom better.
/npat

@codyps
Copy link
Owner

codyps commented Aug 25, 2015

Very cool, thanks for taking the time to do a proper integration :)

My modification (this repo) was only ever intended to be a quick hack for me to debug some serial devices I was suspicious had incorrectly configured clocks leading to incorrect baud rates.

@npat-efault
Copy link
Author

You 're welcome.

Unfortunately, the current state of GLIBC (clashing with the kernel
definition of the termios2 interface) didn't make things easy. Well, I did
the best I could. Sadly, I found no way to avoid manually copying some
definitions that should normally be included from system headers... I'd say
it was "interesting"... if I wanted to be magnanimous about it :)

Cheers
/npat

On Tue, Aug 25, 2015 at 11:26 PM, Cody Schafer notifications@github.com
wrote:

Very cool, thanks for taking the time to do a proper integration :)

My modification (this repo) was only ever intended to be a quick hack for
me to debug some serial devices I was suspicious had incorrectly configured
clocks leading to incorrect baud rates.


Reply to this email directly or view it on GitHub
#2 (comment).

@codyps
Copy link
Owner

codyps commented Aug 25, 2015

If you're interested, I think libserialport (http://sigrok.org/wiki/Libserialport , http://sigrok.org/gitweb/?p=libserialport.git;a=tree ) found a way to isolate things despite the include clashes by using a seperate source file to compartmentalize. Not sure if a similar structure is an option for you, though.

@npat-efault
Copy link
Author

Hmm... interesting.

Sadly I think this won't work nicely with my code.

He hides all the termios2 stuff in a file. Outside of this all other code
see the termios2 as a blob.

So my term.[ch] would have to keep blobs instead of termios structures, and
in order to access "fields" in these blobs, code in "term.c" would have to
call accessors implemented in the termios2 file. Naturally, for system's
that don't have termios2, I would need similar accessors for their termios
stuff.

This would make the code look totally alien.

What I do instead is have a single file where the userspace termios and
kernel-space termios2 are both visible. There the userspace termios are
copied to kernel-space termios2 before doing the ioctl and vice-versa.
(BTW, this is what GLIBC does internally with the old termios interface).

The drawback is that I have to define the kernel termios2 struture manually
(GLIBC does that too, with "kernel_termios"). Since these are fundamental
kernel-to-user-space binary interfaces I don't think they change often (if
ever).

Furthermore (I hope) GLIBC will eventually pick-up termios2 and all this
would be useless.

You win some, you loose some, as always!

Thanks for the pointer.
/npat

On Wed, Aug 26, 2015 at 12:17 AM, Cody Schafer notifications@github.com
wrote:

If you're interested, I think libserialport (
http://sigrok.org/wiki/Libserialport ,
http://sigrok.org/gitweb/?p=libserialport.git;a=tree ) found a way to
isolate things despite the include clashes by using a seperate source file
to compartmentalize. Not sure if a similar structure is an option for you,
though.


Reply to this email directly or view it on GitHub
#2 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants