[ECOS] Nano using PDCurses for eCos

Sergei Gavrikov sergei.gavrikov@gmail.com
Wed Apr 15 11:26:00 GMT 2009


Steven Clugston wrote:
> 
> >> Steven Clugston wrote:
> >> I've been wanting to do a port of a minimal console text editor
> >> something like nano or pico to eCos to do on board editing of
> >> configuration files to be storred in flash. I've not had
> >> time to look
> >> into it yet, but as nano (as far as I remember) uses ncurses, this
> >> might be just the thing to get the ball rolling.
> 
> 
> > I brief check the latest nano sources at the least they have
> >
> > ~/repo/nano$ grep -li pdcurses *
> > BUGS
> > ChangeLog.pre-2.1
> > NEWS
> >
> > ~/repo/nano/src$ grep -i pdcurses *
> > winio.c:#ifdef PDCURSES
> >
> > Sergei
> 
> Hi Sergei
> 
> I've downloaded your PDCurses for eCos and I'm now able to have coloured Xmas trees and worms in minicom running from my board - thanks.
> 
> Can this be put into CVS now? Or will you keep it as a separate project?

Hi Steven

I'm not going to maintain PDCurses package for eCos as a separate
project. I have FSF agreement and I posted the announce in the
ecos-patches list via eCos bugzilla engine
http://ecos.sourceware.org/ml/ecos-patches/2009-04/msg00009.html
So, I must be a patient. And I hope after some discussion the package in
that or another look can be committed in CVS. As Andrew said, he did not
saw the copyright issues with PDCurses itself. So, I hope, that will
happen.

> As I mentioned before, I thought I'd have a go at getting nano to work.
> 
> I've tried version 2.0.7 from:
> http://savannah.gnu.org/projects/nano
> 
> All went well until it came up against some the Linux/unix calls:
> 
> ../src/files.c: In function `safe_tempfile':
> ../src/files.c:1156: `P_tmpdir' undeclared (first use in this function)
> ../src/files.c:1156: (Each undeclared identifier is reported only once
> ../src/files.c:1156: for each function it appears in.)
> ../src/files.c:1165: warning: implicit declaration of function `umask'
> ../src/files.c:1168: warning: implicit declaration of function `mkstemp'
> ../src/files.c: In function `write_file':
> ../src/files.c:1376: warning: implicit declaration of function `lstat'
> 
> Ok, so I created a compat.h to delcare P_tmpdir as "/tmp" and map lstat to stat in a similar way as you did for TCL a few years ago (BTW what happened with you TCl eCos port? Is it available anywhere?).

That was yet another weekend mechanic. I just ran John Osterhout Tcl 6.7
on my small foot-print target. A community right decided that Jim is a
more suitable for embedded. But, I liked that Tcl 6.7 experience.

> Now I've got a problem with termios, as even thought <termios.h> is included and present in the ecos install dir I still get errors:
> 
> powerpc-eabi-gcc -DHAVE_CONFIG_H -I"${BUILD_PATH}/eCos/install/include" -I"${BUILD_PATH}/src/nano/src" -I"src" -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/nano.d" -MT"src/nano.d" -o"src/nano.o" "../src/nano.c"
> ../src/nano.c: In function `finish':
> ../src/nano.c:583: warning: implicit declaration of function `tcsetattr'
> ../src/nano.c:583: `TCSANOW' undeclared (first use in this function)
> <snip>

Hm,

$ find $ECOS_REPOSITORY -type f -name \*.h -print0|xargs -0 grep -l TCSANOW
/home/sg/repo/devo/ecos/packages/isoinfra/current/include/termios.h

check `-I' pathes and eCos `ifdefs'.

> Anyway, that's my progress so far.
> 
> Also there's still the issue of no input support in the dummy pdcurses driver yet which makes nano a bit limited in use...

http://bitbucket.org/tickling/pdcurses4ecos/src/
http://bitbucket.org/tickling/pdcurses4ecos/src/tip/synth-gdb.txt


My first implementation for my own tests supported and input on the test
serial port just to interact with the demos. I did not use termios, but
eCos raw serial non-blocked i/o. I rejected those 3 functions from that
job (see an attachment). It was done just to interact with PDCurses
demos, no more. I used synthetic serial driver from Savin Zlobec, and
"nullmodem" from Jürgen Rinas, and minicom on pseudo tty. It worked. The
demos ran and on one my ARM target too.

IMHO

If you just want to edit config files, it's better to implement own
editor, call it `femto' then :-) http://en.wikipedia.org/wiki/SI_prefix
It seems for me that nano is enough bloat stuff for eCos targets. But
this my opinion, only.


Regards,

Sergei

> Regards,
> Steven
> 
> --
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snip.c
Type: text/x-csrc
Size: 1997 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-discuss/attachments/20090415/11f23ceb/attachment.bin>
-------------- next part --------------
-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


More information about the Ecos-discuss mailing list