当前位置: 技术问答>linux和unix
linux Oops (arm) help!!!
来源: 互联网 发布时间:2017-01-30
本文导语: Unable to handle kernel NULL pointer dereference at virtual address 00000034 pgd = c3aec000 [0000...
Unable to handle kernel NULL pointer dereference at virtual address 00000034
pgd = c3aec000
[00000034] *pgd=33ad7031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1]
last sysfs file: /sys/devices/virtual/vc/vcsa5/dev
Modules linked in: virtual_bus1(+)
CPU: 0 Not tainted (2.6.32.2-FriendlyARM #1)
PC is at bus_add_device+0xbc/0x174
LR is at bus_add_device+0x18/0x174
pc : [] lr : [] psr: 60000013
sp : c3b0de90 ip : c3b0de90 fp : c3b0deb4
r10: 00000000 r9 : c3b0c000 r8 : c04ab958
r7 : 00000000 r6 : bf000188 r5 : bf000220 r4 : bf000180
r3 : 00000000 r2 : c3b0de58 r1 : 00000000 r0 : bf000220
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: c000717f Table: 33aec000 DAC: 00000015
Process insmod (pid: 718, stack limit = 0xc3b0c270)
Stack: (0xc3b0de90 to 0xc3b0e000)
de80: bf000180 bf000188 00000000 00000000
dea0: c04ab958 c3b0c000 c3b0defc c3b0deb8 c017ef40 c01805d0 00000000 00000000
dec0: c3b0dee4 c3b0ded0 c014647c c014745c bf000180 bf000180 c3b0c000 00000000
dee0: bf003000 c0030088 c3b0c000 00000000 c3b0df14 c3b0df00 c017f05c c017eb94
df00: c04812a0 c3b0c000 c3b0df2c c3b0df18 bf003014 c017f050 c04812a0 c3b0c000
df20: c3b0df7c c3b0df30 c002f32c bf003010 bf00014c 00000002 00000000 00000000
df40: 00000000 000b8038 bf000258 00000000 00000edc 000b8038 bf000258 00000000
df60: 00000edc c0030088 c3b0c000 00000000 c3b0dfa4 c3b0df80 c006e394 c002f300
df80: c3b0dfa4 c3b0df90 00000005 00000069 bee66e74 00000080 00000000 c3b0dfa8
dfa0: c002fee0 c006e2d8 00000005 00000069 000b8038 00000edc 000a3cd0 00000000
dfc0: 00000005 00000069 bee66e74 00000080 bee66e78 000a3cd0 bee66e78 00000000
dfe0: 00000001 bee66b24 0001852c 401c8984 60000010 000b8038 00000000 00000000
Backtrace:
[] (bus_add_device+0x0/0x174) from [] (device_add+0x3bc/0x4bc)
r9:c3b0c000 r8:c04ab958 r7:00000000 r6:00000000 r5:bf000188
r4:bf000180
[] (device_add+0x0/0x4bc) from [] (device_register+0x1c/0x20)
[] (device_register+0x0/0x20) from [] (virtual_bus_init+0x14/0x30 [v)
r5:c3b0c000 r4:c04812a0
[] (virtual_bus_init+0x0/0x30 [virtual_bus1]) from [] (do_one_initca)
r5:c3b0c000 r4:c04812a0
[] (do_one_initcall+0x0/0x1dc) from [] (sys_init_module+0xcc/0x1fc)
[] (sys_init_module+0x0/0x1fc) from [] (ret_fast_syscall+0x0/0x28)
r7:00000080 r6:bee66e74 r5:00000069 r4:00000005
Code: e1a00008 e89dabf0 e5953030 e2846008 (e5930034)
---[ end trace 305c0d319c2b81f9 ]---
This is my codes:
#include
#include
#include
#include
#include
static int virtual_bus_mach(struct device *device,struct device_driver *driver)
{
printk(KERN_INFO"virtual bus is maching the device and drivern");
return !strncmp(device->init_name,driver->name,strlen(driver->name));/*in the kernel 2.6.32 */
}
static int virtual_bus_release(struct device *device)
{
printk(KERN_INFO"virtual bus is gone...n");
return 0;
}
struct bus_type virtual_bus_type={
.name="virtual_bus",
.match=virtual_bus_mach,
};
EXPORT_SYMBOL(virtual_bus_type);
struct device virtual_bus={
.parent=NULL,
.init_name="virtual_bus", /*in the kernel 2.6.32 */
.bus=&virtual_bus_type,
.release=virtual_bus_release,
};
EXPORT_SYMBOL(virtual_bus);
static int __init virtual_bus_init()
{
int reg;
reg=device_register(&virtual_bus);
if(reg)
{
printk(KERN_INFO"can not register the virtual_bus");
return reg;
}
return 0;
}
static void __exit virtual_bus_exit()
{
device_unregister(&virtual_bus);
printk(KERN_INFO"virtual bus is gone..n");
}
module_init(virtual_bus_init);
module_exit(virtual_bus_exit);
MODULE_AUTHOR("Z_XLONG");
MODULE_LICENSE("GPL");
*********************************************
please help me,,when i am insmoding the module,kernel print Oops.But ,I can not understand the meaning !!!!
pgd = c3aec000
[00000034] *pgd=33ad7031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1]
last sysfs file: /sys/devices/virtual/vc/vcsa5/dev
Modules linked in: virtual_bus1(+)
CPU: 0 Not tainted (2.6.32.2-FriendlyARM #1)
PC is at bus_add_device+0xbc/0x174
LR is at bus_add_device+0x18/0x174
pc : [] lr : [] psr: 60000013
sp : c3b0de90 ip : c3b0de90 fp : c3b0deb4
r10: 00000000 r9 : c3b0c000 r8 : c04ab958
r7 : 00000000 r6 : bf000188 r5 : bf000220 r4 : bf000180
r3 : 00000000 r2 : c3b0de58 r1 : 00000000 r0 : bf000220
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: c000717f Table: 33aec000 DAC: 00000015
Process insmod (pid: 718, stack limit = 0xc3b0c270)
Stack: (0xc3b0de90 to 0xc3b0e000)
de80: bf000180 bf000188 00000000 00000000
dea0: c04ab958 c3b0c000 c3b0defc c3b0deb8 c017ef40 c01805d0 00000000 00000000
dec0: c3b0dee4 c3b0ded0 c014647c c014745c bf000180 bf000180 c3b0c000 00000000
dee0: bf003000 c0030088 c3b0c000 00000000 c3b0df14 c3b0df00 c017f05c c017eb94
df00: c04812a0 c3b0c000 c3b0df2c c3b0df18 bf003014 c017f050 c04812a0 c3b0c000
df20: c3b0df7c c3b0df30 c002f32c bf003010 bf00014c 00000002 00000000 00000000
df40: 00000000 000b8038 bf000258 00000000 00000edc 000b8038 bf000258 00000000
df60: 00000edc c0030088 c3b0c000 00000000 c3b0dfa4 c3b0df80 c006e394 c002f300
df80: c3b0dfa4 c3b0df90 00000005 00000069 bee66e74 00000080 00000000 c3b0dfa8
dfa0: c002fee0 c006e2d8 00000005 00000069 000b8038 00000edc 000a3cd0 00000000
dfc0: 00000005 00000069 bee66e74 00000080 bee66e78 000a3cd0 bee66e78 00000000
dfe0: 00000001 bee66b24 0001852c 401c8984 60000010 000b8038 00000000 00000000
Backtrace:
[] (bus_add_device+0x0/0x174) from [] (device_add+0x3bc/0x4bc)
r9:c3b0c000 r8:c04ab958 r7:00000000 r6:00000000 r5:bf000188
r4:bf000180
[] (device_add+0x0/0x4bc) from [] (device_register+0x1c/0x20)
[] (device_register+0x0/0x20) from [] (virtual_bus_init+0x14/0x30 [v)
r5:c3b0c000 r4:c04812a0
[] (virtual_bus_init+0x0/0x30 [virtual_bus1]) from [] (do_one_initca)
r5:c3b0c000 r4:c04812a0
[] (do_one_initcall+0x0/0x1dc) from [] (sys_init_module+0xcc/0x1fc)
[] (sys_init_module+0x0/0x1fc) from [] (ret_fast_syscall+0x0/0x28)
r7:00000080 r6:bee66e74 r5:00000069 r4:00000005
Code: e1a00008 e89dabf0 e5953030 e2846008 (e5930034)
---[ end trace 305c0d319c2b81f9 ]---
This is my codes:
#include
#include
#include
#include
#include
static int virtual_bus_mach(struct device *device,struct device_driver *driver)
{
printk(KERN_INFO"virtual bus is maching the device and drivern");
return !strncmp(device->init_name,driver->name,strlen(driver->name));/*in the kernel 2.6.32 */
}
static int virtual_bus_release(struct device *device)
{
printk(KERN_INFO"virtual bus is gone...n");
return 0;
}
struct bus_type virtual_bus_type={
.name="virtual_bus",
.match=virtual_bus_mach,
};
EXPORT_SYMBOL(virtual_bus_type);
struct device virtual_bus={
.parent=NULL,
.init_name="virtual_bus", /*in the kernel 2.6.32 */
.bus=&virtual_bus_type,
.release=virtual_bus_release,
};
EXPORT_SYMBOL(virtual_bus);
static int __init virtual_bus_init()
{
int reg;
reg=device_register(&virtual_bus);
if(reg)
{
printk(KERN_INFO"can not register the virtual_bus");
return reg;
}
return 0;
}
static void __exit virtual_bus_exit()
{
device_unregister(&virtual_bus);
printk(KERN_INFO"virtual bus is gone..n");
}
module_init(virtual_bus_init);
module_exit(virtual_bus_exit);
MODULE_AUTHOR("Z_XLONG");
MODULE_LICENSE("GPL");
*********************************************
please help me,,when i am insmoding the module,kernel print Oops.But ,I can not understand the meaning !!!!
|
怎么死脑筋呢?virtual_bus_type如果没注册你要的设备挂到哪里呢?好好看看LDD吧