Skip to contentSkip to conversation

printk on framebuffer console

directfb-dev Antonino A. Daplas 4 participants 10 messages May 30, 2006 – May 31, 2006 1 message not in the archive Framebuffer layer

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Terence Soh

Hi,

I'm seeking advise on getting printk displayed on the framebuffer console.

You're better off sending this to linux-fbdev-devel, so I'm adding this to the CC list.

Quoted 11 lines

My display is RGB555 VGA resolution and I using the mainline kernel font_8x8 for fonts and I've disabled the serial console and tile blitting support. At the moment, the printk are printing black lines on the screen instead of the printk statements.

In bitblit.c bit_putcs(),the image.depth = 1. Is this correct for my application?

Also is font_8x8 suitable for 16 bit screens? It seems like it's meant for monochrome display.

Yes, the monochrome bitmap are expanded to the current foreground and background colors of the console.

First, make sure that writing directly to the framebuffer memory displays something properly on your monitor.

Then make sure that your driver has a working xxxfb_setcolreg function() and that info->pseudo_palette is properly filled up.

Make sure also that info->var and info->fix are correctly set.

Tony

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

#2 lore raw
Quoted 2 lines

You're better off sending this to linux-fbdev-devel, so I'm adding this to the CC list.

Thanks for the tip!

Quoted 3 lines

Yes, the monochrome bitmap are expanded to the current foreground and background colors of the console.

Would I be better off using vgacon?

Quoted 4 lines

First, make sure that writing directly to the framebuffer memory displays something properly on your monitor.

Yes, I've got the fbcon_logo working and the fb0 working with QT-embedded. The problem is that printk doesn't work in fb console only in serial console.

Quoted 3 lines

Then make sure that your driver has a working xxxfb_setcolreg function() and that info->pseudo_palette is properly filled up.

Are xxxfb_setcolreg function() and info->pseudo_palette necessary for FB_VISUAL_TRUECOLOR? I thought it's required for FB_VISUAL_PSEUDOCOLOR.

Terence.

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

#3 lore raw
Quoted 8 lines · Terence Soh
Quoted 2 lines

You're better off sending this to linux-fbdev-devel, so I'm adding this to the CC list.

Thanks for the tip!

Quoted 3 lines

Yes, the monochrome bitmap are expanded to the current foreground and background colors of the console.

Would I be better off using vgacon?

Well, depends on what you want. If you just want pure text, then vgacon should suit your needs just fine.

Quoted 8 lines
Quoted 5 lines

First, make sure that writing directly to the framebuffer memory displays something properly on your monitor.

Yes, I've got the fbcon_logo working and the fb0 working with QT-embedded. The problem is that printk doesn't work in fb console only in serial console.

If you can display the logo, then you're very nearly done.

Quoted 7 lines
Quoted 4 lines

Then make sure that your driver has a working xxxfb_setcolreg function() and that info->pseudo_palette is properly filled up.

Are xxxfb_setcolreg function() and info->pseudo_palette necessary for FB_VISUAL_TRUECOLOR? I thought it's required for FB_VISUAL_PSEUDOCOLOR.

Other way around, the info->pseudo_palette is needed for truecolor and directcolor. So fill this array properly, and you should be good to go. Look at any driver (ie vesafb.c) on how it's done.

Tony

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

#4 lore raw
Quoted 9 lines
Quoted 3 lines

Are xxxfb_setcolreg function() and info->pseudo_palette necessary for FB_VISUAL_TRUECOLOR? I thought it's required for FB_VISUAL_PSEUDOCOLOR.

Other way around, the info->pseudo_palette is needed for truecolor and directcolor. So fill this array properly, and you should be good to go. Look at any driver (ie vesafb.c) on how it's done.

Thanks Tony,

Turned out that I was missing the xxxfb_setcolreg function() and info->pseudo_palette. Once that's done, the console is appearing on the framebuffer.

Another question. The console only prints starting from the scripts in /etc/init.d/rcS , the printk messages from the various drivers are missing. My kernel command line is "console=ttyS0 root=/dev/mtdblock3 rootfstype=jffs2". Is there any reason why?

Terence.

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

#5 lore raw
Quoted 11 lines · Terence Soh
Quoted 9 lines
Quoted 3 lines

Are xxxfb_setcolreg function() and info->pseudo_palette necessary for FB_VISUAL_TRUECOLOR? I thought it's required for FB_VISUAL_PSEUDOCOLOR.

Other way around, the info->pseudo_palette is needed for truecolor and directcolor. So fill this array properly, and you should be good to go. Look at any driver (ie vesafb.c) on how it's done.

Thanks Tony,

Quoted 8 lines

Turned out that I was missing the xxxfb_setcolreg function() and info->pseudo_palette. Once that's done, the console is appearing on the framebuffer.

Another question. The console only prints starting from the scripts in /etc/init.d/rcS , the printk messages from the various drivers are missing. My kernel command line is "console=ttyS0 root=/dev/mtdblock3 rootfstype=jffs2". Is there any reason why?

Remove the console=ttyS0 from your boot parameter (or change it to tty0) and the system messages should go to the framebuffer console.

Tony

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

#6 lore raw
Quoted 2 lines

Remove the console=ttyS0 from your boot parameter (or change it to tty0) and the system messages should go to the framebuffer console.

You're right, that worked.

Is there any way I can disable the printf/printk once my QT-Embedded application starts?

Terence.

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

#7 lore raw
Quoted 6 lines · Terence Soh
Quoted 2 lines

Remove the console=ttyS0 from your boot parameter (or change it to tty0) and the system messages should go to the framebuffer console.

You're right, that worked.

Is there any way I can disable the printf/printk once my QT-Embedded application starts?

The simplest solution is to write a utility that opens /dev/tty0 for example, then do an ioctl,

ioctl(fd, KDSETMODE, KD_GRAPHICS);

where fd is the file descriptor of /dev/tty0 for instance.

To get back your console, do this:

ioctl(fd, KDSETMODE, KD_TEXT);

Tony

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

#8 lore raw
Quoted 10 lines

The simplest solution is to write a utility that opens /dev/tty0 for example, then do an ioctl,

ioctl(fd, KDSETMODE, KD_GRAPHICS);

where fd is the file descriptor of /dev/tty0 for instance.

To get back your console, do this:

ioctl(fd, KDSETMODE, KD_TEXT);

Tony,

Thanks for your help!

Terence

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642

#9 lore raw
In reply to Terence Soh

Dnia ¶roda, 31 maja 2006 10:17, Terence Soh napisa³:

Quoted 2 lines

Is there any way I can disable the printf/printk once my QT-Embedded application starts?

You can try to use vt-switch.patch [1] from OpenEmbedded. This add option "-terminal" which we use to move OPIE to VT2.

1. http://www.openembedded.org/repo/org.openembedded.dev/packages/qte/qte-2.3.10/vt-switch.patch

Signature · 13 lines
JID: hrw-jabber.org
Sharp Zaurus C-760 (OZ 3.5.x)
OpenEmbedded/OpenZaurus/OPIE developer

          It's better to keep your mouth shut and appear stupid,
          than to open it and remove all doubt.


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
#10 lore raw
In reply to Antonino A. Daplas
Quoted 16 lines · Antonino A. Daplas
Quoted 15 lines · Terence Soh
Quoted 9 lines
Quoted 3 lines

Are xxxfb_setcolreg function() and info->pseudo_palette necessary for FB_VISUAL_TRUECOLOR? I thought it's required for FB_VISUAL_PSEUDOCOLOR.

Other way around, the info->pseudo_palette is needed for truecolor and directcolor. So fill this array properly, and you should be good to go. Look at any driver (ie vesafb.c) on how it's done.

Thanks Tony,

Turned out that I was missing the xxxfb_setcolreg function() and info->pseudo_palette. Once that's done, the console is appearing on the framebuffer.

Quoted 7 lines
Quoted 4 lines

Another question. The console only prints starting from the scripts in /etc/init.d/rcS , the printk messages from the various drivers are missing. My kernel command line is "console=ttyS0 root=/dev/mtdblock3 rootfstype=jffs2". Is there any reason why?

Remove the console=ttyS0 from your boot parameter (or change it to tty0) and the system messages should go to the framebuffer console.

Or use `console=ttyS0 console=tty0' to get kernel messages on both.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642