Re: [uClinux-dev] Shell exits while running a program.

2009-08-12 Thread Michael Schnell
>> Seemingly the best instruction to handle these bits is "atomic compare
>> and exchange" (e.g. provided by the X86 CPU).
> 
> It's actually not the best, because when it returns "did not match"
> you have to loop and try again.  

The supposedly "best" user space implementation for the X86 I found (in
"Futexes are Tricky") uses both "atomic_compare_and_exchange" and
"atomic_exchange" for the lock part and "atomic_dec" for the unlock part.

-Michael
___
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] Shell exits while running a program.

2009-08-12 Thread Michael Schnell
Jim Donelson wrote:
> I'd like to see the code for compare_exchange and the lock function.

Best Read: "Futexes Are Tricky" by Ulrich Drepper, Redhat.

-Michael
___
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] Problem in dma_map

2009-08-12 Thread Daniel Glöckner
On Wed, Aug 12, 2009 at 12:57:58AM +0200, Ithamar R. Adema wrote:
> For now, I've found a simple workaround by changing remap_pfn_range in 
> mm/nommu.c from
> 
> vma->vm_start = vma->vm_pgoff << PAGE_SHIFT;
> 
> 
> to
> 
> vma->vm_start += vma->vm_pgoff << PAGE_SHIFT;

I don't think remap_pfn_range has to do anything besides validating the
parameters on nommu.

What do you think about this version?:

int remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
unsigned long to, unsigned long size, pgprot_t prot)
{
if (vma->vm_start > from || vma->vm_end <= from)
return -EINVAL; 
if (size > (vma->vm_end - from) >> PAGE_SHIFT)
return -EINVAL;
/*
 *  add arch callback here to modify "to" based on "prot"
 *  for uncached memory mirrors, etc.
 */
if (from != to << PAGE_SHIFT)
return -EINVAL;
return 0;
}

  Daniel
___
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] Shell exits while running a program.

2009-08-12 Thread Michael Schnell
Jim Donelson wrote:
> Of course it does - sleeping on a sp means "preempt me now".

Thus the spinning loop needs to do a sleep system call.

This means the process gives up it's current time slice. St least with a
non-realtime scheduling paradigm, this makes the wall-clock speed of the
 thread very slow.

I did a testing program (see another message in this thread) that times
several different user space Mutex algorithms. A simple one of them  is
this kind of spinnlock. Of course the said behavior is shown.

-Michael
___
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] Shell exits while running a program.

2009-08-12 Thread Michael Schnell
Jamie Lokier wrote:
> 
> compare_exchange is a single architecture-specific instruction; that's
> what we're discussing. 

Not really. The OP is working with Microblaze, I am working with NIOS2.
Both archs do not have any provision for atomic memory modification at
all, so we need to implement it by some pure software tricks (i.e.
special provisions in the general ISR entry code) or by implementing a
dedicated custom instruction.

-Michael

___
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] Shell exits while running a program.

2009-08-12 Thread Michael Schnell
Thanks for the pointers !

-Michael
___
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 read and write value in two different systems?

2009-08-12 Thread Michael Schnell
Using Bit 31 for cache-bypassing is a specific non portable feature of
the no-MMU variant of the NIOS2 processor.

So this should be discussed in a NIOS2 forum (niosforum.com or
uclinux-nios mailing list).

-Michael
___
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 mailbox in uclinux?

2009-08-12 Thread Michael Schnell
hotmail wrote:
> As the title.
> Or how to communicate between a uclinux system on cpu_0 and a program on
> cpu_1?

As you suggest "cpu_1" does not run any formal Operating System there
are lots of possible solutions. Any fast communication will involve some
hardware (e.g. to issue interrupts), creating a Kernel driver, and
decent software (and maybe hardware) considerations (e.g. using some
kind of Mutex to protect shared memory regions).

-Michael
___
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] Problems loading uClinux from some 2GB SD cards

2009-08-12 Thread Microbit_Ubuntu
On Tue, 2009-08-11 at 09:01 -0400, Lennart Sorensen wrote:
> On Tue, Aug 11, 2009 at 08:57:46PM +1000, Microbit_Ubuntu wrote:
> > I can't really give any specific help other than what you already tried, but
> > I have been in a similar situation.
> > I got some Olin 2 GB cards a little while ago and existing firmware I had 
> > running (using SPI)
> > totally refused to run properly. Like you, I allowed the "hack" on the 
> > block length
> > in CSD. My good old trusty card reader doesn't like the cards either.
> > 
> > I spent a bit of time stepping around further in my code but I never pinned 
> > it down
> > as to where these 2 GB cards went to lala land. I gave up I must say... too 
> > irritating.
> > A look at the card vendor's URL revealed they expect the consumer to buy 
> > "their" card reader
> > products, which of course is a joke.
> > 
> > The last I checked, the consensus is/was that the 2 GB cards arena is a big 
> > mess. Apparently,
> > more don't work than ones that actually do
> > Seemed to me might as well move to HC... ?
> > 
> > I certainly appreciate/sympathise - I found it very irritating to say the 
> > least :
> > These cards are sold with the SD spec logo - but they don't __comply__ !!!
> 
> I suspect the card does comply but the reader does not.  A number of
> readers assumed the block size on SD cards was 512 bytes even though the
> spec never said that it was.  most card sizes are, but e 1024 byte blocks.
> Apparently the spec says that even the 2GB cards must support 512byte
> reads and writes, but still some card readers/drivers get confused.
> 
> I suppose it is also possible to have a 2GB card that was made to an
> older spec before it was clarified that 512byte read/write was required
> even when the block size was 1024byte.
> 
> personally I have never had issues with 2GB cards in any device, but
> all my 2GB cards are relatively new.
> 

Hi Lennart,

> I suspect the card does comply but the reader does not.  A number of

I'm sorry but I disagree.
The reader is stuck in an endless loop and never appears to even fully read the 
csd
or tuples. I have tried with SPI and with MMC where I _was_ able to read the 
manufacturing details 
- manually - with my own firmware : it was February 2009 IIRC. It certainly was 
a brand new card, in relative terms.
I think we're talking different problems here. In any case, I brought the cards 
back and got a refund,
apparently many others had similar problems, even on consumer devices that 
*should* be able to use the
SD card... (they were being sold to use in digital cameras)

Perhaps this is an isolated issue with the Olin brand, dunno.

-- 
Best regards,
Kris


___
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] Shell exits while running a program.

2009-08-12 Thread Jamie Lokier
Michael Schnell wrote:
> Jamie Lokier wrote:
> > 
> > compare_exchange is a single architecture-specific instruction; that's
> > what we're discussing. 
> 
> Not really. The OP is working with Microblaze, I am working with NIOS2.
> Both archs do not have any provision for atomic memory modification at
> all, so we need to implement it by some pure software tricks (i.e.
> special provisions in the general ISR entry code) or by implementing a
> dedicated custom instruction.

Sorry, the topic wandered a bit, and *I* was talking about the
relative merits of atomic compare-exchange versus atomic
read-modify-write instruction... :-)

The general principle also applies to a custom instruction operating
on special registers - avoid spinning to implement the 'atomic' part,
and don't confuse that with spinning on a lock.  But it's not that
significant in the scheme of things.

-- Jamie
___
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] Shell exits while running a program.

2009-08-12 Thread Jamie Lokier
Michael Schnell wrote:
> >> Seemingly the best instruction to handle these bits is "atomic compare
> >> and exchange" (e.g. provided by the X86 CPU).
> > 
> > It's actually not the best, because when it returns "did not match"
> > you have to loop and try again.  
> 
> The supposedly "best" user space implementation for the X86 I found (in
> "Futexes are Tricky") uses both "atomic_compare_and_exchange" and
> "atomic_exchange" for the lock part and "atomic_dec" for the unlock part.

That's right.  It's possible to use atomic_compare_and_exchange for
unlock; it's correct.  But you get that extra bit of spinning with SMP,
so atomic_dec is better.

-- Jamie
 
___
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] build problem with sshd in the 2.4 kernel

2009-08-12 Thread b2112
Thank you very much for the help and I was able to get the binary to build
with the applied patches.

Now I'm trying to run the application on the target.

Using make menuconfig,  I selected "sshd" in the networking applications
option.  I wasn't sure if I needed to select anything else, but I have the
sshd binary in my /bin directory.

I'm trying to find the documentation that explains how to configure and run
it.  I've been searching the web and I haven't been successful yet.




On Tue, Aug 11, 2009 at 7:17 PM, David McCullough <
david_mccullo...@securecomputing.com> wrote:

>
> Jivin b2112 lays it down ...
> > I'm using the uClinux 2.4 kernel with a Coldfire MC5275 and I'm trying to
> > build in the sshd application and I'm getting a build failure.  I used
> make
> > menuconfig and selected sshd under the networking applications option.
> >
> > In the build process I'm getting the following error;
> >
> > Has anyone been successful in getting sshd to build?  I'm wondering if
> I'm
> > missing something or if there is a patch available.
> >
> > Any help is greatly appreciated.
>
> You don't appear to have the openssl lib build enabled (or perhaps not
> included depending on your version of the dist).
>
> Which uClinux-dist version do you have ?
>
> Check that CONFIG_LIB_LIBSSL is enabled in your config/.config
>
> Check you have libssl or a smart makefile in lib/libssl
>
> You can get patches to add openssl back into an older dist from
> http://ftp.snapgear.org/pub/patches/ , newer dists should have patches and
> download scripts within the makefile to do it for you,
>
> Cheers,
> Davidm
>
>
>
>
>
> >
> --
> >
> > make[2]: Entering directory `/home/uClinux-dist/user/sh'
> > make[2]: Nothing to be done for `all'.
> > make[2]: Leaving directory `/home/uClinux-dist/user/sh'
> > make[2]: Entering directory `/home/uClinux-dist/user/ssh'
> > (cd openbsd-compat && make)
> > make[3]: Entering directory `/home/uClinux-dist/user/ssh/openbsd-compat'
> > ucfront-gcc m68k-elf-gcc -m5200 -DCONFIG_COLDFIRE -Os -g
> > -fomit-frame-pointer -fno-common -fno-builtin -Wall   -DEMBED -msep-data
> > -Dlinux -D__linux__ -Dunix -D__uClinux__ -g -O2 -Wall
> > -D_SSH_PROGRAM=\"/bin/ssh\" -DSSH_ASKPASS_DEFAULT=\"/bin/ssh-askpass\"
> -I.
> > -DHAVE_CONFIG_H -I. -I..-c -o bsd-arc4random.o bsd-arc4random.c
> > In file included from bsd-arc4random.c:25:
> > ../includes.h:168: openssl/opensslv.h: No such file or directory
> > bsd-arc4random.c:32: openssl/rand.h: No such file or directory
> > bsd-arc4random.c:33: openssl/rc4.h: No such file or directory
> > bsd-arc4random.c:34: openssl/err.h: No such file or directory
> > make[3]: *** [bsd-arc4random.o] Error 1
> > make[3]: Leaving directory `/home/uClinux-dist/user/ssh/openbsd-compat'
> > make[2]: *** [subdirs] Error 2
> > make[2]: Leaving directory `/home/uClinux-dist/user/ssh'
> > make[1]: *** [all] Error 2
> > make[1]: Leaving directory `/home/uClinux-dist/user'
> > make: *** [subdirs] Error 1
>
> > ___
> > 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
>
> --
> David McCullough,  david_mccullo...@securecomputing.com,  Ph:+61 734352815
> McAfee - SnapGear  http://www.snapgear.com
> http://www.uCdot.org 
> ___
> 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] Shell exits while running a program.

2009-08-12 Thread Jim Donelson
I wonder why (on an SP machine) you don't just disable interrupts for a few
instructions and give yourself an atomic dec?




On Wed, Aug 12, 2009 at 9:30 AM, Jamie Lokier  wrote:

> Michael Schnell wrote:
> > >> Seemingly the best instruction to handle these bits is "atomic compare
> > >> and exchange" (e.g. provided by the X86 CPU).
> > >
> > > It's actually not the best, because when it returns "did not match"
> > > you have to loop and try again.
> >
> > The supposedly "best" user space implementation for the X86 I found (in
> > "Futexes are Tricky") uses both "atomic_compare_and_exchange" and
> > "atomic_exchange" for the lock part and "atomic_dec" for the unlock part.
>
> That's right.  It's possible to use atomic_compare_and_exchange for
> unlock; it's correct.  But you get that extra bit of spinning with SMP,
> so atomic_dec is better.
>
> -- Jamie
>
> ___
> 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] Problems loading uClinux from some 2GB SD cards

2009-08-12 Thread Lennart Sorensen
On Wed, Aug 12, 2009 at 11:07:07PM +1000, Microbit_Ubuntu wrote:
> I'm sorry but I disagree.
> The reader is stuck in an endless loop and never appears to even fully read 
> the csd
> or tuples. I have tried with SPI and with MMC where I _was_ able to read the 
> manufacturing details 
> - manually - with my own firmware : it was February 2009 IIRC. It certainly 
> was a brand new card, in relative terms.
> I think we're talking different problems here. In any case, I brought the 
> cards back and got a refund,
> apparently many others had similar problems, even on consumer devices that 
> *should* be able to use the
> SD card... (they were being sold to use in digital cameras)
> 
> Perhaps this is an isolated issue with the Olin brand, dunno.

Wow that does sound like a bad card design then.  So far I have been
happy with a-data cards as well as kingston.  I have 2GB a-data uSD cards
in cell phones, GPS, and various other devices, and nothing has ever
had an issue with them, and they are very cheap, although not super fast.

-- 
Len Sorensen
___
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] Shell exits while running a program.

2009-08-12 Thread Jamie Lokier
Jim Donelson wrote:
>I wonder why (on an SP machine) you don't just disable interrupts for
>a few instructions and give yourself an atomic dec?

Yes, that's fine.

However, it's not secure to allow userspace to disable interrupts(*),
so we've talked about a custom instruction which lets userspace
disable interrupts for a maximum of 3/4 instructions, then the
hardware forces them on again.

(*) with an MMU; without an MMU there's no security anyway so it
doesn't matter as much.

Personally I think the ARM method is nicest because it doesn't need
any special hardware, but time-limited interrupt disabling may be a
little bit faster, or slower, depending on the architecture.

-- Jamie
___
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] Shell exits while running a program.

2009-08-12 Thread Michael Schnell
Jamie Lokier wrote:
> That's right.  It's possible to use atomic_compare_and_exchange for
> unlock; it's correct.  But you get that extra bit of spinning with SMP,
> so atomic_dec is better.

In fact I don't see why Ulrich did the unlock code like this:

  if (atomic_dec(val) != 1 ) {
val = 0;
futex_wake(&val, 1);
  };



My current implementation is

  c = atomic_xchg(val, 0) {
  if (c=2) {   // we own the lock, so
   // val can be either of 1 or 2
futex_wake(&val, 1);
  };



It does work fine in my tests on a dual core.


What do you think ?

-Michael
___
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] Shell exits while running a program.

2009-08-12 Thread Michael Schnell
Jim Donelson wrote:
> 
> I wonder why (on an SP machine) you don't just disable interrupts for a
> few instructions and give yourself an atomic dec?

With many archs it's not possible to disable/enable interrupts in
user-space.

-Michael

___
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] Shell exits while running a program.

2009-08-12 Thread Jamie Lokier
Michael Schnell wrote:
> Jamie Lokier wrote:
> > That's right.  It's possible to use atomic_compare_and_exchange for
> > unlock; it's correct.  But you get that extra bit of spinning with SMP,
> > so atomic_dec is better.
> 
> In fact I don't see why Ulrich did the unlock code like this:
> 
>   if (atomic_dec(val) != 1 ) {
> val = 0;
> futex_wake(&val, 1);
>   };
> 
> 
> 
> My current implementation is
> 
>   c = atomic_xchg(val, 0) {
>   if (c=2) {   // we own the lock, so
>// val can be either of 1 or 2
> futex_wake(&val, 1);
>   };


Second implementation:

Thread 1  Thread 2   Thread 3
     

[owns the lock]   [running]  [waiting]

c = atomic_xchg(val, 0);
[c == 2]
  if (compare_swap(val, 0, 1))
  return;
  [owns the lock]
futex_wake(&val, 1);
[wakes Thread 3] [woken by Thread 1]
 if (compare_swap(val, 
0, 1))
 [no]
 compare_sawp(val, 1, 
2))
 [waiting]


In Ulrich's version Thread 2 sleeps and Thread 3 runs, which is about
the same cost.  Keeping Thread 2 running is probably better for
average throughput.

But Ulrich's version is fairer, and does not allow starvation.

In your version Thread 3 can be starved by threads which are already
running, and that can happen repeatedly so it never runs.  In Ulrich's
version, all threads are guaranteed to run because there's a FIFO
queue on the futex, modified only by desired scheduling policies.

-- Jamie
___
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] Shell exits while running a program.

2009-08-12 Thread Michael Schnell
Jamie Lokier wrote:
> In Ulrich's
> version, all threads are guaranteed to run because there's a FIFO
> queue on the futex, modified only by desired scheduling policies.

Great argument !

I'll convert to Ulrich's version.

Thanks a lot !
-Michael
___
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] uclinux and ethernet bridging support?

2009-08-12 Thread The Kernel
Hi @ all,

I have noticed that there is no "networking -> 802.1d Ethernet Bridging"
support in the ucLinux Kernel nor as module. I also have noticed that is
impossible to compile the bridge-utils (
http://sourceforge.net/projects/bridge/files/) it crashs with an compile
error (I have tried every version of the last 3 years).

I use the moxa em-1220-LX Arm9

So does anyone has succeded in using ethernet bridging? If so how you have
achieved that? I need ethernet bridging and iptables :/

Any hint is great, if one can provide me with an image that also supports
ethernet bridging even greater,

Best Regards

Michael
___
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] Shell exits while running a program.

2009-08-12 Thread Jim Donelson
On Wed, Aug 12, 2009 at 10:41 AM, Michael Schnell wrote:

> Jim Donelson wrote:
> >
> > I wonder why (on an SP machine) you don't just disable interrupts for a
> > few instructions and give yourself an atomic dec?
>


>
> With many archs it's not possible to disable/enable interrupts in
> user-space.
>

But, then if you have an MMU, you have atomic instructions.


>
> -Michael
>
> ___
> 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] build problem with sshd in the 2.4 kernel

2009-08-12 Thread Microbit_Ubuntu
Hi,

On Wed, 2009-08-12 at 09:47 -0400, b2112 wrote:
> Thank you very much for the help and I was able to get the binary to
> build with the applied patches.
>  
> Now I'm trying to run the application on the target.  
>  
> Using make menuconfig,  I selected "sshd" in the networking
> applications option.  I wasn't sure if I needed to select anything
> else, but I have the sshd binary in my /bin directory.
>  
> I'm trying to find the documentation that explains how to configure
> and run it.  I've been searching the web and I haven't been successful
> yet.
>  
> 
> 
>  
> On Tue, Aug 11, 2009 at 7:17 PM, David McCullough
>  wrote:
> 
> Jivin b2112 lays it down ...
> > I'm using the uClinux 2.4 kernel with a Coldfire MC5275 and
> I'm trying to
> > build in the sshd application and I'm getting a build
> failure.  I used make
> > menuconfig and selected sshd under the networking
> applications option.
> >
> > In the build process I'm getting the following error;
> >
> > Has anyone been successful in getting sshd to build?  I'm
> wondering if I'm
> > missing something or if there is a patch available.
> >
> > Any help is greatly appreciated.
> 
> 
> You don't appear to have the openssl lib build enabled (or
> perhaps not
> included depending on your version of the dist).
> 
> Which uClinux-dist version do you have ?
> 
> Check that CONFIG_LIB_LIBSSL is enabled in your config/.config
> 
> Check you have libssl or a smart makefile in lib/libssl
> 
> You can get patches to add openssl back into an older dist
> from
> http://ftp.snapgear.org/pub/patches/ , newer dists should have
> patches and
> download scripts within the makefile to do it for you,
> 
> Cheers,
> Davidm
> 
> 
> 
> 
> 
> >
> 
> --
> >
> > make[2]: Entering directory `/home/uClinux-dist/user/sh'
> > make[2]: Nothing to be done for `all'.
> > make[2]: Leaving directory `/home/uClinux-dist/user/sh'
> > make[2]: Entering directory `/home/uClinux-dist/user/ssh'
> > (cd openbsd-compat && make)
> > make[3]: Entering directory
> `/home/uClinux-dist/user/ssh/openbsd-compat'
> > ucfront-gcc m68k-elf-gcc -m5200 -DCONFIG_COLDFIRE -Os -g
> > -fomit-frame-pointer -fno-common -fno-builtin -Wall
> -DEMBED -msep-data
> > -Dlinux -D__linux__ -Dunix -D__uClinux__ -g -O2 -Wall
> > -D_SSH_PROGRAM=\"/bin/ssh\" -DSSH_ASKPASS_DEFAULT=
> \"/bin/ssh-askpass\" -I.
> > -DHAVE_CONFIG_H -I. -I..-c -o bsd-arc4random.o
> bsd-arc4random.c
> > In file included from bsd-arc4random.c:25:
> > ../includes.h:168: openssl/opensslv.h: No such file or
> directory
> > bsd-arc4random.c:32: openssl/rand.h: No such file or
> directory
> > bsd-arc4random.c:33: openssl/rc4.h: No such file or
> directory
> > bsd-arc4random.c:34: openssl/err.h: No such file or
> directory
> > make[3]: *** [bsd-arc4random.o] Error 1
> > make[3]: Leaving directory
> `/home/uClinux-dist/user/ssh/openbsd-compat'
> > make[2]: *** [subdirs] Error 2
> > make[2]: Leaving directory `/home/uClinux-dist/user/ssh'
> > make[1]: *** [all] Error 2
> > make[1]: Leaving directory `/home/uClinux-dist/user'
> > make: *** [subdirs] Error 1
> 
> 
> > ___
> > 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
> 
> --
> David McCullough,  david_mccullo...@securecomputing.com,  Ph:
> +61 734352815
> McAfee - SnapGear  http://www.snapgear.com
>  http://www.uCdot.org
> ___
> 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/m

[uClinux-dev] ltib vs uclinux-dist

2009-08-12 Thread Philippe De Muyter
Hi all,

I need to install (uc)linux on a in-house designed MCF5484-based board.
I feel comfortable with uc-linux dist, having used it before on m68340
and mcf5272 based boards.

I now saw that the MCF5484 development board from freescale comes with
ltib.

- What's the relation between uclinux-dist and ltib, if any ?

- Can I use the compiler provided by ltib to compile uclinux-dist ?

Thanks in advance ?

Philippe
___
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] ltib vs uclinux-dist

2009-08-12 Thread Michael Durrant
Philippe,


These are all good questions.  Here at the office we make use of both
Freescale's LTIB release and the uClinux-dist release.  When Freescale
releases a new part and matching evaluation board they will release it
with a tool chain (from CodeSourcery) and an LTIB that is aware of the
new CPU and Board.


Kernel
==

Typically the LTIB released kernels for their MMU-less processors are
not the most current and may be several version behind the main Linux
tree and Greg's uClinux kernel releases.   Given the lag in kernel
version those that need to use the most recent CPU's may need to use the
older LTIB released kernel as Freescales releases are not in sync with
Greg uClinux nor Linus's kernel trees.   Once forward porting of the CPU
and Board support from LTIB's kernel release to the uClinux and Linux
trees, it become easier to make use of the uClinux kernel than the older
kernel from LTIB. This is also true of some driver support between
kernels as well.


User Applications
=

The LTIB released user applications are a collection of public packaged
user apps that are well used on MMU-full processors ARM/PowerPC etc.  In
many cases these applications are full featured (read big) and not
always optimized to reduce their size and functionality typically needed
for embedded use.  While you can modify the source, the LTIB frame work
takes a far bit to get up to speed with.  If you have the opportunity
you can contact your Freescale reps and they can point you to a few
online resources (Freescale's Virtual FTF is one) that walk you through
how to use LTIB to build and deploy images for their evaluation boards.

Where as the uClinux-dist has a collection of applications that have for
the most part been reduced in functionality and size to fit better on an
embedded device.  That said their many be a few applications that may be
kernel version and C Library specific in their functionality. This is in
part as the uClinux-dist had attempted to allow support to earlier 2.0,
2.4 and 2.6 kernels.


Tool Chains and Libraries
=

The C library and build tools such as uClibc, glibc, GCC, etc  are all
available in source and can be recompiled to enable and disable features
as well as allow you to alter install paths.  At the office we have used
the Freescale release toolchains on both LTIB and the uClinux-dist wish
success. That said we do eventually end up changing the configuration,
install path etc to keep the compiler, C library and Kernel in sync.


Regards,

--
Michael Durrant
mdurr...@arcturusnetworks.com


Philippe De Muyter wrote:
> Hi all,
> 
> I need to install (uc)linux on a in-house designed MCF5484-based board.
> I feel comfortable with uc-linux dist, having used it before on m68340
> and mcf5272 based boards.
> 
> I now saw that the MCF5484 development board from freescale comes with
> ltib.
> 
> - What's the relation between uclinux-dist and ltib, if any ?
> 
> - Can I use the compiler provided by ltib to compile uclinux-dist ?
> 
> Thanks in advance ?
> 
> Philippe
> ___
> 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


[uClinux-dev] LCD-to-VGA question

2009-08-12 Thread zhghua0321
I started uC53281 for coldfire,  But VGA is not show?
and  I connect VGA from LCD
thanks



--
___
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] build problem with sshd in the 2.4 kernel

2009-08-12 Thread b2112
You're right, I wasn't clear on what I was asking.

I have the sshd, ssh and ssh_keygen binaries in the /bin directory on my
target.
I've added the line "/bin/sshd" to my /etc/rc file.
The contents of my '/etc/ssh/sshd_config were copied from a website that had
a basic file.

I think I have most of the pieces in place and it's my understanding that I
need to set up the accounts.  I'm trying to find a website that has a
procedure on how to do that.

If anyone could provide a pointer to a procedure, I'd really appreciate it.



On Wed, Aug 12, 2009 at 2:49 PM, Microbit_Ubuntu <
micro...@virginbroadband.com.au> wrote:

> Hi,
>
> On Wed, 2009-08-12 at 09:47 -0400, b2112 wrote:
> > Thank you very much for the help and I was able to get the binary to
> > build with the applied patches.
> >
> > Now I'm trying to run the application on the target.
> >
> > Using make menuconfig,  I selected "sshd" in the networking
> > applications option.  I wasn't sure if I needed to select anything
> > else, but I have the sshd binary in my /bin directory.
> >
> > I'm trying to find the documentation that explains how to configure
> > and run it.  I've been searching the web and I haven't been successful
> > yet.
> >
> >
> >
> >
> > On Tue, Aug 11, 2009 at 7:17 PM, David McCullough
> >  wrote:
> >
> > Jivin b2112 lays it down ...
> > > I'm using the uClinux 2.4 kernel with a Coldfire MC5275 and
> > I'm trying to
> > > build in the sshd application and I'm getting a build
> > failure.  I used make
> > > menuconfig and selected sshd under the networking
> > applications option.
> > >
> > > In the build process I'm getting the following error;
> > >
> > > Has anyone been successful in getting sshd to build?  I'm
> > wondering if I'm
> > > missing something or if there is a patch available.
> > >
> > > Any help is greatly appreciated.
> >
> >
> > You don't appear to have the openssl lib build enabled (or
> > perhaps not
> > included depending on your version of the dist).
> >
> > Which uClinux-dist version do you have ?
> >
> > Check that CONFIG_LIB_LIBSSL is enabled in your config/.config
> >
> > Check you have libssl or a smart makefile in lib/libssl
> >
> > You can get patches to add openssl back into an older dist
> > from
> > http://ftp.snapgear.org/pub/patches/ , newer dists should have
> > patches and
> > download scripts within the makefile to do it for you,
> >
> > Cheers,
> > Davidm
> >
> >
> >
> >
> >
> > >
> >
> --
> > >
> > > make[2]: Entering directory `/home/uClinux-dist/user/sh'
> > > make[2]: Nothing to be done for `all'.
> > > make[2]: Leaving directory `/home/uClinux-dist/user/sh'
> > > make[2]: Entering directory `/home/uClinux-dist/user/ssh'
> > > (cd openbsd-compat && make)
> > > make[3]: Entering directory
> > `/home/uClinux-dist/user/ssh/openbsd-compat'
> > > ucfront-gcc m68k-elf-gcc -m5200 -DCONFIG_COLDFIRE -Os -g
> > > -fomit-frame-pointer -fno-common -fno-builtin -Wall
> > -DEMBED -msep-data
> > > -Dlinux -D__linux__ -Dunix -D__uClinux__ -g -O2 -Wall
> > > -D_SSH_PROGRAM=\"/bin/ssh\" -DSSH_ASKPASS_DEFAULT=
> > \"/bin/ssh-askpass\" -I.
> > > -DHAVE_CONFIG_H -I. -I..-c -o bsd-arc4random.o
> > bsd-arc4random.c
> > > In file included from bsd-arc4random.c:25:
> > > ../includes.h:168: openssl/opensslv.h: No such file or
> > directory
> > > bsd-arc4random.c:32: openssl/rand.h: No such file or
> > directory
> > > bsd-arc4random.c:33: openssl/rc4.h: No such file or
> > directory
> > > bsd-arc4random.c:34: openssl/err.h: No such file or
> > directory
> > > make[3]: *** [bsd-arc4random.o] Error 1
> > > make[3]: Leaving directory
> > `/home/uClinux-dist/user/ssh/openbsd-compat'
> > > make[2]: *** [subdirs] Error 2
> > > make[2]: Leaving directory `/home/uClinux-dist/user/ssh'
> > > make[1]: *** [all] Error 2
> > > make[1]: Leaving directory `/home/uClinux-dist/user'
> > > make: *** [subdirs] Error 1
> >
> >
> > > ___
> > > 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
> >
> > --
> > David McCullough,  david_mccullo...@securecomputing.com,  Ph:
> > +61 734352815
> > McAfee - SnapGe

Re: [uClinux-dev] [PATCH] m68k: restore lost coldfire CLOCK_TICK_RATE

2009-08-12 Thread Philippe De Muyter
On Wed, Aug 12, 2009 at 04:42:27PM +1000, Greg Ungerer wrote:
> Hi Philippe,
>
> Philippe De Muyter wrote:
>> The good definition of CLOCK_TICK_RATE for coldfires has been lost in the
>> merge of m68k and m68knommu include files.  Restore it.  Culprit :
>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ebafc17468d58bd903c886175ca84a4edc69ae1d;hp=34055b806a6334624e7e8af6eefc3aee42372a85
>> Signed-off-by: Philippe De Muyter 
>
> I have added this to the for-linus branch at 
> git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git.
>
> Thanks
> Greg

Thanks, Greg

Philippe
___
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] Alternatives to C/C++ to write apps?

2009-08-12 Thread Mike Frysinger
On Wednesday 05 August 2009 12:13:35 Fred wrote:
> BTW, I'm reading through http://docs.blackfin.uclinux.org, and
> noticed the CoLinux project which appears to be a compile env't for
> Windows, to avoid having to set up a Linux host just for this. Is it
> as good as the Linux version to write applications for the Blackfin
> BF532 processor?

from a functionality perspective, running linux under colinux is 100% 
equivalent.  from a performance perspective, native linux will always be 
faster than colinux, but i really have no #'s to show the differences.
-mike


signature.asc
Description: This is a digitally signed message part.
___
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] Alternatives to C/C++ to write apps?

2009-08-12 Thread Mike Frysinger
On Wednesday 05 August 2009 12:26:29 Joseph Stewart wrote:
> I've had fabulous luck with Lua (http://www.lua.org) on uCLinux/coldfire.
> You might not find a pre-compiled version for Blackfin, but it's relatively
> easy to build.

it's in the uclinux-dist though and should build just fine.  ive seen reports 
of people using lua on Blackfin w/out a problem.
-mike


signature.asc
Description: This is a digitally signed message part.
___
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] Shell exits while running a program.

2009-08-12 Thread Mike Frysinger
On Thursday 06 August 2009 11:01:01 Jamie Lokier wrote:
> Michael Schnell wrote:
> > I'll take a look if this is viable for the NIOS architecture.
>
> On noMMU, an alternative to using a vsyscall page is to put the
> cmpxchg routine in userspace (in Glibc/uclibc), and tell the kernel
> what addresses to check for, with a dedicated system call (just like
> set_thread_area has a dedicated system call).  The kernel will store
> the address in per-task state.
>
> That will save a memory load on noMMU when calling the routine
> because it'll be a direct call instead of indirect.

the Blackfin port does this with a "fixed code" region where we've reserved 
the lowest 4k of memory:
 - first 1k is to catch NULL pointers
 - next ~1k is user-space atomic code (initialized by kernel at boot)

so when userspace wants to do atomic functions (since the hardware doesnt 
support it), it calls the functions hardcoded in this region.  when the kernel 
goes to return to userspace, it checks the PC isnt in this region.  if it is, 
it will finish the atomic operation for userspace and update the PC.
-mike


signature.asc
Description: This is a digitally signed message part.
___
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] Shell exits while running a program.

2009-08-12 Thread Mike Frysinger
On Wednesday 12 August 2009 12:36:02 Jim Donelson wrote:
> On Wed, Aug 12, 2009 at 10:41 AM, Michael Schnell wrote:
> > Jim Donelson wrote:
> > > I wonder why (on an SP machine) you don't just disable interrupts for a
> > > few instructions and give yourself an atomic dec?
> >
> > With many archs it's not possible to disable/enable interrupts in
> > user-space.
>
> But, then if you have an MMU, you have atomic instructions.

assuming you mean hardware atomic instructions, the answer is "not really".
-mike


signature.asc
Description: This is a digitally signed message part.
___
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] Shell exits while running a program.

2009-08-12 Thread Mike Frysinger
On Wednesday 12 August 2009 10:36:02 Jamie Lokier wrote:
> Jim Donelson wrote:
> >I wonder why (on an SP machine) you don't just disable interrupts for
> >a few instructions and give yourself an atomic dec?
>
> Yes, that's fine.
>
> However, it's not secure to allow userspace to disable interrupts(*),
> so we've talked about a custom instruction which lets userspace
> disable interrupts for a maximum of 3/4 instructions, then the
> hardware forces them on again.
>
> (*) with an MMU; without an MMU there's no security anyway so it
> doesn't matter as much.

s/without an MMU/without an MMU or MPU/ ;)
-mike


signature.asc
Description: This is a digitally signed message part.
___
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] Olimex LPC-E2468 compilation

2009-08-12 Thread Bryan Lavrich
Hey guys, just wondering if anyone has used the Olimex LPC-E2468.  I'm looking 
for information on how to compile the included distribution.  We are reasonably 
seasoned with Linux and very experienced with compilation in general, but have 
never compiled Linux before.  Cross-compiler binaries are included on the CD, 
but documentation is basically 'make config; make'.  I'm just looking for 
someone that has this particular distribution of uCLinux and has hopefully 
gotten it to work.  If not, what is needed to go from the uCLinux trunk to 
support this board?

And I understand the need to contribute information back to the community, so I 
plan to put a tutorial of this online if/when I get it working.

Thanks!

-- 
Bryan Lavrich
___
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