Building a mini thing

Started by
4 comments, last by 255 19 years, 5 months ago
Hi there. First off, this is just for fun, and please don't blaim me if I say anything that is not correct :) I would like to build a very small bootable Linux cd, with just enough to get VGA video mode up and running, and mount a floppy disk, and then auto-start a game that's on the floppy disk. Something like a simple 'console', as you might call it. Now I've done a litte research, but I still have some questions: - For booting, ISOLINUX looks okay. It supports booting your own kernel, altough it is not really clear how the hardware detection works. Is that part of ISOLINUX or would I need to write such things myself? - If so, is modprobing all the joystick modules for example a good thing to do, or should I do it elsewise? Or are there pre-made scripts available? - I want to avoid any text mode as much as possible. Can I simply use bootscreen on an ISOLINUX CD? - I would also like to avoid the boot and login prompts - a default root login would be nice (direct VGA access and such, and hardware thingies like network setup). - Also, what base distribution to use? I initially thought of Arch Linux, because it's very small and easy to setup - and above all, very often up to date. Any recommendations? - For video, there seem to be two ways of getting into graphical mode: the framebuffer, which is used per default by bootscreen, or X with a VGA driver. I need no mouse support - so that's not a problem with the framebuffer device. - Finally, I need a way of accessing the controller. If i'm going to use X, I would use SDL to access the controllers. Using the framebuffer though, I'm not so sure how it works. Any help on this? Thank you for reading this post, and I am looking forward to any replies!
Advertisement
Examining how knoppix, gentoo, damn small linux etc. do their live cds might help.

Take a look at this too.
Hmm. Nice tutorial, however, it doesn't really fit the needs.

Altough.. maybe gentoo actually /is/ a good option. Thanks.
Quote:Original post by Sijmen

Now I've done a litte research, but I still have some questions:
- For booting, ISOLINUX looks okay. It supports booting your own kernel, altough it is not really clear how the hardware detection works. Is that part of ISOLINUX or would I need to write such things myself?


ISOLINUX is a loader. It loads the kernel. It does no more hardware detection than it needs to, in order to load the kernel (i.e. approximately none).

The kernel itself does a lot of hardware detection. With modern hardware this is pretty much all via PnP (PCI, ISA, etc) or via device identifiers for things like USB. This type of hardware detection is pretty safe.

Quote:
- If so, is modprobing all the joystick modules for example a good thing to do, or should I do it elsewise? Or are there pre-made scripts available?


Non-hotpluggable devices' drivers (example: PCI sound cards) will throw an error if the device isn't present when they're loaded, so you can safely modprobe them without any side effects.

With hotpluggable devices (USB for instance), the driver will sit around until it is required (or even if it isn't). So loading excessive USB drivers will use up memory uselessly (although not very much probably)

Quote:
- I want to avoid any text mode as much as possible. Can I simply use bootscreen on an ISOLINUX CD?


ISOLINUX has a boot screen but it will remove it when the kernel boots.

Use framebuffer if you really want a gui during kernel booting.

Or boot with the kernel "quiet" option, which suppresses all the normal "noise", and have init or something early in the boot process load some sort of splash screen program. That should only take a second or two on modern hardware.

Quote:
- I would also like to avoid the boot and login prompts - a default root login would be nice (direct VGA access and such, and hardware thingies like network setup).


The boot prompt can be avoided simply by setting the timeout to 0. The login prompt is generated because you're running login processes, (getty or something), which is entirely optional. If init doesn't run a getty on the main console, the user won't see it.

Quote:
- Also, what base distribution to use? I initially thought of Arch Linux, because it's very small and easy to setup - and above all, very often up to date. Any recommendations?


Dunno, Slackware perhaps because it's simple and stupid (doesn't try to do anything clever)

Quote:
- For video, there seem to be two ways of getting into graphical mode: the framebuffer, which is used per default by bootscreen, or X with a VGA driver. I need no mouse support - so that's not a problem with the framebuffer device.


Mouse support is entirely independent of video. You can use Framebuffer but if you don't have the right driver, you will be stuck with a lousy video mode and no hardware acceleration.

Quote:
- Finally, I need a way of accessing the controller. If i'm going to use X, I would use SDL to access the controllers. Using the framebuffer though, I'm not so sure how it works. Any help on this?


I would assume that SDL would also work if you were on the console.

I don't think X has any interaction with game controller devices (i.e. Joystick devices). So they are opened directly from the kernel by the application (via SDL if used) regardless of whether X is used or not.

Mark
Quote:Original post by markr
Quote:Original post by Sijmen

Now I've done a litte research, but I still have some questions:
- For booting, ISOLINUX looks okay. It supports booting your own kernel, altough it is not really clear how the hardware detection works. Is that part of ISOLINUX or would I need to write such things myself?


ISOLINUX is a loader. It loads the kernel. It does no more hardware detection than it needs to, in order to load the kernel (i.e. approximately none).


That's nice. Thanks.

Quote:
The kernel itself does a lot of hardware detection. With modern hardware this is pretty much all via PnP (PCI, ISA, etc) or via device identifiers for things like USB. This type of hardware detection is pretty safe.

Quote:
- If so, is modprobing all the joystick modules for example a good thing to do, or should I do it elsewise? Or are there pre-made scripts available?


Non-hotpluggable devices' drivers (example: PCI sound cards) will throw an error if the device isn't present when they're loaded, so you can safely modprobe them without any side effects.

With hotpluggable devices (USB for instance), the driver will sit around until it is required (or even if it isn't). So loading excessive USB drivers will use up memory uselessly (although not very much probably)


Thanks, that makes it clearer.

Quote:
Quote:
- I want to avoid any text mode as much as possible. Can I simply use bootscreen on an ISOLINUX CD?


ISOLINUX has a boot screen but it will remove it when the kernel boots.

Use framebuffer if you really want a gui during kernel booting.

Or boot with the kernel "quiet" option, which suppresses all the normal "noise", and have init or something early in the boot process load some sort of splash screen program. That should only take a second or two on modern hardware.


I was actually pointing at the bootscreen utility for Linux, which is a kernel extension (or something like that), that does exactly that.

Quote:
Quote:
- I would also like to avoid the boot and login prompts - a default root login would be nice (direct VGA access and such, and hardware thingies like network setup).


The boot prompt can be avoided simply by setting the timeout to 0. The login prompt is generated because you're running login processes, (getty or something), which is entirely optional. If init doesn't run a getty on the main console, the user won't see it.


So I'll have to remove one of those script from the run configuration, right? And insert one (the one that runs last) that starts the actual system I wrote/will write? Or should I use local - or however it may be called?

Quote:
Quote:
- Also, what base distribution to use? I initially thought of Arch Linux, because it's very small and easy to setup - and above all, very often up to date. Any recommendations?


Dunno, Slackware perhaps because it's simple and stupid (doesn't try to do anything clever)



Hmm. I was more looking at Arch, Gentoo, and Knoppix, because each of them have an auto-install/update system which are very usefull for quickly setting up such a thing - altough I think that Gentoo is not really what I want, because of the endless compile runs (even at level 3). And if I use those prebuilt packages, I could just as well go for Arch or Knoppix.

Knoppix on the other hand, is already this style of thing, but I cannot seem to get the cloop module working in SuSE 9.1 - which is my currently installed system.

I think that I will go for ISOLINUX with Arch. Also because I've been using Arch for some time now, and I am able to configure it quite good to my needs.

Quote:
Quote:
- For video, there seem to be two ways of getting into graphical mode: the framebuffer, which is used per default by bootscreen, or X with a VGA driver. I need no mouse support - so that's not a problem with the framebuffer device.


Mouse support is entirely independent of video. You can use Framebuffer but if you don't have the right driver, you will be stuck with a lousy video mode and no hardware acceleration.



I actually want to use VGA only, so low-res is not really a problem. And altough mouse support is not directly bound to video, X does supply the mouse drivers. But that's not very important because I don't need the mouse support :).


Quote:
Quote:
- Finally, I need a way of accessing the controller. If i'm going to use X, I would use SDL to access the controllers. Using the framebuffer though, I'm not so sure how it works. Any help on this?


I would assume that SDL would also work if you were on the console.

I don't think X has any interaction with game controller devices (i.e. Joystick devices). So they are opened directly from the kernel by the application (via SDL if used) regardless of whether X is used or not.


Hmm. Thanks for the info!
SDL works surprisingly well on the frame buffer. It should transparently detect its environment when the program is started.

Recently I tried playing the Loki port of Alpha Centauri but apparently the old game was incompatible with X.Org 6.8.1. I notced the game used SDL and tried to run it in the console. To my amazement the only tinkering that was needed was enabling gpm (the console mouse daemon) in repeater mode. After that the (binary-only) game was fully playable!

This might give you some insight into the capabilities and options of SDL.

Quote:
So I'll have to remove one of those script from the run configuration, right? And insert one (the one that runs last) that starts the actual system I wrote/will write? Or should I use local - or however it may be called?

Take a look at /etc/inittab and 'man inittab'. Beware that these things might vary a bit between distros.

This topic is closed to new replies.

Advertisement