Skip to contentSkip to conversation

Network Driver and NFS Root

DISCUSSION Bob Wirka 3 participants 3 messages Oct 19, 2004 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Bob Wirka

author
#1 lore raw

First, thanks for the responses to my earlier post. I appreciate it.

The ethernet driver code is now executing at boot time; adding either '__initcall(init_fcn)' or 'init_module(init_fcn)' will cause the kernel to call 'init_fcn'. That's the good news.

The bad news is that the initializatin code causes a kernel oops when accessing the 'net_device' structure that is passed to it by the kernel (as a pointer). When the code either reads or writes to the 'net_device' structure you get:

Unable to handle kernel paging request at virtual address 00010f24

Can anyone shed some light on this? I've printed out the value of the 'net_device' pointer, and it's not a null pointer.

Thanks,

Bob Wirka
Realtime Control Works

---------------ORIGINAL POST----------------------------

Quoted 19 lines · Bob Wirka

Hello,

I'm trying to build a kernel that mounts a NFS root file system. This is an embedded system; it uses an SMSC LAN91C111 network chip that is hardwired to I/O addres 0x300 and IRQ 5. I've been using the driver (as supplied by SMSC) as a module, and it works fine. Now I'm trying to incorporate it into the kernel build so that I can mount an NFS file system when the system boots.

I've added the source code to the kernel tree, and modified the Makefile(s) and Config.in files so that the driver <<appears>> to be compiled into the kernel. The kernel will load, but the chip is not initialized and the NFS fails.

Since I don't know how to pass the io address and irq number to the kernel, I've hard-coded them into the driver's init function (which I don't see being called).

If someone could point me in the right direction, I'd appreciate it.

Thank you,

Bob Wirka
Realtime Control Works
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 6 lines · Bob Wirka

First, thanks for the responses to my earlier post. I appreciate it.

The ethernet driver code is now executing at boot time; adding either '__initcall(init_fcn)' or 'init_module(init_fcn)' will cause the kernel to call 'init_fcn'. That's the good news.

The bad news is that the initializatin code causes a kernel oops when accessing the 'net_device' structure that is passed to it by the kernel (as a pointer). When the code either reads or writes to the 'net_device' structure you get:

Quoted 9 lines
Unable to handle kernel paging request at virtual address 00010f24

Can anyone shed some light on this? I've printed out the value of the 'net_device' pointer, and it's not a null pointer.

Thanks,

Bob Wirka
Realtime Control Works

Take a look at any of the other working net drivers in the kernel. You
can pretty well cut-n-paste the net_device allocation/initalization code
from any of those drivers into yours. Look for calls to
alloc_etherdev to find places to start looking.

Most likely you've forgotten to initalize some part of the structure
before passing it to register_netdev, or perhaps you've passed a pointer to a net_device structure that was allocated on the stack rather than from the heap. Its not really possible to tell without looking through the code, but regardless, start comparing what you do in your initalization routine to what any of the other net drivers do in the same area of code, and your problem is likely to jump right out at you.

HTH
Neil

Quoted 28 lines

---------------ORIGINAL POST----------------------------

Quoted 10 lines · Bob Wirka

Hello,

I'm trying to build a kernel that mounts a NFS root file system. This is an embedded system; it uses an SMSC LAN91C111 network chip that is hardwired to I/O addres 0x300 and IRQ 5. I've been using the driver (as supplied by SMSC) as a module, and it works fine. Now I'm trying to incorporate it into the kernel build so that I can mount an NFS file system when the system boots.

I've added the source code to the kernel tree, and modified the Makefile(s) and Config.in files so that the driver <<appears>> to be compiled into the kernel. The kernel will load, but the chip is not initialized and the NFS fails.

Since I don't know how to pass the io address and irq number to the kernel, I've hard-coded them into the driver's init function (which I don't see being called).

If someone could point me in the right direction, I'd appreciate it.

Quoted 9 lines

Thank you,

Bob Wirka
Realtime Control Works
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 8 lines
/***************************************************
 *Neil Horman
 *Software Engineer
 *Red Hat, Inc.
 *[email protected]
 *gpg keyid: 1024D / 0x92A74FA1
 *http://pgp.mit.edu
 ***************************************************/
#3 lore raw
In reply to Bob Wirka
Quoted 10 lines · Bob Wirka

First, thanks for the responses to my earlier post. I appreciate it.

The ethernet driver code is now executing at boot time; adding either '__initcall(init_fcn)' or 'init_module(init_fcn)' will cause the kernel to call 'init_fcn'. That's the good news.

The bad news is that the initializatin code causes a kernel oops when accessing the 'net_device' structure that is passed to it by the kernel (as a pointer). When the code either reads or writes to the 'net_device' structure you get:

Unable to handle kernel paging request at virtual address 00010f24

Can anyone shed some light on this? I've printed out the value of the 'net_device' pointer, and it's not a null pointer.

Quoted 19 lines

Thanks,

Bob Wirka
Realtime Control Works

---------------ORIGINAL POST----------------------------

Quoted 9 lines · Bob Wirka

Hello,

I'm trying to build a kernel that mounts a NFS root file system. This is an embedded system; it uses an SMSC LAN91C111 network chip that is hardwired to I/O addres 0x300 and IRQ 5. I've been using the driver (as supplied by SMSC) as a module, and it works fine. Now I'm trying to incorporate it into the kernel build so that I can mount an NFS file system when the system boots.

I've added the source code to the kernel tree, and modified the Makefile(s) and Config.in files so that the driver <<appears>> to be compiled into the kernel. The kernel will load, but the chip is not initialized and the NFS fails.

Since I don't know how to pass the io address and irq number to the kernel, I've hard-coded them into the driver's init function (which I don't see being called).

If someone could point me in the right direction, I'd appreciate it.

You should just configure the SMSC driver to be built in. The module_init_call will be called correctly on boot after the network core has been initialized. If you use an initcall it will be too early, before networking is ready. You could use a deviceinitcall that would happen at the right time.