*** tpb has joined #timvideos | 00:00 | |
*** TheAssassin has quit IRC | 00:33 | |
*** TheAssassin has joined #timvideos | 00:38 | |
*** cr1901_modern has quit IRC | 00:59 | |
*** cr1901_modern has joined #timvideos | 01:23 | |
*** cr1901_modern1 has joined #timvideos | 01:45 | |
*** cr1901_modern has quit IRC | 01:48 | |
*** cr1901_modern1 has quit IRC | 02:45 | |
*** cr1901_modern has joined #timvideos | 02:45 | |
*** rohitksingh_work has joined #timvideos | 04:07 | |
*** Toba has quit IRC | 04:17 | |
*** Toba has joined #timvideos | 04:17 | |
*** Toba is now known as Guest95844 | 04:18 | |
*** futarisIRCcloud has joined #timvideos | 05:18 | |
CarlFK | flterm --port=/dev/ttyUSB1 ... [FLTERM] Starting... ^c exits, echo $? => 130 | 06:25 |
---|---|---|
CarlFK | flterm.c int main(int argc, char *argv[]) return 0; | 06:25 |
CarlFK | https://github.com/timvideos/flterm/blob/master/flterm.c#L973 | 06:25 |
tpb | Title: flterm/flterm.c at master · timvideos/flterm · GitHub (at github.com) | 06:25 |
CarlFK | why is $? => 130 ? | 06:25 |
CarlFK | Its making make abort (or something that breaks my tests) | 06:26 |
xobs | CarlFK: 130 is EOWNERDEAD. Could be that it's missing a shared library, or that it doesn't have permission to open /dev/ttyUSB1, or any number of things. | 06:28 |
xobs | Ah, or maybe something else is using /dev/ttyUSB1 | 06:28 |
CarlFK | flterm runs and functions, I hit ^c to exit it, and make aborts | 06:29 |
CarlFK | 130 is ^c https://www.tldp.org/LDP/abs/html/exitcodes.html | 06:29 |
tpb | Title: Exit Codes With Special Meanings (at www.tldp.org) | 06:29 |
CarlFK | but I don't see how flterm returns 130 | 06:29 |
CarlFK | unless read() does an exit(13) inside it and flterm doesn't get a chance to handle it, but according to read docs it returns on 'evertyhing' | 06:31 |
xobs | That's what you get when you quit a program with Control-C and it doesn't exit normally. | 06:31 |
xobs | For example, this program will also return 130 if you control-C: int main(int argc, char **argv) { while (1) read(1, &argc, 1); return 0; } | 06:32 |
CarlFK | https://www.gnu.org/software/libc/manual/html_node/I_002fO-Primitives.html#index-read | 06:32 |
tpb | Title: I/O Primitives (The GNU C Library) (at www.gnu.org) | 06:32 |
CarlFK | so read() calls exit(130)? | 06:32 |
xobs | More likely, hitting Control-C sends a SIGINT to the program, which probably has no default handler, so it does exit(EOWNERDEAD). But I'm still looking for the documentation on that. | 06:34 |
xobs | Ah, my mistake. "When a command terminates on a fatal signal whose number is N, Bash uses the value 128+N as the exit status" so it's a SIGINT (signal 2), plus 128. | 06:42 |
xobs | Because yes, the default behavior of SIGINT when it's untrapped (according to signal(7)) is to terminate with that signal. | 06:43 |
CarlFK | would ^c kill int main(int argc, char **argv) { while (1); return 0; } | 06:45 |
xobs | Yes, and with bash, that also returns 130 | 06:45 |
CarlFK | ah, so reading read() docs isnt' helping me | 06:46 |
CarlFK | http://ix.io/aQn trap date INT eats the ^c | 06:52 |
CarlFK | (not sure dont' care where the ouput from date goes) | 06:52 |
xobs | You can "trap true INT" | 06:53 |
CarlFK | (trap true INT; flterm --port=/dev/ttyUSB1 --kernel=build/arty_net_or1k.linux//software/firmware/firmware.bin --speed=115200) || true | 06:58 |
mithro | CarlFK: why not just modify flterm to have a signal handler to exit gracefully on SIGINT? | 06:59 |
CarlFK | mithro: I have no idea how to add a signal handler | 07:00 |
mithro | man signal | 07:00 |
mithro | I'm pretty sure there is an example in there that is almost copy and pastable.. | 07:01 |
mithro | Otherwise Google and stack overflow should take you like 30 seconds to find a solution | 07:01 |
CarlFK | 10 hits later, best 2: | 07:09 |
CarlFK | https://stackoverflow.com/questions/53222728/ctrlc-kills-process-despite-signal-handling-works-on-different-machine | 07:09 |
tpb | Title: c++ - Ctrl+c kills process, despite signal handling, works on different machine - Stack Overflow (at stackoverflow.com) | 07:09 |
CarlFK | https://stackoverflow.com/questions/8984364/correct-way-to-use-signal-handlers | 07:09 |
tpb | Title: c - Correct way to use signal handlers - Stack Overflow (at stackoverflow.com) | 07:09 |
mithro | CarlFK: LGTM! Ship it | 07:32 |
CarlFK | mithro: really? | 07:33 |
mithro | CarlFK: yes, you really only need probably 5 lines in total | 07:33 |
CarlFK | write(1, "Caught signal 11\n", 17); what is 11 ? | 07:33 |
xobs | CarlFK: SIGSEGV, i.e. segfault | 07:34 |
xobs | (you can see it by looking at "man 7 signal") | 07:34 |
CarlFK | ah.. I need to change signal(SIGSEGV | 07:34 |
xobs | I thought you wanted to trap SIGINT (i.e. Ctrl-C)? | 07:35 |
CarlFK | right. I thought that code I found trapped all of them | 07:36 |
CarlFK | what ... lib? is signal in? | 07:37 |
xobs | I thought it was a syscall, but it might just be in libc. | 07:41 |
xobs | mithro: so the problems with CSR in simulation were just related to `write_from_dev=True` not behaving properly? Or were there other issues as well? | 07:46 |
CarlFK | is this going to eat the ^c but not exit flterm ? | 07:49 |
xobs | CarlFK: it will. you probably want to add `exit(0)` to it. | 07:49 |
*** cr1901_modern1 has joined #timvideos | 07:52 | |
CarlFK | flterm.c:703:12: error: ‘SIGINT’ undeclared | 07:55 |
*** cr1901_modern has quit IRC | 07:55 | |
*** cr1901_modern1 has quit IRC | 07:55 | |
*** cr1901_modern has joined #timvideos | 07:56 | |
CarlFK | man snglal fixed: #include <signal.h> | 07:57 |
CarlFK | bah.need to call tcsetattr(0, TCSANOW, &otty) or my term is broken (no keyboard echo) | 08:02 |
CarlFK | how does ^c reset that? | 08:02 |
CarlFK | never mind - this yak is too smelly | 08:04 |
xobs | CarlFK: why are you pressing control-C? isn't this part of an automated setup process? | 08:05 |
CarlFK | it boots the hdmi2usb firmware and I'm left at a H2U 01:51:38> prompt | 08:07 |
xobs | CarlFK: sounds you want to just add another argument to flterm to exit after xmodem. Check the flag value, and break if true at https://github.com/timvideos/flterm/blob/master/flterm.c#L799 | 08:11 |
tpb | Title: flterm/flterm.c at master · timvideos/flterm · GitHub (at github.com) | 08:11 |
CarlFK | xobs: I kinda want to see if it works. I think ;) | 08:12 |
CarlFK | like, I think the or1k cpu is throwing an exception? or throwing a fit: http://paste.ubuntu.com/p/k5KVYzZFQk/ | 08:13 |
tpb | Title: Ubuntu Pastebin (at paste.ubuntu.com) | 08:13 |
*** futarisIRCcloud has quit IRC | 08:17 | |
*** m4ssi has joined #timvideos | 08:40 | |
CarlFK | how did building qemu break?!! | 08:45 |
CarlFK | /home/juser/tv/litex-buildenv/third_party/qemu-litex/ui/gtk.c:1957:5: error: ‘vte_terminal_set_encoding’ is deprecated [-Werror=deprecated-declarations] | 08:46 |
CarlFK | derp - I forgot I was trying a different repo and didn't put it back | 09:00 |
CarlFK | make still aborts: http://paste.ubuntu.com/p/F36PZwy8dN/ | 09:40 |
tpb | Title: Ubuntu Pastebin (at paste.ubuntu.com) | 09:40 |
CarlFK | I'm going to abort and go to bed... Zzzzzz | 09:41 |
xobs | CarlFK: abort(); sleep(); | 09:41 |
xobs | Goodnight! | 09:41 |
CarlFK | lol yep | 09:42 |
*** futarisIRCcloud has joined #timvideos | 10:01 | |
futarisIRCcloud | _florent_: That was quick. Check out @enjoy_digital’s Tweet: https://twitter.com/enjoy_digital/status/1097755857666883584 ... mithro / xobs, this might be useful for fomu too. | 10:03 |
*** tsglove2 is now known as tsglove | 11:54 | |
*** futarisIRCcloud has quit IRC | 12:20 | |
*** Kripton has quit IRC | 12:31 | |
*** Kripton has joined #timvideos | 12:46 | |
*** rohitksingh_work has quit IRC | 12:55 | |
*** rohitksingh has joined #timvideos | 13:52 | |
*** rohitksingh has quit IRC | 15:39 | |
*** rohitksingh has joined #timvideos | 16:07 | |
*** m4ssi has quit IRC | 17:33 | |
*** rohitksingh has quit IRC | 19:12 | |
CarlFK | huh - hdmi2usb on qemu: the uptime goes up to 00:00:42 and then stops. | 22:30 |
CarlFK | I'm guessing this is nothing new. i've noticed 42 in the past, just now noticed it starts at 0 and goes up for 42 seconds. | 22:31 |
Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!