wyattgoettsch n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 14 Jun 2005 Posts: 49
|
Posted: Tue Jun 14, 2005 11:08 pm Post subject: Dial-up modem driver. |
|
|
I went out to Fry's Electronics the other day and bought a Hummingbird 56K/V.92 Fax Modem. It is a software modem. On the back of the box it has a Tux logo and underneath it says "Linux Powered." Upon further investigation, I found a .tar.gz file on the provided driver disc containing source to build a kernel module. This is my first time building a kernel module, here are the instructions included in the README file:
Code: | 1. Unpack tar.gz package file:
$ gzip -dc slmdm-2.X.X.tar.gz | tar xf -
2. 'cd' to package directory:
$ cd slmdm-2.X.X
3. Review and edit (if need) 'Makefile'.
Note: Probably you will want to correct in Makefile path to your
local linux kernel header files:
KERNEL_INCLUDES=/path/to/linux/include
Another way is to pass command line the parameter while
running 'make':
$ make KERNEL_INCLUDES=/path/to/linux/include ...
4. Run 'make' command to compile package:
$ make
5. Install.
If you are going to use AMR/CNR/PCI modem type (as superuser):
# make install-amr
, or
# make install-usb
if you are going to use USB modem.
It will install:
- modem kernel modules slmdm.o (modem core), slfax.o (fax)
into '/lib/modules/<kernel-version>/misc' directory
(standard linux modules' directory).
- hardware specific kernel module slamrmo.o (for AMR/CNR/PCI) or
slusb.o (for USB) into '/lib/modules/<kernel-version>/misc'
directory (standard linux modules' directory).
- country settings data file 'country.dat' into directory '/etc'.
Also it will:
- create character tty device entry '/dev/ttySL0' with major
number 212 and symbolic link 'dev/modem'.
- config you '/etc/modules.conf' file in order to provide
possibility for loading the modem modules into kernel on demand
automatically by kmod, when you are going to use them.
Note: currently you cannot use both AMR/CNR/PCI and USB Modems.
6. Config modem country.
You can configure your current country by using module parameters
'country' or 'country_code'.
Add 'options' directive line to file '/etc/modules.conf':
options slmdm country=<MyCountry>
, for example
options slmdm country=USA
, or use module parameter while module loading:
# modprobe slmdm country=<MyCountry>
Use 'slver -c' to see list of all supported countries and their
codes (utility 'slver' may be found in package directory).
Note: Command ATI7 shows installed country setting.
7. Using the modem.
Installation will automatically create character tty device entry
'/dev/ttySL0' with major number 212 and symbolic link '/dev/modem'.
Use one of them as modem device for your dialing application. |
I followed those instructions. When it came to step 3 - the part about "KERNEL_INCLUDES" - I entered:
Code: | KERNEL_INCLUDES=/usr/src/linux/include |
Then I typed $ make and got this output:
Code: | gcc -Wall -O3 -fomit-frame-pointer -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -I. -I/usr/src/linux/include -DMODVERSIONS --include /usr/src/linux/include/linux/modversions.h -o amrmo_init.o -c amrmo_init.c
<command line>:139147685:14824: /usr/src/linux/include/linux/modversions.h: No such file or directory
In file included from /usr/src/linux/include/asm/processor.h:18,
from /usr/src/linux/include/asm/thread_info.h:16,
from /usr/src/linux/include/linux/thread_info.h:21,
from /usr/src/linux/include/linux/spinlock.h:12,
from /usr/src/linux/include/linux/capability.h:45,
from /usr/src/linux/include/linux/sched.h:7,
from /usr/src/linux/include/linux/module.h:10,
from amrmo_init.c:47:
/usr/src/linux/include/asm/system.h: In function `__set_64bit_var':
/usr/src/linux/include/asm/system.h:193: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/src/linux/include/asm/system.h:193: warning: dereferencing type-punned pointer will break strict-aliasing rules
amrmo_init.c: In function `amr_mod_usage_increase':
amrmo_init.c:232: warning: `MOD_INC_USE_COUNT' is deprecated (declared at /usr/src/linux/include/linux/module.h:555)
amrmo_init.c: In function `amr_mod_usage_decrease':
amrmo_init.c:236: warning: `MOD_DEC_USE_COUNT' is deprecated (declared at /usr/src/linux/include/linux/module.h:567)
amrmo_init.c: In function `amrmo_probe':
amrmo_init.c:264: error: structure has no member named `name'
amrmo_init.c:315: warning: implicit declaration of function `request_irq'
amrmo_init.c: In function `amrmo_remove':
amrmo_init.c:335: warning: implicit declaration of function `free_irq'
amrmo_init.c: In function `amrmo_init':
amrmo_init.c:369: warning: implicit declaration of function `pci_present'
amrmo_init.c:376: warning: implicit declaration of function `pci_for_each_dev'
amrmo_init.c:376: error: syntax error before '{' token
amrmo_init.c: At top level:
amrmo_init.c:386: error: syntax error before '}' token
amrmo_init.c:404: warning: type defaults to `int' in declaration of `EXPORT_NO_SYMBOLS'
amrmo_init.c:404: warning: data definition has no type or storage class
make: *** [amrmo_init.o] Error 1 |
I then typed $ make install-amr and got this output:
Code: | gcc -Wall -O3 -fomit-frame-pointer -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -I. -I/usr/src/linux/include -DMODVERSIONS --include /usr/src/linux/include/linux/modversions.h -o kernel-ver.o -c kernel-ver.c
<command line>:139147685:14824: /usr/src/linux/include/linux/modversions.h: No such file or directory
make: *** [kernel-ver.o] Error 1 |
Then I tested my module by typing:
Code: | insmod slmdm.o
and
insmod slmdm |
I got this error message:
Code: | insmod: can't read 'slmdm.o': No such file or directory
and
insmod: can't read 'slmdm': No such file or directory |
Then I typed:
Code: | insmod slamrmo.o
and
insmod slamrmo |
I got the same error messages:
Code: | insmod: can't read 'slamrmo.o': No such file or directory
and
insmod: can't read 'slamrmo': No such file or directory |
The fantastic instructions say it installs into "/lib/modules/<kernel-version>/misc." I of course looked in (my kernel is gentoo-2.6.9) /lib/modules/2.6.9-gentoo-r1 for the misc directory, but a misc directory does not even exist!
Oh, by the way, I WAS the super user during the installation.
Someone please help me. |
|