Linux-Development-Sys Digest #28, Volume #8 Tue, 18 Jul 00 18:13:17 EDT
Contents:
Re: My own distribution (Mike Dowling)
Writing Device Drivers for Newer Kernels ("William F. Simmons")
Re: Writing Device Drivers for Newer Kernels (Pete Zaitcev)
new keyword export ("Timo Volkmer")
Re: new keyword export ("Marco Manfredini")
Sources of /usr/lib/libpci.a (Alexander Rezinsky)
Re: strange "mv" bug (Mario Klebsch)
Re: Shared memory, XFree4 and GNOME
Re: Writing Device Drivers for Newer Kernels (Rick Ellis)
Re: Writing Device Drivers for Newer Kernels (Mario Klebsch)
Re: Sources of /usr/lib/libpci.a (Rick Ellis)
Re: file descriptor limitation on linux (Lawrence K. Chen, P.Eng.)
Re: Dealing with core files? (Rick Ellis)
after select() and getc(), puts/printf are different?? ("A derelict Engineer")
Re: is there a port to windows media player? (Rick Ellis)
Re: after select() and getc(), puts/printf are different?? (Kaz Kylheku)
Re: strange "mv" bug (Nix)
kernel-2.4.0-test4 parport module is not working... (Nikos Kalogridis)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (Mike Dowling)
Subject: Re: My own distribution
Date: 18 Jul 2000 16:25:38 GMT
>On Mon, 17 Jul 2000 12:15:55 +0200 Gregor Zor� <[EMAIL PROTECTED]> wrote:
>
>| I would like to make my own Linux distribution cd wich I could share
>| with others.
>
>Why? WHat I'm asking is, are you thinking of some idea or philosophy
>that will make your distribution at least distinct, and for people like
>yourself also better, than what's out there now?
In a sense, I have always had my own distribution. I.e., I have never
used a distribution. The advantage for me is obvious; I know where
everything is and how it is configured.
>You have to first decide what your installation process will be like.
>Then you basically build a CD bootable system.
Yes, well, there's the rub. And that is where my analogy of my system
and a distribution breaks down. A distribution will need to support all
kinds of hardware. I only support what I have. Porting means deciding
what hardware I want to port to, build the appropriate kernel, and
somwhow copy my entire system to the new hardware. This latter part can
be difficult!
>| I would like to make a distribution cd, wich I could take to my friend,
>| and install my distribution on his/her computer. Basicly I would like to
>| hava a distribution cd like let's say Red Hat, just fewer instalation
>| options.
My strategy is sufficient for this. Don't go the the hassle of
supporting everything.
Cheers,
Mike
--
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[29,30]
are valid. If email to mikeN bounces, try mikeN+1.
------------------------------
From: "William F. Simmons" <[EMAIL PROTECTED]>
Subject: Writing Device Drivers for Newer Kernels
Date: Tue, 18 Jul 2000 16:51:05 GMT
I have been studying device drivers recently, and have gone through
Alessandro Rubini's book, George Pajari's book, and Egan &
Teixeira's book. I believe I have the background down fairly well.
I found a very nice article on writing device drivers on the Web
by Michael K. Johnson (now with RedHat). He says very plainly that
the example code in the article will not work on newer kernel
implementations. Rubini mentions this fact too, and the code he
presents is for kernels in the 1.2.13 - 2.0.0 era. I have taken
several bare-bones type skeleton drivers and tried to compile them
as specified in Rubini's book. But when the linker kicks in, it
complains of numerous unresolved and undefined symbols. All of the
undefined symbols come from the kernel header files (they are not
symbols private to the driver). In response, I went through all of
the header files looking for these offending symbol definitions, and
they were already in header files that I had included in the driver
source.
One example of this is "register_chrdev()." ld protested that this
symbol was undefined. Fine, no problem. But I had included
<linux/fs.h> at the top of the driver code. So I figured, that maybe
the definiton was elsewhere in the newer kernel implementations. So I
cd'ed to /usr/include/linux and issued "grep -il 'register_chrdev' *.h"
and grep came back with fs.h and wrapper.h. The actual definition is
located in fs.h.
Why was the linker complaining about underfined symbols that were, in
fact, defined in my include files? Maybe it was the order in which
the header files were cited? I looked at the include files in several
drivers that actually came with the distribution (mem.c, serial.c,
lp.c), and tried to mimmick their order. The result was the same.
I guess the question is this: Does anyone know what has changed since
kernel 2.0.0 that would make previously valid device driver code
(character drivers for the time being) not compile on the newer
kernels? There are all kinds of examples and write ups out there
about device driver code. But it doesn't seem to compile. And what
the H@%# is with these undefined symbols which, incidently, just
happened to have been defined?
Thanks. Sorry for all the hot air.
Willie Simmons
===============================================================================
William F. Simmons (Willie)
SIMTECH
Creators of dbops(R) (Unix Shell DataBase Operators)
6427 Windfern
Houston, Texas 77040
U.S.A.
713/460-5921
[EMAIL PROTECTED]
www.simtech-soft.com
===============================================================================
------------------------------
From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: Writing Device Drivers for Newer Kernels
Date: Tue, 18 Jul 2000 17:09:15 GMT
> [...] But when the linker kicks in, it
> complains of numerous unresolved and undefined symbols. All of the
> undefined symbols come from the kernel header files (they are not
> symbols private to the driver). In response, I went through all of
> the header files looking for these offending symbol definitions, and
> they were already in header files that I had included in the driver
> source.
Linker has nothing to do with header files whatsoever.
Linker symbols are situated in .o files that compiler produces.
> One example of this is "register_chrdev()." ld protested that this
> symbol was undefined. [...]
Something is very rotten with your configuration, I do not even
hazard to guess what. The register_chrdev() works fine for me in
2.4.0 kernels so it is certainly not a kernel version problem.
--Pete
------------------------------
From: "Timo Volkmer" <[EMAIL PROTECTED]>
Crossposted-To: gnu.g++.help,comp.lang.c++,de.comp.gnu,comp.os.linux.development.apps
Subject: new keyword export
Date: Tue, 18 Jul 2000 17:48:32 +0200
Hi everybody,
I am currently working with SuSE-Linux 6.4 and the GCC V2.95.2
This compiler gives me warnings when it detects the word "export" telling me
that this keyword is not implemented and will be ignored.
Is there a way not to have the compiler discard the word from the code but
just leave it in and treat it as an identifier?
I have the problem that I have to use older header files from a third
supplier who uses memberfunctions and variables called "export". Since I can
not change the headerfiles I do not see a way how to use them with my
compiler. I could not find a compiler switch to turn that behaviour off. I
don't need the keyword export at all.
I'd be happy about any advice or hint with this problem - THANKS.
Timo.
mailto:[EMAIL PROTECTED]
------------------------------
From: "Marco Manfredini" <[EMAIL PROTECTED]>
Crossposted-To: gnu.g++.help,comp.lang.c++,de.comp.gnu,comp.os.linux.development.apps
Subject: Re: new keyword export
Date: Tue, 18 Jul 2000 19:39:47 +0200
Either:
add
#define export MyExport
as the very first line in your source files. Now every reference to a thing
named "export" will be compiled as MyExport
Or:
compile like that: gcc -c -Dexport=MyExport some_file.cc
does the same
----
Marco
------------------------------
From: Alexander Rezinsky <[EMAIL PROTECTED]>
Subject: Sources of /usr/lib/libpci.a
Date: 18 Jul 2000 17:27:57 +0300
Hi,
Where can I find sources of the /usr/lib/libpci.a library?
AFAIK it isn't part of glibc.
Thanks,
Alex
------------------------------
From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: strange "mv" bug
Date: Tue, 18 Jul 2000 18:25:03 +0200
Robert Lynch <[EMAIL PROTECTED]> writes:
>[EMAIL PROTECTED] wrote:
>>
>> It appears in Linux (Slackware 7.0 with 2.2.16 in this case, but also
>> in Redhat 6.0 with 2.2.10):
>>
>> phil@procyon:/home/phil 2> ls -ld d f1 f2
>======
>Works for me on RH 6.2:
Does not work on my self compiled Linux system. My mv(1) is taken from
fileutils-4.0.
73, Mario
--
Mario Klebsch [EMAIL PROTECTED]
PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB 1483 30CE 9FB2 A047 9CE0
Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5 8B98 9464 53FF 9382 F518
------------------------------
From: <[EMAIL PROTECTED]>
Subject: Re: Shared memory, XFree4 and GNOME
Date: Tue, 18 Jul 2000 18:30:10 GMT
It looks like Xfree 4.0.1 helps this problem a lot. I'm down to less than
100 segments now instead of maxing out at 128.
Curtis
Marc D. Williams wrote:
>
>
> On Thu, 15 Jun 2000 18:30:45 GMT, <[EMAIL PROTECTED]> wrote:
> >I'm running kernel 2.2.16, Xfree86 4.0 and GNOME 1.2. I've noticed that
X
> >and GNOME use a hell of a lot of shared memory segments. In fact, they
max
> >out at 128 which is the maximum allowed under my kernel. I then get
shmget:
> >failed messages everywhere. First of all, are these guys supposed to use
> >this many shared memory segments? Each GNOME process uses 5 or 6 of them
> >and X uses about 20 - 25. Second of all, how do I increase the maximum
> >without totally screwing up my kernel.
> >
> I wonder, I'm using kernel 2.0.38, XF86 3.3.3.1 and GNOME 1.0x and have
> the same problems.
> Everything was working fine with the GNOME 1.0x stuff. I then moved up
> to 1.2 and everything was jacked up. Most every part of GNOME would not
> start or run, got a lot of the shmget failures.
> Even older programs like ee would crash.
> Wasn't sure who the actual culprit was so I messed with it nightly
> for days. Frustrated I got rid of everything and went back to my
> old setup (GNOME 1.0x, gtk/glib 1.2.6) but wouldn't you know it, it's
> also hosed. Nothing works.
>
> Started narrowing it down to gdk but wasn't sure.
> Moving away from GNOME I compiled the latest XFce (3.4.0) and lo and
> behold the xfce panel also crashes, without a useful error message.
> Strace output showed an shmget error.
> Recompiled it without imlib support and it runs fine.
> Did an ldd on several of the programs that won't run and notice all
> of them use gdk_imlib.
>
> The problem is with gdk_imlib or gdk proper I suppose. Just not sure
> why I didn't have this problem before but get it now, seeing as how
> I'm using all the old stuff I was running before.
> On the other hand, though, xzgv works fine and it uses gdk_imlib.
> Only diff between it and the failing programs is it doesn't
> use gnome but then neither does xfce.
> I am so confused. :-/
>
> Checking the gnome bug and mailing lists I don't see a lot about
> this but I do remember the enlightenment list had a lot of
> posts about this shared memory problem.
>
> --
> >>ANIME SENSHI<<
>
> Marc D. Williams
> [EMAIL PROTECTED]
> http://www.oldskool.org/~tvdog/ -- DOS Internet & Tandy 1000
> http://www.geocities.com/SiliconValley/Platform/8269/ -- Win3.x Makeover
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
From: [EMAIL PROTECTED] (Rick Ellis)
Subject: Re: Writing Device Drivers for Newer Kernels
Date: 18 Jul 2000 19:42:42 GMT
In article <ZV%c5.73$XL5.1626@insync>,
William F. Simmons <[EMAIL PROTECTED]> wrote:
>But when the linker kicks in
You shouldn't be linking at all. All you want is the .o file. Use
the -c option on gcc.
--
http://www.fnet.net/~ellis/photo/linux.html
------------------------------
From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: Writing Device Drivers for Newer Kernels
Date: Tue, 18 Jul 2000 20:30:52 +0200
[EMAIL PROTECTED] (Pete Zaitcev) writes:
>> One example of this is "register_chrdev()." ld protested that this
>> symbol was undefined. [...]
>Something is very rotten with your configuration, I do not even
>hazard to guess what.
Perhaps versioned symbols?
73, Mario
--
Mario Klebsch [EMAIL PROTECTED]
PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB 1483 30CE 9FB2 A047 9CE0
Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5 8B98 9464 53FF 9382 F518
------------------------------
From: [EMAIL PROTECTED] (Rick Ellis)
Subject: Re: Sources of /usr/lib/libpci.a
Date: 18 Jul 2000 20:13:01 GMT
In article <[EMAIL PROTECTED]>,
Alexander Rezinsky <[EMAIL PROTECTED]> wrote:
>Where can I find sources of the /usr/lib/libpci.a library?
>AFAIK it isn't part of glibc.
http://atrey.karlin.mff.cuni.cz/~mj/pciutils.html
--
http://www.fnet.net/~ellis/photo/linux.html
------------------------------
From: Lawrence K. Chen, P.Eng. <[EMAIL PROTECTED]>
Subject: Re: file descriptor limitation on linux
Date: Tue, 18 Jul 2000 20:06:44 GMT
In article <8kfr71$e9h$[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Myke Morgan) wrote:
> I found an answer on this web site:
>
> http://www.volano.com/linux.html
>
> You can easily change the limits on-the fly. RedHat 6.1/6.2 for sure
that
> I know of.
>
>
It works!....after I realized that I had typed 'filenos' instead of
'fileno' in /etc/security/limits.conf
Now I wonder if there's a rule on how the numbers are chosen, so I can
document it and leave it to the user to pick appropriate numbers for
his/her system.
--
Me: Lawrence K. Chen, P.Eng. Email: [EMAIL PROTECTED]
Open Text, BASIS Division ICQ: 12129673
5080 Tuttle Crossing Blvd. Phone: 614-761-7449 Fax: 761-7269
Dublin, OH 43016 URL: http://www.opentext.com/basis
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: [EMAIL PROTECTED] (Rick Ellis)
Subject: Re: Dealing with core files?
Date: 18 Jul 2000 20:40:44 GMT
In article <[EMAIL PROTECTED]>,
Kenneth J. Ingram <[EMAIL PROTECTED]> wrote:
>What tools are available to debug core files? I recall a couple of tools
>in AIX but I can't remember the name.
gdb
------------------------------
From: "A derelict Engineer" <[EMAIL PROTECTED]>
Subject: after select() and getc(), puts/printf are different??
Date: Tue, 18 Jul 2000 13:51:03 -0700
I'm trying to read data from the keyboard, using select() and getc()
(because my actual application has to monitor several outputs).
I have the terminal set to non-canonical mode, so it doesn't buffer the
inputs, and returns immediately. It took me awhile to even establish that,
and the reason I've had trouble is that I was trying to print the returned
character, but neither putchar() nor printf("%c") will produce an output
immediately (their output is delayed one keystroke)!! Yet puts() and
printf("%s") produce correct results immediately!!
Thus, with the print statements shown below in process_kbd(), I see the
following results when I type 'dere' :
calling wait_on_inputs
entering main loop...
?64!64
dd?65!65
ee?72!72
rr?65!65
Notice that after the first character was typed, the two string-printing
statements showed output immediately, but the two character-printing
statements didn't show output until the next character was received!!
Does *anyone* know what's going on here?? I have both ECHO and ICANON
disabled for stdin via tcsetattr(), but have not modified stdout at all. I
am VERY confused!!
Dan Miller
file://*******************************************************************
int check_io (int serfd, int kbdfd, int msec_timeout)
{
// setting up fds, timeout, etc deleted for brevity
// call select() to wait on inputs
result = select (i + 1, &fds, NULL, NULL, &tv) ;
if (result > 0) {
n = 1 * (FD_ISSET (serfd, &fds) > 0)
+ 2 * (FD_ISSET (kbdfd, &fds) > 0);
}
return (n);
}
file://*******************************************************************
int wait_on_inputs (void)
{
char buf[256], *ptr;
int x, blen;
/* Main loop */
while (1) {
// setting up fds, timeout, etc deleted for brevity
// call select() to wait on inputs
result = select (i + 1, &fds, NULL, NULL, &tv) ;
if (result > 0) {
n = 1 * (FD_ISSET (serfd, &fds) > 0)
+ 2 * (FD_ISSET (kbdfd, &fds) > 0);
}
// handle inputs from keyboard
if (n & 2) {
// read(STDIN_FILENO, &buf[0], 1) ;
buf[0] = getc(stdin) ;
process_kbd (buf[0]);
}
}
}
file://*******************************************************************
// process input keystrokes.
file://*******************************************************************
void process_kbd (int invalue)
{
switch (invalue) {
case 'q':
finish (0); // this does not return...
break;
default:
printf("?%02X", (char) invalue) ;
sprintf(tempstr, "!%02X", (char) invalue) ;
puts(tempstr) ;
printf("%c", (char) invalue) ;
putchar((char) invalue) ;
break;
}
}
------------------------------
From: [EMAIL PROTECTED] (Rick Ellis)
Crossposted-To:
comp.os.linux.development.apps,comp.os.linux.misc,comp.os.linux.setup,comp.os.linux.x
Subject: Re: is there a port to windows media player?
Date: 18 Jul 2000 21:00:34 GMT
In article <[EMAIL PROTECTED]>,
Stewart Honsberger <[EMAIL PROTECTED]> wrote:
>>Perhaps, but there are plenty of .asp only sources on the net.
>Check http://www.shoutcast.com - you'll find literally hundreds of streaming
>MP3 servers. Pick and choose according to genre, bandwidth, and bitrate.
How would that solve his desire to listen to a source that is only asp?
--
http://www.fnet.net/~ellis/photo/linux.html
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: after select() and getc(), puts/printf are different??
Reply-To: [EMAIL PROTECTED]
Date: Tue, 18 Jul 2000 21:32:33 GMT
On Tue, 18 Jul 2000 13:51:03 -0700, A derelict Engineer <[EMAIL PROTECTED]>
wrote:
>I'm trying to read data from the keyboard, using select() and getc()
>(because my actual application has to monitor several outputs).
Mixing stdio with multiplexing operations on low level descriptors is possible,
but requires special consideration.
>I have the terminal set to non-canonical mode, so it doesn't buffer the
>inputs, and returns immediately.
That is very well, however, the output through the standard I/O library
is still buffered.
> It took me awhile to even establish that,
>and the reason I've had trouble is that I was trying to print the returned
>character, but neither putchar() nor printf("%c") will produce an output
>immediately (their output is delayed one keystroke)!! Yet puts() and
>printf("%s") produce correct results immediately!!
I don't believe that is the case for printf("%s") unless it has some weird bug.
The ANSI C language standard requires that stdout and stderr be line buffered
when they are connected to interactive devices. A line buffered stream flushes
its buffer to the operating system when the buffer fills up, or whenever a
newline character is output.
The puts function adds a newline to its output, so it would trigger a flush.
You can cause a flush at any time using the fflush() function.
You can also disable buffering using the setvbuf function.
--
#exclude <windows.h>
------------------------------
From: Nix <$}xinix{[email protected]>
Subject: Re: strange "mv" bug
Date: 18 Jul 2000 22:02:55 +0100
[EMAIL PROTECTED] (Kaz Kylheku) writes:
> Perhaps there are filesystems out there where hard links cannot cross
> directory boundaries, so this algorithm is needed.
Yes; AFS and Coda, to name but two.
--
`I can guarantee it's no problem in my network, and if I don't get some
sleep soon, I'll guarantee it will become a problem in your network.'
--- Chris `Saundo' Saunderson deals with a late-night phone call
------------------------------
From: Nikos Kalogridis <[EMAIL PROTECTED]>
Subject: kernel-2.4.0-test4 parport module is not working...
Date: Tue, 18 Jul 2000 22:59:16 +0100
I recently updated my kernel from 2.4.0-test2 to test4 and the following
problem occurs. The parport module although compiled normally together
with the parport_pc module (I have a RH 6.2 tailored to my taste more or
less) does not seem to work. After doing a modprobe parport_pc and
according to the kernel logging messages loading normally the parport
module does not seem to call the client modules that are registered in
the parport interface to take control of the new port(s) found. I tried
that both with plip, lp, and other modules with no success. Does anyone
has the same problem with me?
Here is the log messages that I am getting when I do 'modprobe
parport_pc':
Winbond Super-IO detection, now testing ports 3F0,370,250,4E,2E ...
SMSC Super-IO detection, now testing Ports 2F0, 370 ...
0x378: FIFO is 16 bytes
0x378: writeIntrThreshold is 16
0x378: readIntrThreshold is 16
0x378: PWord is 8 bits
0x378: Interrupts are ISA-Pulses
0x378: ECP port cfgA=0x10 cfgB=0x40
0x378: ECP settings irq=<none or set by other means> dma=<none or set by
other means>
parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE,COMPAT,ECP]
parport0: irq 7 detected
parport0: cpp_mux: aa55f00f52ad51(86)
parport0: cpp_daisy: aa5500ff(80)
parport0: assign_addrs: aa5500ff(80)
parport0: cpp_mux: aa55f00f52ad51(86)
parport0: cpp_daisy: aa5500ff(80)
parport0: assign_addrs: aa5500ff(80)
and then when I do a 'modprobe lp' the following appears:
lp: driver loaded but no devices found
Thanks for your help
Nikos Kalogridis
------------------------------
** 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
******************************