tags:

views:

812

answers:

5

This is NOT a question on plain old boring customization; I actually want to create an program, you know, with source code, etc...

I'm thinking about programming my own media centre interface, and I figured it'd look better if I coded my own splash screen for when the OS is loading.

Note: The media centre interface will be run in X, but this question is regarding what will happen before the X server loads.

Simply, I'd like to make a splash screen application to hide the linux kernel boot messages. Is there a way I can program some animation in to this like some sort of animated progress bar for example? I assume that I won't be able to code any 2D/3D graphics (as that'd require X to be running, right?), so how would I go about generating that?

I'd prefer to do this in C++, but C is also an option.

Note: I'm not looking to use any existing "themes" or anything like that, just interested in the programming side of things.

Update:

Some suggestions have been to use standard images (.bmp, .jpeg, etc), I am not interested in loading images in to an existing application. But obviously I may want to load images in to the boot screen application that I will make.

I'm not tied to a Linux distro, so this can be for anything, although Debian or a Debian-based distro would be nice.

I like the suggestion about loading the X server early and running a loading screen from there, however is there not a more direct approach? Surely you can make a program which hides the boot messages and shows a custom program? Obviously this would be very low level programming, but that's what I'm looking for...

Also, I'm not interested in altering the boot loader (LILO, GRUB, etc).

Update 2:

So far good suggestions have been looking at the source code for applications like splashy and fbsplash. Can anyone better this suggestion?

+1  A: 

The splash screen is simply an image (.bmp, .jpg, etc.) and can be loaded by the boot loader. Since you haven't specified the distribution you're using, look into LILO, grub, or whichever one is appropriate. Check the /boot directory for clues that will direct your search.

Adam Liss
You are talking about the bootloader, it seems the question is more about fbsplash and alike; a splashscreen while the kernel and init are starting up.
ypnos
@ypnos: Yes exactly, just added an update to my question: I am not interested in using simple images; as I said in my original question I want to program this my self.
nbolton
+2  A: 

I'd look into splashy source code. But you will need to code in C.

If you have the skills, you can implement a software based 3D engine (like in the good old days). A simple rotating cube shouldn't be very hard to code and there are tons of tutorials. The downside is that you will increase the boot time, something not very pleasant in a media center.

jassuncao
Yeah 3D isn't a priority per say... I just want something to hide the kernel boot messages rather than a blank screen... In fact, I don't even know how to do that!
nbolton
A: 

There are several ways you could do this. You could have the X server load very early, and just write a program to display the splash screen. You could also use the framebuffer device. If you are using Intel hardware, or are willing to use the OSS AMD drivers, or Nouveau for Nvidia, you could use kernel mode setting. For this, I would look at Fedora's Plymouth. You could just write a Plymouth plugin to display your splash screen.

Zifre
Please elaborate on the *several* bit hehe ;-) I have no idea how to approach this... Any ideas for Debian? Is there a library for this that I can implement?
nbolton
+2  A: 

Here's the thing: there is a library/kernel patch, fbsplash, that has already been written to do exactly what it sounds like you want to do. It will display an image in place of the normal boot messages, and it can also incorporate a progress bar. When you're trying to do something for which a well-established open-source implementation already exists, there's really no better way to learn how to do it yourself than to look at the source code.

Even if you're looking for something more complicated (say if you want to create some fancier animation than a progress bar), you might be able to start with fbsplash and modify it to suit your needs.

David Zaslavsky
+1  A: 

For the graphical output you can use the Linux framebuffer, for application development you can use gtk which support rendering directly to the framebuffer GtkFB.

For the video and such you can use mplayer which also support rendering to the framebuffer.

For the initialization you have to look around the system used, debian uses a sysv init style initialization http://www.debian-administration.org/articles/212, ubuntu uses upstart.

Ismael
Thanks, but the media centre interface will be run in X; the splash screen is the only thing in question here.
nbolton
Anyway, I've accepted your answer as you've pointed out the framebuffer, which I'll have a go at using. Thanks! :)
nbolton
I've used a live distro similar to what you are trying to accomplish, perhaps it is worth to take a look at how they are doing the same things http://geexbox.org/en/index.html.
Ismael