|
发表于 2016-4-19 14:28:08
只看该作者
18#
写好的东西不能加载进去,直接使用阿sai的hello模块,使用insmod插入提示为:
root@firefly:~/Coding# insmod hello.ko
Segmentation fault
查看了下模块信息如下:
root@firefly:~/Coding# modinfo hello.ko
filename: /root/Coding/hello.ko
license: GPL
description: Firefly hello driver
author: sai <271319925@qq.com>
depends:
intree: Y
vermagic: 3.10.0 SMP preempt mod_unload ARMv7 p2v8
查看了下内核记录如下:
root@firefly:~/Coding# dmesg |grep Hello
[ 809.210801] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 0
[ 810.195044] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 1
[ 811.179216] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 2
[ 812.163363] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 3
[ 813.147510] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 4
[ 814.131688] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 5
[ 815.115862] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 6
[ 816.100016] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 7
[ 817.084153] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 8
[ 818.068297] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 9
[ 819.052436] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 10
成功打印出来了。但是查看了下dmesg的信息,发现是这样的:
[ 809.210801] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 0
[ 810.195044] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 1
[ 811.179216] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 2
[ 812.163363] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 3
[ 813.147510] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 4
[ 814.131688] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 5
[ 815.115862] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 6
[ 816.100016] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 7
[ 817.084153] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 8
[ 818.068297] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 9
[ 819.052436] ~~~~~~~~~~~~~~~~~~~~~~~~Hello world~~~~~~~~~~~~~~~~~~~~~~~~ 10
[ 820.036660] Unable to handle kernel paging request at virtual address 0131d004
[ 820.043734] pgd = dccec000
[ 820.046331] [0131d004] *pgd=00000000
[ 820.049848] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[ 820.055031] Modules linked in: hello
[ 820.058527] CPU: 1 PID: 1444 Comm: insmod Not tainted 3.10.0 #17
[ 820.064405] task: dccd1a40 ti: de8ec000 task.ti: de8ec000
[ 820.069752] PC is at module_put+0x38/0x10c
[ 820.073739] LR is at do_init_module+0xf4/0x168
[ 820.078054] pc : [<c00896b0>] lr : [<c0841a54>] psr: a0070013
[ 820.078054] sp : de8edf28 ip : 00000000 fp : 00000000
[ 820.089306] r10: 00000000 r9 : de8ec000 r8 : c0841a54
[ 820.094424] r7 : 0000017b r6 : b6ef8398 r5 : bf000094 r4 : bf000094
[ 820.100819] r3 : de8ec000 r2 : 00000004 r1 : 0131d000 r0 : bf000094
[ 820.107232] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 820.114209] Control: 10c5387d Table: 1ccec06a DAC: 00000015
[ 820.119843]
[ 820.119843] PC: 0xc0089630:
[ 820.124011] 9630 30d11003 33a03000 e3530000 1a000004 e1a01006 eb07b4ad e3500000 0a000007
[ 820.132028] 9650 ea000003 e3520000 0a000004 e1a01002 eb07be06 e5940000 e3e0500d eb01b187
[ 820.140044] 9670 e1a00005 e8bd8070 e92d41f0 e2505000 e1a0800e 08bd81f0 e1a0200d e3c23d7f
[ 820.148061] 9690 e3c3303f e5932004 e2822001 e5832004 f57ff05a e595216c ee1d1f90 e2822004
[ 820.156077] 96b0 e7910002 e2800001 e7810002 e59f20bc e5921018 e3510000 0a00001c e5931004
[ 820.164093] 96d0 e2811001 e5831004 e5926024 e3560000 0a00000c e2867008 e1a04006 e5943000
[ 820.172109] 96f0 e1a01005 e5940004 e1a02008 e2844008 e12fff33 e0663004 e0833007 e5133008
[ 820.180126] 9710 e3530000 1afffff4 e1a0200d e3c23d7f e3c3303f e5932004 e2422001 e5832004
[ 820.188146]
[ 820.188146] LR: 0xc08419d4:
[ 820.192320] 19d4 ebe121f7 e3a02000 e59f00d4 e3a01003 e1a03002 ea00002e 0a000006 e59f10c4
[ 820.200337] 19f4 e284200c e1a03005 e59f00bc e58d1000 ebfff9f3 eb0024a0 e3a01000 e1a02004
[ 820.208353] 1a14 e5841000 e59f0094 ebe065f3 e1a0200d e3c23d7f e3c3303f e593300c e593300c
[ 820.216370] 1a34 e3130901 0a000000 ebe06a49 e59f007c e3a05000 eb0060e9 e1a00004 ebe11f08
[ 820.224386] 1a54 e1a00004 ebe8df8b e594311c e59410c0 e1a00004 e5843118 e5943114 e5843110
[ 820.232402] 1a74 e5943124 e5843120 ebe121ca e59f003c e58450c0 e58450c8 e58450d8 e58450d0
[ 820.240419] 1a94 eb00603f e59f0018 e3a01003 e1a02005 e1a03005 ebe07404 e1a00005 e8bd807c
[ 820.248435] 1ab4 c0c1ff48 c0c1ff3c c0861c58 c0a4f9f4 c0c1ff24 e1a03000 e59f00d4 e92d40f0
[ 820.256455]
[ 820.256455] SP: 0xde8edea8:
[ 820.260630] dea8 fd640800 c05d39a8 de8edefc 00005dbf 00000006 00000000 c0d8d000 de8ec000
[ 820.268646] dec8 00000000 c00896b0 a0070013 ffffffff de8edf14 c000d598 bf000094 0131d000
[ 820.276663] dee8 00000004 de8ec000 bf000094 bf000094 b6ef8398 0000017b c0841a54 de8ec000
[ 820.284679] df08 00000000 00000000 00000000 de8edf28 c0841a54 c00896b0 a0070013 ffffffff
[ 820.292695] df28 bf000094 00000000 b6ef8398 0000017b c000db84 c0841a54 bf000094 00000000
[ 820.300711] df48 00000000 00000003 b6ef8398 c008b048 e1a31000 00000ca7 e1a314b4 e1a313a1
[ 820.308728] df68 e1a31ba4 000001fc 0000029c 00000000 00000000 00000000 00000017 00000018
[ 820.316744] df88 0000000f 00000000 0000000c 00000000 be9d3504 be9d3684 5f434600 c000da00
[ 820.324764]
[ 820.324764] R3: 0xde8ebf80:
[ 820.328939] bf80 de8ebf80 de8ebf80 00000000 00000000 de8ebf90 de8ebf90 de8ebfac de87bed0
[ 820.336956] bfa0 c0056070 00000000 00000000 c000da98 00000000 00000000 00000000 00000000
[ 820.344972] bfc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 820.352988] bfe0 00000000 00000000 00000000 00000000 00000013 00000000 ffff5fff f8ffdffd
[ 820.361004] c000 00000000 00000002 00000000 dccd1a40 c0c1c178 00000001 00000015 dccd1a40
[ 820.369021] c020 c1f13cc0 de8ec000 c5b9f340 00000000 000000be de89c980 de8ede8c de8ede08
[ 820.377037] c040 c085aba4 00000000 00000000 00000000 00000000 00000000 01000000 00000000
[ 820.385054] c060 b6efe850 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 820.393070]
[ 820.393070] R8: 0xc08419d4:
[ 820.397249] 19d4 ebe121f7 e3a02000 e59f00d4 e3a01003 e1a03002 ea00002e 0a000006 e59f10c4
[ 820.405265] 19f4 e284200c e1a03005 e59f00bc e58d1000 ebfff9f3 eb0024a0 e3a01000 e1a02004
[ 820.413281] 1a14 e5841000 e59f0094 ebe065f3 e1a0200d e3c23d7f e3c3303f e593300c e593300c
[ 820.421297] 1a34 e3130901 0a000000 ebe06a49 e59f007c e3a05000 eb0060e9 e1a00004 ebe11f08
[ 820.429314] 1a54 e1a00004 ebe8df8b e594311c e59410c0 e1a00004 e5843118 e5943114 e5843110
[ 820.437330] 1a74 e5943124 e5843120 ebe121ca e59f003c e58450c0 e58450c8 e58450d8 e58450d0
[ 820.445347] 1a94 eb00603f e59f0018 e3a01003 e1a02005 e1a03005 ebe07404 e1a00005 e8bd807c
[ 820.453363] 1ab4 c0c1ff48 c0c1ff3c c0861c58 c0a4f9f4 c0c1ff24 e1a03000 e59f00d4 e92d40f0
[ 820.461380]
[ 820.461380] R9: 0xde8ebf80:
[ 820.465558] bf80 de8ebf80 de8ebf80 00000000 00000000 de8ebf90 de8ebf90 de8ebfac de87bed0
[ 820.473574] bfa0 c0056070 00000000 00000000 c000da98 00000000 00000000 00000000 00000000
[ 820.481590] bfc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 820.489607] bfe0 00000000 00000000 00000000 00000000 00000013 00000000 ffff5fff f8ffdffd
[ 820.497623] c000 00000000 00000002 00000000 dccd1a40 c0c1c178 00000001 00000015 dccd1a40
[ 820.505639] c020 c1f13cc0 de8ec000 c5b9f340 00000000 000000be de89c980 de8ede8c de8ede08
[ 820.513656] c040 c085aba4 00000000 00000000 00000000 00000000 00000000 01000000 00000000
[ 820.521672] c060 b6efe850 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 820.529690] Process insmod (pid: 1444, stack limit = 0xde8ec238)
[ 820.535577] Stack: (0xde8edf28 to 0xde8ee000)
[ 820.539845] df20: bf000094 00000000 b6ef8398 0000017b c000db84 c0841a54
[ 820.547856] df40: bf000094 00000000 00000000 00000003 b6ef8398 c008b048 e1a31000 00000ca7
[ 820.555872] df60: e1a314b4 e1a313a1 e1a31ba4 000001fc 0000029c 00000000 00000000 00000000
[ 820.563888] df80: 00000017 00000018 0000000f 00000000 0000000c 00000000 be9d3504 be9d3684
[ 820.571905] dfa0: 5f434600 c000da00 be9d3504 be9d3684 00000003 b6ef8398 00000000 00000000
[ 820.579921] dfc0: be9d3504 be9d3684 5f434600 0000017b b6f04ea8 00000000 b6ef4b60 00000000
[ 820.587937] dfe0: be9d34b0 be9d34a0 b6eef177 b6e5f982 80070030 00000003 440a2930 72637365
[ 820.595993] [<c00896b0>] (module_put+0x38/0x10c) from [<c0841a54>] (do_init_module+0xf4/0x168)
[ 820.604427] [<c0841a54>] (do_init_module+0xf4/0x168) from [<c008b048>] (SyS_finit_module+0x6c/0x94)
[ 820.613314] [<c008b048>] (SyS_finit_module+0x6c/0x94) from [<c000da00>] (ret_fast_syscall+0x0/0x30)
[ 820.622139] Code: f57ff05a e595216c ee1d1f90 e2822004 (e7910002)
[ 820.628152] ---[ end trace a4f74d77999ba5be ]---
|
|