IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Linux Discussion :

Problème compilation - Drivers


Sujet :

Linux

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2002
    Messages
    168
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2002
    Messages : 168
    Par défaut Problème compilation - Drivers
    Bonsoir,
    J'essai de suivre le tuto suivant : http://broux.developpez.com/articles/c/driver-c-linux/

    Donc 1ere chose, je tente de compiler le code d'exemple et c'est là que mon premier obstacle apparait...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    #define MODULE
    #include <linux/module.h>
    #include <linux/init.h>
     
    static int __init mon_module_init(void)
    {
    	printk(KERN_DEBUG "Hello World !\n");
    	return 0;
    }
     
    static void __exit mon_module_cleanup(void)
    {
        printk(KERN_DEBUG "Goodbye World!\n");
    }
     
    module_init(mon_module_init);
    module_exit(mon_module_cleanup);
    Ma commande pour compiler le tout :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    gcc -c -I/usr/src/linux-headers-2.6.17-10-386/include/ module.c
    Et le résultat... Je dois avouer que je suis un peu perdu... Les erreurs viennent de fichiers systèmes on dirait :/

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    In file included from /usr/src/linux-headers-2.6.17-10-386/include/linux/bitops.h:9,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/thread_info.h:20,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/preempt.h:9,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/spinlock.h:49,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:10,
                     from module.c:2:
    /usr/src/linux-headers-2.6.17-10-386/include/asm/bitops.h:244: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
    In file included from /usr/src/linux-headers-2.6.17-10-386/include/linux/spinlock.h:56,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:10,
                     from module.c:2:
    /usr/src/linux-headers-2.6.17-10-386/include/asm/system.h:307: error: expected declaration specifiers or ‘...’ before ‘u8’
    /usr/src/linux-headers-2.6.17-10-386/include/asm/system.h:307: error: expected declaration specifiers or ‘...’ before ‘u8’
    /usr/src/linux-headers-2.6.17-10-386/include/asm/system.h:308: error: expected declaration specifiers or ‘...’ before ‘u16’
    /usr/src/linux-headers-2.6.17-10-386/include/asm/system.h:308: error: expected declaration specifiers or ‘...’ before ‘u16’
    /usr/src/linux-headers-2.6.17-10-386/include/asm/system.h:309: error: expected declaration specifiers or ‘...’ before ‘u32’
    /usr/src/linux-headers-2.6.17-10-386/include/asm/system.h:309: error: expected declaration specifiers or ‘...’ before ‘u32’
    /usr/src/linux-headers-2.6.17-10-386/include/asm/system.h: In function ‘cmpxchg_386’:
    /usr/src/linux-headers-2.6.17-10-386/include/asm/system.h:316: error: too many arguments to function ‘cmpxchg_386_u8’
    /usr/src/linux-headers-2.6.17-10-386/include/asm/system.h:318: error: too many arguments to function ‘cmpxchg_386_u16’
    /usr/src/linux-headers-2.6.17-10-386/include/asm/system.h:320: error: too many arguments to function ‘cmpxchg_386_u32’
    In file included from /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:86,
                     from /usr/src/linux-headers-2.6.17-10-386/include/asm/processor.h:22,
                     from /usr/src/linux-headers-2.6.17-10-386/include/asm/atomic.h:5,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/spinlock.h:230,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:10,
                     from module.c:2:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_zero’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:128: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:128: error: (Each undeclared identifier is reported only once
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:128: error: for each function it appears in.)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:132: warning: incompatible implicit declaration of built-in function ‘memset’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_fill’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:141: warning: incompatible implicit declaration of built-in function ‘memset’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:143: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_copy’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:149: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:153: warning: incompatible implicit declaration of built-in function ‘memcpy’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_and’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:160: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_or’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:169: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_xor’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:178: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_andnot’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:187: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_complement’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:196: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_equal’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:205: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_intersects’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:214: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_subset’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:223: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_empty’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:231: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_full’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:239: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_shift_right’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:253: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h: In function ‘bitmap_shift_left’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/bitmap.h:262: error: ‘BITS_PER_LONG’ undeclared (first use in this function)
    In file included from /usr/src/linux-headers-2.6.17-10-386/include/asm/processor.h:22,
                     from /usr/src/linux-headers-2.6.17-10-386/include/asm/atomic.h:5,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/spinlock.h:230,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:10,
                     from module.c:2:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: At top level:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:88: error: expected specifier-qualifier-list before ‘DECLARE_BITMAP’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpu_set’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:94: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpu_clear’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:100: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_setall’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:106: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_clear’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:112: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpu_test_and_set’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:121: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_and’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:128: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:128: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:128: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_or’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:135: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:135: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:135: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_xor’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:142: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:142: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:142: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_andnot’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:150: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:150: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:150: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_complement’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:157: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:157: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_equal’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:164: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:164: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_intersects’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:171: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:171: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_subset’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:178: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:178: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_empty’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:184: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_full’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:190: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_weight’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:196: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_shift_right’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:204: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:204: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_shift_left’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:212: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:212: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpumask_scnprintf’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:273: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpumask_parse’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:281: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpulist_scnprintf’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:289: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpulist_parse’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:295: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpu_remap’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:303: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:303: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h: In function ‘__cpus_remap’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:311: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:311: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:311: error: ‘cpumask_t’ has no member named ‘bits’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/cpumask.h:311: error: ‘cpumask_t’ has no member named ‘bits’
    In file included from /usr/src/linux-headers-2.6.17-10-386/include/asm/atomic.h:5,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/spinlock.h:230,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:10,
                     from module.c:2:
    /usr/src/linux-headers-2.6.17-10-386/include/asm/processor.h: At top level:
    /usr/src/linux-headers-2.6.17-10-386/include/asm/processor.h:76: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
    /usr/src/linux-headers-2.6.17-10-386/include/asm/processor.h:76: error: requested alignment is not a constant
    In file included from /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:11,
                     from module.c:2:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/list.h:838:2: warning: #warning "don't include kernel headers in userspace"
    In file included from /usr/src/linux-headers-2.6.17-10-386/include/asm/local.h:4,
                     from /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:20,
                     from module.c:2:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/percpu.h: In function ‘__alloc_percpu’:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/percpu.h:44: error: ‘GFP_KERNEL’ undeclared (first use in this function)
    /usr/src/linux-headers-2.6.17-10-386/include/linux/percpu.h:44: warning: initialization makes pointer from integer without a cast
    /usr/src/linux-headers-2.6.17-10-386/include/linux/percpu.h:46: warning: incompatible implicit declaration of built-in function ‘memset’
    In file included from /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:22,
                     from module.c:2:
    /usr/src/linux-headers-2.6.17-10-386/include/asm/module.h:60:2: error: #error unknown processor family
    In file included from module.c:2:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h: At top level:
    /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:49: error: field ‘attr’ has incomplete type
    /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:60: error: field ‘kobj’ has incomplete type
    /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:561: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘inter_module_register’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:563: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘inter_module_unregister’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:564: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘inter_module_get_request’
    /usr/src/linux-headers-2.6.17-10-386/include/linux/module.h:566: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘inter_module_put’
    module.c: In function ‘mon_module_init’:
    module.c:7: error: ‘KERN_DEBUG’ undeclared (first use in this function)
    module.c:7: error: expected ‘)’ before string constant
    module.c: In function ‘mon_module_cleanup’:
    module.c:13: error: ‘KERN_DEBUG’ undeclared (first use in this function)
    module.c:13: error: expected ‘)’ before string constant
    Merci pour votre aide, remarques ou suggestion de tout arrêter

    Edit : Ptite précision, je suis sous Ubuntu 6.10 !

  2. #2
    Expert confirmé
    Avatar de Skyounet
    Homme Profil pro
    Software Engineer
    Inscrit en
    Mars 2005
    Messages
    6 380
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : Etats-Unis

    Informations professionnelles :
    Activité : Software Engineer
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2005
    Messages : 6 380
    Par défaut
    Pour les noyaux 2.6, il faut utiliser un makefile.

    Le Makefile est donné dans le tuto.

    Avec le kernel 2.6, le #define MODULE est inutile.

    Pour le kernel 2.6, on peut utiliser cette commande :
    # make

    Avec le makefile suivant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    obj-m : module.o
     
    default:
    	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
     
    clean:
    	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2002
    Messages
    168
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2002
    Messages : 168
    Par défaut
    D'accord, je n'avais pas essayé le makefile, car j'avais lu "on peut" et non "il faut"... J'essai cette alternative !

    Merci à toi !

  4. #4
    Expert confirmé
    Avatar de Skyounet
    Homme Profil pro
    Software Engineer
    Inscrit en
    Mars 2005
    Messages
    6 380
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : Etats-Unis

    Informations professionnelles :
    Activité : Software Engineer
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2005
    Messages : 6 380
    Par défaut
    Citation Envoyé par Alexandre`
    D'accord, je n'avais pas essayé le makefile, car j'avais lu "on peut" et non "il faut"... J'essai cette alternative !

    Merci à toi !
    C'est ce que j'ai écris .

    Je vais rectifier.

  5. #5
    Expert confirmé
    Avatar de Michaël
    Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Juillet 2003
    Messages
    3 497
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux

    Informations forums :
    Inscription : Juillet 2003
    Messages : 3 497
    Par défaut
    salut,
    je pense que ton makefile n'est pas correct pour les noyaux 2.6. il ne génère pas de module pour les noyaux 2.6 mais pour les noyaux 2.4 (extension .o au lieu de .ko pour les 2.6). une manière simple de s'en rendre compte est d'insérer le module dans le noyau avecet ça dit
    insmod: error inserting 'module.o': -1 Invalid module format
    tu peux d'ailleurs voir dans la log
    Feb 3 10:03:44 debian kernel: No module found in object

    pour corriger ça, il faut changerenet là ça génère les bons fichiers

  6. #6
    Expert confirmé
    Avatar de Skyounet
    Homme Profil pro
    Software Engineer
    Inscrit en
    Mars 2005
    Messages
    6 380
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : Etats-Unis

    Informations professionnelles :
    Activité : Software Engineer
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2005
    Messages : 6 380
    Par défaut
    Citation Envoyé par Michaël
    salut,
    je pense que ton makefile n'est pas correct pour les noyaux 2.6. il ne génère pas de module pour les noyaux 2.6 mais pour les noyaux 2.4 (extension .o au lieu de .ko pour les 2.6). une manière simple de s'en rendre compte est d'insérer le module dans le noyau avecet ça dittu peux d'ailleurs voir dans la log


    pour corriger ça, il faut changerenet là ça génère les bons fichiers
    Exact

    Je viens de regarder un de mes Makefile et c'est ce qu'il y a dedans. Je vais rectifier.

    EDIT : réctifié

Discussions similaires

  1. Problème compilation driver ethernet
    Par bogsy15 dans le forum Debian
    Réponses: 3
    Dernier message: 20/02/2007, 20h50
  2. Problème compilation (toolkit Maximum Entropy)
    Par yannick_frere dans le forum MFC
    Réponses: 4
    Dernier message: 07/03/2005, 09h47
  3. Problème compilation Version 8.0.1 sous Debian Sarge
    Par LIndien dans le forum PostgreSQL
    Réponses: 1
    Dernier message: 04/02/2005, 21h38
  4. [tomcat] [jsp] Problème avec driver OCI pour oracle
    Par nanardcompanie dans le forum Tomcat et TomEE
    Réponses: 3
    Dernier message: 01/07/2004, 09h54
  5. [Kylix] problème compilation kylix3 avec redhat 9.0
    Par madininaoursa dans le forum EDI
    Réponses: 1
    Dernier message: 02/07/2003, 16h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo