public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Re: Any shell available?
@ 2006-05-31 18:28 Zimman, Chris
  2006-06-02 10:47 ` Ilija Koco
  0 siblings, 1 reply; 10+ messages in thread
From: Zimman, Chris @ 2006-05-31 18:28 UTC (permalink / raw)
  To: Anthony Tonizzo, ecos-discuss

We've actually written a small shell for eCos that we use internally.
There's no objloader support for our platform yet (AFAIK), but we use
something similar to the RedBoot_cmd() syntax to bring in commands to
the shell.  There's a "ps" clone, mount/unmount for the filesystems, ls,
etc.
There's no scripting support, but there's no reason it couldn't be
added.

If anyone is interested, let me know and I'll see if I can pack it up
into something exportable.

--Chris

-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Anthony
Tonizzo
Sent: Wednesday, May 31, 2006 12:43 PM
To: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Re: Any shell available?

Andrew:

> However what Anthony is suggesting would allow multiple blobs of
> object code to be loaded and executed simultaniously. And the blobs
> can be loaded at any time, not just at boot time. It is more than a
> boot loader.

> However, there is no practical way to terminate all the threads
> associated with a blob, unload it, and make sure it has released all
> its resources. To do this you need processes. Without this you cannot
> have a proper shell.

Agreed. Process management is impossible, and thus a real shell
will be impossible. But something based on objloader is still better
than nothing especially if your tasks are reasonably well behaved and
are not expected to die on you all the time, leaking memory all over
the map.

A possible implementation of the "kill" command in the shell would
call the  library_close() function inside the blob, and if the user is
judicious,
it can be used to try to reclaim as many resources as possible. In other
words, you must reclaim your own garbage, do not expect the OS
to do it for you. This "thread desctructor" is not  perfect by any
stretch of the
imagination, but a first step  in the right direction, and with time we
can get
to a point where the memory leaks that result  from terminating a
process
might be kept reasonably low.

In the case in which the thread dies a sudden death, there is little
that
can be done without an MMU and per-thread paging anyway. And we really
do not want to go there.

Also, as you correctly suggest, the ability to run a script upon startup
(a la
RedBoot) could make this "poor man's shell" a good boot loader: Instead
of
recompiling and reflashing the application with the kernel, you instruct
the
startup script to load the application upon boot from an existing file
system
(JFFS2 come to mind.) That way multiple copies of the application can be
kept, and you can boot whichever one you prefer.

Cheers
Tony

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <3B530EF12E388B408ECC3162BA8C00F401BBE726@ny2526.corp.bloomberg. com>]
* [ECOS] Re: Any shell available?
@ 2006-05-31  1:02 Anthony Tonizzo
  2006-05-31  8:37 ` Andrew Lunn
  0 siblings, 1 reply; 10+ messages in thread
From: Anthony Tonizzo @ 2006-05-31  1:02 UTC (permalink / raw)
  To: ecos-discuss

Andrew:

> Now eCos has no concept of loading a program from secondary storage
> and executing it. It has no concept of a program. It has no concept of
> a process.

I am not sure I agree 100% with this statement.

eCos has both the concept of file system (and hence we can extrapolate
the concept of secondary storage) as well as the concept of process, given
that a process can be loaded by the objloader package and executed.

I do not see anything wrong with an application (call it shell) that is capable
of both accessing a file system as well as loading from that file system a
file and running it. It would be a good way to test quickly a new version
of the code, because the application (nimbler in size, because all the kernel
is already running on the target as part of the shell) can be compiled on the
host, loaded (perhaps remotely) and then run. Of course when everything is
said and done, you will eventually compile your application with the kernel
and drop  the shell, but my point is that the former does not preclude the
latter.

vxWorks does it, why shouldn't eCos?

Yes, the two systems are different, different customers, different design
and all that goes with it, but there is nothing technical that prevents a
shell to be written for eCos. Besides, the  topic has come up several
times already, and the answers that have been  given so far for the lack
a shell in eCos are, in my humble opinion, neither convincing nor conclusive.

I can even envision a world in which, for those embedded systems that can
tolerate the extra requirements, RedBoot itself is put out to pasture and it
is replaced by a kernel with shell.

Regards
Tony

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-06-02 16:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-31 18:28 [ECOS] Re: Any shell available? Zimman, Chris
2006-06-02 10:47 ` Ilija Koco
     [not found]   ` <44805E04.2040400@mindspring.com>
2006-06-02 16:19     ` Ilija Koco
     [not found] <3B530EF12E388B408ECC3162BA8C00F401BBE726@ny2526.corp.bloomberg. com>
     [not found] ` <3B530EF12E388B408ECC3162BA8C00F401BBE726@ny2526.corp.bloomberg .com>
2006-05-31 22:28   ` John Carter
  -- strict thread matches above, loose matches on Subject: below --
2006-05-31  1:02 Anthony Tonizzo
2006-05-31  8:37 ` Andrew Lunn
2006-05-31 11:51   ` Luis Friedrich
2006-05-31 12:20     ` Andrew Lunn
2006-05-31 16:42     ` Anthony Tonizzo
2006-05-31 21:47     ` David N. Welton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).