* EARLY_PRINTK equivalent for framebuffers.
@ 2014-08-28 19:19 jonsmirl
2014-08-29 1:36 ` Alexandre Courbot
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: jonsmirl @ 2014-08-28 19:19 UTC (permalink / raw)
To: linux-fbdev
Is there some existing way to do early printk type output to a
framebuffer that has been set up by the bootloader? early printk is
before any device drivers are loaded.
If not, what would it take to create a way to do this? Something along
the lines of build in the fbdev library and give it an address plus
x/y layout of the buffer. Assume that everything else is set up and
anything written to the buffer will appear on the display. Then hook
into where the kernel does early printk on uarts and add in support
for this buffer. The core fbdev library implements scrolling and
graphical characters.
I'm only looking to address early boot messages so that if the kernel
fails to boot before it can get to a real video driver, the output is
still visible.
Note that you get this early output right now, but it is buffered by
the kernel until the console driver is loaded, then it gets dumped. If
you fail before that console driver loads you see nothing. The idea is
to make the output that gets lost visible.
To communicate this you need the existing fb mode line on the kernel
command line (to get x/y layout) plus the framebuffer address. Or this
info can come via the DT.
No intention to keep this display working once real display drivers
get loaded. So no touching clocks, regulators, display modes, etc....
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: EARLY_PRINTK equivalent for framebuffers.
2014-08-28 19:19 EARLY_PRINTK equivalent for framebuffers jonsmirl
@ 2014-08-29 1:36 ` Alexandre Courbot
2014-08-29 1:40 ` jonsmirl
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Alexandre Courbot @ 2014-08-29 1:36 UTC (permalink / raw)
To: linux-fbdev
On Thu, Aug 28, 2014 at 12:19 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
> Is there some existing way to do early printk type output to a
> framebuffer that has been set up by the bootloader? early printk is
> before any device drivers are loaded.
>
> If not, what would it take to create a way to do this? Something along
> the lines of build in the fbdev library and give it an address plus
> x/y layout of the buffer. Assume that everything else is set up and
> anything written to the buffer will appear on the display. Then hook
> into where the kernel does early printk on uarts and add in support
> for this buffer. The core fbdev library implements scrolling and
> graphical characters.
simplefb does something like this (implement a console on top of a
framebuffer set up by the bootloader), but I don't think you can use
it for earlyprintk. It would be a very interesting option though (and
even better if it could be used by the kernel decompression code), but
I suspect this is more involved than good old UART as you need to
manage fonts, pixel format, screen geometry, etc.
OTOH it would be very useful for some retail devices that come without
an accessible serial line, but have a framebuffer set up by the
bootloader.
Alex.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: EARLY_PRINTK equivalent for framebuffers.
2014-08-28 19:19 EARLY_PRINTK equivalent for framebuffers jonsmirl
2014-08-29 1:36 ` Alexandre Courbot
@ 2014-08-29 1:40 ` jonsmirl
2014-08-29 1:54 ` Alexandre Courbot
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jonsmirl @ 2014-08-29 1:40 UTC (permalink / raw)
To: linux-fbdev
On Thu, Aug 28, 2014 at 9:36 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
> On Thu, Aug 28, 2014 at 12:19 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
>> Is there some existing way to do early printk type output to a
>> framebuffer that has been set up by the bootloader? early printk is
>> before any device drivers are loaded.
>>
>> If not, what would it take to create a way to do this? Something along
>> the lines of build in the fbdev library and give it an address plus
>> x/y layout of the buffer. Assume that everything else is set up and
>> anything written to the buffer will appear on the display. Then hook
>> into where the kernel does early printk on uarts and add in support
>> for this buffer. The core fbdev library implements scrolling and
>> graphical characters.
>
> simplefb does something like this (implement a console on top of a
> framebuffer set up by the bootloader), but I don't think you can use
> it for earlyprintk. It would be a very interesting option though (and
simplefb is a device driver so it doesn't process the early output.
This would need to be some custom code that gets the framebuffer
address and x/y setup very early in the boot process. I'm fairly sure
nothing like it current exists.
> even better if it could be used by the kernel decompression code), but
> I suspect this is more involved than good old UART as you need to
> manage fonts, pixel format, screen geometry, etc.
>
> OTOH it would be very useful for some retail devices that come without
> an accessible serial line, but have a framebuffer set up by the
> bootloader.
>
> Alex.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: EARLY_PRINTK equivalent for framebuffers.
2014-08-28 19:19 EARLY_PRINTK equivalent for framebuffers jonsmirl
2014-08-29 1:36 ` Alexandre Courbot
2014-08-29 1:40 ` jonsmirl
@ 2014-08-29 1:54 ` Alexandre Courbot
2014-08-29 2:00 ` jonsmirl
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Alexandre Courbot @ 2014-08-29 1:54 UTC (permalink / raw)
To: linux-fbdev
On Thu, Aug 28, 2014 at 6:40 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
> On Thu, Aug 28, 2014 at 9:36 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
>> On Thu, Aug 28, 2014 at 12:19 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
>>> Is there some existing way to do early printk type output to a
>>> framebuffer that has been set up by the bootloader? early printk is
>>> before any device drivers are loaded.
>>>
>>> If not, what would it take to create a way to do this? Something along
>>> the lines of build in the fbdev library and give it an address plus
>>> x/y layout of the buffer. Assume that everything else is set up and
>>> anything written to the buffer will appear on the display. Then hook
>>> into where the kernel does early printk on uarts and add in support
>>> for this buffer. The core fbdev library implements scrolling and
>>> graphical characters.
>>
>> simplefb does something like this (implement a console on top of a
>> framebuffer set up by the bootloader), but I don't think you can use
>> it for earlyprintk. It would be a very interesting option though (and
>
> simplefb is a device driver so it doesn't process the early output.
> This would need to be some custom code that gets the framebuffer
> address and x/y setup very early in the boot process. I'm fairly sure
> nothing like it current exists.
You're right AFAICT. And although simplefb shares part of of idea it
also doesn't operate at the required level. Also contrary to what I
said it also does not implement a console, but just a framebuffer
device on top of which you need some more logic before you can think
about displaying strings.
It seems like what would be needed is an early platform driver that
would operate like earlyprintk, with some extra parameters to specify
the FB's location and properties. Such a driver would be very
simplistic though, and I don't think we could have things like a
smooth transition with the "real" console, although I guess that's not
the goal here.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: EARLY_PRINTK equivalent for framebuffers.
2014-08-28 19:19 EARLY_PRINTK equivalent for framebuffers jonsmirl
` (2 preceding siblings ...)
2014-08-29 1:54 ` Alexandre Courbot
@ 2014-08-29 2:00 ` jonsmirl
2014-08-29 2:05 ` Alexandre Courbot
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jonsmirl @ 2014-08-29 2:00 UTC (permalink / raw)
To: linux-fbdev
On Thu, Aug 28, 2014 at 9:54 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
> On Thu, Aug 28, 2014 at 6:40 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
>> On Thu, Aug 28, 2014 at 9:36 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
>>> On Thu, Aug 28, 2014 at 12:19 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
>>>> Is there some existing way to do early printk type output to a
>>>> framebuffer that has been set up by the bootloader? early printk is
>>>> before any device drivers are loaded.
>>>>
>>>> If not, what would it take to create a way to do this? Something along
>>>> the lines of build in the fbdev library and give it an address plus
>>>> x/y layout of the buffer. Assume that everything else is set up and
>>>> anything written to the buffer will appear on the display. Then hook
>>>> into where the kernel does early printk on uarts and add in support
>>>> for this buffer. The core fbdev library implements scrolling and
>>>> graphical characters.
>>>
>>> simplefb does something like this (implement a console on top of a
>>> framebuffer set up by the bootloader), but I don't think you can use
>>> it for earlyprintk. It would be a very interesting option though (and
>>
>> simplefb is a device driver so it doesn't process the early output.
>> This would need to be some custom code that gets the framebuffer
>> address and x/y setup very early in the boot process. I'm fairly sure
>> nothing like it current exists.
>
> You're right AFAICT. And although simplefb shares part of of idea it
> also doesn't operate at the required level. Also contrary to what I
> said it also does not implement a console, but just a framebuffer
> device on top of which you need some more logic before you can think
> about displaying strings.
turn on fbconsole support and it should work.
>
> It seems like what would be needed is an early platform driver that
> would operate like earlyprintk, with some extra parameters to specify
> the FB's location and properties. Such a driver would be very
> simplistic though, and I don't think we could have things like a
> smooth transition with the "real" console, although I guess that's not
> the goal here.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: EARLY_PRINTK equivalent for framebuffers.
2014-08-28 19:19 EARLY_PRINTK equivalent for framebuffers jonsmirl
` (3 preceding siblings ...)
2014-08-29 2:00 ` jonsmirl
@ 2014-08-29 2:05 ` Alexandre Courbot
2014-08-29 2:09 ` jonsmirl
2014-08-29 8:51 ` Geert Uytterhoeven
6 siblings, 0 replies; 8+ messages in thread
From: Alexandre Courbot @ 2014-08-29 2:05 UTC (permalink / raw)
To: linux-fbdev
On Thu, Aug 28, 2014 at 7:00 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
> On Thu, Aug 28, 2014 at 9:54 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
>> On Thu, Aug 28, 2014 at 6:40 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
>>> On Thu, Aug 28, 2014 at 9:36 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
>>>> On Thu, Aug 28, 2014 at 12:19 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
>>>>> Is there some existing way to do early printk type output to a
>>>>> framebuffer that has been set up by the bootloader? early printk is
>>>>> before any device drivers are loaded.
>>>>>
>>>>> If not, what would it take to create a way to do this? Something along
>>>>> the lines of build in the fbdev library and give it an address plus
>>>>> x/y layout of the buffer. Assume that everything else is set up and
>>>>> anything written to the buffer will appear on the display. Then hook
>>>>> into where the kernel does early printk on uarts and add in support
>>>>> for this buffer. The core fbdev library implements scrolling and
>>>>> graphical characters.
>>>>
>>>> simplefb does something like this (implement a console on top of a
>>>> framebuffer set up by the bootloader), but I don't think you can use
>>>> it for earlyprintk. It would be a very interesting option though (and
>>>
>>> simplefb is a device driver so it doesn't process the early output.
>>> This would need to be some custom code that gets the framebuffer
>>> address and x/y setup very early in the boot process. I'm fairly sure
>>> nothing like it current exists.
>>
>> You're right AFAICT. And although simplefb shares part of of idea it
>> also doesn't operate at the required level. Also contrary to what I
>> said it also does not implement a console, but just a framebuffer
>> device on top of which you need some more logic before you can think
>> about displaying strings.
>
> turn on fbconsole support and it should work.
Yeah, but my point was, that I don't think you can use fbconsole that
early in the kernel?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: EARLY_PRINTK equivalent for framebuffers.
2014-08-28 19:19 EARLY_PRINTK equivalent for framebuffers jonsmirl
` (4 preceding siblings ...)
2014-08-29 2:05 ` Alexandre Courbot
@ 2014-08-29 2:09 ` jonsmirl
2014-08-29 8:51 ` Geert Uytterhoeven
6 siblings, 0 replies; 8+ messages in thread
From: jonsmirl @ 2014-08-29 2:09 UTC (permalink / raw)
To: linux-fbdev
On Thu, Aug 28, 2014 at 10:05 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
> On Thu, Aug 28, 2014 at 7:00 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
>> On Thu, Aug 28, 2014 at 9:54 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
>>> On Thu, Aug 28, 2014 at 6:40 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
>>>> On Thu, Aug 28, 2014 at 9:36 PM, Alexandre Courbot <gnurou@gmail.com> wrote:
>>>>> On Thu, Aug 28, 2014 at 12:19 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
>>>>>> Is there some existing way to do early printk type output to a
>>>>>> framebuffer that has been set up by the bootloader? early printk is
>>>>>> before any device drivers are loaded.
>>>>>>
>>>>>> If not, what would it take to create a way to do this? Something along
>>>>>> the lines of build in the fbdev library and give it an address plus
>>>>>> x/y layout of the buffer. Assume that everything else is set up and
>>>>>> anything written to the buffer will appear on the display. Then hook
>>>>>> into where the kernel does early printk on uarts and add in support
>>>>>> for this buffer. The core fbdev library implements scrolling and
>>>>>> graphical characters.
>>>>>
>>>>> simplefb does something like this (implement a console on top of a
>>>>> framebuffer set up by the bootloader), but I don't think you can use
>>>>> it for earlyprintk. It would be a very interesting option though (and
>>>>
>>>> simplefb is a device driver so it doesn't process the early output.
>>>> This would need to be some custom code that gets the framebuffer
>>>> address and x/y setup very early in the boot process. I'm fairly sure
>>>> nothing like it current exists.
>>>
>>> You're right AFAICT. And although simplefb shares part of of idea it
>>> also doesn't operate at the required level. Also contrary to what I
>>> said it also does not implement a console, but just a framebuffer
>>> device on top of which you need some more logic before you can think
>>> about displaying strings.
>>
>> turn on fbconsole support and it should work.
>
> Yeah, but my point was, that I don't think you can use fbconsole that
> early in the kernel?
You can't. But all of the needed code is sitting there in fbconsole.
There is just a small bit missing to make an early console work.
Mainly just the bit about address of buffer and x/y layout.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: EARLY_PRINTK equivalent for framebuffers.
2014-08-28 19:19 EARLY_PRINTK equivalent for framebuffers jonsmirl
` (5 preceding siblings ...)
2014-08-29 2:09 ` jonsmirl
@ 2014-08-29 8:51 ` Geert Uytterhoeven
6 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2014-08-29 8:51 UTC (permalink / raw)
To: linux-fbdev
Hi Jon,
On Thu, Aug 28, 2014 at 9:19 PM, jonsmirl@gmail.com <jonsmirl@gmail.com> wrote:
> Is there some existing way to do early printk type output to a
> framebuffer that has been set up by the bootloader? early printk is
> before any device drivers are loaded.
arch/m68k/kernel/head.S does this on Mac.
ISTR offb also used to do that on PPC, or perhaps it was the
old PowerMac console driver we had before that.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-08-29 8:51 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-28 19:19 EARLY_PRINTK equivalent for framebuffers jonsmirl
2014-08-29 1:36 ` Alexandre Courbot
2014-08-29 1:40 ` jonsmirl
2014-08-29 1:54 ` Alexandre Courbot
2014-08-29 2:00 ` jonsmirl
2014-08-29 2:05 ` Alexandre Courbot
2014-08-29 2:09 ` jonsmirl
2014-08-29 8:51 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox