.ko modules and DRI problems

Alexander E. Patrakov semzx at newmail.ru
Sat Jul 19 20:29:35 PDT 2003


On Sunday 20 July 2003 03:56, Ken Moffat wrote:
>  I'm assuming that .ko modules are the new-style modules which break
> modutils ?  I know nothing about how to persuade X to build a .ko
> instead of a .o (I haven't built 2.5 since before this change), but a
> quick search on google suggests there is a Makefile.build script in the
> kernel scripts directory, and within that is something I don't
> understand ending $(obj-m:.o=.ko).  At a guess, this is telling the make
> process to create the object modules as .ko instead of .o, in which case
> I think all you need to do is
>
> 1. build the XFree dri module with the same compiler as you used for the
> kernel, giving a .o in the XFree tree (if you need help on this, check
> search.linuxfromscratch.org for XFree DRI - I posted in April this year,
> somebody gave me a one-liner which should rebuild most of the modules,
> then Kelledin posted a link to a tarball for building only modules with
> a corrected Makefile).
>
That won't work - there is some additional information in the new style 
modules. But I think you will be able to build them. See below for general 
information.

> 2. save your existing module under another name, just in case, and copy
> the module from X to /lib/modules/wherever changing the suffix to .ko .

That won't work!

Below is a series of steps that I had to perform to use the LT Win Modem 
driver under 2.5.70. They are general enough, so I hope that you will be able 
to apply them to DRI.

1) Investigate which source files you have. For LT Win Modem: There is a 
prebuilt file ltmdmobj.o.gcc3 and a glue source file ltmodem.c that in 2.4 go 
together into lt_modem.o. Also there is a file serial-lt-2.4.c that produces 
lt_serial.o.
2) Based on this knowledge, write a Makefile. In my case it looks as follows:

# the first two lines are based on the original Makefile, they are LT-specific
EXTRA_CFLAGS := -DNO_EEPROM -DLT_SERIAL_MODULE=lt_serial -DLT_VERSION=8.26a9
LDFLAGS += -d
# Then for each source file we add the corresponding .o file to obj-m
obj-m += lt_modem.o
# and for each resulting .ko module we list the .o files that go into it
lt_modem-objs := ltmdmobj.o.gcc3 ltmodem.o
# the same for lt_serial.ko
obj-m += lt_serial.o
lt_serial-objs := serial-lt-2.4.o
# End of the Makefile

3) Build as follows (I assume that you didn't issue a make clean in the kernel 
sources tree):

make -C /usr/src/linux-2.5.70 SUBDIRS=$PWD modules

3.5) That didn't work because of some changes in the PCI bus access functions, 
totally rewritten devfs, and some changes in the tty code. I managed to 
modify the source to account for all these differences. A patch will be sent 
here upon request. At last, the step 3 succeded. I hope there will be no such 
problem for DRI.

4) Install modules as usual.

Or, you can always try a CVS version of DRI. I will be much surprised if there 
is no support for 2.5 (now 2.6pre) kernels there.

-- 
Alexander E. Patrakov

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message



More information about the blfs-support mailing list