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

Printf->net #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kraiskil
Copy link

An aleternative to kammy, that allows plain printfs to be sent to network.
Unless configure.h is edited, nothing changes in psl1ght.

    This is an alternative to Kammy. Enable at PSL1GHT compile time.
    See configure.h for info.
@ooPo
Copy link
Member

ooPo commented Jul 4, 2011

I like this addition as well, but I'd also like to see some discussion on the config.h part. Is this how we want to introduce options? Can we do this in a way that could always be enabled and avoid configuration completely?

@zeldin
Copy link
Member

zeldin commented Jul 4, 2011

Unless support for sending stdout to sysTtyWrite() should be removed, then some kind of configuration at some time is needed, namely whether to use sysTtyWrite() or _stdio_sock for stdout.

Whether that configuration should be done globally when installing PSL1GHT is something that can be discussed. A different approach could be to let the individual app do that configuration, by manually calling init_stdio_to_net() from main. The IP address could be a parameter of the function call (or NULL for broadcast).

@kraiskil
Copy link
Author

kraiskil commented Jul 4, 2011

This fix is mostly a kludge around the missing tty->ethernet possibility on 3.55 (this was the case a while ago - don't know if things have changed?). Stdio is anyways a developer tool (on ps3) and most devs are on 3.41 anyways(?), so I'm not sure how much effort is useful here. Do you see other uses for this? (if yes, the rest of this comment is moot)

I made the link with TCP in order to minimize uncertanties whilst debugging. I'm sure UDP doesn't drop too much packets and would be useful for broadcasting to subnets but my prefferral here was to be rather safe than sorry. Also, I have set up my router to give static IPs to all known computer in my home router, so the stdio stream is always available.

I wanted to have "printfs out of the box" when I wrote this - that is minimal (or no) changes to the application. That is why the current configuration setup is as it is. One could ofcourse do a more runtime/dynamic approach - but what would be the benefit? This patch is sufficient as is for me, so I'm not sure how to best develop it further. So if anybody wants to step up, feel free :)

(and as a side note, I had the stdin done also, but goofed and it ended up into git heaven. Should be straight froward to add once a consensus is reached)

@zeldin
Copy link
Member

zeldin commented Jul 4, 2011

Rather than further commenting on the bikeshed at hand, I'd just like to point out that if you lost a commit in git heaven, you might be able to find it again with "gitk --reflog". Edit: (Or "gitk --reflog --not --all" to get a view of only git heaven itself.)

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

Successfully merging this pull request may close these issues.

5 participants