From: Levente Kurusa <levex@linux.com>
To: "Teodora Băluţă" <teobaluta@gmail.com>,
"Jason Cooper" <jason@lakedaemon.net>
Cc: David Lang <david@lang.hm>, Dave Jones <davej@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
Subject: Re: [RFC] QR encoding for Oops messages
Date: Sat, 05 Apr 2014 11:11:02 +0200 [thread overview]
Message-ID: <533FC8A6.6050905@linux.com> (raw)
In-Reply-To: <CACV2jQCxfQzRydFD6KizFnquasqtqaz1O_yNnVDBetFA5UryrA@mail.gmail.com>
Hi,
On 04/04/2014 11:42 PM, Teodora Băluţă wrote:
> On Fri, Apr 4, 2014 at 7:17 PM, Levente Kurusa <levex@linux.com> wrote:
>> Hi,
>>
>> On 04/04/2014 05:15 PM, Jason Cooper wrote:
>>> On Thu, Apr 03, 2014 at 01:57:04PM -0700, David Lang wrote:
>>>> On Tue, 1 Apr 2014, Jason Cooper wrote:
>>>>
>>>>>> Now I guess we need to think how to make it work without a
>>>>>> framebuffer. I already suggested using the ASCII characters,
>>>>>> but seeing the resolution of this QR code for example (147x147),
>>>>>> made me realize that we can't shuffle that into a 80x25 textmode
>>>>>> display. Any ideas how to fix that or should we just simply depend
>>>>>> on a framebuffer being present?
>>>>>
>>>>> I think depending on the framebuffer being present (via kconfig) is
>>>>> sane. Folks running old systems know what they're in for, like missing
>>>>> shiny new features. ;-)
>>>>
>>>> First get it working and into acceptable form, but after that, take
>>>> a look at the various ASCII-art tools out there. While the display
>>>> may be limited to 80x25, that's not a hard requirement (and I'd
>>>> happily run systems with a smaller text console if this was an
>>>> option), and then you can look at the possibility of using
>>>> characters that represent more than one pixel per character. While
>>>> this may not be able to render everything perfectly, remember that
>>>> qr codes can include redundancy to correct for bad pixels, you may
>>>> be able to get something working.
>>
>> I am not sure depending on the error recovery is good practice.
>> We also have to take into account that scanners themselves also
>> create noise and may not be perfect. Better reserve the error
>> recovery for those details instead of messing the QR code with
>> characters...
>
> You do have the option of error recovery for up to 30% recovery (H
> level), but that means the space you get for storing is smaller.
>
>>
>>>
>>> I'm not sure this will work. The screen space allocated to a single
>>> character isn't square. However, the QR pixels are square. I see a lot
>>> of fragile complexity ahead...
>>>
>>
>> ... not to mention this as well.
>>
>>
>> IMHO supporting textmode is just not worth the effort. Besides,
>> what would we gain from it? Supporting those devices without
>> a framebuffer? Do devices like that even exist anymore? In fact,
>> even to make this you need a screen, and AFAIK most screens come
>> with some kind of a framebuffer to drive them.
>
> Guys, first things first is cleaning the library up. I haven't managed
> to do anything yet as I am working on my thesis (bachelor's degree,
> yay!). I will do some this weekend and that is removing the kanji mode
> support. So, Levente, pleaso do that parameter thing you mentioned.
> Merging that with the cleanup shouldn't be a problem. :-)
Awesome, good luck on your thesis, take your time, we are not
rushing. :-)
Yea, I began the work on the parameter and scaling but using
'oops.qr=' isn't easy to use in a file called 'print_oops.c'.
Reason is that KBUILD_MODNAME will become 'print_oops' and then
MODULE_PARAM_PREFIX will be 'print_oops.' (note the dot character)
and so the final parameter will be 'print_oops.qr'. I have solved
this with:
#undef MODULE_PARAM_PREFIX
#define MODULE_PARAM_PREFIX "oops."
but I think this is ugly and is a hack. The good solution
would be to change KBUILD_MODNAME to 'oops' but I am not sure
how to do that, since I have little to no knowledge (and
experience) in how kbuild works.
Or, we could use core_param and simply have 'oops_qr' or
'qr_oops'. In my humble opinion the latter sounds better.
Or, there is __setup as well and that could achieve 'oops.qr',
but that is for *very* core stuff and this is probably not *that*
core. :-)
So, yea, if anyone knows how to change KBUILD_MODNAME without
ugly hacks, I would be grateful to be informed.
>
> I think writing the QR to the frame buffer is the way to do it for
> now. Doing a QR in text mode (as in displaying it, not as previously
> mentioned idea with the link base64 encoding &/ compression) would
> mean that for each square you get an ASCII character filling up your
> screen. To get an idea of how the QR looks on the frame buffer I've
> made a screenshot. That's the whole Oops message being encoded and
> compressed. [0]
I am not sure if we ever wanted to output a link, but yes filling the
screen with ASCII characters and relying on the error recovery to
ensure readability is very bad.
Nice screenshot, I had as well successfully set up a testsuite
with qemu that allows me to test if it displays correctly. I can
share the testsuite if needed.
>
> The problem with frame buffer is that I currently implemented it using
> the generic frame buffer API. There are some issues as mentioned in
> the first post of this RFC [1]. Would making it work with KMS be
> better? Any opinions?
Not sure, since we are already in a very bad situation when the
Oops happens, I think it is better use something that has existed
for ages and seems to be a bit more simple, and has less chance to
fail. Adding a lot of new code to a fragile part of the kernel
is a hotbed for a recursive oops so I would say just stick with
fb for now...
Oh and another suggestion, I think placing it in the bottom-right
corner would be better since then we wouldn't overwrite some of
the timestamps and messages.
--
Regards,
Levente Kurusa
next prev parent reply other threads:[~2014-04-05 9:11 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-17 21:59 [RFC] QR encoding for Oops messages Teodora Baluta
2014-03-18 21:49 ` Matthew Garrett
2014-03-19 20:09 ` Teodora Băluţă
2014-03-19 18:03 ` Borislav Petkov
2014-03-19 20:18 ` Teodora Băluţă
2014-03-19 20:18 ` Dave Jones
2014-03-19 20:28 ` Levente Kurusa
2014-03-19 20:50 ` Teodora Băluţă
2014-03-19 20:51 ` Teodora Băluţă
2014-03-19 21:17 ` Levente Kurusa
2014-03-19 20:38 ` Teodora Băluţă
2014-03-21 13:28 ` Jason Cooper
2014-03-22 17:09 ` Levente Kurusa
2014-03-22 18:20 ` Teodora Băluţă
2014-03-22 18:29 ` Levente Kurusa
2014-03-23 11:51 ` Levente Kurusa
2014-03-23 19:38 ` Jason Cooper
2014-03-30 10:17 ` Levente Kurusa
2014-04-01 14:20 ` Jason Cooper
2014-04-01 21:07 ` Teodora Băluţă
2014-04-03 20:21 ` Levente Kurusa
2014-04-04 15:12 ` Jason Cooper
2014-04-04 15:42 ` Levente Kurusa
2014-04-03 20:57 ` David Lang
2014-04-04 15:15 ` Jason Cooper
2014-04-04 16:17 ` Levente Kurusa
2014-04-04 21:42 ` Teodora Băluţă
2014-04-05 9:11 ` Levente Kurusa [this message]
2014-04-07 15:20 ` Jason Cooper
2014-04-08 15:42 ` Levente Kurusa
2014-04-08 17:20 ` Jason Cooper
2014-04-08 17:29 ` Levente Kurusa
2014-04-13 20:43 ` Levente Kurusa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=533FC8A6.6050905@linux.com \
--to=levex@linux.com \
--cc=davej@redhat.com \
--cc=david@lang.hm \
--cc=jason@lakedaemon.net \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.com \
--cc=teobaluta@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.