Linux-Development-Sys Digest #681, Volume #6 Wed, 5 May 99 14:13:58 EDT
Contents:
Bug with alarm() interrupting read()??? (Brad Pepers)
drivers/scsi/st.c: sugg bt? (Trevor Bradley)
Re: what is safe optimisation level for kernel? (Marcus Sundberg)
Re: PPP over Ethernet (anthony classick)
Kernel panic with 2.2.7 and MO devices (Mike Dowling)
Re: Files larger than 2 GB on Intel/Linux ([EMAIL PROTECTED])
Re: Bug with alarm() interrupting read()??? ([EMAIL PROTECTED])
Re: mknod from a module (Andreas Schwab)
Initrd ([EMAIL PROTECTED])
Re: compiling glibc2 (or finding glibc 2.1) (Vladimir Stanishev)
Problems compiling Kernel 2.2.7 (Sellaro)
ip port forwarding in 2.2.x ([EMAIL PROTECTED])
Re: scancodes, keycodes and XKEYBOARD (Eric Plaster)
----------------------------------------------------------------------------
From: Brad Pepers <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development,comp.os.linux.redhat
Subject: Bug with alarm() interrupting read()???
Date: Wed, 05 May 1999 07:21:54 GMT
This is a multi-part message in MIME format.
==============082960B5B12F4D2DCE16E6E0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have a program that does ymodem transfers. The program works
fine on older Red Hat releases (4.x) but I've found out it dies
in the latest version I have (5.2). I've traced it down to the
fact that the alarm() call only gets triggered once but I don't
know why!
The code is doing a read() and setting up a SIGALRM handler and
alarm() call to make it timeout. If it does timeout, everything
is set back again and it tries to read again. The second time
though, the SIGALRM isn't triggered.
Is this something to do with continuing interrupted system calls?
Should it even work at all or is it a fluke it worked with older
Red Hat versions? The kernel I'm using is 2.0.36 with glibc 2.0.7
(pretty standard Red Hat 5.2 release).
I realize the code should be using select instead but I inherited
it this way and now want to understand why it doesn't work rather
than just re-code it.
I've attached a stripped down demo program that will show the
problem. The "timeout1" happends just once. Using strace I can
see the first timeout stop the read() when the SIGALRM occurs and
then I see it all get set up again but the read() never returns
this time!
--
Brad Pepers
Linux Canada Inc. Home of Linux products in Canada!
http://www.linuxcanada.com Proud supporter of Cyclades, Red
[EMAIL PROTECTED] Hat, and Caldera.
==============082960B5B12F4D2DCE16E6E0
Content-Type: text/plain; charset=us-ascii; name="test.cc"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="test.cc"
#include <fcntl.h>
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <termios.h>
#include <unistd.h>
const int MAX_BLOCK_LEN = 1024;
const int TIMEOUT = -2;
int inputFd;
FILE* outputFile;
char blockBuf[MAX_BLOCK_LEN];
int blockLen = 128;
long bytesLeft;
jmp_buf alarmJump;
void showTime() {
static struct timeval tv;
gettimeofday(&tv, 0);
printf("%d,%d: ", tv.tv_sec, tv.tv_usec);
}
void setDevice(int fd)
{
struct termios t;
tcgetattr(fd, &t);
cfmakeraw(&t);
cfsetospeed(&t, B9600);
tcsetattr(fd, TCSANOW, &t);
}
void handleAlarm(int c)
{
showTime();
printf("handleAlarm\n");
longjmp(alarmJump, -1);
}
void sendChar(char c)
{
write(inputFd, &c, 1);
showTime();
printf("sendChar: %d\n", c);
}
int readChar(int timeout)
{
static char line[MAX_BLOCK_LEN];
static char* buffer;
static long numChars = 0;
if (--numChars >= 0) {
showTime();
printf("readChar: %d\n", (*buffer & 0377));
return (*buffer++ & 0377);
}
if (setjmp(alarmJump)) {
showTime();
printf("readChar: timeout1\n");
numChars = 0;
alarm(0);
return TIMEOUT;
}
showTime();
printf("start alarm: %d\n", timeout);
alarm(timeout);
buffer = line;
numChars = read(inputFd, buffer, MAX_BLOCK_LEN);
showTime();
printf("cancel alarm\n");
alarm(0);
if (numChars < 1) {
showTime();
printf("readChar: timeout2\n");
return TIMEOUT;
}
--numChars;
showTime();
printf("readChar: %d\n", (*buffer & 0377));
return *buffer++ & 0377;
}
void writeData(char* p, int n)
{
fwrite(p, 1, n, outputFile);
}
void flushInput(void)
{
int ch;
do {
ch = readChar(2);
} while (ch != TIMEOUT);
}
int main(int argc, char* argv[])
{
inputFd = open("/dev/ttyS0", O_RDWR);
if (inputFd < 0) {
fprintf(stderr, "Error: can't open /dev/ttyS0\n");
exit(2);
}
setDevice(inputFd);
signal(SIGALRM, handleAlarm);
flushInput();
readChar(2);
return 0;
}
==============082960B5B12F4D2DCE16E6E0==
------------------------------
From: Trevor Bradley <[EMAIL PROTECTED]>
Subject: drivers/scsi/st.c: sugg bt?
Date: Wed, 05 May 1999 06:28:54 GMT
Hi There.
I'm running Linux kernel 2.0.36 and 2.2.6 and and getting an old Exabyte
8200 to work. It works great. However, when I run under 2.2.6, I get the
following error when a large operation completes (i.e. tar cf /dev/st0 ...):
st0: Error 25040000 (sugg. bt 0x20, driver bt 0x25, host bt 0x4).
Then /dev/st0 throws an I/O error and it takes a bit of time (perhaps 10
seconds?) until I can issue further commands with mt.
Everything appears to be just fine. I can rewind the tape and verify that
the data is recorded correctly. I've looked at st.c (which generates the
error) and haven't been able to decrypt the error. Is it Exabyte 8200
specific? What does it mean?
I don't appear to get this error under 2.0.36...
Can anyone help?
--
Trevor Bradley Surrey, British Columbia, Canada
[EMAIL PROTECTED] http://www.arbutus.cx/
------------------------------
From: Marcus Sundberg <[EMAIL PROTECTED]>
Subject: Re: what is safe optimisation level for kernel?
Date: Wed, 05 May 1999 09:46:51 +0200
Mark Brown wrote:
> > What about pgcc? I read that XFree-3.3.3 hangs when
> > > compiled with pgcc, so pgcc is bad and egcs is safe? Is it bug in
> > > pgcc and will it be corrected?
>
> > i do not know. call me lazy, but i don't bother compiling xfree86.
>
> It's a bug in PGCC. However, XFree86 is not the kernel and it may be
> that the kernel doesn't excercise that bug.
PGCC seems to honor the "volatile" directive incorrectly. I've found
a specific bug regarding this which I'll report to the PGCC maintainers.
Also, my XFree86 3.3.3.1 is compiled with pgcc. I use -O6 -mpentium
for everything except the actual hardware drivers, for which I use
-O2 -mpentium. This works fine, but using -O3 or higher for the hardware
stuff doesn't.
//Marcus
--
===============================+====================================
Marcus Sundberg | http://www.stacken.kth.se/~mackan/
Royal Institute of Technology | Phone: +46 707 295404
Stockholm, Sweden | E-Mail: [EMAIL PROTECTED]
------------------------------
From: anthony classick <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: PPP over Ethernet
Date: Wed, 05 May 1999 07:13:35 -0400
Why would you need PPP over ethernet, might I ask?
Mattias Wildeman wrote:
>
> Is there anyone out there who is working on a PPP over Ethernet client
> for Linux?
>
> /Matt
------------------------------
From: [EMAIL PROTECTED] (Mike Dowling)
Subject: Kernel panic with 2.2.7 and MO devices
Date: 5 May 1999 13:25:57 GMT
I tried to create a filesystem on an MO device using
% e2fsck -b 2048 /dev/sdc1
and got zillions of errors. Since I could not interrupt the command, I
simply turned off the MO device, and the kernel paniced. Admittedly, my
action was drastic, but I would have thought that the kernel still should
not have paniced.
The bigger problem is how to create a filesystem on an MO device.
Cheers,
Mike Dowling
--
My email address [EMAIL PROTECTED] above is a valid email address.
It is, in fact, a sendmail alias; the digit 'N' is incremented regularly.
Spammed aliases will be deleted. Currently, mike[5,7-9,12] have been deleted.
If email to mikeN bounces, try mikeN+1.
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Files larger than 2 GB on Intel/Linux
Reply-To: [EMAIL PROTECTED]
Date: Wed, 5 May 1999 09:56:11 GMT
Eildert Groeneveld <[EMAIL PROTECTED]> wrote:
> it again. We are about the by a really big Alpha server with some 3GB
> of RAM and 40 or so GB of disk space. What are our chances of
> being able to handle files larger than 2GB?
You mention Intel in the Subject, then Alpha in the body.
Linux is 64 bit on 64 bit architectures (Alpha, UltraSparc) so you
will have no problems having files >2GB on an AlphaServer.
------------------------------
Crossposted-To: comp.os.linux.redhat
From: [EMAIL PROTECTED]
Subject: Re: Bug with alarm() interrupting read()???
Reply-To: [EMAIL PROTECTED]
Date: Wed, 5 May 1999 09:54:12 GMT
In comp.os.linux.development.system Brad Pepers <[EMAIL PROTECTED]> wrote:
> I have a program that does ymodem transfers. The program works
> fine on older Red Hat releases (4.x) but I've found out it dies
> in the latest version I have (5.2). I've traced it down to the
> fact that the alarm() call only gets triggered once but I don't
> know why!
The semantics of signal() [ which is depcrecated in favour of
so-called 'reliable' signal handling ] have changed in glibc.
If you have Redhat-5.2, then read /usr/doc/glibc-2.0.7/FAQ,
particularly all the questions relating to signal.
Jason.
------------------------------
From: Andreas Schwab <[EMAIL PROTECTED]>
Subject: Re: mknod from a module
Date: 05 May 1999 12:05:40 +0200
Klaus Elend <[EMAIL PROTECTED]> writes:
|> H. Peter Anvin wrote:
|> >
|> > Followup to: <7gkn19$adp$[EMAIL PROTECTED]>
|> > By author: [EMAIL PROTECTED]
|> > In newsgroup: comp.os.linux.development.system
|> > >
|> > > Hi,
|> > >
|> > > I am trying to call mknod from a module.
|> > >
|> >
|> > Don't.
|>
|> So you consider doing this a bad idea, in all cases, independent
|> on the circumstances? Could you give a little explanation why?
This belongs to the user space.
--
Andreas Schwab "And now for something
[EMAIL PROTECTED] completely different"
[EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED]
Subject: Initrd
Date: Wed, 05 May 1999 09:27:21 GMT
Hi
I have a few different Linux-partitions and are trying to boot one of them
with a initrd.img (for having it read-only). The initrd.img contains a script
linuxrc that shall mount the read-only filesystem as / in RAM. The linuxrc
looks like this: "#!/bin/sh mount -o ro /dev/hda4 /mnt zcat
/mnt/boot/ram40.img.gz > /dev/ram umount /dev/hda4"
sh, mount, zcat, umount are present in /bin in initrd.img.gz but when the
linuxrc tries to run mount, zcat and umount something goes wrong.
"/linuxrc : mount :not found
/linuxrc : zcat : not found
/linuxrc : umount : not found
...
Kernel panic : Unable to mount root filesystem"
total stop of course...
I�ve also tried to write the full path in the linuxrc:
"#!/bin/sh
/bin/mount -o ro /dev/hda4 /mnt
/bin/zcat /mnt/boot/initrd.img.gz > /dev/ram
/bin/umount /dev/hda4"
This doesn�t help at all, it just says
"/linuxrc : /bin/mount :not found
/linuxrc : /bin/zcat : not found
/linuxrc : /bin/umount : not found
...
Kernel panic : Unable to mount root filesystem"
You can see that the linuxrc-script is found but why can�t it find mount, zcat
and umount? I can�t understand this!
Anyone who have some hints?????
Thank you
Martin
============= Posted via Deja News, The Discussion Network ============
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
From: Vladimir Stanishev <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: compiling glibc2 (or finding glibc 2.1)
Date: Tue, 04 May 1999 22:57:45 -0400
"Paul D. Smith" wrote:
> %% Chris Rankin <au.com.zipworld@{no.spam}rankinc> writes:
>
> cr> Is glibc-2.1 available for download somewhere? I tried gnu.org but
> cr> there was a file instead saying that it had been temporarily
> cr> removed for "political reasons".
>
> Since EGCS has just taken over the steering of GCC, the policital
> reasons don't seem to exist any longer--hopefully that will get updated
> shortly (the FSF folks have been rather busy the last few weeks due to a
> stupid childish dumbass cracker).
>
> Anyway, you can get an "official" copy of glibc 2.1 on the Cygnus site
> somewhere.
that "somewhere" took me longer to find than i'd like to admit. here is the url if
anyone is still looking.
ftp://glibc.cygnus.com/pub/glibc/
------------------------------
From: Sellaro <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc,comp.os.linux.setup
Subject: Problems compiling Kernel 2.2.7
Date: Wed, 05 May 1999 13:43:17 -0300
Hello ALL
When I try to compile kernel 2.2.7 (and other 2.2.x kernels) in my
system (Pentium II 233 MHz, with 64 MB RAM, running Slackware 3.6 with
kernel 2.0.36) I get the following error message:
make[2]: Entering directory '/usr/src/linux/arch/i386/lib'
gcc -D__kernel__ -I/usr/src/linux/include -Wall -Wstrict-prototype -O2
-fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2
-malign-jumps=2 -malign-functions=2 -DCPU=686 -c -o checksum.o
checksum.c
checksum.c:204: redefinition of 'csum_partial_copy'
checksum.c:109: 'csum_partial_copy' previously defined here
{standard input}: Assembler messages:
{standard input}:185: Fatal error: Symbol csum_partial_copy already
defined.
make[2]: *** [checksum.o] Error 1
make[2]: Leaving directory '/usr/src/linux/arch/i386/lib'
make: *** [_dir_arch/i386/lib] Error 2
I've already checked the file <kernel source>/Documentation/Changes and
verified all the requirements to properly compile the new kernel. Here
they are:
Kernel Modutils: 2.1.121
GCC: 2.8.1
Binutils: 2.9.1
libc5: 5.4.46
Dynamic Linker: 1.9.9
any help will be greatly appreciated. Please, drop it also to
[EMAIL PROTECTED]
T.I.A.
--
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
"Eu sou um imortal. Nao tenho onde cair morto." - Olavo Bilac
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Sellaro
Network and System Administrator
Computer Science Dept.
Federal University of Ceara - Brazil (UFC)
------------------------------
From: [EMAIL PROTECTED]
Subject: ip port forwarding in 2.2.x
Date: Wed, 05 May 1999 18:27:33 GMT
hi everyone !!
i'm searching for some documentation and/or experience with the port
forwarding features in the current linux kernels.
i had a look at IPPORTFW and MARKFW but could find any documentation
how to setup and use these features.
if any one knows a link or has some more information on these topics,
please send me a mail
TIA,
olli
------------------------------
From: Eric Plaster <[EMAIL PROTECTED]>
Subject: Re: scancodes, keycodes and XKEYBOARD
Date: Tue, 04 May 1999 11:09:27 -0500
==============AE983D51617EEB10226DCE38
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
That is one of the first things that I tried. Xev doesn't even get the key
(it does nothing when I press the key). My guess is that X windows swallows
the scancodes that are not FF**.
Aurel Balmosan wrote:
> In article <[EMAIL PROTECTED]> you wrote:
>
> > We are doing some work on hardware that will generate scancodes like a
> > keyboard (i.e. something like E025). To use as a development tool, I'm
> > using a tronix keyboard (model number: scorpius 98N plus) which has
> > special keys labeled WWW, BACK, SRCH, etc... When I boot up the linux
> > box and hit a key it will generate an error that will tell me the
> > scancode. I can also get the scancode by using "showkey -s" before
> > going into xwindows.
>
> > The problem is I loose the scancodes in X. It's almost as though X
> > swallows scancodes that it doesn't recognize. Using setkeycodes works
> > will under linux but doesn't follow through into X.
>
> > Is XKEYBOARD the answer? I've downloaded the source to XFree86 and took
> > a look at the code for xkb, but I can't make heads or tails of it (it
> > would be nice to see at least one comment). And I searched the net for
> > days on any information on the xkb. Any ideas?
>
> > --
> > Eric Plaster Image Manipulation Systems
> > Software Engineer (612)753-5602 x117
> > [EMAIL PROTECTED] www.imageman.com
>
> Have you tried to use the program 'xev'. It show you what the X-Server
> generates. Also the key strokes. You the keycode as well as the symbol
> for it.
>
> --
> ================================================================
> Aurel Balmosan | [EMAIL PROTECTED], [EMAIL PROTECTED]
> http://gaia.owl.de/~aurel/ |
> ================================================================
--
Eric Plaster Image Manipulation Systems
Software Engineer (612)753-5602 x117
[EMAIL PROTECTED] www.imageman.com
==============AE983D51617EEB10226DCE38
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<BR>That is one of the first things that I tried. Xev doesn't even
get the key (it does nothing when I press the key). My guess is that
X windows swallows the scancodes that are not FF**.
<P>Aurel Balmosan wrote:
<BLOCKQUOTE TYPE=CITE>In article <[EMAIL PROTECTED]> you
wrote:
<P>> We are doing some work on hardware that will generate scancodes like
a
<BR>> keyboard (i.e. something like E025). To use as a development
tool, I'm
<BR>> using a tronix keyboard (model number: scorpius 98N plus) which has
<BR>> special keys labeled WWW, BACK, SRCH, etc... When I boot up
the linux
<BR>> box and hit a key it will generate an error that will tell me the
<BR>> scancode. I can also get the scancode by using "showkey -s"
before
<BR>> going into xwindows.
<P>> The problem is I loose the scancodes in X. It's almost as though
X
<BR>> swallows scancodes that it doesn't recognize. Using setkeycodes
works
<BR>> will under linux but doesn't follow through into X.
<P>> Is XKEYBOARD the answer? I've downloaded the source to XFree86
and took
<BR>> a look at the code for xkb, but I can't make heads or tails of it
(it
<BR>> would be nice to see at least one comment). And I searched
the net for
<BR>> days on any information on the xkb. Any ideas?
<P>> --
<BR>> Eric
Plaster
Image Manipulation Systems
<BR>> Software
Engineer
(612)753-5602 x117
<BR>>
[EMAIL PROTECTED]
www.imageman.com
<P>Have you tried to use the program 'xev'. It show you what the X-Server
<BR>generates. Also the key strokes. You the keycode as well as the symbol
<BR>for it.
<P>--
<BR>================================================================
<BR>Aurel
Balmosan
| [EMAIL PROTECTED], [EMAIL PROTECTED]
<BR><A
HREF="http://gaia.owl.de/~aurel/">http://gaia.owl.de/~aurel/</A>
|
<BR>================================================================</BLOCKQUOTE>
<PRE>--
Eric
Plaster
Image Manipulation Systems
Software
Engineer
(612)753-5602 x117
[EMAIL PROTECTED]
www.imageman.com</PRE>
</HTML>
==============AE983D51617EEB10226DCE38==
------------------------------
** 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
******************************