Linux-Development-Sys Digest #531, Volume #6     Thu, 25 Mar 99 21:14:31 EST

Contents:
  Re: How about /dev/web? (Greg Franks)
  Re: RS485 & Linux: Must toggle DTR quickly (Tom Aschenbrenner)
  RS485 & Linux: Must toggle DTR quickly (Olav Woelfelschneider)
  Re: How about /dev/web? (Christopher Browne)
  modprobe ERROR -- what's wrong??? ("Dan")
  Re: DMA cache cohrency? ("Pat Crean")
  Re: Device Drivers - IOCTL (ellis)
  Re: Compiling 2.2.4, error in kernel/acct.c (Viljo Hakala)
  Re: How about /dev/web? (Ryan S Warner)
  Re: How about /dev/web? (Alexander Viro)
  Re: RS485 & Linux: Must toggle DTR quickly (Matthew T. Linehan)
  Re: Debugging terrible stack corruption problems - tips or tools? (Bryan Hackney)
  Re: DMA cache cohrency? (hyosang lim)
  Re: Compiling 2.2.4, error in kernel/acct.c (Juergen Heinzl)
  Re: How about /dev/web? (Juergen Heinzl)

----------------------------------------------------------------------------

From: Greg Franks <[EMAIL PROTECTED]>
Subject: Re: How about /dev/web?
Date: 25 Mar 1999 19:02:30 GMT

>>>>> "Mathieu" == Mathieu ARNOLD <[EMAIL PROTECTED]> writes:

    Mathieu> Alexander Viro wrote:
    >>  What next, Java in the kernel?

    Mathieu> the kernel in java :)

No... Java in the kernel developer...  :-)
-- 
   __@            Greg Franks, (613) 520-5726         <|       _~@ __O 
 _`\<,_    Systems Engineering, Carleton University,   |O\   -^\<;^\<, 
(*)/ (*)       Ottawa, Ontario, Canada  K1S 5B6.       (*)--(*)%---/(*)
          "Where do you want to go today?"   Outside. 

------------------------------

From: Tom Aschenbrenner <[EMAIL PROTECTED]>
Crossposted-To: comp.arch.embedded
Subject: Re: RS485 & Linux: Must toggle DTR quickly
Date: Thu, 25 Mar 1999 13:24:25 -0600

Olav.....I went thru the very same thought process you are going thru. I also
use a rs485 network
in the half duplex mode (on 2 wires) communicating with some 8051 based
controllers....after much
work the solution i used was a VERY SIMPLE hardware solution....turns out there
are times when
a few parts replace alot of software and result in a much more reliable
system....since i had built a
simple rs232 to rs485 converter (worked the same as yours...DTR enabled the
rs485 tranmit) i just
added a single one shot that was triggered off the falling edge of the rs232
signal and whose output
enabled the rs485 transmit....set the one shot for the byte time and your
DONE!!!!  now i fought this
solution for a few weeks as i am a software guy at heart but when i saw how
simple it was in the
hardware domain and versus how complex it was in the software domain i switched.
This approach
allowed me to use standard drivers and also the standard linux time slice
scheduler rather then the
SCHED_FIFO mod to be able to get the execution resoltion i needed to control the
DTR lead from
user space.
    Regards,  Tom A - Dallas, Tx.





Olav Woelfelschneider wrote:

> Keywords: RS485-Network, Linux
>
> I try to run a small RS485 network off the serial port of a PC. The PC polls


------------------------------

From: Olav Woelfelschneider <[EMAIL PROTECTED]>
Crossposted-To: comp.arch.embedded
Subject: RS485 & Linux: Must toggle DTR quickly
Date: Thu, 25 Mar 1999 18:44:41 +0100

Keywords: RS485-Network, Linux

I try to run a small RS485 network off the serial port of a PC. The PC polls
some gadgets with microcontrollers in them.

The PC is coupled via a RS232-RS485 converter which uses DTR to
switch between transmit and receive. (I use the half-duplex approach with
only one pair of wires.)

So, to send some data, I turn DTR on, write() the bytes and turn DTR off
again after the last byte fell out of the UART.

Now waiting for end of transmission to turn off DTR is my problem.

If I use tcdrain() to wait, it takes too long, since the kernel doesn't
return quick enough to my process for it to turn DTR off. This means I
lose the response from the device which received the data, as it answers
really quick.

The alternative is a busy loop polling with TIOCSERGETLSR, waiting for
end of transmission. This works, but I don't like it, since it hogs the
CPU, uses tons of system calls and feels very ugly.

Imagine what happens if the scheduler decides to schedule the process away
right after write() but before turning DTR off. Kaboom, the bus stays locked.

This is the code snipplet for that approach:

  {
    int arg;

    /* DTR on */
    ioctl(com, TIOCMGET, &arg);
    arg|=TIOCM_DTR;
    ioctl(com, TIOCMSET, &arg);

    /* Send data */
    if (write(com, buf, bp)!=bp) return -1;

    /* Wait for transmitter to finish -- UGLY! */
    do {
      ioctl(com, TIOCSERGETLSR, &arg);
    } while((arg & TIOCSER_TEMT)==0);

    /* DTR off */
    ioctl(com, TIOCMGET, &arg);
    arg&=~TIOCM_DTR;
    ioctl(com, TIOCMSET, &arg);
  }

Before I go and hack up the serial driver to include automatic DTR toggling,
I wonder what other people might think.

Any hints greatly appreciated!

Thanks,
-- 
Olav "Mac" Wölfelschneider                         [EMAIL PROTECTED]
PGP fingerprint = 06 5F 66 B3  2A AD 7D 2D  B7 19 67 3C  95 A7 9D AF
Mer muß doch nur emol e bissje nochdenke. -- Mundstuhl

------------------------------

From: [EMAIL PROTECTED] (Christopher Browne)
Crossposted-To: comp.emacs,gnu.misc.discuss
Subject: Re: How about /dev/web?
Reply-To: [EMAIL PROTECTED]
Date: Fri, 26 Mar 1999 00:44:22 GMT

On 25 Mar 1999 12:58:14 -0500, Alexander Viro <[EMAIL PROTECTED]> wrote:
>In article <7ddr99$8i2$[EMAIL PROTECTED]>,
>Ryan S Warner <[EMAIL PROTECTED]> wrote:
>>How about implementing /dev/web?  then an act like:
>>mount /dev/web /mnt/web -t web
>>could put http and ftp in the filesystem.  I'm not up on the technical
>>aspects of how to do this, but is seems reasonable.  Take the following
>>fictional example for how it would work:
>[snip]
>>had proper access.  The http connections would support using PUT to upload
>>files, like Netscape Composer and FrontPage do as long as the server does.
>>To log in as a specific user just do: cd ftp:[EMAIL PROTECTED]
>>Could the filesystem driver prompt for password?  Sounds simple enough.  
>>If so, could it possible pop up a prompt in X Windows instead, if it
>>detects X Windows is running?
>
>       You mean making the kernel aware of X??? What next, Java in the
>kernel?

This is *not* the same thing as "pushing Java into the kernel," for
which the useful part (e.g. - recognizing "Java bytecode signatures,"
and then asking for the invocation of a JVM) has been doable for a
couple of years now... 

Note that the Hurd "filesystem translator" notion, for which a Linux
daemon *has* been created, does provide generally this sort of
functionality, essentially allowing you to try to access web information
as if it were a filesystem. 

Hurd allows "mounting" FTP connections as if they were filesystems; the
password authentication takes place at the point at which the mount is
attempted. 

The issue of authentication *is* a good one, albeit one that displays
not having *fully* thought through the issue.  A tty-based mount would
presumably authenticate interactively; if you set up a GUIed "mount"
utility, it would make sense for it to ask for authentication in a
"GUIed" fashion. 

Note that the "mount" pushes *absolutely nothing* of this process into
the kernel, since mount is a user-space program, not a kernel-space
program.  That's the insight that Ryan seems not to have seen, and it's
not something that is *blindingly* obvious when you consider that
"mount" is one of those programs that sits at the edge between
kernel-mode and user-mode. 

>>Seems like an ideal way to make all legacy applications internet ready.
>
>Wake me up when you will implement lseek() and mmap() over FTP. FTP is not
>a filesystem. HTTP is not a filesystem. BTW, could you tell me how to
>implement locks over these protocols? 

This *doesn't* establish that it's a dumb idea to try to treat FTP as a
sort of filesystem, merely that the semantics will differ from ext2,
much as the semantics of ext2 already differ assortedly from NFS, CODA,
UMSDOS, procfs, reiserfs, et al.

Obviously when the protocols don't provide identical semantics it will
prove problematic to provide locking across this.

You already can't use ext2-specific semantics across NFS, which, as the
often-enough lowest-common denominator, means that there are lots of
would-be filesystem extensions that people regard as useless.  

Dumb question (for which I don't know the answer, and would be
interested in knowing): Can you use memory mapped files across NFS? 

>And what on the Earth "internet ready" is supposed to mean?

Pretty content-free, to be sure. 

Probably a sign of having vaguely gathered the notion of Name Spaces,
thinking it might be useful on the Internet, and then not being aware of
relevant seminal works such as
<http://plan9.bell-labs.com/plan9/doc/names.html>, "The Use of Name
Spaces in Plan 9." (And that paper may have further references that may
be considered previous to it...)

Recent discussions on the Reiserfs mailing list are starting to try to
grapple with some of this; other views can be seen assortedly with VSTa,
which unabashedly emulates Plan 9, Hurd, and Tom Lord's "Berkeley
Database," where databases are "mounted" as user-level filesystems.  His
web presence regrettably appears to have disappeared; it used to be
<http://users.lanminds.com/~lord/> and <ftp://emf.net/users/lord/>.  I
may have a copy of BDB kicking around; if not, it's something that
probably ought to get reimplemented or otherwise brought up-to-date in
any case. 

I've got Tom Lord's papers on this at
<http://www.hex.net/~cbbrowne/bbdb.txt>.  He cites Emacs as an
illustration of the principle of having a virtual, extensible file
system interface.  See GNUS for a *really* good example of this; GNUS is
able to join together news "feeds" from upwards of a dozen different
kinds of news sources. 

Or, to put this quite another way, Ryan's question seems pretty
legitimate, and really fairly insightful.  He may not be highly
sophisticated in his knowledge, but his question certainly isn't the
typical whining of "Why don't we put X into the kernel?" (Where by "X,"
I specifically mean "The X Window System, Version 11.")

-- 
"Whenever you find that you are on the side of the majority, it is time
to reform." -- Mark Twain
[EMAIL PROTECTED] <http://www.hex.net/~cbbrowne/oses.html>

------------------------------

From: "Dan" <[EMAIL PROTECTED]>
Subject: modprobe ERROR -- what's wrong???
Date: Thu, 25 Mar 1999 19:36:47 GMT

I compiled and installed the latest version of iBCS on my 2.2.3 kernel (RH
5.2).

When I run:  modprobe iBCS  -- I get the following error:
   no dependency information for module: "/lib/modules/2.2.3/misc/iBCS"

Does anyone know why this error occurs and what I can do to resolve it?
Thanks.

--
DR [EMAIL PROTECTED]



------------------------------

From: "Pat Crean" <[EMAIL PROTECTED]>
Subject: Re: DMA cache cohrency?
Date: Thu, 25 Mar 1999 14:42:10 -0500

You shouldn't have to worry about it.  If the cache subsystem is properly
designed, the hardware will snoop the system bus during dma and invalidate
the cache as required.


hyosang lim wrote in message <[EMAIL PROTECTED]>...
>Hello,
>
>I'm now writing device driver for bust master DMA device.
>I don't know how to sync RAM and cache.
>How can I solve this problem ?
>
>Thanks,
>
>Hyosang Lim.
>
>



------------------------------

From: [EMAIL PROTECTED] (ellis)
Subject: Re: Device Drivers - IOCTL
Date: 25 Mar 1999 19:16:34 GMT

In article <01be76b8$97327900$ec1b1dac@ut9811251830>,
jacob <[EMAIL PROTECTED]> wrote:

>no , he wants to know how u can do the same from user-space instead of
>kernel-space (moron)!

You mean he doesn't know how to use printf (asshole)?

--
http://www.fnet.net/~ellis/photo/linux.hmtl


------------------------------

From: [EMAIL PROTECTED] (Viljo Hakala)
Subject: Re: Compiling 2.2.4, error in kernel/acct.c
Date: 25 Mar 1999 20:19:30 GMT

25 Mar 1999 19:08:21 +0100, Bernd Strieder <[EMAIL PROTECTED]> wrote:
>Hi,
>
>compiling 2.2.4 there is a stop at:
Patch attached. 

--- linux/kernel/acct.c-old Tue Mar 23 19:53:57 1999
+++ linux/kernel/acct.c Tue Mar 23 22:08:11 1999
@@ -194,13 +194,13 @@
        }
        if (old_acct) {
                do_acct_process(0,old_acct);
-               filp_close(old_acct);
+               filp_close(old_acct, NULL);
        }
 out:
        unlock_kernel();
        return error;
 out_err:
-       filp_close(file);
+       filp_close(file, NULL);
        goto out;
 }

--
vh 


------------------------------

From: [EMAIL PROTECTED] (Ryan S Warner)
Subject: Re: How about /dev/web?
Date: 25 Mar 1999 20:02:35 GMT

Alexander Viro ([EMAIL PROTECTED]) wrote:

:       You mean making the kernel aware of X??? What next, Java in the
: kernel?

Sorry your Highness, it was an awful suggestion.  How about _something_
that processes requests for passwords, in the user space, and it could be
implemented as a shell program or X app.

: >Seems like an ideal way to make all legacy applications internet ready.

: Wake me up when you will implement lseek() and mmap() over FTP. FTP is not
: a filesystem. HTTP is not a filesystem. BTW, could you tell me how to
: implement locks over these protocols? And what on the Earth "internet ready"
: is supposed to mean?

I guess I'm not looking for full fledged filesystem access.  Just
something that feels like it in a limited way.  Example:  A KDE image
viewer can open an image not on the local file system by using a
URL for the path.  With this approach one could then do the same with xv. 
I don't see why a phony file system isn't realistic.  Have you ever heard
of /proc? 

Oh, and.  Ooooh, oooh, somebody has an idea I don't like.  Ouch! Ouch!
What's that?  My undies bunching up?  I better go flame someone before
circulation is cutoff to my groin.  <tap tap tap (typing flame)> Ahhh! boy
I showed that moron for trying to innovate.  I'm so smart. 

--
============================================================================
Ryan Warner                                         [EMAIL PROTECTED]
Innovation doesn't come with failures. - me
============================================================================

------------------------------

From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: How about /dev/web?
Date: 25 Mar 1999 19:58:45 -0500

In article <XLAK2.5806$[EMAIL PROTECTED]>,
Christopher Browne <[EMAIL PROTECTED]> wrote:
>On 25 Mar 1999 14:39:55 -0500, Alexander Viro <[EMAIL PROTECTED]> wrote:
>>In article <[EMAIL PROTECTED]>,
>>Mathieu ARNOLD  <[EMAIL PROTECTED]> wrote:
>>>Alexander Viro wrote:
>>>>         What next, Java in the kernel?
>>>
>>>the kernel in java :)
>>
>>vmlinux.el, to mention another monstrosity ;-/
>
>No, no, no.  
>
>vmlinux.scm

I see your vmlinux.scm and raise to /etc/mail/vmlinux.cf

-- 
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid.  Get yourself a better computer" - Dilbert.

------------------------------

From: [EMAIL PROTECTED] (Matthew T. Linehan)
Crossposted-To: comp.arch.embedded
Subject: Re: RS485 & Linux: Must toggle DTR quickly
Date: Fri, 26 Mar 1999 01:32:12 GMT

On Thu, 25 Mar 1999 18:44:41 +0100, Olav Woelfelschneider
<[EMAIL PROTECTED]> wrote:

>So, to send some data, I turn DTR on, write() the bytes and turn DTR off
>again after the last byte fell out of the UART.
>
>Now waiting for end of transmission to turn off DTR is my problem.

More so than you have realized yet. I'm not familiar with the Linux
implementation, but most serial drivers consider the buffer flushed,
and done as soon as the last byte to be transmitted as been sent to
the uart. The problem is, it takes about 1mS (9600 baud) for the uart
to finish transmitting the character. If your using a buffered uart,
the problem gets much worse!

If you manage to get a fast DTR shut off routine working, you WILL cut
off the last few bits of your last character. Been there, done that.

The easiest solution is to not control the 485 transmitter in
software. Use a one shot circuit in the RS-232 to 485 converter to do
the dirty work for you.

B&B has just such an animal, and it works great! We use about 20-30
485TBLED units per year. DB25 for RS-232 side, Screw terminals for the
485 side. 

Check out: http://www.bb-elec.com/


--
+------------------------+---------------------+--------------------+
|   Matthew T. Linehan   |   AKA -=(UDIC)=-    | All Round Computer |
| American LED-gible Inc | Quantum Void Dragon |  Nerd. Hardware,   |
|       Engineer         |   Ultima Fanatic    | Software, Other :-)|
+------------------------+---------------------+--------------------+

------------------------------

From: Bryan Hackney <[EMAIL PROTECTED]>
Subject: Re: Debugging terrible stack corruption problems - tips or tools?
Date: Thu, 25 Mar 1999 20:12:00 +0000
Reply-To: [EMAIL PROTECTED]



I have a suggestion, but have never done (or needed to) this.

Snarf the SP very early ( first thing in main ) and then make a copy
of the entire stack at the beginning of every call.

I don't know if gdb will let you swap SPs, but if so, you're in control.
Otherwise you will have to restore the stack contents yourself.

Good luck.

BH




David Mellor wrote:
> 
> Does any one have any tips or tools for resolving those terrible stack
> corruption problems please?
> 
> I have a problem where function parameters become inaccessible part way
> through a function, as a result of stack corruption - caused by something
> the function has done. I get a segmentation fault when I access them.
> 
> Unfortunately I can not reproduce the problem under Windows, or I would use
> Purify to try to find the source of the problem.
> 
> Thank you!
> 
> >> David Mellor                             Parallel Computer Systems
> >>
> >>  High performance cluster computing            [EMAIL PROTECTED]
> >>  software, including fast PVM clone       http://www.parasys.co.uk

-- 
Bryan Hackney / BHC / bhackneyatexpress-news.net
*

------------------------------

From: hyosang lim <[EMAIL PROTECTED]>
Subject: Re: DMA cache cohrency?
Date: Fri, 26 Mar 1999 11:00:08 +0900
Reply-To: [EMAIL PROTECTED]

I'm now writing IEEE 1394 Network Device Driver.
I send data using DMA on computer A, and receive data using DMA on
computer B.
The data read from RAM (computer B) was incorrect.
I think it is cache coherency problem.
In VxWorks (RealTimeOS), cacheFlush() and cacheInvalidate() system calls
are used
to sync cache and memory.
Is there any functions to control cache in Linux?

Pat Crean wrote:
> 
> You shouldn't have to worry about it.  If the cache subsystem is properly
> designed, the hardware will snoop the system bus during dma and invalidate
> the cache as required.
> 
> hyosang lim wrote in message <[EMAIL PROTECTED]>...
> >Hello,
> >
> >I'm now writing device driver for bust master DMA device.
> >I don't know how to sync RAM and cache.
> >How can I solve this problem ?
> >
> >Thanks,
> >
> >Hyosang Lim.
> >
> >

------------------------------

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: Compiling 2.2.4, error in kernel/acct.c
Date: Thu, 25 Mar 1999 21:17:08 GMT

In article <[EMAIL PROTECTED]>, Bernd Strieder wrote:
>Hi,
>
>compiling 2.2.4 there is a stop at:
>
>gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
>-fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2
>-malign-jumps=2 -malign-functions=2 -DCPU=586   -c -o acct.o acct.c
>acct.c: In function `sys_acct':
>acct.c:197: too few arguments to function `filp_close'
>acct.c:203: too few arguments to function `filp_close'

http://www.linuxhq.com/ ... patch available ... 

>Bye,
In the hope this is not going the last word we will hear from you ... right
now running 2.2.4; no problems for 120 sec and counting
Juergen

-- 
\ Real name     : Jürgen Heinzl                 \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /
  \ Phone Private : +44 181-332 0750              \                  /

------------------------------

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: How about /dev/web?
Date: Thu, 25 Mar 1999 21:17:08 GMT

In article <7ddr99$8i2$[EMAIL PROTECTED]>, Ryan S Warner wrote:
>How about implementing /dev/web?  then an act like:
>mount /dev/web /mnt/web -t web
>could put http and ftp in the filesystem.  I'm not up on the technical
>aspects of how to do this, but is seems reasonable.  Take the following
>fictional example for how it would work:

FIX ME: Sun has something like a web filesystem (heard about this one
quite some time ago). You might take a look on their side what's the
beef, but sure, for dedicated servers an optimised FS can be an
advantage.

Cheers,
Juergen

-- 
\ Real name     : Jürgen Heinzl                 \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /
  \ Phone Private : +44 181-332 0750              \                  /

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to