[uClinux-dev] Kernel modules don't work on read-only filesystems ?

David Wu davidwu at arcturusnetworks.com
Thu Oct 11 10:53:51 EDT 2007


On Thu, 11 Oct 2007 10:30:27 -0400, Josue de Freitas  
<josue.freitas at gmail.com> wrote:

> On 10/11/07, David Wu <davidwu at arcturusnetworks.com> wrote:
>>
>> On Thu, 11 Oct 2007 09:30:26 -0400, Josue de Freitas
>> <josue.freitas at gmail.com> wrote:
>>
>> > On 10/10/07, David Wu < davidwu at arcturusnetworks.com> wrote:
>> >>
>> >> On Wed, 10 Oct 2007 16:59:56 -0400, Josue de Freitas
>> >> <josue.freitas at gmail.com> wrote:
>> >>
>> >> > On 10/10/07, Crane, Matthew <mcrane03 at harris.com> wrote:
>> >> >>
>> >> >>  Hi,
>> >> >>
>> >> >> Sounds like your module didn't actually get inserted.  Can you
>> verify
>> >> it
>> >> >> is present with an lsmod?   If it failed to insert, then check  
>> your
>> >> >> klog.
>> >> >>
>> >> >
>> >> >
>> >> > Yes it is up. It's very strange because it's up but seems not to be
>> >> > running,
>> >> > a simple "hello world" module using printk  also don't work, it  
>> gets
>> >> up
>> >> > but
>> >> > apparently not run (damn my naivety to think that this will work  
>> :p).
>>
>> >> >
>> >> > The scull module is suppose to create an proc dir entry called
>> >> scullmem,
>> >> > but
>> >> > it's not created.
>> >> Did you do a strip on the module? If yes then try not strip.
>> >
>> >
>> >
>> > I never wonder if this have any influence... but it's not-stripped:
>> >
>> > # file scull.o
>> > scull.o: ELF 32-bit MSB relocatable, version 1 (SYSV), not stripped
>> This doesn't show if it is stripped. try list the size of your module in
>> the kernel tree and on the target.
>
>
>
> The module is build with those commands:
>
> mb-gcc -D__KERNEL__ -I/root/uClinux/cvs/uClinux-2.4.x/include  -Wall
> -Wstrict-prototypes -Wno-trigraphs -O1 -g -fno-strict-aliasing  
> -fno-common
> -fno-builtin-sprintf  -DPLATFORM=uclinux-auto -O2 -fno-builtin -DNO_MM
> -DNO_FPU -D__ELF__ -DMAGIC_ROM_PTR -D__linux__
> -I/root/uClinux/microblaze-elf-tools/bin/../lib/gcc/microblaze/3.4.1/./include
> -mxl-soft-div -mno-xl-soft-mul -mxl-pattern-compare -DMODULE   -nostdinc
> -iwithprefix include -DKBUILD_BASENAME=main  -c -o main.o main.c
>
> mb-gcc -D__KERNEL__ -I/root/uClinux/cvs/uClinux-2.4.x/include  -Wall
> -Wstrict-prototypes -Wno-trigraphs -O1 -g -fno-strict-aliasing  
> -fno-common
> -fno-builtin-sprintf  -DPLATFORM=uclinux-auto -O2 -fno-builtin -DNO_MM
> -DNO_FPU -D__ELF__ -DMAGIC_ROM_PTR -D__linux__
> -I/root/uClinux/microblaze-elf-tools/bin/../lib/gcc/microblaze/3.4.1/./include
> -mxl-soft-div -mno-xl-soft-mul -mxl-pattern-compare -DMODULE   -nostdinc
> -iwithprefix include -DKBUILD_BASENAME=access  -c -o access.o access.c
>
> mb-gcc -D__KERNEL__ -I/root/uClinux/cvs/uClinux-2.4.x/include  -Wall
> -Wstrict-prototypes -Wno-trigraphs -O1 -g -fno-strict-aliasing  
> -fno-common
> -fno-builtin-sprintf  -DPLATFORM=uclinux-auto -O2 -fno-builtin -DNO_MM
> -DNO_FPU -D__ELF__ -DMAGIC_ROM_PTR -D__linux__
> -I/root/uClinux/microblaze-elf-tools/bin/../lib/gcc/microblaze/3.4.1/./include
> -mxl-soft-div -mno-xl-soft-mul -mxl-pattern-compare -DMODULE   -nostdinc
> -iwithprefix include -DKBUILD_BASENAME=pipe  -c -o pipe.o pipe.c
>
> mb-ld -r -o scull.o main.o access.o pipe.o
>
>
> on the target board I have:
>
> # ls -l
> -rw-r--r--    1 root     0           19988 Jan  1 00:00 scull.o
>
> and on my computer I have:
>
> Gmicro3-278:~/uClinux/cvs/uClinux-dist/linux-2.4.x/drivers/char/scull#  
> ls -l
> scull.o
> -rw-r--r-- 1 root root 335835 2007-10-11 11:07 scull.o
>
>
> The different size mean that... ?
I believe It is stripped. Then ftp the one in the kernel tree to your  
target and test your module.

>
> BTW. what do you have in /proc/sys/kernel/printk ?
>
>
>
> I do and "echo 8 > /proc/sys/kernel/printk"... Also don't work.
The value below is fine. If you want to change the value do this
    echo "7 4 1 7" >  /proc/sys/kernel/printk

> By default I have:
>
> # cat /proc/sys/kernel/printk
> 15      4       1       7
>
>
> Thanks again David.
>
> Regards, Josue.



-- 
David
davidwu at arcturusnetworks.com


More information about the uClinux-dev mailing list