# fbsplash +-ppc: console text does not stay in text box FIXED

## Dent

Hello...  

Using kernel 2.6.11-gentoo-r6 with boot logo and fbsplash enabled (haven't tried older kernels)

splashutils 1.1.9.3 (same problem with earlier versions)

cat /proc/fbsplash: Frambuffer splash v0.9, mode: verbose

using the default emergence theme to test with

relevant kernel command line args: video=radeonfb:1280x854-32 splash-silent,fadein,theme:emergence CONSOLE=/dev/tty1 quiet

The console text goes to all edges of the screen

ie tx = ty = 0, tw=1280, th=854, even though the values in the .cfg are:

tx=31,ty=30, tw=1223, th=809

It's pretty, but it would be so much better if the text was where it should be.

I am not sure vesa support would be a good idea as this is a ppc (powerbook).Last edited by Dent on Wed Apr 13, 2005 10:35 pm; edited 1 time in total

----------

## Dent

```
Splash config on console 2:

tx:       0

ty:       0

twidth:   1280

theight:  854

bg_color: 0

theme:    emergence

```

I am beginning to think it may have to do with config parsing, or something?

The config file says:

```
bgcolor=0

tx=31

ty=30

tw=1223

th=809

text_x=254

text_y=604

text_size=28

text_color=0xeef4ff

```

----------

## Dent

turns out this is an endian bug.

edit the file parse.c

find the parse_int function

change the last line of the function so that the int pointer cast is a u16 pointer cast

  [ change "*(unsigned int*)opt.val = strtol(t,NULL,0);" to "*(u16*)opt.val = strtol(t,NULL,0);"]

and I have my text boxes!

I'll submit a patch to spock

----------

## antrix

Excellent. I noticed that the tex wast all the way to the edges as well! 

I will try the endian fix tomorrow.

Would you mind posting your entire yaboot.conf just so I could have a look at it?

----------

## Dent

```
boot=/dev/hda9

device=/pci@f4000000/ata-6@d/disk@0:

#defaultos=macosx

partition=4

root=/dev/hda4

timeout=30

install=/usr/lib/yaboot/yaboot

magicboot=/usr/lib/yaboot/ofboot

#video=ofonly

macos=/dev/hda8

macosx=/dev/hda3

image=/boot/kernel-2.6.11-dst3

        label=Linux

        sysmap=/boot/System.map-2.6.11-dst3

        initrd=/boot/initrd-splash

        append="video=radeonfb:ywrap,1280x854-32 splash=silent,theme:World,fadein CONSOLE=/dev/tty1 quiet"

        read-only

```

World is a custom theme...  macos was a tiger beta

----------

## Pylon

 *Dent wrote:*   

> turns out this is an endian bug.

 

Thanks a lot!  :Cool:   I had that nasty bug for quite a while now (and that's the reason why the 2005.0 ppc LiveCD don't boot up with that nice artwork).  But now everything is fine and I had a good chat with spock (who told me about this thread).

But there is another bug with --tty= instead of --vc=.  Somehow the --tty= causes a segfaut on my machine.

----------

## Dent

It was a fun problem to diagnose too...

I added fprints to stderr and noticed that when I would set tx, ty would get set.  when tw was set, the value would end up in th.  I was totally confused until I noticed that the struct is packed and remebered that cs lecture on endianess.

I am still having a slight problem...  /etc/init.d/splash doesn't work during the boot process.  console 1 and 8 are setup during boot, but the rest fail with error 22.  After boot, I do /etc/init.d/splash restart, and all the consoles are setup.  I use different themes on each vc, but that doesn't appear to be the issue as splashutil gets called correctly.

----------

## Dent

Here's a little kernel patch that improves startup for me.

use the patch below, it's safer and won't spit kernel warnings

Without it, most of my virtual consoles don't get setup with fbsplash when the splash script

(/etc/init.d/splash) starts.  With it, they do.

```
removed because it was a little dangerous...  see below for a new version
```

Last edited by Dent on Sun Apr 17, 2005 9:36 am; edited 1 time in total

----------

## antrix

Cheers Dent.

I spotted a problem in my yaboot.conf, which prevented me from seeing the bootup screen.

I had forgotten to separate the splash and theme options with a comma. Thanks to you, its working now.  :Smile: 

----------

## Dent

Here's a better patch that actually locks the semaphore (to avoid error messages and possible problems).

```
diff -upr linux-2.6.11-gentoo-r6/drivers/video/fbsplash.c linux-2.6.11-gentoo-r6-vc_allocate/drivers/video/fbsplash.c

--- linux-2.6.11-gentoo-r6/drivers/video/fbsplash.c     2005-04-17 02:26:45.000000000 -0700

+++ linux-2.6.11-gentoo-r6-vc_allocate/drivers/video/fbsplash.c 2005-04-17 02:27:58.000000000 -0700

@@ -433,8 +433,14 @@ static int splash_ioctl(struct inode * i

                __get_user(origin, &wrapper->origin);

                __get_user(data, &wrapper->data);

-               if (!vc_cons_allocated(vc_num))

-                       return -EINVAL;

+               if (!vc_cons_allocated(vc_num)) {

+                       acquire_console_sem();

+                        if (vc_allocate(vc_num)) {

+                                release_console_sem();

+                               return -EINVAL;

+                        }

+                        release_console_sem();

+                }

                vc = vc_cons[vc_num].d;

        }

```

----------

