Pedro Alves wrote:
> Danny Backx wrote:
>> On Mon, 2007-05-28 at 11:57 +0200, Danny Backx wrote:
>>> On Mon, 2007-05-28 at 02:12 +0100, Pedro Alves wrote:
>>>> I'm not having much luck with telnet or ssh servers for WinCE.
>>>> Does anyone have experience with those?
>>> I've occasionally used a telnet server, I didn't have much trouble with
>>> it but as I said I've never used it much.
>>
>> Err, actually it as a rshd. Too long ago :-)
>>
> 
>  From GNUWINCE?  I once tried it, yeah.  Don't remember how good it was.
> I'll give it a try.  Thanks.
> 
>>> One problem I had was that I really don't understand which types of
>>> applications the shell allows me to run; it only appears to launch apps
>>> if they've been built with the voxware tools.
>>>
> 
> That will be a problem, then.
> 


Found out.  It only works with GNUWINCE apps, because it relies on
GNUWINCE pipes.  It may work with cegcc apps too, but certainly
it won't work with mingw32ce/MSVC apps.


>>>> Specifically I need some way to run the app and the device
>>>> and have its stdout/stderr show up on the pc's console.
>>>>
>>>> rsh/rexec would be perfect, since I want this to run
>>>> the dejagnu testsuite.
>>> Would it be very hard to port these to WinCE ?
> 
> No idea, but the alternative below seems easier.
> 

The alternative didn't work that well.  It seems I hit
some weird file opening problem.  The child writes data
to the redirected file.  But the parent doesn't see the
data grow, even if I close/reopen the file.  E.g.:
child writes 100 bytes per second.  The parent sees the
first 100 or 200 bytes.  If I use ReadFile to wait
for the new data, the data never comes, since ReadFile
thinks it is at EOF.  If I close and reopen the handle,
the parent still sees the same 100 or 200 bytes...  Oh
well.  I wonder how PocketCMD.exe does it.

I took a look at rlogind from GNUWINCE, and
got inspired...

>  >> Or, alternatively, write
>>> a small application that does the equivalent of "tail -f /your-log-file"
>>> and then sends that to your PC over the network ? (That's what you
>>> appear to refer to below.)
>>>
>>>> Alternatively, I'm thinking it could be also possible
>>>> to play with redirection with [Get|Set]StdioPathW,
>>>> and special (like pocket console's CONx: ) devices,
>>>> or just simply redirecting to a file and having a
>>>> proxy app pump the data back.
>>>>
> 

... I'm finishing up a pipe driver/device implementation.  Say
hello to CreatePipe on WinCE.

My first driver for WinCE, and I'm sure I've violated like 134
rules, but preliminary testing shows it works great.  With this
new driver, no temp file is needed, so no worries about
disk space exhausting.  Since the Pipe is blocking, I have
perfect synchronization between child/parent.  One thing is
preventing it from being perfect, though.

Does anyone here have any experience with WinCE driver development?
I've implemented the Pipe as a stream device, and use ActivateDevice
to activate it.  Is there any way to deactivate the device when the
last handle (returned from ReadFile) is closed?  That is, somehow
deactivate the handler from XXX_Close ?
I have a PipeLib (static) library that serves as front-end to
the driver.  The app never sees the device - it is an
implementation detail.

I've trying many things to unload it, and the best I have is to
have a thread on PipeLib wait for the file open count to reach 0,
but it won't catch the case where the parent abruptly terminates,
before this thread gets a change to DeactivateDevice the pipe driver.
I've also tried passing the driver handle into the first open file
handle (the reading end) with an IoControl, and call DeactivateDevice
from a spawned thread running in the device manager's context.  Didn't
work.  I think for now I'll live with the leak.

Let's see how it goes with integrating with rlogind.  I've seen that
the OpenSSH WinCE port uses a socket->file driver wrapper, but I
think that a pipe driver is more generic, more reusable.  Eg: we
can implement 'cat | grep' with this device :)

Cheers,
Pedro Alves



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cegcc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to