Howto use the Framebuffer with Puppy 430/431

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

Howto use the Framebuffer with Puppy 430/431

#1 Post by aragon »

0. Intro
The linux-framebuffer is an abstraction-layer that could be used to enlarge the capabilities of the commandline-interface. it could be used to display graphics (some of us know the tux on bootup) or to change the resolution of the cli. normally puppy is configured to boot with a resolution of 640 x 480. By using the framebuffer, you could enlarge this to use the native resolution of your monitor.

Puppy does not enable the framebuffer by default but at least for 430/431 it is 'relatively' easy to make the needed changes.

But be aware that you'll need to edit the initrd.gz and the pup-430.sfs / pup-431.sfs.
Read carefully and as STEP 1! Use at your own risk, maybe try it with a 'clean' system first.


1. Create a working-directory (Linux-Partition)

2. unpack initrd.gz
a) copy initrd.gz to you working directory
b) open a terminal in your working-directory

Code: Select all

mkdir initdir
cd initdir
zcat ../initrd.gz | cpio -i -d
you should now have copied the content of the initrd.gz to initdir.

3. unpack pup-430.sfs
Note: as you probably want to make changes for the version you're running, you cannot mount the sfs by clicking, as it is allready mounted.
a) copy pup-430.sfs to /tmp
b) rename it to pup-430x.sfs
c) click on pup-430x.sfs to mount it.
d) create a subdir pup-430 in your working directory.
e) open a terminal

Code: Select all

copy -r /mnt/pup-430x/* /WORKINGDIR/pup-430
d) click on pup-430x.sfs to unmount it.

you're now prepared to apply the changes. i will use INITDIR and PUPDIR as names for our subdirectories. If i only use pup-430.. in the following, it allways means pup-430/pup-431...

4. copy framebuffer-devices
we need the framebuffer-devices in initrd.gz to be able to use it on bootup.
a) open a terminal

Code: Select all

cp /PUPDIR/dev/fb* /INITDIR/dev
EDIT 20100127: changed mv to cp as we need the devices in PUPDIR and INITDIR.

5. move modules
we need the kernel-modules in initrd.gz.
a) open a terminal

Code: Select all

mv /PUPDIR/lib/modules/2.6.30.5/kernel/drivers/video/console /INITDIR/lib/modules/2.6.30.5/kernel/drivers/video
6. Update modules.dep
a) open /INITDIR/lib/modules/2.6.30.5/modules.dep
b) paste the following at the end of the file

Code: Select all

/lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/bitblit.ko: /lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/softcursor.ko
/lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/fbcon.ko: /lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/bitblit.ko /lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/softcursor.ko /lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/tileblit.ko /lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/font.ko
/lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/font.ko:
/lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/mdacon.ko:
/lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/softcursor.ko:
/lib/modules/2.6.30.5/initrd/kernel/drivers/video/console/tileblit.ko:
c) save

7. Load module fbcon in init
a) open /INITDIR/init and add the following to line 253

Code: Select all

modprobe fbcon
b) save the file.

Note: It does not need to be Line 253, but you should use a line at the beginning of the init as you'll have a black screen until fbcon is loaded.

8. resquash PUPDIR
a) open your working-directory in a terminal

Code: Select all

dir2sfs pup-430
b) you'll get a wrong named file pup-430_430.sfs. rename it to pup-430.sfs

Your new sfs is ready.

9. repack initrd.gz
a) open your working-directory in a terminal

Code: Select all

cd initdir
find . | cpio -o -H newc | gzip -9 > ../initrd.gz 
Your new initrd.gz is ready.

10. Exchange Files
a) Boot from a Live-CD with puppy pfix=ram
b) Backup the 'old' initrd.gz and pup-430/431.sfs.
c) Copy the new initrd.gz and pup-430/431.sfs to your regular boot-drive (and subfolder).

11. Edit your boot-config file
You now have to edit your boot-config file. This could be menu.lst / syslinux.cfg /isolinux.cfg
a) backup the 'old' file.
b) add

Code: Select all

vga=[VGA-OPTION] 
to the line where the initrd.gz is 'called', as example

Code: Select all

append initrd=initrd.gz pmedia=usbflash vga=0x314
in my syslinux-config. See '10.1 VGA-Options' for possible values. You could also add

Code: Select all

vga=ask
in a first run. If so you will be asked to choose a parameter from a list. You could then append that setting in a second run to your boot-config file.

If you want to remaster a cd (isolinux.cfg) it might be best, to always choose 'vga=ask'.
c) save

10.1 VGA-Options
There are 2 ways to call an vga-option, you will have to find out yourself, which one works for you. For me, values from the first list work. It might be a little trial and error.

Code: Select all

Colours |640x480 | 800x600 | 1024x768 | 1152x864 | 1280x1024
----------------------------------------------------------------
08 bits | 0x301  |  0x303  |   0x305  |  0x161   |   0x307
15 bits | 0x310  |  0x313  |   0x316  |  0x162   |   0x319
16 bits | 0x311  |  0x314  |   0x317  |  0x163   |   0x31A

Code: Select all

vga = normal 
1024x768x64k: vga=791
1024x768x32k: vga=790
1024x768x256: vga=773
800x600x64k:  vga=788
800x600x32k:  vga=787
800x600x256:  vga=771
640x480x64k:  vga=785
640x480x32k:  vga=784
640x480x256:  vga=769
If your looking for another resolution, google will be your friend.

11. Reboot

If everything went well, you could now use your cli with a better resolution.

THANKS: My thanks go to Pizzasgood. Most parts of this howto is based on his docs for pebble http://www.murga-linux.com/puppy/viewtopic.php?t=26339.

aragon
Last edited by aragon on Thu 15 Apr 2010, 16:11, edited 2 times in total.

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#2 Post by aragon »

QUESTION:
Does anybody know, why devices in /dev that are in the initrd.gz (but not in the pup-file), are not show in /dev?

thanks
aragon

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#3 Post by Flash »

Aragon, could you add a bit about what framebuffer is and why it might be useful? Some people might not realize they need it. :)

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#4 Post by aragon »

will try to...

aragon

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#5 Post by amigo »

Devices in the intrd are completely separate from the main system. What happens in the initrd is not automatically apparent to the main system, though what happens there is not forgotten by the kernel.

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#6 Post by aragon »

amigo wrote:Devices in the intrd are completely separate from the main system. What happens in the initrd is not automatically apparent to the main system, though what happens there is not forgotten by the kernel.
thanks for the explanation. so we just copy over the fb-devices from PUPDIR to INITDIR.

aragon

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#7 Post by amigo »

Yeah, or use mknod to create them -you'd have to look up the specs for the framebuffer devices -you can llok in MAKEDEV or look them up in the table in the kernel sources under Documentation/devices.txt

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#8 Post by aragon »

yup, should be

Code: Select all

mknod /dev/fb[NO] c 29 [NO x 32]
eg

Code: Select all

mknod /dev/fb0 c 29 0
mknod /dev/fb1 c 29 32
mknod /dev/fb2 c 29 64
...

EDIT: fixed typo missing c

aragon[/code]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#9 Post by amigo »

Understand, it wasn't because of laziness that I didn't simply look them up and tell you -I just didn't want to take away your joy at finding them yourself... LOL

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#10 Post by aragon »

amigo wrote:Understand, it wasn't because of laziness that I didn't simply look them up and tell you -I just didn't want to take away your joy at finding them yourself... LOL
he he, yes but this time i got them allready in my snippets... :wink:
aragon

foreirongold
Posts: 12
Joined: Mon 29 Jun 2009, 01:00

#11 Post by foreirongold »

Thanks for the tutorial, but how would you do this on a full hard drive install (no initrd)?

The modules and dependencies seem to be there already but I can't seem to find a good spot to load fbcon; as soon as "starting..." comes up on the console an undefined resolution error appears (using vga=773 in menu.lst). I'm guessing busybox needs to load fbcon straight away, but is that a simple matter of finding another init file and sticking it in or would I need to recompile the kernel with fbcon built-in?

aragon
Posts: 1698
Joined: Mon 15 Oct 2007, 12:18
Location: Germany

#12 Post by aragon »

foreirongold wrote:The modules and dependencies seem to be there already but I can't seem to find a good spot to load fbcon; as soon as "starting..." comes up on the console an undefined resolution error appears (using vga=773 in menu.lst).
try to use a value from the first table like

Code: Select all

vga=0x317
in menu.lst. i have the same problem as mentioned and for me the values from the first table work.

good luck
aragon

jplt

#13 Post by jplt »

Hello,

does this method work in the new puppy's (puppy precise) ?

Thanks

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#14 Post by Keef »

Bit late with a response, but just in case it is useful...
Framebuffer is enabled in Precise. In order to use it, use for example

Code: Select all

video=1024x768
on the kernel line in your grub menu or equivalent.

Code: Select all

vga=791
does not work, well it does until the kernel module kicks in then it reverts to 640x480, which must be a default.
Only found out what was going on today.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#15 Post by Karl Godt »

which must be a default.
Yes it is compiled into the kernel:
CONFIG_CMDLINE="video=640x480"

That wasn't always there , Lupu kernel 2.6.33.2 with common intel graphics i915 modeset=1 really gives a console after fbcon.ko loaded of 132x60 lines instead of the default 80x32 .

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#16 Post by Keef »

My little brain had got confused by all this kernel modesetting stuff. The only kernel compiling I have done is to enable the framebuffer console (for 301, 412 and a Wary kernel or two).
This explained it for me http://nouveau.freedesktop.org/wiki/KernelModeSetting/
I looked at /var/log/messages and noticed the video=640x480 line which gave the game away.

User avatar
Chili Dog
Posts: 161
Joined: Tue 20 Dec 2011, 11:17

#17 Post by Chili Dog »

Does this work with Slacko?

Post Reply