Xfbdev startup on customize Linux kernel
Date: 10/12/11
(Web Development) Keywords: linux
Hi All,
I just finished working on Xserver startup on Linux machine along with configuring kernel for that. I hope this would be helpful to guys, who hold less experience in Linux world.
Before I begin, I just want to have some words with you guys that this blog is NOT a step by step guide to do things. It's just a list of my experiments I have done with development board. So this will provide an insight to people who are facing same problems as I did. But they must know some basics of Linux.
Personally I never liked spoon feeding, some answers need to be dig up by yourself.
So let's begin with Xservers. Xservers are most important thing for Linux GUI. In Linux environment, almost all Xclients (any GUI application) request to Xserver for Screen draw and other graphical operations(like Windows, button checkbox draw/movement on screen). The idea behind Xserver and Xclient is to run a light weight server which can process and send request to graphics hardware on Host machine. Now the Xclients can run on same machine or other and request to Xserver for graphical operations.
One can find more details about X system on http://en.wikipedia.org/wiki/X_Window_System.
So Xervers can be said of two types. One is Xorg, full featured Xserver.
Second one is Xfbdev, which has some limited functionality as compared to Xorg. It is a generic Xserver, which does not know about the particular hardware and uses framebuffer provided by Linux framebuffer device.
Now let's move on to kernel configuration required for kernel.
The linux kernel must have support for framebuffer device and VESA driver support for framebuffer.
following options should be enabled in kernel config:
CONFIG_FB
CONFIG_FB_VESA
For Sandy Bridge architecture based boards, enable CONFIG_ACPI option too, to avoid DSDT table error.
After building the kernel, all you need to do is to copy the kernel image under /boot directory with name like 'vmlinuz-' and make relevant entries in grub configuration.
In grub entry for the kernel, add 'vga=0x318' (or any other suitable vga mode) in kernel boot option. [0x318 represents standard resolution of 1028x768x32]
Now install the modules under /lib directory.
Also u may need to build an initramfs/initrd, required for RHEL/ubuntu file systems.
You can use dracut/mkinitramfs utility to build one.
Place it under /boot directory and add it to grub entry.
Under /boot/grub/grub.conf file, remove or comment out the line 'hiddenmenu' and set some time out.
Now reboot the system.
Select your custom kernel, and press enter. Kernel should boot and give you log in prompt. I have tried it with custom file system which does not belong to redhat/ubuntu. so i got command prompt. In order to have the same, one can add 'single' in boot option for custom kernel grub entry.
Ensure the enumeration of framebuffer device nodes, like /dev/fb*
Now execute 'export DISPLAY=:0'.
Run 'Xfbdev'.
Xserver should start and give you a graphical pattern with a X on it. X represents mouse pointer.
Source: https://webdev.livejournal.com/576507.html