Re: [uCsimm] serial raw data transfer

From: sticke_m (sticke_m@informatik.fh-hamburg.de)
Date: Fri Aug 11 2000 - 04:13:36 EDT


On Thu, 10 Aug 2000, Keith Owens wrote:

> On Thu, 10 Aug 2000 13:19:18 +0200 (MEST),
> >In the serial driver from uCSimm is a nice feature, but for a raw
> >communication it is not very suitable. Here a extract from the source code of serial
> >driver 68328serial.c file:
> > } else if (ch == 0x12) { /* ^R */
> > hard_reset_now();
> > return;
> >
> >When my serial device send for e.g. the byte 12 - the uClinux boot !
> Change the kernel code or use a transfer program that lets you escape

There may be usecases where you need to be able to send every byte
over the serial port. Btw. Is it possible to change the speed of the
serial port of the uCsimm to 250KBit/s. Then I would use it to build
an Ethernet to DMX-Bridge that must be able to send every bytecode.

> selected characters and escape the problem ones. This code is
> someone's attempt to provide the Sysrq feature in uclinux, but there is
> a very good reason why the real sysrq code needs a multi key sequence.

write a driver like /dev/sysrqmode where you can write a '1' or '0' to
enable or disable it. So you can switch it on and off on demand.
You may also write a small program like sysrqmode [on|off] that makes it
more easy to use.

....

static int sysrqmode=1;

sysrqswitch_write (..., char *buffer, ....)
{
  switch (*buffer)
  {
    case '0': sysrqmode=0; break;
    case '1': sysrqmode=1; break;
  }
}

char is_debug_mode ()
{
  return sysrqmode;
}

.....

                if (is_debug_mode())
                {
               .....
                        } else if (ch == 0x12) { /* ^R */
                                hard_reset_now();
                                return;
               .....
                }

Michael
  michael@cubic.org

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:37 EST