|
Making the Soundmodem Module
|
|||||||||||||
| I |
As an alternative, you might consider compiling it into the kernel, but this entails modifying a new .config file using something like menuconfig and then re-compiling that kernel in its entirety, which sometimes can be risky and often takes considerable time, perhaps even up to an hour.
I would strongly suggest that you create it as a module if your OS version permits! A typical modules build only takes about 10-15 minutes as compared to several times longer for a full kernel build. The scale is more manageable and less worriesome. Your machine will only "complain" about unresolved modules; whereas, a "corrupted" kernel may not even boot correctly, possibly locking you out alltogther, and causing you no end of headaches.
However, if you are confident about a kernel re-build, then pursue your course; I don't want to discourage anyone since most Linux administrators, sooner or later, will need to re-compile their kernels, and it is not difficult. This caveat is just a warning on my part in case you are hesitant about any major re-compile on your system. Following the steps below for installing just a single module, the soundmodem.o, may be the wiser course at this time...
The overview of our general strategy for creating this module is to run "make menuconfig," then "make modules," and, on a successful build/compile, copy just the soundmodem.o file from /usr/src/linux/drivers/net/soundmodem to the directory /lib/modules/your_OS_version/net. Normally, you would run "make modules_install" after a modules compile, but we are not going to do that since it copies all the modules you just built into the /lib/modules... directories, and we want to minimize the impact of this compile on the system! (That is why we will only copy this one file.)
Also, I am going to be an optimist and present the most straighforward path to completing these ops. Then, I will go back and play "devil's advocate" suggesting what might have gone wrong and how to fix it...
NOTE : Be sure that you have obtained a Linux distribution that contains a complete set of drivers! Specifically, you must have under /usr/src/linux a directory for drivers/net/soundmodem, and there must be many files that begin with the prefix sm_, and a piece of code named gentbl.c! This is crucial. If you don't have this, nothing will be there to make the soundmodem.o module! (Gentbl, a "C" executable, is responsible for custom generating the timing tables that will eventually be encorporated into the soundmodem module.)
- Running menuconfig
Menuconfig is a piece of code that helps you to configure the kernel on your OS system. It offers choices about what "objects" and functionality you want to be included in the kernel. However, it can also be used to create modules without having to re-build the entire kernel! Except for a few minor details, it still looks like you "might" be doing a kernel re-build, but where you see a choice surrounded by < and >, you may enter an "M" here. This signals the "configer" that you want this built as a module and not as part of the kernel.
You should note that sometimes you will not see those angle brackets. This means that this version of the kernel does not support building this function or code facility as a module, and you have no choice but to re-compile the entire kernel with this module "permanently" built-in.
Let's assume, though, that you can build the soundmodem as a module! There is a precautionary step that you should take now before running menuconfig. Make a copy of the file /usr/src/linux/.config! You may call it anything you like, perhaps: config.mmddyy, where mmddyy is today's date. This file contains a listing of the current kernel configuration, something you don't want to lose! Even though you are not re-building the kernel, it is still a good idea to make this backup since a module compile also uses this file...
Now we can move ahead and run menuconfig. Two commands will get you right into the program:
- cd /usr/src/linux
- make menuconfig
Using the arrow keys, go to "Network device support". Press "Enter" at this point to see the next menu screen. Keep going down with the blue highlight bar, until you see "Soundmodem modem driver for AX.25". Press "M" to select this as a module. The screen should refresh with the "M" being displayed between the brackets. If you know you have a Soundblaster or a clone thereof, press a "y" after you have moved the blue indicator bar over that square brace selection. It should come back with an "*" inside the brace. You may also select a choice for support for WSS, Windows Sound System. Then you must choose a speed, typically that would be support for 1200 baud AFSK modulation. So after the initial "M" select, you will have three (3) more "*'s". Exit this screen. Then exit the menuconfig program, "saying" yes to the save configuration file prompt.The table below approximates what a typical session might look like. You position the "blue bar" via the arrow keys over the "Network device support" and press "Enter" to see the next screen...
Linux Kernel v2.0.30 Configuration
Main Menu Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes features. Press <Esc><Esc> to exit, <?> for Help. Legend: [*] built-in [ ] excluded <M> module < > module capableCode maturity level options ---> Loadable module support ---> General setup ---> Floppy, IDE, and other block devices ---> Networking options ---> SCSI support ---> Network device support ---> ISDN subsystem ---> CD-ROM drivers (not for SCSI or IDE/ATAPI drives) ---> Filesystems ---> Character devices ---> (+)< Select > < Exit > < Help >
Here is what your final selections might look like...
Linux Kernel v2.0.30 Configuration
Network device support Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted letters are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes features. Press <Esc><Esc> to exit, <?> for Help. Legend: [*] built-in [ ] excluded <M> module < > module capable <M> Soundcard modem driver for AX.25 [*] Soundmodem support for Soundblaster and compatible cards [*] Soundmodem support for WSS and Crystal cards [*] Soundmodem support for 1200 baud AFSK modulation [ ] Soundmodem support for 2400 baud AFSK modulation (7.3728MHz crystal) [ ] Soundmodem support for 2400 baud AFSK modulation (8MHz crystal) [ ] Soundmodem support for 4800 baud HAPN-1 modulation [ ] Soundmodem support for 9600 baud FSK G3RUH modulation [ ] Soundmodem using floating point <M> Serial port KISS driver for AX.25 <M> BPQ Ethernet driver for AX.25< Select > < Exit > < Help >You could also have "checked" all of the remaining options for the soundmodem if you thought you might have an opportunity to use them at some future time. As you can see, I just stuck with the basics for now... (My module turned out to be about 40k in size.)
Your new configuration will be stored in the file /usr/src/linux/.config. If you look at it with "less" or "more," you will see the new entry for the soundmodem support you just selected. It will be listed under "Network device support." Here is a sample from my .config file:
Network Device Excerpt from /usr/src/linux/.config ... # # Network device support # CONFIG_NETDEVICES=y CONFIG_DUMMY=m # CONFIG_EQUALIZER is not set # CONFIG_DLCI is not set # CONFIG_PLIP is not set CONFIG_PPP=m CONFIG_SLIP=m # CONFIG_SLIP_COMPRESSED is not set # CONFIG_SLIP_SMART is not set # CONFIG_SLIP_MODE_SLIP6 is not set CONFIG_NET_RADIO=y CONFIG_BAYCOM=m CONFIG_SOUNDMODEM=m CONFIG_SOUNDMODEM_SBC=y CONFIG_SOUNDMODEM_WSS=y CONFIG_SOUNDMODEM_AFSK1200=y # CONFIG_SOUNDMODEM_AFSK2400_7 is not set # CONFIG_SOUNDMODEM_AFSK2400_8 is not set # CONFIG_SOUNDMODEM_HAPN4800 is not set # CONFIG_SOUNDMODEM_FSK9600 is not set # CONFIG_SOUNDMODEM_FLOAT is not set CONFIG_MKISS=m CONFIG_BPQETHER=m # CONFIG_PT is not set # CONFIG_PI is not set # CONFIG_SCC is not set # CONFIG_STRIP is not set # CONFIG_WAVELAN is not set # CONFIG_WIC is not set CONFIG_NET_ETHERNET=y CONFIG_NET_VENDOR_3COM=y # CONFIG_EL1 is not set # CONFIG_EL2 is not set # CONFIG_ELPLUS is not set # CONFIG_EL16 is not set # CONFIG_EL3 is not set # CONFIG_VORTEX is not set # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_ISA is not set # CONFIG_NET_EISA is not set # CONFIG_NET_POCKET is not set # CONFIG_TR is not set # CONFIG_FDDI is not set # CONFIG_ARCNET is not set ...Notice that the CONFIG_SOUNDMODEM has been set to "m". And the items "underneath" have been tagged with "y" which in this case means include these in the module, not in the kernel. There is some ambiguity in the menuconfig screen since the "y's" are encased in square braces which normally means compile it in the kernel. But when the name, soundmodem, precedes each entry, then it must mean include in the module marked above... at least that is how I finally interpreted it. :)
- The "Big" Compile
Ok, now we are ready to "rock and roll!" If all has gone well, just one more command will fire up the compiler. Remember too, that we are re-compiling all modules, that is, all code objects that have been flagged with the "M" tag in the .config file! (NOTE: If you have compiled modules before, you should also run "make clean" first to remove any "stale" .o object files; otherwise, it won't think it has anything to do.) Here is that command to begin the modules compile:
- make modules
You will now see quite a bit of compiler directive code flying by on the screen. "Warnings" are ok, but if you see a "stop," you will probably also see some "Error" message(s) which will abort the compile process and produce nothing. If all goes well, it will end gracefully and have produced a whole new set of modules, whose symbolic links can be found in /usr/src/linux/modules. If you are not sure where the soundmodem.o lives, you can begin looking in this modules directory. It should have located itself in /usr/src/linux/drivers/net/soundmodem.Our final step is to copy the new soundmodem.o code into the directory /lib/modules... Here is the command to do that:
- cp /usr/src/linux/drivers/net/soundmodem/soundmodem.o (space)
/lib/modules/your_OS_version/net/
(NOTE: This would all be entered as one line. I have broken the line for readability here and added the word "space" to mean a single space between these two path/files.) If all has gone well, you now have a newly configured soundmodem module ready to be loaded in the "mods" list with the insmod command!- Oops! It Didn't Work!
What happens if it didn't complete properly? Well, rather than trying to troubleshoot each step, I am going to suggest the "systemic" remedy. This is somewhat of an extreme measure, but it is very similiar to what happens on an OS install; you probably never noticed this level of detail at that time. The first step as always is to backup your .config file, typically by making a copy and renaming it. This file contains a text "snapshot" of your Linux kernel as of that moment.
The next step is to run "make mrproper" which will "clear the decks!" And I mean clear! All objects, all rule sets, all extraneous code fragments, all local runtime config files, and all symbolic links in the modules directory, will be removed in the /usr/src/linux directories. (This is not always a bad thing... :) You are starting over. (Note that this is what I use on my Slackware package. This same feature may or may not be present in your Makefile. You can check the file by opening it with "less" and looking for this feature... Also, be sure to backup any object files (*.o's) you are concerned about. The command "make mrproper" is a very powerful directive, only to be used when you are sure you want to do this... And when you are done with your module compile, you may want to copy your saved config file back into the .config file. Remember, mrproper will remove the current .config file too!)
The next step which is usually given as a two-part command is:
- make dep ; make clean
The command "make dep" is a very critical step. It re-builds the rules sets for the detail levels of the compile. For example, it will make the piece of code gentbl.c into an executable and run it! Thus custom-creating the timing tables needed for soundmodem.o, as mentioned above. The "make clean" will remove all .o object files recursively from all the directories below linux. You can run them independently, but they are usually run as a pair. (NOTE: You might also be able to run just this command set without running the more pervasive "make mrproper" if you are concerned about the possisble "side-effects," or don't have this facility in your package.)Now go back into menuconfig by running "make menuconfig" and select the options as described above. You might notice how sparse this file has become. It contains only the defaults for a very bare-bones system. (That is why you may want to copy your saved config file back into the .config file when you are done compiling this module...)
NOTE: If you don't see the soundmodem choices, then you may have to do either a soft or hard re-boot. After I ran mrproper, I coudn't find my soundmodem choices under network devices. But they came back after a re-boot...If all of the above completed OK, then you can run "make modules" again. This time, it should compile! If it does, then copy over the soundmodem.o code as noted above into the /lib/modules... directory.
If you still can't do the module compile for the soundmodem, then check to make sure that you really have the source code for it in /usr/src/linux/drivers/net/soundmodem. (You must have this to find the soundmodem selections in menuconfig.) And make sure you see the code, gentbl in executable form, along with the many tables it should have produced, files with "_tbl_" in their names. If you have done all of the above and still cannot get a modules compile, then you may need to consult with a fellow admin/sysop or Linux guru to help you work around this problem...
However, if it worked, you are now ready to put this module into action.
- Conclusions
Logging in as "root" and starting up major compiles is always an "adventure!" In most cases, if you are careful, thoughtful, and cautious, your efforts will be rewarded with enhanced capabilities. I have tried not to understate or overstate the risks involved, and there are risks, but the rewards usually far outweight those risks. If you are puzzled or confused about anything when putting on your admin's hat, wait before you press! Carpenters say, "Measure twice, cut once." This is always good advice even on OS platforms!
If you now have your new soundmodem in place, press on to take advantage of this great communication tool! Please see the "Using the Soundmodem on Packet Radio" page for information on how to get this interface up and running at your packet station.