GNU screen to the rescue

So I’m talking to a veeeeery slow device over serial connection. Meanwhile I have managed to talk to it using kermit from within Linux – from within a GNU screen (actually byobu) session to be more precise. The output that I initiated is a dump of memory contents, more precisely of the flash memory mapped at a particular location. 16 MiB of flash memory. Now consider that every line looks approximately like this:

XXXXXXXX: 00000000 00000000 00000000 00000000  ................

Of course for the Xs it’s an address and the zeros would be actual byte values corresponding to the contents at that address. This runs at 38400 Baud and is slooooow :mrgreen:

To my horror I realized before finishing the first MiB, that this would take hours and that I have no means of killing it before it’s finished (e.g. Ctrl+C does not work). However, the plan was anyway to abuse the textual form of it and convert that to the binary form. Fortunately GNU screen offers a logging feature and I knew it was there, although I didn’t remember the shortcut. Well, easy enough. I looked it up and enabled logging. Simply brilliant. It will run for a few more hours, but I have only “lost” less than 1 MiB at the front of the dump that I’m going to rerun tomorrow.

The solution for enabling logging:

C-a H

I’m not going to forget that one again :mrgreen:

// Oliver

This entry was posted in EN, Linux, Software. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.