Click to See Complete Forum and Search --> : Help,USB Support in Kernel on Laptop, tired everything!


NewJack
08-07-2002, 09:19 PM
Hello,

I'm running Red Hat 7.3 on a Sony Viao laptop. I have checked google, this site and the linux laptop site. I still can not get my usb mouse to work with linux. I really hate using that darned touchpad thingy.

When I boot up I see the usb stuff come up at the prompt and then the OK shows.

I've edited my X...config files to show the additional entry for the usb mouse but still no go...

Can anybody suggest something here?

PS. I only have a usb port so I can't just toss the usb idea :)

I'd hate to go back to w*ndows. There's gotta be someone here that can point me in the right direction?

TIA

i_like_peanut_butter
08-07-2002, 09:37 PM
Are you sure you have the correct USB modules in your kernel? I couldn't get my USB mouse to work for a long time because I left out the HID module or something. If you don't and need to recompile, I've found it easiest just to compile all my USB stuff as modules and set up hotplugging. That way when you plug in a new USB device the hotplugging script detects it and loads the correct module.

Anyway, do a 'cat /proc/bus/usb/devices' to see if your mouse is listed among the USB devices detected.

NewJack
08-07-2002, 09:43 PM
->Are you sure you have the correct USB modules in your kernel?

Nope, I'm a total newbie. I only assummed so since see the words usb and ok during startup :)

I tried the 'cat /proc/bus/usb/devices' and I didn't see a mouse. However I did see:

S: Product=USB UHCI Root Hub

It was in there twice.

So...what does this mean?

TIA

i_like_peanut_butter
08-07-2002, 10:16 PM
It means that you have a USB controller based on the VIA chipset. So far so good...

Run /sbin/lsmod to see what modules are loaded. Hopefully the following modules show up:

usb-uhci
input
usbmouse
hid
mousedev


If they show up, then all the modules are then you just need to find out what device your mouse is using. Run cat /dev/mouse and move your mouse around. Strings of characters should show up. If they do, that means /dev/mouse is what you need to tell X to use as your mouse. Press Crtl-C to stop the characters.

You now need to configure X to use /dev/mouse. As root, you'll need to edit /etc/X11/XF86Config. In there there will be a "Input" section. In that section, there is a mouse section. In that section there is Option Device "/dev/<something>". Comment out this section, and add Option Device "/dev/mouse" and hopefully that'll do it.

If you don't have all the modules or if cat /dev/mouse doesn't do anything let us know and we'll take another look at it.

NewJack
08-07-2002, 11:23 PM
Wow! Thanks for the response.

I ran /sbin/lsmod and none of the items you listed were there except...

usb-uhci

So I did some further reading and said what the hell, I tried the following commands

/sbin/insmod mousedev
/sbin/insmod input
/sbin/insmod hid

Everything installed fine...when I tried it with usbmouse I got a module not found error.

Also I rebooted and ran the lsmod command again and it appears that when I installed the other modules...they didn't stick. Do I need to put these commands in a startup file or something? modules.conf?

So I think I'm getting closer to solving my problem thanks to your help but..........I don't think I'm there since the usbmouse module did not load.

I would appreciate if you would help me further in troubleshooting this problem.

TIA

i_like_peanut_butter
08-08-2002, 09:00 AM
Most likely ush-uhci is compiled directly into your kernel. I don't think the other modules can load with out it being present in one way or another. Load as many of the modules as you can and try to 'cat /dev/mouse' and see what happens.

i_like_peanut_butter
08-08-2002, 09:13 AM
Oh yeah, to get the modules to load at boot you can edit /etc/modules.conf. Rather than do that though, I prefer to set up Hotplugging and let the hotplugging script load the right USB modules as needed. Before that though, best to find out if you have all the needed modules and work from there.

NewJack
08-08-2002, 12:54 PM
Hi,

I did as you suggested (loading the modules at the command line).

I moved the usb mouse around and nothing happened. I moved the mouse on my touchpad and then it spit out those funky characters.

So is it safe to say /dev/mouse is mapped to my touchpad only?

So the question is how do I find out what's mapped to my usb? Are there other options I should try with the cat/dev/ command?

Thanks again

i_like_peanut_butter
08-08-2002, 01:21 PM
Yep, /dev/mouse is a symlink pointing to your touchpad. Try ls -l to see where /dev/mouse is pointing, that way if stuff screws up you can go back to it. Always good to have a contingency plan.

You'll need to point /dev/mouse to /dev/input/mouse0 (probably). Check and see if /dev/input/mouse0 exists, if it does delete /dev/mouse and recreate it by typing:

ln -s /dev/input/mouse0 /dev/mouse

do another cat /dev/mouse to see if you get the characters. If so, you should be good to go.

Oh yeah, to delete and recreate /dev/mouse you'll have to be root or superuser.

i_like_peanut_butter
08-08-2002, 01:35 PM
Or try this:

ln -s /dev/input/mouse0 /dev/usbmouse

Then in your /etc/X11/XF86Config file add Option "Device" "/dev/usbmouse" to the mouse section.

Then maybe you could use point the trackpoint and USB mouse. Or it will totally kill X. Never tried it so I have no idea. If it does freak X out, go back and take that line out.

NewJack
08-08-2002, 05:24 PM
Hi,

When I try :

/dev/input/mouse0 /dev/usbmouse

I get a permission denied. I don't know what this means:

ln -s /dev/input/mouse0 /dev/mouse

I get a syntax error when I run it.

Since I'm new to all this, I don't know if you're assuming that I run this command with something else or as is?

In anycase I can't run the command as is.

Thanks

i_like_peanut_butter
08-08-2002, 05:54 PM
You have to be root.

For the 1st one, you have to ln -s /dev/input/mouse0 /dev/usbmouse.

If that doesn't work post the error message. If it does, do another cat /dev/usbmouse and move your mouse to see if it is talking to /dev/usbmouse.

Groovy, no?

NewJack
08-08-2002, 06:01 PM
Hi,

I'm logged in as root already and I typed the command

ln -s /dev/input/mouse0 /dev/usbmouse

I get an error message that says
bash: In:command not found

Thanks

i_like_peanut_butter
08-08-2002, 06:21 PM
Not found? Hmm. Maybe it is not in your path somehow? Instead of just ln try /bin/ln. Btw, ln is lowercase "L" lowercase "N".

NewJack
08-08-2002, 06:35 PM
AHH Ha!

ok now that the commans is "LN" not "IN" lowercase of course...I'm starting to get somewhere! Sorry for the mixup :)

So I tried:

ln -s /dev/input/mouse0 /dev/usbmouse

No error so I'm guessing it did something useful.

I went back through our earlier posts and noticed you suggested I first delete /dev/mouse. How?

I'm trying to backtrack to your earlier suggestions once I got this ln command working.

Also I ran cat /dev/mouse
and it's mapped to the touchpad

I ran cat /dev/input/mouse0
Error, no such file or directory

I ran cat /dev/usbmouse
Error No such device

Thanks

i_like_peanut_butter
08-08-2002, 06:57 PM
Ok, looks like you're going to have to compile the USB kernel modules.

Go to /usr/src/linux. Hopefully you're kernel sources are there. All you have to do is make menuconfig. Go into the USB section and compile most everything as modules, especially all the stuff dealing with mice.

If you don't have your kernel sources there we'll have to see what other options you have.

NewJack
08-08-2002, 07:04 PM
I had a feeling you were going to say that!

Ok I'm up for the challenge. I did some reading and am ready to tackle it. How else am I going to learn!

I just have 2 questions if you don't mind...

1--I do not have a directory called /usr/src/linux, so I don't have the kernel source files. How can I obtain them? I downloaded the Reh Hat 7.3 ISO's from Red Hat's site...I didn't see anything on the source..unless it's an option I have to choose during the install?

2- All of the infor on recompiling the kernel talks about setting up lilo to boot the new kernerl...I'm using Grub as my boot loader..can you point me to a resource that show's me step by step on how to congfigure Grub to load the new kernerl?

Please excuse my terminology. I may be saying the stuff the wrong way.

Finally I thank you for your time and help.

i_like_peanut_butter
08-08-2002, 07:12 PM
Good to hear you are up to it. The first time is fun :P

The source is probably an option during the install, probably in the development packages. It has been awhile since I've done a Red Hat install.

This NHF (http://www.linuxnewbie.org/nhf/Compiling_Kernels/Compiling_Software.html) is very helpful.

To get the latest kernel sources go to http://www.kernels.org. Actually, go to a mirror (http://www.kernel.org/mirrors) and get it from a local mirror.

Don't know about Grub, I've only used Lilo. Do a google search, or search through the forums, I'm sure someone has posted a similar question.

Before you get started, do a /sbin/lsmod and make note of all the modules loaded up so you can make sure you compile them.

Good luck

NewJack
08-08-2002, 07:18 PM
Awesome!

Thanks for your help and I will post back here once i get it all going to thank you once again :)

NewJack
08-09-2002, 04:26 AM
Well I recompiled the kernel...it took about 2 or 3 tries....every online help I read does something differently...??

Anyways I got it to boot with the new kernel but....as soon as I plug in my usb mouse the system just hangs!
This is either at boot time or during X.

So I brute-force rebooted without the usb plugged in...went to a shell and typed /sbin/lsmod and guess what?

Nothing was loaded! So I really goofed! I did not removed any of the modules when I compiled the kernel I only added input devices and then under usb ...mouse.

I'll keep trying, thanks for your help.

It's pretty fun until you hit a wall with no results :)

i_like_peanut_butter
08-09-2002, 09:09 AM
I'm sorry! Should have warned you, when you compile a new kernel, it creates new modules for that specific kernel. You have to go back and recompile the modules that were compiled in your previous kernel.

Did you get rid of your old kernel? If it was an older version than the one you just compiled you should be ok. It's modules weren't deleted or over-written.

NewJack
08-09-2002, 11:38 AM
How do I know what modules were in my previous kernel?

Do I just boot into the old kernel and type /sbin/lsmod and just copy everything on paper?

Will these names be the same when I recompile and go into xconfig?

I still have the old kernel as I did not override it....I created a new verision linux-xxxx-5custom.....

Overall it wasn't soo bad at all...once i know how get these modules in my new kernel I sould be good to go!

1 last questions...after recompiling everything, when should I plug in my usb mouse? During boot up or after Xstarts? I'm assuming i have to reconfigure X as well?

Thanks again

i_like_peanut_butter
08-09-2002, 12:35 PM
Yes. Kernel modules are stored in /lib/modules/<kernel-version>. When you boot into your old kernel (assuming you didn't download the same kernel version as the one you had) you init scripts will detect your kernel version and load the appropriate modules. /sbin/lsmod, and copy as you said.

Plug in your mouse before you reboot. Once booted into your new kernel, try to load all the modules for your mouse and see if cat /dev/input/mouse0 gets you anything.

NewJack
08-09-2002, 02:42 PM
How do I copy the modules....do I just copy the folder? Or is there a text file I need to edit?

Thanks

i_like_peanut_butter
08-09-2002, 03:01 PM
You don't copy them, you compile the latest version of them. When you are in the 'make menuconfig' phase of kernel compilation, you have tons of options on what to leave out, what to compile directly in, and what to compile as modules. You want to compile as modules all the modules your current kernel is using, plus the ones that were missing for your USB mouse.

Let me know if I can explain this better...

NewJack
08-09-2002, 03:57 PM
Sorry,

I think I follow now but.....will the names of the modules in make menuconfig be the same name when i do a /sbin/lsmod?

My workflow was to boot up to working kernel...
type /sbin/lsmod and write down all of the modules.

Then I was going to rebuild the kernel and during the make menuconfig I was going to add the usb support stuff and look for the modules that I wrote down earlier. So I just want to make sure they are named the same in this part of the interface that will be infront of me?

Also....since I'm on a laptop I don't have a scsi drive so I thought about disabling it....will that make my computer faster? IE less overhead? Or is that just at boot time?

Thanks a million.

i_like_peanut_butter
08-09-2002, 04:06 PM
Your workflow sounds good.

Do you have a CD burner on your laptop? If not it is probably pretty safe to not install and SCSI stuff in your kernel. If you do though, you'll want to compile in "IDE-SCSI" emulation and "Generic SCSI" driver.

What it will do if you leave it out will make your kernel a slight bit smaller and a little more efficient.

NewJack
08-10-2002, 12:25 PM
Hi,

I think I narrowed my problem down to the modules.

I'm sure it's trivial, I just can't figure it out.

here's what I did....

I booted into a working kernel...I did a
/sbin/lsmod....and wrote down all of the modules on paper.

When I go to recompile the kernel and select the modules when I make xmenuconfig....

the names are different? For example there is not agpgart in there? I'm sure it's there under a different name.

I noticed in this UI there's an option to load a configuration file.

So instead of my guessing on 10 modules, I'd like to load a configuration file that enables the modules that I need and then I would add the usb stuff manually.

So my question is...where is this configuration file? Does linux create a configuration file by default? If not, is there a way I can create this file to use as my template?

Thanks

i_like_peanut_butter
08-10-2002, 01:18 PM
Your configuration file would be in /usr/scr/linux, but since you didn't have the kernel sources for the stock Red Hat kernel, I'm not sure where it would be.

The agpgart is in there somewhere. Not sure where though...

NewJack
08-10-2002, 09:58 PM
Ok.....here's goes..

I'm sure this thread is getting old and boring for you:)

I finally re-compiled my kernel the right way and reloaded all my modules...yippie...it boots! but...

The usbmouse still doesn't work! ?

Am I supposed to do something else after I recompile my kernel with usb support?

Thanks again

i_like_peanut_butter
08-10-2002, 10:15 PM
As modules you'll need

You're USB controller
Full Human Interface Device (HID) support

Those two are in the USB section

Then from the Input Core section you'll need

Input Core Support
Mouse support

And I think from the Character Device --> Mice section
Mouse support


Sounds like you are getting close.

NewJack
08-10-2002, 10:28 PM
So it's supposed to work as soon as I boot?

Meaning if I get all the modules right when I recompile.....it should work right away? Or do I need to mess with the XF86-Config file?

I'm trying to narrow down where I goofed :)

Thanks

i_like_peanut_butter
08-10-2002, 10:40 PM
after you boot you will have to load the modules. Either use modprobe or insmod (as root, of course).

After modules are loaded see if you have a /dev/input/mouse0. If so, symlink it to /dev/usbmouse. Do cat /dev/usbmouse to see if it is up and working. If so, then go in and change your XF86Config file. After you make the change start (or restart) X and you should be good to go

NewJack
08-11-2002, 01:50 AM
I redid the kernel with the settings you suggested....everything booted...all the modules loaded...but when I do:

cat /dev/input/mouse0 and then move either usb or touchpad mouse....nothing happens.

My touchpad is mapped to /dev/mouse. I tested this.

Also I do not have /dev/usbmouse.

So....I'm a hell of a lot closer than before....cause when I boot I see enabling mouse support!!!!!!!!!!!!!!

If I can only get it working now that it's supported.

I have to admit coming from Windows.....this is just insane!!!! But I'm learning and that's what counts!

Thanks

i_like_peanut_butter
08-12-2002, 10:25 AM
Do you have a /dev/input directory? If you do, what is in it?

If not make one (as root 'mkdir /dev/input'). Now that it is there, you can make /dev/input/mouse0 with the following command (as root and with all the modules loaded):

mknod /dev/input/mouse0 c 13 32

Now try a cat /dev/input/mouse0. If it works do the following command to create /dev/usbmouse:

ln -s /dev/input/mouse0 /dev/usbmouse

This makes /dev/usbmouse a symlink to /dev/input/mouse0. From here it is just a matter of adding /dev/usbmouse to you XF86Config file. I hope :P

NewJack
08-12-2002, 12:34 PM
-->Do you have a /dev/input directory? If you do, what is in it?

Alot! :) mice, mouse, mouse0, mouse1.....etc

-->cat /dev/input/mouse0
Error No such device...

I tried cat /dev/input/mice...
I moved the usbmouse and nuttin, I moved the touchpad and nuttin.

My problem is ..I can't find what is mapped to the usb mouse? Strange uhh?

i_like_peanut_butter
08-12-2002, 12:37 PM
Hmm. Try /dev/input/mouse. Is /dev/input/mice a directory or character device?

NewJack
08-12-2002, 12:47 PM
-->cat /dev/input/mouse
Error No such device

-->cat /dev/input/mice

nuttin happens, like it's waiting for me to move the mouse... so I'm assuming it's a character device?
Of course I move the mouse and it does nuttin.

However
cat /dev/mouse
is mapped to the touchpad for sure.

wierd uhh?

ghostie
01-29-2003, 04:43 PM
Hey,

I'm having the same problem as you, and have been following this post and trying all things suggested to no avail.

Have you gotten any further with this issue?
thanks

one more thing,
have you tried editing /etc/modules and adding :
alias usb-controller usb-uhci

NewJack
02-12-2003, 02:11 PM
Hi,

Sorry for the delay. Yes I got this working. All i had to do was recompile the kernel with usb support and it worked.

Under USB enable usb mouse support.
Also under input devices enable mouse.
I just made them part of the kernel. I didn't feel like loading modules.

However i'm not using red hat anymore. Now I use Gentoo and i find it much more responsive. However compiling gentoo took 6 days on my laptop :)

Take care,

NJ