From owner-freebsd-hackers Sun Aug 3 10:23:49 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA03644 for hackers-outgoing; Sun, 3 Aug 1997 10:23:49 -0700 (PDT) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id KAA03621 for ; Sun, 3 Aug 1997 10:23:20 -0700 (PDT) Received: from awfulhak.org (dev.lan.awfulhak.org [10.0.1.5]) by awfulhak.demon.co.uk (8.8.5/8.8.5) with ESMTP id SAA17780; Sun, 3 Aug 1997 18:22:35 +0100 (BST) Received: from dev.lan.awfulhak.org (localhost [127.0.0.1]) by awfulhak.org (8.8.6/8.8.6) with ESMTP id SAA19779; Sun, 3 Aug 1997 18:22:34 +0100 (BST) Message-Id: <199708031722.SAA19779@awfulhak.org> X-Mailer: exmh version 2.0zeta 7/24/97 To: Charles Henrich cc: Michael Smith , tom@sdf.com, freebsd-hackers@FreeBSD.ORG Subject: Re: tty-level buffer overflows In-reply-to: Your message of "Sun, 03 Aug 1997 11:21:47 EDT." <19970803112147.21483@crh.cl.msu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 03 Aug 1997 18:22:34 +0100 From: Brian Somers Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > Your application is busted; data is arriving faster than your app is reading > > it, and the kernel has run out of patience and started throwing the data > > away. > > Im afraid not, the application is a software Upload, with a singly byte ack > every 2k, if the serial port cant handle that, theres a problem. I would > presume that if the buffer is full, a write() should block. It's not a case of the serial port handling it. As the OS receives data from the com port, it buffers it 'till your application does a read(). If your application isn't read()ing as fast as the data is arriving, the kernel buffers will fill. When they're full, the sio driver can't do anything with the incoming data, so it doesn't bother reading the port. When your app eventually read()s, some buffers are emptied and the kernel goes off and reads the receive buffer of the UART. It notices that the overflow bit is set, and emmits the sio overflow message. If your application really needs to run slower than the data that's being given to it, you'll need to design around it. > -Crh > > Charles Henrich Michigan State University henrich@msu.edu > > http://pilot.msu.edu/~henrich -- Brian , Don't _EVER_ lose your sense of humour....