# questions on kernel, to include or module NIC and floppy?

## SRC_DoD

so i've been on a mission to make my kernel as monolithic as possible (its been explained to me that the less modules the better).  so far this is my lsmod output

 *Quote:*   

> $ lsmod
> 
> Module                  Size  Used by
> 
> vmnet                  27556  5
> ...

 

can floppy and 8159too (realtek nic) be compiled into the kernel?  i seem to remember that compiling in your NIC either isn't even allowed or will cause it to malfunction.  floppy i can't remember if that can be compiled in and still work.  nvidia i believe has to stay as a module to work.

comments?

----------

## jpl888

There is no reason why you can't compile those 2 modules directly into the kernel.

If it causes a malfunction then my customers have been malfunctioning for 2 years now, strangely they haven's said anything, so it must malfunction in an inoquous way.

Actually I haven't tried using the floppy module compiled in but that is because I don't use a floppy.

Personally If you try compiling everything into the kernel that you might use it will probably slow the machine down. These are the rules I use:-

If you don't need to use modules then great go totally monolitic and remove module support from the kernel

If you do need modules i.e. some driver won't work unless it is as a module then compile in all the stuff that will get loaded automatically and then have the stuff you only use occasionally compiled as modules.

For instance I have a server which my partner likes to use for internet the odd time, therefore I don't have xdm started unless she wants to surf and I have the ps2 mouse drivers compiled as modules. Granted it is a pain having to type "modprobe psmouse" before I start xdm but hey anything that keeps my machine humming along nicely is good. If you hadn't guessed I am a bit of a ricer that particular thing probably doesn't make much difference but as a certain popular supermarket chain in UK and Ireland says "Every little helps".

Nuff said.

----------

## Keruskerfuerst

You can include floppy and LAN driver in the kernel. This will work without any problems.

----------

## 1clue

First, let me state that I have a completely monolithic kernel on my Gentoo boxes.  My boxes are essentially headless network appliances and I want them to be as stable as possible.

On the other hand, monolithic is not necessarily the best approach.  If you want to upgrade your driver without recompiling the kernel every time, then modules are the way to go.  If you're a true uptime junkie then you can get some astonishing uptimes if you're careful about it.

What you have to be careful about is that things which you need in your boot process be compiled in.  For example, if you have an EXT3 filesystem as /, then you need that to be compiled in to your kernel.  If you use ReiserFS, you need that instead.  If you mount to a Samba drive as an optional file sharing mount, that can be a module.  I personally try to get my main NIC card compiled in too, but that's just preference especially on a workstation.

I guess what I'm getting at is that modules were made for a reason, and before deciding that less modules is better you need to examine what your specific needs are.  Try it one way, then try it another way, sooner or later you'll come up with your own approach.

IMHO, a floppy is a completely obsolete device, only slightly more useful than a kick stand on a dump truck.  I doubt I'll ever build another one into a PC.  I'd rather add another hard drive in that slot.

Now, back to me and my methodology:  I have not ever found a driver that ceased to function when I compiled it into the kernel.

----------

## jpl888

As I remember the aic7xxx driver used to have problems compiled into the kernel. Indeed things like ndiswrapper, misdn, and variouse wireless drivers only have options to be built as modules.

----------

## SRC_DoD

ok i've gone through some mental refreshing in this thread, thats always good.

i really could careless about uptime.  i'm actually of the school of thought that a reboot every now and then is a good thing, at least for a workstation which is what i'm referring to in this thread.  now if only i didn't have to use a nvidia module that would free up some memory.  oh well whats 4 megs

----------

## 1clue

Uptime isn't the only thing that matters, of course.

The first thing I do when compiling a kernel is 'lspci' and print that out.  Then I cross out anything I don't actually need for something (eg the sound card on a server) and then write down what this box is supposed to do.  If it's a DHCP server and nothing else, then I don't care about video anything or experimental drivers, or tape drives or anything else that's not specifically related to the task at hand, OR to reboot the system once something goes haywire.  Check the cpuinfo, and build exactly to that.  If you change CPUs you'll probably change a whole lot more, and leaving out unnecessary junk that you'll never have on this PC is going to make you smaller and faster.

As I go through the kernel configuration, if the option does not serve my immediate needs I don't put it in there.  If you "might use that some day" then it doesn't fit your immediate needs.  Leave it out of there, and when you finally get around to tinkering with whatever it was, you can recompile again.  Chances are there'll be a dozen kernel upgrades between now and then anyway.  This process makes some pretty small kernels, so if you need your NVidia module you made up for part of it somewhere else.

The whole point of Gentoo is that you stop building for generic systems and start building for what you have.  It involves a bit more work, but you knew that after the first hour of the install.  Knowing how the kernel works in an abstract way helps a lot, and knowing how it works specifically for your stuff would help more.  I know in the abstract, never had time to dig into it for specifics.  Knowing what the real difference is between a module and built-in drivers is important.  You need that much both in detail and in practical terms, what does it mean for my box, as an administrator, if this driver is a module?  Usually it means exactly nothing after you get it to work.  In some cases it can be significant.

----------

