Linux-Development-Sys Digest #59, Volume #7 Mon, 16 Aug 99 22:14:17 EDT
Contents:
Re: Problem with device driver. HELP (Kaz Kylheku)
Re: want to keep eth0 as eth0... really. ("Ted Pavlic")
Re: Async IO and X (Matthias Kilian)
Problem with device driver. HELP ([EMAIL PROTECTED])
Printing in Linux ("Norm Dresner")
Re: want to keep eth0 as eth0... really. (joh jae chul)
Re: My first linux program: non-bios boot loader (Neil Koozer)
Re: reading kernel symbols (H. Peter Anvin)
Re: Deadly optimization bug (all versions!) (Kaz Kylheku)
OT: OO OSs (Re: Troll (was: why not C++?)) ("Joshua D. Boyd")
Re: Help: Shared Memory!! (Nix)
Re: does egcs 1.1.2 produce stable kernels? (Nix)
Re: creating a Unix domain socket file? (Nix)
Re: Linux assembly, etc (Nix)
Re: buffers? (Nix)
Re: Async IO and X (Tristan Wibberley)
shared libraries and RH 6.0 ("James E. Rowley")
Re: reg support of FAT32 on linux kernel 2.2.5-15 ("Charles Sullivan")
Re: why not C++? (Christopher B. Browne)
----------------------------------------------------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Problem with device driver. HELP
Date: Tue, 17 Aug 1999 00:04:22 GMT
On Mon, 16 Aug 1999 21:49:45 GMT, Peter Pointner <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] wrote:
>> When i try to compile this charter device driver i get this error:
>> pbus.c: In function `pb_open':
>> pbus.c:70: wrong type argument to bit-complement
>
>> Here is the code:
>> while((lock[dev] >> func) & 1) {
>> interruptible_sleep_on(&pb_WaitQ);
>> line 70-> if(current->signal & ~current->blocked) {
>> MOD_DEC_USE_COUNT;
>> return -EINTR;
>> }
>> }
>> What is wrong?
>
>You are using a 2.2.x kernel? Then use
> if (signal_pending(current))
>instead of your code. AFAIK current->blocked has been changed
>to an array to make more than 32 signals possible, and ~ can't
>be used on that.
Also, what about the possible race between testing the condition and sleeping?
I.e. what if the condition ``(lock[dev] >> func) & 1'' becomes false after it
is tested but before suspension? What then? The problem is that
interruptible_sleep_on both enqueues the task and calls the scheduler in one
operation. If the wake up goes off before the task is enqueued, it will be
missed.
------------------------------
From: "Ted Pavlic" <[EMAIL PROTECTED]>
Subject: Re: want to keep eth0 as eth0... really.
Date: Mon, 16 Aug 1999 15:48:14 -0400
Investigate adding an append to your lilo.conf... like:
append="ether=irq,base,eth0 ether=irq,base,eth1"
Or just deal with the on-board being eth1 and attach your network cables
appropriately. :)
That's about the best idea I have for you.
All the best --
Ted
joh jae chul <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi, all.
> I have 3c905b ethernet card on board. When I installed additional 3c905b
> card on pci slots, the on board became eth1. I'd like to keep on board
> one as eth0.
>
> My temporary solution for that was to modify device driver (3c59x.c)
> assuming that <pci_bus, pci_device_fn> pair is unique on a machine.
> I pcibios_find_class() and save pci_bus and pci_device_fn values in
> arrays. And then, do the rest of the stuff ( request_irq, memory
> allocation, etc ) while "making sure that this is done for the on board
> card first".
>
> But, how do I know which <pci_bus, pci_devie_fn> pair stands for the on
> board card? I tested on 2 machines, they seem that pci_bus = 0x00,
> pci_device_fn = 0x88 are for on board card. But, is it *always* so? Or,
> is there other ways? For example, is there a flag that stands for "on
> board" card?
>
> I have 40 more machines forming a cluster, and I'd like to make sure it's
> okey before working on the cluster.
>
> Thanks in advance.
>
------------------------------
From: [EMAIL PROTECTED] (Matthias Kilian)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Async IO and X
Date: 16 Aug 1999 21:55:18 GMT
I'm not an Xpert, but couldn't you use XtAppAddInput?
Kili
------------------------------
From: [EMAIL PROTECTED]
Subject: Problem with device driver. HELP
Date: Mon, 16 Aug 1999 20:39:18 GMT
When i try to compile this charter device driver i get this error:
pbus.c: In function `pb_open':
pbus.c:70: wrong type argument to bit-complement
Here is the code:
while((lock[dev] >> func) & 1) {
interruptible_sleep_on(&pb_WaitQ);
line 70-> if(current->signal & ~current->blocked) {
MOD_DEC_USE_COUNT;
return -EINTR;
}
}
What is wrong?
- David Belius
------------------------------
From: "Norm Dresner" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Printing in Linux
Date: 16 Aug 1999 21:02:04 GMT
I need to write a c-program to print to the "default" printer which is
usually (and the Printing-HOWO confirms this) denoted as the device "lp".
But /proc/lp contains no device lp. The printer is installed and working.
I can print from a file with the "lp <filename>" command and if I
explicitly code the device name "/dev/lp0" into the program it will also
print correctly.
The main question is how can I tell if any printer is installed from a
c-program and what to call it when I open it for writing?
Thanks
Norm
------------------------------
From: joh jae chul <[EMAIL PROTECTED]>
Subject: Re: want to keep eth0 as eth0... really.
Date: Mon, 16 Aug 1999 18:40:46 -0500
On Mon, 16 Aug 1999, Ted Pavlic wrote:
> Investigate adding an append to your lilo.conf... like:
>
> append="ether=irq,base,eth0 ether=irq,base,eth1"
This isn't working because irq and/or base address change depending on
which slot the additional card sits on.
>
> Or just deal with the on-board being eth1 and attach your network cables
> appropriately. :)
This is not very good either because the sysadmin - not me - uses
KickStart to manage the cluster - looks like it keeps hw addresses of the
default ethernet card on each machine. So, whenever the order of ethx
changes, more things than moving the cable are involved.
Moreover, we plan to put more cards on each machine, which would force me
/ sysadmin to do extra work.
More importantly, we are writing own device driver and want to keep the on
board one for ip stack until our driver supports ip, too.
Thanks for your comment.
Jae
>
> All the best --
> Ted
>
> joh jae chul <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > Hi, all.
> > I have 3c905b ethernet card on board. When I installed additional 3c905b
> > card on pci slots, the on board became eth1. I'd like to keep on board
> > one as eth0.
> >
> > My temporary solution for that was to modify device driver (3c59x.c)
> > assuming that <pci_bus, pci_device_fn> pair is unique on a machine.
> > I pcibios_find_class() and save pci_bus and pci_device_fn values in
> > arrays. And then, do the rest of the stuff ( request_irq, memory
> > allocation, etc ) while "making sure that this is done for the on board
> > card first".
> >
> > But, how do I know which <pci_bus, pci_devie_fn> pair stands for the on
> > board card? I tested on 2 machines, they seem that pci_bus = 0x00,
> > pci_device_fn = 0x88 are for on board card. But, is it *always* so? Or,
> > is there other ways? For example, is there a flag that stands for "on
> > board" card?
> >
> > I have 40 more machines forming a cluster, and I'd like to make sure it's
> > okey before working on the cluster.
> >
> > Thanks in advance.
> >
>
>
>
>
------------------------------
From: Neil Koozer <[EMAIL PROTECTED]>
Subject: Re: My first linux program: non-bios boot loader
Date: Sun, 15 Aug 1999 11:50:30 +0000
"H�rst Christian Wimmer-Rue" wrote:
>
> I don't know who initiated the thread, but the author of the boot-loader
> should go to www.uruk.org/grub and look at some of the docs there. The
> pages haven't been updated in a long time, but there is some meaty info
> there.
>
> BTW, grub means (GR)and (U)nified (B)oot-loader for those not familiar with
> it.
Is that the correct URL? Netscape can not connect to it. It just hangs
forever while trying.
I'm wondering if grub transparently works for new users whose machines
hit the "LI" or "L 01 01..." problem. I've seen hundreds of these
messages, but not one reply stating that grub would fix the problem.
We're talking new users who have no reason to suspect that it's anything
to do with disk drives.
Neil.
p.s. I originated the thread. Several more boot loaders came out of the
woodwork during this thread. Perhaps all authors could check the others
for ideas.
------------------------------
From: [EMAIL PROTECTED] (H. Peter Anvin)
Subject: Re: reading kernel symbols
Date: 15 Aug 1999 21:58:06 GMT
Reply-To: [EMAIL PROTECTED] (H. Peter Anvin)
Followup to: <[EMAIL PROTECTED]>
By author: Robin Becker <[EMAIL PROTECTED]>
In newsgroup: comp.os.linux.development.system
> >
> >The kernel knows its own symbols. See /proc/ksyms
> so what is all the stuff about Loaded xxxx symbols from
> /boot/System.map-vvvv which appears in my boot messages. Don't these
> come from klogd?
>
Yes; it turns out only *important* symbols (needed for modules) are in
/proc/ksyms, so once /boot/System.map is available, it augments the
set.
-hpa
--
<[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: gnu.gcc.help,gnu.gcc.bugs
Subject: Re: Deadly optimization bug (all versions!)
Date: Tue, 17 Aug 1999 00:01:22 GMT
On Mon, 16 Aug 1999 23:21:58 GMT, James Yang <jamesy@ottoman.> wrote:
>
>
>
>Interesting enough, -O3 on x86 with egcs 1.1.2 and gcc 2.7.2.3 generate
>the proper code. But I do duplicate your results on both with -O and -O2.
That's probably because the function calls are probably inlined with -O3 so the
optimization is done differently. So the code just does the equivalent
of:
printf("ret=%d\n", 0);
printf("ret=%d\n", 1);
printf("ret=%d\n", 1);
Too bad it's not smart enough to do
puts("ret=0\nret=1\nret=1");
:)
------------------------------
From: "Joshua D. Boyd" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: OT: OO OSs (Re: Troll (was: why not C++?))
Date: Tue, 17 Aug 1999 00:32:12 GMT
Timo Tossavainen wrote:
> <take with a grain of salt>
> How about a paradigm shift ? Let's write a Lisp OS, where the Lisp environment
> is the OS and throw away all the old buggy C code. Let's throw in
> multiprocessing, hard realtime GC and scheduling and why not orthogonal
> persistence while we're at it. Come to think of it this should have been done
> ages ago... =) I'd be a happy user.
> </take with a grain of salt>
>
> The point being: If you want to do that, write a new OS and do it with pure
> OO concepts from the very beginning. I don't see the benefit in trying to
> force OO on a UNIX mindset. It won't work, you're better off with a new OS.
> Maybe you could build some sort of OO system on top of the mach microkernel
> in HURD and skip some of the devious stuff... I think it's designed for that
> sort of thing. BTW, you could take a look at the academic OS research. There
> are a lot of operating systems that have all sorts of nice OO capabilities.
I've frequently wondered why other OSs don't become more popular. I'm use linux
almost exclusivly at home (I also have BeOS installed, which I do use, and Windows,
which is only used to play games, but I usually don't since the effort of rebooting
just to game is too much), and I've frequently wished for more modern OSs. I know
they are out there, but when ever I read about one, I usually also find that it is too
early in development. For profit I do database programming, and for fun, I write
heavy duty media programs (or at least attempt to). What I do for fun is really
pushing
the edges of linux, let alone stuff like Plan9 or GNU/Hurd, and since I don't have the
skill or desire to do systems programming, I'm stuck using more established stuff.
I was quite excited when finally a version of BeOS came that would run on my hardware,
but I was quickly quite disappointed by the network services. It probably is a picky
point to complain about their primitive web browser, but I found myself needing to
reboot to linux anytime I needed to get something from the web, which isn't good if you
hate rebooting like I do. Also, I had trouble with networked file access (i'm told
that is fixed in the latest version which I haven't yet installed), which made getting
files to work from the server a real pain. Finally, I was disappointed by the fact
that it wasn't really a multiuser system.
On linux, for some tasks, I wish I had a pervasively object oriented system like BeOS
or NeXTStep, or many other less developed systems, but for various reasons, I was never
able to use them, or was unsatisfied. Don't get me wrong, I love linux, but I am
frequently left wondering if it couldn't be much more powerfull is wasn't lugging
all of the unix legacy behind. Stuff like BeOSs file system look really cool, not to
mention the NeXTStep display system (if only it could operate remotely like X11 does),
or the way ActiveX and OLE provides services (I think the implementations is awefull,
but I've never seen stuff like corba do the things that I do with ActiveX). Hopefully
someday soon peope will take something like Hurd, or Linux, or other free OS and turn
it into a more modern OS that is just as flexible as Linux, Irix, or Solaris is (I
don't consider *BSD, Windows NT, NeXTStep/OpenStep/MacOSX, or BeOS to be as flexible.
Each of those either lacks in the workstation arena or the server arena).
--
Joshua D. Boyd
http://catpro.dragonfire.net/joshua
------------------------------
From: Nix <$}xinix{[email protected]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Help: Shared Memory!!
Date: 16 Aug 1999 13:05:43 +0100
[EMAIL PROTECTED] writes:
> I wrote a set of patches for mmalloc a while back
> that let you do this in a much more natural way.
> Basically, all your applications share a persistent
> shared file, and can use malloc/free-like semantics
> to allocate and deallocate blocks of mmapped
> memory from this file. When the applications go
> away (and even when the machine is turned off)
> the shared memory/file stays around.
Sounds just like the RVM that coda uses (see
http://www.coda.cs.cmu.edu/).
--
`The plague, dirt, lack of running water, illiteracy, ignorance, and
oppressive political and social systems are what made the dark ages what
they were.' --- Gus Hartmann in the Monastery
------------------------------
From: Nix <$}xinix{[email protected]>
Subject: Re: does egcs 1.1.2 produce stable kernels?
Date: 16 Aug 1999 13:01:20 +0100
[EMAIL PROTECTED] (Philip Brown) writes:
[gcc-2.95]
> it's still below contempt for non-linux systems. gee, i wonder what the
> primary development platform isi...
If you count the `primary development platform' as what the project
leader is using, then HP-UX 11 (IIRC).
HTH.
--
`The plague, dirt, lack of running water, illiteracy, ignorance, and
oppressive political and social systems are what made the dark ages what
they were.' --- Gus Hartmann in the Monastery
------------------------------
From: Nix <$}xinix{[email protected]>
Subject: Re: creating a Unix domain socket file?
Date: 16 Aug 1999 13:18:46 +0100
"Tim Sell" <[EMAIL PROTECTED]> writes:
> How do I create a "socket special file"? For example, /dev/printer and
> /dev/log look like this:
> 4719 srw-rw-rw- 1 root root 0 Aug 10 08:18 /dev/log=
> 4673 srwxrwxrwx 1 root root 0 Feb 9 1999
> /dev/printer=
>
> How would I create such files? (I'm looking for something like mkfifo or
> mknod.)
bind() creates it magically when called for an AF_UNIX socket.
--
`The plague, dirt, lack of running water, illiteracy, ignorance, and
oppressive political and social systems are what made the dark ages what
they were.' --- Gus Hartmann in the Monastery
------------------------------
From: Nix <$}xinix{[email protected]>
Subject: Re: Linux assembly, etc
Date: 16 Aug 1999 12:25:55 +0100
[Newsgroups trimmed]
[EMAIL PROTECTED] (Alexander Viro) writes:
> UNIX assumes two protection levels.
> Which is all that x86 gives, BTW - 4 rings are there only if you are working
> with segments.
? Reading the 386 Programmer's Reference Manual I can't see this.
ISTM that there are always rings 0-3... it is true that most of this is
tied up with selectors, but one-selector-per-shared-lib could
work. (That said, that isn't done in Linux, is it?)
--
`The plague, dirt, lack of running water, illiteracy, ignorance, and
oppressive political and social systems are what made the dark ages what
they were.' --- Gus Hartmann in the Monastery
------------------------------
From: Nix <$}xinix{[email protected]>
Subject: Re: buffers?
Date: 16 Aug 1999 13:34:26 +0100
[EMAIL PROTECTED] (James Stevenson) writes:
> i have a question on bufferes under linux
> is it not meant to slowly write the bufferes to disk
> when the system is idle for a certin amount of time
> or is there a way of doing this?
Linux < 2.2.11 does this with `update'.
Later versions have a kernel thread (kupdate) and need no userspace help
to do this.
It's tuneable via /proc/sys/vm/bdflush.
--
`The plague, dirt, lack of running water, illiteracy, ignorance, and
oppressive political and social systems are what made the dark ages what
they were.' --- Gus Hartmann in the Monastery
------------------------------
From: Tristan Wibberley <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Async IO and X
Date: Sun, 15 Aug 1999 20:38:34 +0100
Reply-To: [EMAIL PROTECTED]
Nils Henrik Lorentzen wrote:
>
> Tristan Wibberley wrote:
> >
> > Nils Henrik Lorentzen wrote:
> > >
> > > Hi,
> > >
> > > I am working on an application, where I have to do async IO on X.
> > > Ie, I can't use XNextEvent(). So I set the FASYNC flag for the
> > > X display connection, and handle the SIGIO signals.
> > > However, there is one problem: SIGIO signals are also generated when I
> > > do rendering operations (ie. writes to the display connection).
> > > This greatly decreases the speed of rendering a lot.
> > > Is there a way so that I would get SIGIO only when data is
> > > available for reading (ie. X input events) ?
> > > Or maybe there is some other way to handle this ?
> >
> > You can come close (and probably more processor efficient). You need to
> > fork a process which selects for the connections readability, when
> > select returns you check that it was because the socket became readable
> > and signal the first process - then loop.
> >
> > This will give a *very* small period where input will not be immediately
> > signalled, but the process *will* be signalled no more that a few
> > milliseconds later.
>
> Hmm.., will this work ? What I mean is, does the forked process
> inherit the parent process' file descriptors, so I can access the
> display connection from the child process ?
Yes it does (FYI, it doesn't inherit any locks). If I remember X
protocol details correctly (I don't have documentation in front of me),
your rendering performance is slowed down by the server returning
success codes. This means that the second process must filter out the
return codes and send them through a pipe to the original, this then
stops Xlib from working.
So now that I think more, the original idea wont work.
So I suggest opening two connections and using one to draw, and the
other to receive events (create an input window which covers the visible
one). Keep this window over the drawing one. This is now getting ugly -
you can't use a standard toolkit.
Why do you need ASYNC IO - like behaviour? Perhaps there is a better
alternative? I don't think X was intended for this.
--
Tristan Wibberley
------------------------------
From: "James E. Rowley" <[EMAIL PROTECTED]>
Subject: shared libraries and RH 6.0
Date: Mon, 16 Aug 1999 21:18:31 GMT
I have two simple c files, Fopen.c and foo.c
$ cat Fopen.c
#include <stdio.h>
FILE *File_open(char *path, char *mode)
{
FILE *f;
if ((f = fopen(path, mode)) == NULL) {
fprintf(stderr, "Error opening %s\n", path);
exit(1);
}
return f;
}
$ cat foo.c
#include <stdio.h>
extern FILE *File_open(char *path, char *mode);
main ()
{
char s[1024];
FILE *file = File_open("tmp.foo", "r");
fscanf(file, "%s", &s);
printf("s='%s'\n", s);
fclose(file);
return 0;
}
If I:
1 compile Fopen.c
gcc -fpic -shared -c -O2 -o Fopen.o Fopen.c
2 archive Fopen.o with "ar"
ar crs libFopen.a Fopen.o
3 use "ld" to make a shared library.
ld -shared --whole-archive -o libFopen1.so libFopen.a
4 compile and link foo.c with the shared library
gcc -O2 -o foo1 foo.c -L. -Wl,-rpath,. -lFopen1
then the executable "foo1" dumps core when all of these steps are done
under Red Hat 6.0 If they are done under Red Hat 5.2, the executable
runs and does not dump core. Also, if I skip step #2 above and make the
.so file directly from the .o file, the resulting executable doesn't
dump core under 6.0
Here's the result of running gdb on the executable under RH 6.0
Starting program: /n/d3/jer/abney/foo1
s='hi'
Program received signal SIGSEGV, Segmentation fault.
0x40066a70 in _IO_new_fclose (fp=0x8049738) at iofclose.c:45
iofclose.c:45: No such file or directory.
(gdb) where
#0 0x40066a70 in _IO_new_fclose (fp=0x8049738) at iofclose.c:45
#1 0x8048597 in main ()
#2 0x4002dcb3 in __libc_start_main (main=0x8048558 <main>, argc=1,
argv=0xbffff814, init=0x80483f8 <_init>, fini=0x80485dc <_fini>,
rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffff80c)
at ../sysdeps/generic/libc-start.c:78
Any ideas?
- jim
------------------------------
From: "Charles Sullivan" <[EMAIL PROTECTED]>
Crossposted-To: redhat.config,redhat.kernel.general
Subject: Re: reg support of FAT32 on linux kernel 2.2.5-15
Date: Mon, 16 Aug 1999 21:15:14 -0400
How are you trying to mount your FAT 32 partition? You
(as root) should be using something like:
mount -t vfat /dev/hda1 /dosc
where /dev/hda1 is your FAT 32 partition and /dosc is
an existing empty directory (pick whatever name you like).
(There have been a few messages lately in the various
Linux newsgroups which suggest using
mount -t fat32 ...
but that is nonsense! )
sarfaraz kazi wrote in message ...
>i have win 98 and linux 6.0 with kernel 2.2.5-15 but the kernel does not
>supports fat32 and my win 98 runs on fat32 can anybody guide me what to do
>to fix it?
>sarfaraz
>
>------------------ Posted via CNET Linux Help ------------------
> http://www.searchlinux.com
------------------------------
From: [EMAIL PROTECTED] (Christopher B. Browne)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: why not C++?
Reply-To: [EMAIL PROTECTED]
Date: Tue, 17 Aug 1999 01:47:38 GMT
On Mon, 16 Aug 1999 20:50:43 -0400, Frank V. Castellucci
<[EMAIL PROTECTED]> posted:
>>GCC has represented a stable C compiler for many years now, and may
>>be considered mature.
>>
>>G++ has not represented a stable C++ compiler for a terribly long time.
>>There is no question of it being "mature" yet.
>>
>>The OS can only be as stable as the compiler is mature.
>
>Yes, and I have seen the comments in the kernel code defering to bugs in the
>compiler. We all have written "work-arounds" to overcome a weakness we may
>find in our choice of compilers.
Yes, and the maturity of GCC for C means that the kernel folk can
expect their understanding of how GCC generates code to be at least
somewhat meaningful.
>>If you want to have an OS written in C++, then it makes sense to start
>>designing a C++-based OS kernel.
>
>I think that was the original authors starting point.
... A starting point that doesn't relate to comp.os.linux.*, which
represents the set of newsgroups in which the notion is being
proposed.
comp.os.research would be a far better place to post proposals about
the idea of developing a new OS written in C++.
--
We all live in a yellow subroutine, a yellow subroutine, a yellow subroutine...
[EMAIL PROTECTED] <http://www.ntlug.org/~cbbrowne/lsf.html>
------------------------------
** 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
******************************