On Friday 17 September 2004 19:29, Ralph Pa=DFgang wrote:
> Am Freitag 17 September 2004 18:58 schrieb Lei Yang:
> > Dear fellows,
> >
> > I am new to kernel modules and am trying to get a module work right now.
> > I need some tools to debug. In order not to risk the host machine, I am
> > thinking of using UML. I downloaded the kernel RPM
> >
> > ------user_mode_linux-2.4.19.5um-0.i386.rpm
> >
> > and root filesystem
> >
> > ------Debian-3.0r0.ext2.bz2
> >
> > and got Debian boot sucessfully. However, I still have several question=
s:
> >
> > 1. The kernel version does not match filesystem:
> > (none):/lib/modules# ls
> > 2.4.18-37um
> > (none):/lib/modules# uname -r
> > 2.4.19-5um
>
> You have to copy /usr/lib/uml/modules/... (from the host) to /lib/modules
> (on the guest) to have the correct modules for the installed uml kernel.
>
> > 2. How do I get my own module compiled into the kernel and debug with i=
t?
Well, first you must compile the UML on your own. The version from the UML=
=20
package can be called "totally screwed up". If you add your module inside t=
he=20
tree (you must know kbuild) then you are on the right route.
You can find info about how to do this on=20
http://user-mode-linux.sourceforge.net/compile.html
At the end of the "Compiling and installing kernel modules" section, it als=
o=20
explains how to fix external modules makefiles.
>
> apt-get install kernel-source-2.4.19
> apt-get source user-mode-linux
> cd user-mode-linux
> debian/rules unpack
> debian/rules patch
> debian/rules configure
> cd kernel-source-2.4.19
> make menuconfig
> <edit the config>
> cp .config ../config
> cd..
> dpkg-buildpackage -b
> this will built your own user-mode-linux debian package with the config of
> your choice.
> I hope the commands are 100% correct, but I am not sure, because I never=
=20
used=20
> the quite old woody version myself.
Well, maybe he does not use Debian for his host, and anyway, using a so old=
=20
UML version is just hunting for bugs. The stabler 2.4 release is 2.4.24-1;
the 2nd most stable is 2.4.26-3, if you don't care about hostfs working.
Bye
=2D-=20
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
|