[uClinux-dev] SLOB and binfmt_flat/do_mremap

2007-05-03 Thread John Williams

Hi,

With the SLOB allocator enabled, kobjsize() doesn't seem to match 
ksize().  This triggers a bug with binfmt_flat, where the do_mremap call 
is used to take up slack space in the allocated text/data segments.


binfmt_flat calls ksize to get the allocated region size, but do_mremap 
calls kobjsize.


I've got a system where these are reporting two different values, and 
it's causing mremap to fail:


do_mremap(0x13f4, 0x0001b4be, 0x0002, 0x0002,0x13f4)
new_len is 0x0002
kobjsize is 0x1000
ksize is 0x0002
Unable to allocate RAM for process text/data, errno 12

ksize() is reporting 0x2 (and that's what binfmt_flat passed in), 
but kobjsize() is reporting 0x1000.  This trigggers the test in 
do_mremap and the application fails with -ENOMEM.


With SLAB it's fine.

Inspired by this patch from last year

http://mailman.uclinux.org/pipermail/uclinux-dev/2006-July/039232.html

I've got the following that seems to work OK:

Index: nommu.c
===
--- nommu.c (revision 2640)
+++ nommu.c (working copy)
@@ -112,13 +112,7 @@
if (!objp || !((page = virt_to_page(objp
return 0;

-   if (PageSlab(page))
-   return ksize(objp);
-
-   BUG_ON(page-index  0);
-   BUG_ON(page-index = MAX_ORDER);
-
-   return (PAGE_SIZE  page-index);
+   return ksize(objp);
 }

Any thoughts?  It seems that this is a known issue with SLOB.

Thanks,

John

___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] simpleinit and empty inittab file

2007-05-03 Thread Michele d'Amico

Hi all,

I'm working on a blackfin board. I'm using user/init/simpleinit as init 
application. By doing some tests I found that the kernel crash while 
trying to use an empty inittab file. The message that I receive is

Kernel panic - not syncing: Attempted to kill init!

I've taken a look to the code and I've found the root cause of it:
At the end of read_inittab() function [lines 708-709 of CVS head] there are
if (numcmd == 0)
_exit(1);

Now, I could not understand why if the inittab file is empty (or 
contains only commented lines) the init application should exit with an 
error code.

Is that a well know behaviour or just a bug?

Maybe is better remove this lines ...
Is there some side effects that I should expecting?


Best Regards

--Michele
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] kernel module and static

2007-05-03 Thread Stéphane
Hi,

I have a bug that I can be resume as:

/***/
#include linux/module.h// Needed by all modules
#include linux/kernel.h// Needed for KERN_INFO

static long global_right_encoder;
static long global_left_encoder;
static long VitL;

int init_module(void)
{
VitL = 0;
global_left_encoder = 0;
global_right_encoder = 0;

printk(KERN_INFO Bug:\n);
   
VitL = global_left_encoder*global_right_encoder;
   
printk(KERN_INFO Never Reach\n);
   
return 0;
}


void cleanup_module(void)
{
}

MODULE_AUTHOR(Stephane Germain);
MODULE_LICENSE(GPL);
/**/

result:

insmod xxx.o:
SIGSEGV

dmesg:
Bug:
*** ILLEGAL INSTRUCTION ***   FORMAT=0
Current process id is 47
BAD KERNEL TRAP: 
PC: [000a8bec]
SR: 2014  SP: 007dbee8  a2: 10c16b34
d0: d1: 0991d2: d3: ffea
d4: 0060d5: 0008a0: 0003dc8ca1: 0003dca8
Process insmod (pid: 47, stackpage=007db000)
Frame format=0
Stack from 007dbf1c:
000a8c14 007d3000 007dbfc4 10c17856 007c5348 00102428 007c5348
00e8
0002 0001 007da000 00192e00 007c51c0 00190004 00140560
0015fae0
007d3000 007d4000 0060 0003dd58 000a8bc0 00e8 

      

      

  0019fdc8 10c127d2 00192e00 007c5348 00102428
007c5348
Call Trace:
[10c17856] [10c127d2]
Code: 4c39 0800 000a 8c3c 23c0 000a 8c44 4879 000a 8c1d

/*/


if the variables are local, all work!

Somebody know something that I don't  about that?

Thanks

Stephane Germain



___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] kernel module and static

2007-05-03 Thread Wolfgang Reissnegger

Hi Stéphane,

looks like you are compiling your code with compiler flags that generate 
instructions that the processor does not support. That's why you see the 
illegal instruction trap.


The reason that it all works if the variables are local is probably that 
you also use an optimization flag (e.g. -O3) that causes the compiler to 
optimize the whole multiplication away in main because it has no effect 
on the function's result and is local to the function.


You should try to compile the code with gcc -S to generate assembler 
output. Then you can identify the instruction that causes the problem.


Cheers,
   Wolfgang

Stéphane wrote:

Hi,

I have a bug that I can be resume as:

/***/
#include linux/module.h// Needed by all modules
#include linux/kernel.h// Needed for KERN_INFO

static long global_right_encoder;
static long global_left_encoder;
static long VitL;

int init_module(void)
{
VitL = 0;
global_left_encoder = 0;
global_right_encoder = 0;

printk(KERN_INFO Bug:\n);
   
VitL = global_left_encoder*global_right_encoder;
   
printk(KERN_INFO Never Reach\n);
   
return 0;

}


void cleanup_module(void)
{
}

MODULE_AUTHOR(Stephane Germain);
MODULE_LICENSE(GPL);
/**/

result:

insmod xxx.o:
SIGSEGV

dmesg:
Bug:
*** ILLEGAL INSTRUCTION ***   FORMAT=0
Current process id is 47
BAD KERNEL TRAP: 
PC: [000a8bec]
SR: 2014  SP: 007dbee8  a2: 10c16b34
d0: d1: 0991d2: d3: ffea
d4: 0060d5: 0008a0: 0003dc8ca1: 0003dca8
Process insmod (pid: 47, stackpage=007db000)
Frame format=0
Stack from 007dbf1c:
000a8c14 007d3000 007dbfc4 10c17856 007c5348 00102428 007c5348
00e8
0002 0001 007da000 00192e00 007c51c0 00190004 00140560
0015fae0
007d3000 007d4000 0060 0003dd58 000a8bc0 00e8 

      

      

  0019fdc8 10c127d2 00192e00 007c5348 00102428
007c5348
Call Trace:
[10c17856] [10c127d2]
Code: 4c39 0800 000a 8c3c 23c0 000a 8c44 4879 000a 8c1d

/*/


if the variables are local, all work!

Somebody know something that I don't  about that?

Thanks

Stephane Germain



___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] kernel module and static

2007-05-03 Thread Wolfgang Reissnegger

Hi Stéphane,

can you also generate an objdump of the module and post it?

Stéphane wrote:

Hmm,

In Makefile:

//

INCLUDE := -isystem ../uClinux-dist-20060803/linux-2.4.x/include
CFLAGS  := -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE}
CC  := /opt/uClinux-m68k-elf/bin/m68k-elf-gcc
   
${TARGET}.o: ${TARGET}.c


//

and with -S  :

/*/

.file   ucAsserv.c
gcc2_compiled.:
.section.modinfo,a,@progbits
.type__module_kernel_version,@object
.size__module_kernel_version,33
__module_kernel_version:
.string kernel_version=2.4.31-uc0-ANI-10
.section.rodata
.LC0:
.string 6Bug:\n
.LC1:
.string 6Never Reach\n
.text
.align  2
.globl init_module
.typeinit_module,@function
init_module:
link.w %a6,#0
clr.l VitL
clr.l global_left_encoder
clr.l global_right_encoder
pea .LC0
jsr printk
addq.l #4,%sp
move.l global_left_encoder,%d0
muls.l global_right_encoder,%d0
move.l %d0,VitL
pea .LC1
jsr printk
addq.l #4,%sp
clr.l %d0
jbra .L95
.align  2
.L95:
unlk %a6
rts
.Lfe1:
.sizeinit_module,.Lfe1-init_module
.align  2
.globl cleanup_module
.typecleanup_module,@function
cleanup_module:
link.w %a6,#0
.L96:
unlk %a6
rts
.Lfe2:
.sizecleanup_module,.Lfe2-cleanup_module
.globl __module_author
.section.modinfo
.type__module_author,@object
.size__module_author,24
__module_author:
.string author=Stephane Germain
.type__module_license,@object
.size__module_license,12
__module_license:
.string license=GPL
.local  global_right_encoder
.comm   global_right_encoder,4,2
.local  global_left_encoder
.comm   global_left_encoder,4,2
.local  VitL
.comm   VitL,4,2
.ident  GCC: (GNU) 2.95.3 20010315 (release)(ColdFire patches -
20010318 from
http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from
http://www.snapgear.com/)

/***/


I use the default toolchain

/opt/uClinux-m68k-elf/bin/m68k-elf-gcc -v :
Reading specs from /opt/uClinux-m68k-elf/lib/gcc-lib/m68k-elf/2.95.3/specs
gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from
http://fiddes.net/coldfire/)(uClinux XIP
and shared lib patches from http://www.snapgear.com/)

thanks


Wolfgang Reissnegger a écrit :

Hi Stéphane,

looks like you are compiling your code with compiler flags that
generate instructions that the processor does not support. That's why
you see the illegal instruction trap.

The reason that it all works if the variables are local is probably
that you also use an optimization flag (e.g. -O3) that causes the
compiler to optimize the whole multiplication away in main because it
has no effect on the function's result and is local to the function.

You should try to compile the code with gcc -S to generate assembler
output. Then you can identify the instruction that causes the problem.

Cheers,
   Wolfgang

Stéphane wrote:

Hi,

I have a bug that I can be resume as:

/***/
#include linux/module.h// Needed by all modules
#include linux/kernel.h// Needed for KERN_INFO

static long global_right_encoder;
static long global_left_encoder;
static long VitL;

int init_module(void)
{
VitL = 0;
global_left_encoder = 0;
global_right_encoder = 0;

printk(KERN_INFO Bug:\n);
   VitL = global_left_encoder*global_right_encoder;
   printk(KERN_INFO Never Reach\n);
   return 0;
}


void cleanup_module(void)
{
}

MODULE_AUTHOR(Stephane Germain);
MODULE_LICENSE(GPL);
/**/

result:

insmod xxx.o:
SIGSEGV

dmesg:
Bug:
*** ILLEGAL INSTRUCTION ***   FORMAT=0
Current process id is 47
BAD KERNEL TRAP: 
PC: [000a8bec]
SR: 2014  SP: 007dbee8  a2: 10c16b34
d0: d1: 0991d2: d3: ffea
d4: 0060d5: 0008a0: 0003dc8ca1: 0003dca8
Process insmod (pid: 47, stackpage=007db000)
Frame format=0
Stack from 007dbf1c:
000a8c14 007d3000 007dbfc4 10c17856 007c5348 00102428 007c5348
00e8
0002 0001 007da000 00192e00 007c51c0 00190004 00140560
0015fae0
007d3000 007d4000 0060 0003dd58 000a8bc0 00e8 

      

      

  0019fdc8 10c127d2 00192e00 007c5348 00102428
007c5348
Call Trace:
[10c17856] [10c127d2]
Code: 4c39 0800 000a 8c3c 23c0 000a 8c44 4879 000a 8c1d

/*/


if the variables are local, all work!

Somebody know something that I don't  

Re: [uClinux-dev] kernel module and static

2007-05-03 Thread Stéphane
Hi

I don't exactly know but:

objdump -sx xx.o :

ucAsserv.o: file format elf32-big
ucAsserv.o
architecture: UNKNOWN!, flags 0x0011:
HAS_RELOC, HAS_SYMS
start address 0x

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .text 0058      0034  2**2
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .data       008c  2**2
  CONTENTS, ALLOC, LOAD, DATA
  2 .bss  000c      008c  2**2
  ALLOC
  3 .modinfo  0045      008c  2**0
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .rodata   0019      00d1  2**0
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .comment  00a6      00ea  2**0
  CONTENTS, READONLY
SYMBOL TABLE:
 ldf *ABS* ucAsserv.c
 ld  .text .text
 ld  .data .data
 ld  .bss .bss
 l   .text gcc2_compiled.
 ld  .modinfo .modinfo
 l O .modinfo0021 __module_kernel_version
 ld  .rodata .rodata
0008 l O .bss0004 VitL
0004 l O .bss0004 global_left_encoder
 l O .bss0004 global_right_encoder
0039 l O .modinfo000c __module_license
 ld  .comment .comment
 g F .text0050 init_module
 *UND* printk
0050 g F .text0008 cleanup_module
0021 g O .modinfo0018 __module_author


RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE  VALUE
0006 UNKNOWN   .bss+0x0008
000c UNKNOWN   .bss+0x0004
0012 UNKNOWN   .bss
0018 UNKNOWN   .rodata
001e UNKNOWN   printk
0026 UNKNOWN   .bss+0x0004
002e UNKNOWN   .bss
0034 UNKNOWN   .bss+0x0008
003a UNKNOWN   .rodata+0x0009
0040 UNKNOWN   printk


Contents of section .text:
  4e56 42b9 42b9   NV..B.B.
 0010 42b9 4879  4eb9  B.HyN...
 0020 588f 2039 4c39 0800  ..X. 9L9
 0030 23c0  4879 4eb9  ..#.HyN.
 0040  588f4280 6002 4e5e4e75  X.B.`...N^Nu
 0050 4e56 4e5e4e75NV..N^Nu   
Contents of section .modinfo:
  6b65726e 656c5f76 65727369 6f6e3d32  kernel_version=2
 0010 2e342e33 312d7563 302d414e 492d3130  .4.31-uc0-ANI-10
 0020 00617574 686f723d 53746570 68616e65  .author=Stephane
 0030 20476572 6d61696e 006c6963 656e7365   Germain.license
 0040 3d47504c 00  =GPL.  
Contents of section .rodata:
  3c363e42 75673a0a 003c363e 4e657665  6Bug:..6Neve
 0010 72205265 6163680a 00 r Reach..  
Contents of section .comment:
  00474343 3a202847 4e552920 322e3935  .GCC: (GNU) 2.95
 0010 2e332032 30303130 33313520 2872656c  .3 20010315 (rel
 0020 65617365 2928436f 6c644669 72652070  ease)(ColdFire p
 0030 61746368 6573202d 20323030 31303331  atches - 2001031
 0040 38206672 6f6d2068 7474703a 2f2f6669  8 from http://fi
 0050 64646573 2e6e6574 2f636f6c 64666972  ddes.net/coldfir
 0060 652f2928 75436c69 6e757820 58495020  e/)(uClinux XIP
 0070 616e6420 73686172 6564206c 69622070  and shared lib p
 0080 61746368 65732066 726f6d20 68747470  atches from http
 0090 3a2f2f77 2e73 6e617067 6561722e  ://www.snapgear.
 00a0 636f6d2f 2900com/). 






Wolfgang Reissnegger a écrit :
 Hi Stéphane,

 can you also generate an objdump of the module and post it?

 Stéphane wrote:
 Hmm,

 In Makefile:

 //

 INCLUDE := -isystem ../uClinux-dist-20060803/linux-2.4.x/include
 CFLAGS  := -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE}
 CC  := /opt/uClinux-m68k-elf/bin/m68k-elf-gcc
${TARGET}.o: ${TARGET}.c

 //

 and with -S  :

 /*/

 .file   ucAsserv.c
 gcc2_compiled.:
 .section.modinfo,a,@progbits
 .type__module_kernel_version,@object
 .size__module_kernel_version,33
 __module_kernel_version:
 .string kernel_version=2.4.31-uc0-ANI-10
 .section.rodata
 .LC0:
 .string 6Bug:\n
 .LC1:
 .string 6Never Reach\n
 .text
 .align  2
 .globl init_module
 .typeinit_module,@function
 init_module:
 link.w %a6,#0
 clr.l VitL
 clr.l global_left_encoder
 clr.l global_right_encoder
 pea .LC0
 jsr printk
 addq.l #4,%sp
 move.l global_left_encoder,%d0
 muls.l global_right_encoder,%d0
 move.l %d0,VitL
 pea .LC1
 jsr printk
 

Re: [uClinux-dev] kernel module and static

2007-05-03 Thread Wolfgang Reissnegger

Hi,

try to use objdump -D xx.o

You should see the disassembled section of module_init.

Stéphane wrote:

Hi

I don't exactly know but:

objdump -sx xx.o :

ucAsserv.o: file format elf32-big
ucAsserv.o
architecture: UNKNOWN!, flags 0x0011:
HAS_RELOC, HAS_SYMS
start address 0x

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .text 0058      0034  2**2
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .data       008c  2**2
  CONTENTS, ALLOC, LOAD, DATA
  2 .bss  000c      008c  2**2
  ALLOC
  3 .modinfo  0045      008c  2**0
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .rodata   0019      00d1  2**0
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .comment  00a6      00ea  2**0
  CONTENTS, READONLY
SYMBOL TABLE:
 ldf *ABS* ucAsserv.c
 ld  .text .text
 ld  .data .data
 ld  .bss .bss
 l   .text gcc2_compiled.
 ld  .modinfo .modinfo
 l O .modinfo0021 __module_kernel_version
 ld  .rodata .rodata
0008 l O .bss0004 VitL
0004 l O .bss0004 global_left_encoder
 l O .bss0004 global_right_encoder
0039 l O .modinfo000c __module_license
 ld  .comment .comment
 g F .text0050 init_module
 *UND* printk
0050 g F .text0008 cleanup_module
0021 g O .modinfo0018 __module_author


RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE  VALUE
0006 UNKNOWN   .bss+0x0008
000c UNKNOWN   .bss+0x0004
0012 UNKNOWN   .bss
0018 UNKNOWN   .rodata
001e UNKNOWN   printk
0026 UNKNOWN   .bss+0x0004
002e UNKNOWN   .bss
0034 UNKNOWN   .bss+0x0008
003a UNKNOWN   .rodata+0x0009
0040 UNKNOWN   printk


Contents of section .text:
  4e56 42b9 42b9   NV..B.B.
 0010 42b9 4879  4eb9  B.HyN...
 0020 588f 2039 4c39 0800  ..X. 9L9
 0030 23c0  4879 4eb9  ..#.HyN.
 0040  588f4280 6002 4e5e4e75  X.B.`...N^Nu
 0050 4e56 4e5e4e75NV..N^Nu   
Contents of section .modinfo:

  6b65726e 656c5f76 65727369 6f6e3d32  kernel_version=2
 0010 2e342e33 312d7563 302d414e 492d3130  .4.31-uc0-ANI-10
 0020 00617574 686f723d 53746570 68616e65  .author=Stephane
 0030 20476572 6d61696e 006c6963 656e7365   Germain.license
 0040 3d47504c 00  =GPL.  
Contents of section .rodata:

  3c363e42 75673a0a 003c363e 4e657665  6Bug:..6Neve
 0010 72205265 6163680a 00 r Reach..  
Contents of section .comment:

  00474343 3a202847 4e552920 322e3935  .GCC: (GNU) 2.95
 0010 2e332032 30303130 33313520 2872656c  .3 20010315 (rel
 0020 65617365 2928436f 6c644669 72652070  ease)(ColdFire p
 0030 61746368 6573202d 20323030 31303331  atches - 2001031
 0040 38206672 6f6d2068 7474703a 2f2f6669  8 from http://fi
 0050 64646573 2e6e6574 2f636f6c 64666972  ddes.net/coldfir
 0060 652f2928 75436c69 6e757820 58495020  e/)(uClinux XIP
 0070 616e6420 73686172 6564206c 69622070  and shared lib p
 0080 61746368 65732066 726f6d20 68747470  atches from http
 0090 3a2f2f77 2e73 6e617067 6561722e  ://www.snapgear.
 00a0 636f6d2f 2900com/). 







Wolfgang Reissnegger a écrit :

Hi Stéphane,

can you also generate an objdump of the module and post it?

Stéphane wrote:

Hmm,

In Makefile:

//

INCLUDE := -isystem ../uClinux-dist-20060803/linux-2.4.x/include
CFLAGS  := -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE}
CC  := /opt/uClinux-m68k-elf/bin/m68k-elf-gcc
   ${TARGET}.o: ${TARGET}.c

//

and with -S  :

/*/

.file   ucAsserv.c
gcc2_compiled.:
.section.modinfo,a,@progbits
.type__module_kernel_version,@object
.size__module_kernel_version,33
__module_kernel_version:
.string kernel_version=2.4.31-uc0-ANI-10
.section.rodata
.LC0:
.string 6Bug:\n
.LC1:
.string 6Never Reach\n
.text
.align  2
.globl init_module
.typeinit_module,@function
init_module:
link.w %a6,#0
clr.l VitL
clr.l global_left_encoder
clr.l global_right_encoder
pea .LC0
jsr printk
addq.l #4,%sp
move.l global_left_encoder,%d0
muls.l 

Re: [uClinux-dev] Using math.h in uClinux applications

2007-05-03 Thread Sven Johnsson

Doug,

I have not used a Makefile at all, I just compile by typing gcc
file.c -o file -lm

Regards,
Sven


--- Doug Kehn wrote:

Did you also add -lm to the Makefile?  For example,

$(EXEC): $(OBJS)
  $(CC) $(LDFLAGS) -o $@ $(OBJS) -lm $(LDLIBS)


Regards,
...doug
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] add ROMfs in RAM at the end of kernel (_ebss)

2007-05-03 Thread Shuanglin Wang

Hi Lance,

I'm doing similar things. I patched the kernel with your code, but i got 
an kernel panic. The boot log is:


/-/
Kernel command line: root=/dev/ram0
...
io scheduler noop registered (default)
atmel_usart.0: ttyS0 at MMIO 0xf800f000 (irq = 11) is a ATMEL_SERIAL
RAMDISK driver initialized: 1 RAM disks of 1024K size 1024 blocksize
uclinux[mtd]: RAM probe address=0xf02f0 size=0x1e000
Creating 1 MTD partitions on RAM:
0x-0x0001e000 : ROMfs
mtd: Giving out device 0 to ROMfs
uclinux[mtd]: set ROMfs to be root filesystem
Generic platform RAM MTD, (c) 2004 Simtec Electronics
VFS: Can't find a romfs filesystem on dev ram0.
No filesystem could mount root, tried:  romfs
Kernel panic - not syncing: VFS: Unable to mount root fs on 
unknown-block(1,0)

/-/

I made further test on it. And it seems it get an empty super inode from 
romfs.


Did I miss something in kernel configuration or kernel command line?

Thansk a lot.

Shuanglin




Lance Spaulding wrote:


Mickael Sergent wrote:
 


Hello,

I'm trying to port uclinux 2.6.x on dev. board based on ARM946-E-S. (I
use uClinux-dist 20070130)

I would like to have kernel and ROMfs entirely in RAM but it seems to
be impossible on ARM architecture.

On uclinux 2.4 version a switch (CONFIG_RAM_ATTACHED_ROMFS) can be
used to do this.

Does an equivalent exist in 2.6 version ?


I tried to use CONFIG_MTD_UCLINUX_EBSS (after having defined _ebss
symbol in the end of kernel) but it doesn't solve problem (because RAM
where is stored ROMfs is used by uclinux), so a patch is needed to
reserve ROMfs memory

Do you know another solution to put ROMfs at the end of kernel ?

Thanks a lot !

Best regards,

Mickael.



___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
   


Hi Mickael,

We use a ram based rom filesystem on our ARM products (including ones
using an arm946).  I've attached a small patch of the changes I made to
get this to work.  Note that we use little-endian exclusively so if you
are using big-endian you will need to change the code slightly. 


Thanks,
Lance
 




diff -Naur uClinux-dist.orig/linux-2.6.x/arch/arm/kernel/head-common.S 
uClinux-dist/linux-2.6.x/arch/arm/kernel/head-common.S
--- uClinux-dist.orig/linux-2.6.x/arch/arm/kernel/head-common.S 2006-06-28 
01:22:16.0 -0600
+++ uClinux-dist/linux-2.6.x/arch/arm/kernel/head-common.S  2007-04-18 
17:57:48.0 -0600
@@ -10,7 +10,6 @@
 * published by the Free Software Foundation.
 *
 */
-
.type   __switch_data, %object
__switch_data:
.long   __mmap_switched
@@ -41,7 +40,6 @@
ldrne   fp, [r4], #4
strne   fp, [r5], #4
bne 1b
-
mov fp, #0  @ Clear BSS (and zero fp)
1:  cmp r6, r7
strcc   fp, [r6],#4
@@ -215,3 +213,41 @@
bl  __lookup_machine_type
mov r0, r5
ldmfd   sp!, {r4 - r6, pc}
+
+#ifdef CONFIG_MTD_UCLINUX
+   .type   __relocate_romfs, %function
+__relocate_romfs:
+   adr r4, romfsinfo
+   ldmia   r4!, {r6, r7}
+   bic r6, r6, #0xc000
+   bic r7, r7, #0xc000
+   
+   /* move the ram based rom filesystem to its correct final location...  */

+   /* the value is stored big-endian  
*/
+   mov fp, #0
+   add r4,r6,#8
+   ldrb r4,[r4]
+   orr fp, fp, r4, LSL #24
+   add r4,r6,#9
+   ldrb r4,[r4]
+   orr fp, fp, r4, LSL #16
+   add r4,r6,#10
+   ldrb r4,[r4]
+   orr fp, fp, r4, LSL #8
+   add r4,r6,#11
+   ldrb r4,[r4]
+   orr fp, fp, r4, LSL #0
+   add r4, r6, fp
+   add fp, r7, fp
+   sub r6, r6, #4
+1: ldr r5, [r4]
+   str r5, [fp]
+   sub r4, r4, #4
+   sub fp, fp, #4
+   cmp r4, r6
+   bne 1b
+   mov pc, lr
+romfsinfo:
+   .long   __bss_start @ r6
+   .long   _end@ r7
+#endif
diff -Naur uClinux-dist.orig/linux-2.6.x/arch/arm/kernel/head-nommu.S 
uClinux-dist/linux-2.6.x/arch/arm/kernel/head-nommu.S
--- uClinux-dist.orig/linux-2.6.x/arch/arm/kernel/head-nommu.S  2007-01-29 
18:55:08.0 -0700
+++ uClinux-dist/linux-2.6.x/arch/arm/kernel/head-nommu.S   2007-04-19 
08:25:58.0 -0600
@@ -16,7 +16,6 @@

#include asm/assembler.h
#include asm/mach-types.h
-#include asm/procinfo.h
#include asm/ptrace.h
#include asm/asm-offsets.h
#include asm/thread_info.h
@@ -41,6 +40,9 @@
ldr r1, =machine_arch_type  @ find the machine type
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
 

Re: [uClinux-dev] kernel module and static

2007-05-03 Thread Wolfgang Reissnegger

OK,

so it seems like the:
   2a:4c39 0800  mulsl 0 init_module,%d0
instruction is causing your illegal instruction trap.

I would suspect that the CPU you are running does not support 
multiplication instructions? You can look into the gcc man page to find 
out if there are any options you can pass to the compiler to generate 
instructions for your particular model.


Wolfgang

Stéphane wrote:

Hi

Ok I do that:
/opt/m68k-uclinux-tools-20060615/bin/m68k-uclinux-objdump -D xx.o


ucAsserv.o: file format elf32-m68k

Disassembly of section .text:

 init_module:
   0:4e56   linkw %fp,#0
   4:42b9   clrl 0 init_module
   a:42b9   clrl 0 init_module
  10:42b9   clrl 0 init_module
  16:4879   pea 0 init_module
  1c:4eb9   jsr 0 init_module
  22:588f   addql #4,%sp
  24:2039   movel 0 init_module,%d0
  2a:4c39 0800  mulsl 0 init_module,%d0
  30:
  32:23c0   movel %d0,0 init_module
  38:4879   pea 0 init_module
  3e:4eb9   jsr 0 init_module
  44:588f   addql #4,%sp
  46:4280   clrl %d0
  48:6000 0002  braw 4c init_module+0x4c
  4c:4e5e   unlk %fp
  4e:4e75   rts

0050 cleanup_module:
  50:4e56   linkw %fp,#0
  54:4e5e   unlk %fp
  56:4e75   rts
Disassembly of section .bss:

 global_right_encoder:
   0:   orib #0,%d0

0004 global_left_encoder:
   4:   orib #0,%d0

0008 VitL:
   8:   orib #0,%d0
Disassembly of section .modinfo:

 __module_kernel_version:
   0:6b65   bmis 67 cleanup_module+0x17
   2:726e   moveq #110,%d1
   4:656c   bcss 72 cleanup_module+0x22
   6:5f76 6572 7369 subqw #7,%fp@(73696f6e)@(3d32)
   c:6f6e 3d32
  10:2e34 2e33  movel %a4@(0033,%d2:l:8),%d7
  14:312d 7563  movew %a5@(30051),[EMAIL PROTECTED]
  18:302d 414e  movew %a5@(16718),%d0
  1c:492d 3130  chkl %a5@(12592),%d4
...

0021 __module_author:
  21:6175   bsrs 98 cleanup_module+0x48
  23:7468   moveq #104,%d2
  25:6f72   bles 99 cleanup_module+0x49
  27:3d53 7465  movew %a3@,%fp@(29797)
  2b:7068   moveq #104,%d0
  2d:616e   bsrs 9d cleanup_module+0x4d
  2f:6520   bcss 51 cleanup_module+0x1
  31:4765   043545
  33:726d   moveq #109,%d1
  35:6169   bsrs a0 cleanup_module+0x50
  37:6e00 6c69  bgtw 6ca2 cleanup_module+0x6c52

0039 __module_license:
  39:6c69   bges a4 cleanup_module+0x54
  3b:6365   blss a2 cleanup_module+0x52
  3d:6e73   bgts b2 cleanup_module+0x62
  3f:653d   bcss 7e cleanup_module+0x2e
  41:4750   043520
  43:Address 0x0045 is out of bounds.

Disassembly of section .rodata:

 .rodata:
   0:3c36 3e42  movew %fp@(0042,%d3:l:8),%d6
   4:7567   mvsw [EMAIL PROTECTED],%d2
   6:3a0a   movew %a2,%d5
   8:003c 363e  orib #62,%ccr
   c:4e65   movel %a5,%usp
   e:7665   moveq #101,%d3
  10:7220   moveq #32,%d1
  12:5265   addqw #1,[EMAIL PROTECTED]
  14:6163   bsrs 79 cleanup_module+0x29
  16:680a   bvcs 22 __module_author+0x1
...
Disassembly of section .comment:

 .comment:
   0:0047 4343  oriw #17219,%d7
   4:3a20   movew [EMAIL PROTECTED],%d5
   6:2847   moveal %d7,%a4
   8:4e55 2920  linkw %a5,#10528
   c:322e 3935  movew %fp@(14645),%d1
  10:2e33 2032  movel %a3@(0032,%d2:w),%d7
  14:3030 3130 3331 movew %a0@(33313520,%d3:w),%d0
  1a:3520
  1c:2872 656c 6561 moveal %a2@(6561)@(),%a4
  22:7365   mvsw [EMAIL PROTECTED],%d1
  24:2928 436f  movel %a0@(17263),[EMAIL PROTECTED]
  28:6c64   bges 8e .comment+0x8e
  2a:4669 7265  notw %a1@(29285)
  2e:2070 6174 6368 moveal %a0@(63686573)@(),%a0
  34:6573
  36:202d 2032  movel %a5@(8242),%d0
  3a:3030 3130 3331 movew %a0@(33313820,%d3:w),%d0
  40:3820
  42:6672   bnes b6 cleanup_module+0x66
  44:6f6d   bles b3 cleanup_module+0x63
  46:2068 7474  moveal %a0@(29812),%a0
  4a:703a   moveq #58,%d0
  4c:2f2f 6669  movel %sp@(26217),[EMAIL PROTECTED]
  50:6464   bccs b6 cleanup_module+0x66
  52:6573   bcss 

Re: [uClinux-dev] add ROMfs in RAM at the end of kernel (_ebss)

2007-05-03 Thread Lance Spaulding
Hi Shaunglin,

Try removing the 'root=/dev/ram0' from your command line.  You can add
'rootfstype=romfs' if you want but it should work w/o it.

Thanks,
Lance

Shuanglin Wang wrote:
 Hi Lance,

 I'm doing similar things. I patched the kernel with your code, but i
 got an kernel panic. The boot log is:

 /-/
 Kernel command line: root=/dev/ram0
 ...
 io scheduler noop registered (default)
 atmel_usart.0: ttyS0 at MMIO 0xf800f000 (irq = 11) is a ATMEL_SERIAL
 RAMDISK driver initialized: 1 RAM disks of 1024K size 1024 blocksize
 uclinux[mtd]: RAM probe address=0xf02f0 size=0x1e000
 Creating 1 MTD partitions on RAM:
 0x-0x0001e000 : ROMfs
 mtd: Giving out device 0 to ROMfs
 uclinux[mtd]: set ROMfs to be root filesystem
 Generic platform RAM MTD, (c) 2004 Simtec Electronics
 VFS: Can't find a romfs filesystem on dev ram0.
 No filesystem could mount root, tried:  romfs
 Kernel panic - not syncing: VFS: Unable to mount root fs on
 unknown-block(1,0)
 /-/

 I made further test on it. And it seems it get an empty super inode
 from romfs.

 Did I miss something in kernel configuration or kernel command line?

 Thansk a lot.

 Shuanglin




 Lance Spaulding wrote:

 Mickael Sergent wrote:
  

 Hello,

 I'm trying to port uclinux 2.6.x on dev. board based on ARM946-E-S. (I
 use uClinux-dist 20070130)

 I would like to have kernel and ROMfs entirely in RAM but it seems to
 be impossible on ARM architecture.

 On uclinux 2.4 version a switch (CONFIG_RAM_ATTACHED_ROMFS) can be
 used to do this.

 Does an equivalent exist in 2.6 version ?


 I tried to use CONFIG_MTD_UCLINUX_EBSS (after having defined _ebss
 symbol in the end of kernel) but it doesn't solve problem (because RAM
 where is stored ROMfs is used by uclinux), so a patch is needed to
 reserve ROMfs memory

 Do you know another solution to put ROMfs at the end of kernel ?

 Thanks a lot !

 Best regards,

 Mickael.

 


 ___
 uClinux-dev mailing list
 uClinux-dev@uclinux.org
 http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
 This message was resent by uclinux-dev@uclinux.org
 To unsubscribe see:
 http://mailman.uclinux.org/mailman/options/uclinux-dev
   
 Hi Mickael,

 We use a ram based rom filesystem on our ARM products (including ones
 using an arm946).  I've attached a small patch of the changes I made to
 get this to work.  Note that we use little-endian exclusively so if you
 are using big-endian you will need to change the code slightly.
 Thanks,
 Lance
  

 

 diff -Naur
 uClinux-dist.orig/linux-2.6.x/arch/arm/kernel/head-common.S
 uClinux-dist/linux-2.6.x/arch/arm/kernel/head-common.S
 --- uClinux-dist.orig/linux-2.6.x/arch/arm/kernel/head-common.S   
 2006-06-28 01:22:16.0 -0600
 +++ uClinux-dist/linux-2.6.x/arch/arm/kernel/head-common.S   
 2007-04-18 17:57:48.0 -0600
 @@ -10,7 +10,6 @@
  * published by the Free Software Foundation.
  *
  */
 -
 .type__switch_data, %object
 __switch_data:
 .long__mmap_switched
 @@ -41,7 +40,6 @@
 ldrnefp, [r4], #4
 strnefp, [r5], #4
 bne1b
 -
 movfp, #0@ Clear BSS (and zero fp)
 1:cmpr6, r7
 strccfp, [r6],#4
 @@ -215,3 +213,41 @@
 bl__lookup_machine_type
 movr0, r5
 ldmfdsp!, {r4 - r6, pc}
 +
 +#ifdef CONFIG_MTD_UCLINUX
 +.type__relocate_romfs, %function
 +__relocate_romfs:
 +   adr r4, romfsinfo
 +ldmiar4!, {r6, r7}
 +   bic r6, r6, #0xc000
 +   bic r7, r7, #0xc000
 +   +   /* move the ram based rom filesystem to its correct final
 location...  */
 +   /* the value is stored
 big-endian  */
 +   mov fp, #0
 +   add r4,r6,#8
 +   ldrb r4,[r4]
 +   orr fp, fp, r4, LSL #24
 +   add r4,r6,#9
 +   ldrb r4,[r4]
 +   orr fp, fp, r4, LSL #16
 +   add r4,r6,#10
 +   ldrb r4,[r4]
 +   orr fp, fp, r4, LSL #8
 +   add r4,r6,#11
 +   ldrb r4,[r4]
 +   orr fp, fp, r4, LSL #0
 +   add r4, r6, fp
 +   add fp, r7, fp
 +   sub r6, r6, #4
 +1: ldr r5, [r4]
 +   str r5, [fp]
 +   sub r4, r4, #4
 +   sub fp, fp, #4
 +   cmp r4, r6
 +   bne 1b
 +   mov pc, lr
 +romfsinfo:
 +.long__bss_start@ r6
 +.long_end@ r7
 +#endif
 diff -Naur uClinux-dist.orig/linux-2.6.x/arch/arm/kernel/head-nommu.S
 uClinux-dist/linux-2.6.x/arch/arm/kernel/head-nommu.S
 --- uClinux-dist.orig/linux-2.6.x/arch/arm/kernel/head-nommu.S   
 2007-01-29 18:55:08.0 -0700
 +++ uClinux-dist/linux-2.6.x/arch/arm/kernel/head-nommu.S   
 2007-04-19 08:25:58.0 -0600
 @@ -16,7 +16,6 @@

 #include asm/assembler.h
 #include asm/mach-types.h
 -#include asm/procinfo.h
 #include asm/ptrace.h
 #include 

[uClinux-dev] how to use ftp client to upload a file from target to server?

2007-05-03 Thread Bob Furber
I am having difficulty figuring out how to use ftp client to upload a file
from a uClinux target to server.

In fact, I am having difficulty figuring out how to log into a server and
give it a username and password. Unlike Linux, uClinux does not request a
username and password.

# ftp ftp.sbctools.com
ftp: ftp.sbctools.com: ftp user sbctools
ftp

..connects, but, does not ask for username and password. But, now the trick
is to give the server a username and password.

# ftp ftp.sbctools.com
ftp: ftp.sbctools.com: ftp user sbctools
Not connected
ftp

This is the kind of Linux session I am trying to repicate from a uClinux
target:

[EMAIL PROTECTED] bin]$ ftp ftp.sbctools.com
Connected to ftp.sbctools.com (67.55.39.12).
220 ftp.sbctools.com FTP Server ready
Name (ftp.sbctools.com:intec): sbctools
331 Password required for sbctools.
Password:
230 User sbctools logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp cd /var/www/html/downloads/V3
250 CWD command successful
ftp ls
227 Entering Passive Mode (67,55,39,12,109,83).
150 Opening ASCII mode data connection for file list
-rw-r--r--   1 sbctools sbctools  9979668 Mar 12 21:15 M5208EVBE_dbug.zip
  :
-rw-r--r--   1 sbctools sbctools   667828 Apr 30 15:55 wildfire_iflash.s19
226 Transfer complete.
ftp send partitionSD
local: partitionSD remote: partitionSD
227 Entering Passive Mode (67,55,39,12,109,23).
150 Opening BINARY mode data connection for partitionSD
226 Transfer complete.
129 bytes sent in 0.0345 secs (3.6 Kbytes/sec)
ftp ls
227 Entering Passive Mode (67,55,39,12,109,83).
150 Opening ASCII mode data connection for file list
-rw-r--r--   1 sbctools sbctools  9979668 Mar 12 21:15 M5208EVBE_dbug.zip
-rw-r--r--   1 sbctools sbctools  129 May  3 22:49 partitionSD
  :
-rw-r--r--   1 sbctools sbctools   667828 Apr 30 15:55 wildfire_iflash.s19
226 Transfer complete.
ftp close
221 Goodbye.
ftp quit
[EMAIL PROTECTED] bin]$

Has anyone done this? Care to share?

Thanks,

Bob Furber


___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] kernel module and static

2007-05-03 Thread Michael Broughton
That MULS.L instruction is definitely wrong. The source effective 
address mode specified, is not supported in the longword variant of MULS.


Is it just me, or does that whole disassembly look strange?

Mike



Wolfgang Reissnegger wrote:

OK,

so it seems like the:
   2a:4c39 0800  mulsl 0 init_module,%d0
instruction is causing your illegal instruction trap.

I would suspect that the CPU you are running does not support 
multiplication instructions? You can look into the gcc man page to 
find out if there are any options you can pass to the compiler to 
generate instructions for your particular model.


Wolfgang

Stéphane wrote:

Hi

Ok I do that:
/opt/m68k-uclinux-tools-20060615/bin/m68k-uclinux-objdump -D xx.o


ucAsserv.o: file format elf32-m68k

Disassembly of section .text:

 init_module:
   0:4e56   linkw %fp,#0
   4:42b9   clrl 0 init_module
   a:42b9   clrl 0 init_module
  10:42b9   clrl 0 init_module
  16:4879   pea 0 init_module
  1c:4eb9   jsr 0 init_module
  22:588f   addql #4,%sp
  24:2039   movel 0 init_module,%d0
  2a:4c39 0800  mulsl 0 init_module,%d0
  30:
  32:23c0   movel %d0,0 init_module
  38:4879   pea 0 init_module
  3e:4eb9   jsr 0 init_module
  44:588f   addql #4,%sp
  46:4280   clrl %d0
  48:6000 0002  braw 4c init_module+0x4c
  4c:4e5e   unlk %fp
  4e:4e75   rts

0050 cleanup_module:
  50:4e56   linkw %fp,#0
  54:4e5e   unlk %fp
  56:4e75   rts
Disassembly of section .bss:

 global_right_encoder:
   0:   orib #0,%d0

0004 global_left_encoder:
   4:   orib #0,%d0

0008 VitL:
   8:   orib #0,%d0
Disassembly of section .modinfo:

 __module_kernel_version:
   0:6b65   bmis 67 cleanup_module+0x17
   2:726e   moveq #110,%d1
   4:656c   bcss 72 cleanup_module+0x22
   6:5f76 6572 7369 subqw #7,%fp@(73696f6e)@(3d32)
   c:6f6e 3d32
  10:2e34 2e33  movel %a4@(0033,%d2:l:8),%d7
  14:312d 7563  movew %a5@(30051),[EMAIL PROTECTED]
  18:302d 414e  movew %a5@(16718),%d0
  1c:492d 3130  chkl %a5@(12592),%d4
...

0021 __module_author:
  21:6175   bsrs 98 cleanup_module+0x48
  23:7468   moveq #104,%d2
  25:6f72   bles 99 cleanup_module+0x49
  27:3d53 7465  movew %a3@,%fp@(29797)
  2b:7068   moveq #104,%d0
  2d:616e   bsrs 9d cleanup_module+0x4d
  2f:6520   bcss 51 cleanup_module+0x1
  31:4765   043545
  33:726d   moveq #109,%d1
  35:6169   bsrs a0 cleanup_module+0x50
  37:6e00 6c69  bgtw 6ca2 cleanup_module+0x6c52

0039 __module_license:
  39:6c69   bges a4 cleanup_module+0x54
  3b:6365   blss a2 cleanup_module+0x52
  3d:6e73   bgts b2 cleanup_module+0x62
  3f:653d   bcss 7e cleanup_module+0x2e
  41:4750   043520
  43:Address 0x0045 is out of bounds.

Disassembly of section .rodata:

 .rodata:
   0:3c36 3e42  movew %fp@(0042,%d3:l:8),%d6
   4:7567   mvsw [EMAIL PROTECTED],%d2
   6:3a0a   movew %a2,%d5
   8:003c 363e  orib #62,%ccr
   c:4e65   movel %a5,%usp
   e:7665   moveq #101,%d3
  10:7220   moveq #32,%d1
  12:5265   addqw #1,[EMAIL PROTECTED]
  14:6163   bsrs 79 cleanup_module+0x29
  16:680a   bvcs 22 __module_author+0x1
...
Disassembly of section .comment:

 .comment:
   0:0047 4343  oriw #17219,%d7
   4:3a20   movew [EMAIL PROTECTED],%d5
   6:2847   moveal %d7,%a4
   8:4e55 2920  linkw %a5,#10528
   c:322e 3935  movew %fp@(14645),%d1
  10:2e33 2032  movel %a3@(0032,%d2:w),%d7
  14:3030 3130 3331 movew %a0@(33313520,%d3:w),%d0
  1a:3520
  1c:2872 656c 6561 moveal %a2@(6561)@(),%a4
  22:7365   mvsw [EMAIL PROTECTED],%d1
  24:2928 436f  movel %a0@(17263),[EMAIL PROTECTED]
  28:6c64   bges 8e .comment+0x8e
  2a:4669 7265  notw %a1@(29285)
  2e:2070 6174 6368 moveal %a0@(63686573)@(),%a0
  34:6573
  36:202d 2032  movel %a5@(8242),%d0
  3a:3030 3130 3331 movew %a0@(33313820,%d3:w),%d0
  40:3820
  42:6672   bnes b6 cleanup_module+0x66
  44:6f6d   bles b3 cleanup_module+0x63
  46: 

Re: [uClinux-dev] kernel module and static

2007-05-03 Thread Greg Ungerer

Hi Stephane,

Stéphane wrote:

In Makefile:

//

INCLUDE := -isystem ../uClinux-dist-20060803/linux-2.4.x/include
CFLAGS  := -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE}
CC  := /opt/uClinux-m68k-elf/bin/m68k-elf-gcc
   
${TARGET}.o: ${TARGET}.c


What CPU are you running on?
What is the actual compile line?

From the ensuing discussion I would guess that you are not
compiling with the appropriate CPU class passed to gcc.

If you are using a ColdFire you should at least have an
-m5200 (or equivalent) gcc option. If a base 68k (like
68328 or similar) then -m68000. Otherwise you won't get
instructions generated appropriate to your CPU.

Regards
Greg




//

and with -S  :

/*/

.file   ucAsserv.c
gcc2_compiled.:
.section.modinfo,a,@progbits
.type__module_kernel_version,@object
.size__module_kernel_version,33
__module_kernel_version:
.string kernel_version=2.4.31-uc0-ANI-10
.section.rodata
.LC0:
.string 6Bug:\n
.LC1:
.string 6Never Reach\n
.text
.align  2
.globl init_module
.typeinit_module,@function
init_module:
link.w %a6,#0
clr.l VitL
clr.l global_left_encoder
clr.l global_right_encoder
pea .LC0
jsr printk
addq.l #4,%sp
move.l global_left_encoder,%d0
muls.l global_right_encoder,%d0
move.l %d0,VitL
pea .LC1
jsr printk
addq.l #4,%sp
clr.l %d0
jbra .L95
.align  2
.L95:
unlk %a6
rts
.Lfe1:
.sizeinit_module,.Lfe1-init_module
.align  2
.globl cleanup_module
.typecleanup_module,@function
cleanup_module:
link.w %a6,#0
.L96:
unlk %a6
rts
.Lfe2:
.sizecleanup_module,.Lfe2-cleanup_module
.globl __module_author
.section.modinfo
.type__module_author,@object
.size__module_author,24
__module_author:
.string author=Stephane Germain
.type__module_license,@object
.size__module_license,12
__module_license:
.string license=GPL
.local  global_right_encoder
.comm   global_right_encoder,4,2
.local  global_left_encoder
.comm   global_left_encoder,4,2
.local  VitL
.comm   VitL,4,2
.ident  GCC: (GNU) 2.95.3 20010315 (release)(ColdFire patches -
20010318 from
http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from
http://www.snapgear.com/)

/***/


I use the default toolchain

/opt/uClinux-m68k-elf/bin/m68k-elf-gcc -v :
Reading specs from /opt/uClinux-m68k-elf/lib/gcc-lib/m68k-elf/2.95.3/specs
gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from
http://fiddes.net/coldfire/)(uClinux XIP
and shared lib patches from http://www.snapgear.com/)

thanks


Wolfgang Reissnegger a écrit :

Hi Stéphane,

looks like you are compiling your code with compiler flags that
generate instructions that the processor does not support. That's why
you see the illegal instruction trap.

The reason that it all works if the variables are local is probably
that you also use an optimization flag (e.g. -O3) that causes the
compiler to optimize the whole multiplication away in main because it
has no effect on the function's result and is local to the function.

You should try to compile the code with gcc -S to generate assembler
output. Then you can identify the instruction that causes the problem.

Cheers,
   Wolfgang

Stéphane wrote:

Hi,

I have a bug that I can be resume as:

/***/
#include linux/module.h// Needed by all modules
#include linux/kernel.h// Needed for KERN_INFO

static long global_right_encoder;
static long global_left_encoder;
static long VitL;

int init_module(void)
{
VitL = 0;
global_left_encoder = 0;
global_right_encoder = 0;

printk(KERN_INFO Bug:\n);
   VitL = global_left_encoder*global_right_encoder;
   printk(KERN_INFO Never Reach\n);
   return 0;
}


void cleanup_module(void)
{
}

MODULE_AUTHOR(Stephane Germain);
MODULE_LICENSE(GPL);
/**/

result:

insmod xxx.o:
SIGSEGV

dmesg:
Bug:
*** ILLEGAL INSTRUCTION ***   FORMAT=0
Current process id is 47
BAD KERNEL TRAP: 
PC: [000a8bec]
SR: 2014  SP: 007dbee8  a2: 10c16b34
d0: d1: 0991d2: d3: ffea
d4: 0060d5: 0008a0: 0003dc8ca1: 0003dca8
Process insmod (pid: 47, stackpage=007db000)
Frame format=0
Stack from 007dbf1c:
000a8c14 007d3000 007dbfc4 10c17856 007c5348 00102428 007c5348
00e8
0002 0001 007da000 00192e00 007c51c0 00190004 00140560
0015fae0
007d3000 007d4000 0060 0003dd58 000a8bc0 00e8 

      

  

Re: [uClinux-dev] how to use ftp client to upload a file from target to server?

2007-05-03 Thread Steve Bennett

That version of ftp is just not very good at error reporting.
It will be failing to resolve ftp.sbctools.com

Try 'ping ftp.scbtools.com' and you will see.

Try with the IP address instead:
# ftp 67.55.39.12

Cheers,
Steve

On 04/05/2007, at 9:11 AM, Bob Furber wrote:

I am having difficulty figuring out how to use ftp client to upload  
a file

from a uClinux target to server.

In fact, I am having difficulty figuring out how to log into a  
server and
give it a username and password. Unlike Linux, uClinux does not  
request a

username and password.

# ftp ftp.sbctools.com
ftp: ftp.sbctools.com: ftp user sbctools
ftp

..connects, but, does not ask for username and password. But, now  
the trick

is to give the server a username and password.

# ftp ftp.sbctools.com
ftp: ftp.sbctools.com: ftp user sbctools
Not connected
ftp

This is the kind of Linux session I am trying to repicate from a  
uClinux

target:

[EMAIL PROTECTED] bin]$ ftp ftp.sbctools.com
Connected to ftp.sbctools.com (67.55.39.12).
220 ftp.sbctools.com FTP Server ready
Name (ftp.sbctools.com:intec): sbctools
331 Password required for sbctools.
Password:
230 User sbctools logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp cd /var/www/html/downloads/V3
250 CWD command successful
ftp ls
227 Entering Passive Mode (67,55,39,12,109,83).
150 Opening ASCII mode data connection for file list
-rw-r--r--   1 sbctools sbctools  9979668 Mar 12 21:15  
M5208EVBE_dbug.zip

  :
-rw-r--r--   1 sbctools sbctools   667828 Apr 30 15:55  
wildfire_iflash.s19

226 Transfer complete.
ftp send partitionSD
local: partitionSD remote: partitionSD
227 Entering Passive Mode (67,55,39,12,109,23).
150 Opening BINARY mode data connection for partitionSD
226 Transfer complete.
129 bytes sent in 0.0345 secs (3.6 Kbytes/sec)
ftp ls
227 Entering Passive Mode (67,55,39,12,109,83).
150 Opening ASCII mode data connection for file list
-rw-r--r--   1 sbctools sbctools  9979668 Mar 12 21:15  
M5208EVBE_dbug.zip

-rw-r--r--   1 sbctools sbctools  129 May  3 22:49 partitionSD
  :
-rw-r--r--   1 sbctools sbctools   667828 Apr 30 15:55  
wildfire_iflash.s19

226 Transfer complete.
ftp close
221 Goodbye.
ftp quit
[EMAIL PROTECTED] bin]$

Has anyone done this? Care to share?

Thanks,

Bob Furber


___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev




--
WorkWare Systems Pty Ltd
W: www.workware.net.au
P: 0434 921 300
F: 07 3102 9221
E: [EMAIL PROTECTED]




smime.p7s
Description: S/MIME cryptographic signature
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

RE: [uClinux-dev] how to use ftp client to upload a file from targetto server?

2007-05-03 Thread Bob Furber
Thanks Steve

 Try 'ping ftp.scbtools.com' and you will see.

uClinux[-2.6.6] responds that sbctools.com is alive!

How did you get it to resolve the IP address?

 Try with the IP address instead:
 # ftp 67.55.39.12

Ftp went catatonic. Not even a ftp prompt. It required a ^C to exit to
the uClinux '#' prompt.

I have the feeling that I am missing something.

Bob F.


 Cheers,
 Steve

 On 04/05/2007, at 9:11 AM, Bob Furber wrote:

  I am having difficulty figuring out how to use ftp client to upload
  a file
  from a uClinux target to server.
 
  In fact, I am having difficulty figuring out how to log into a
  server and
  give it a username and password. Unlike Linux, uClinux does not
  request a
  username and password.
 
  # ftp ftp.sbctools.com
  ftp: ftp.sbctools.com: ftp user sbctools
  ftp
 
  ..connects, but, does not ask for username and password. But, now
  the trick
  is to give the server a username and password.
 
  # ftp ftp.sbctools.com
  ftp: ftp.sbctools.com: ftp user sbctools
  Not connected
  ftp
 
  This is the kind of Linux session I am trying to repicate from a
  uClinux
  target:
 
  [EMAIL PROTECTED] bin]$ ftp ftp.sbctools.com
  Connected to ftp.sbctools.com (67.55.39.12).
  220 ftp.sbctools.com FTP Server ready
  Name (ftp.sbctools.com:intec): sbctools
  331 Password required for sbctools.
  Password:
  230 User sbctools logged in.
  Remote system type is UNIX.
  Using binary mode to transfer files.
  ftp cd /var/www/html/downloads/V3
  250 CWD command successful
  ftp ls
  227 Entering Passive Mode (67,55,39,12,109,83).
  150 Opening ASCII mode data connection for file list
  -rw-r--r--   1 sbctools sbctools  9979668 Mar 12 21:15
  M5208EVBE_dbug.zip
:
  -rw-r--r--   1 sbctools sbctools   667828 Apr 30 15:55
  wildfire_iflash.s19
  226 Transfer complete.
  ftp send partitionSD
  local: partitionSD remote: partitionSD
  227 Entering Passive Mode (67,55,39,12,109,23).
  150 Opening BINARY mode data connection for partitionSD
  226 Transfer complete.
  129 bytes sent in 0.0345 secs (3.6 Kbytes/sec)
  ftp ls
  227 Entering Passive Mode (67,55,39,12,109,83).
  150 Opening ASCII mode data connection for file list
  -rw-r--r--   1 sbctools sbctools  9979668 Mar 12 21:15
  M5208EVBE_dbug.zip
  -rw-r--r--   1 sbctools sbctools  129 May  3 22:49 partitionSD
:
  -rw-r--r--   1 sbctools sbctools   667828 Apr 30 15:55
  wildfire_iflash.s19
  226 Transfer complete.
  ftp close
  221 Goodbye.
  ftp quit
  [EMAIL PROTECTED] bin]$
 
  Has anyone done this? Care to share?
 
  Thanks,
 
  Bob Furber
 
 
  ___
  uClinux-dev mailing list
  uClinux-dev@uclinux.org
  http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
  This message was resent by uclinux-dev@uclinux.org
  To unsubscribe see:
  http://mailman.uclinux.org/mailman/options/uclinux-dev
 
 

 --
 WorkWare Systems Pty Ltd
 W: www.workware.net.au
 P: 0434 921 300
 F: 07 3102 9221
 E: [EMAIL PROTECTED]





___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev