Linux-Development-Sys Digest #642, Volume #7 Wed, 1 Mar 00 23:13:17 EST
Contents:
Re: Binary compatibility: what kind of crack are they smoking? (Gregory Neil Bastow)
Re: Electric Fence for C++ ??? (Tom Glass)
Re: GCC and EGCS, SuSE say they can co-exist, I don't see how - Thanks Guys, Now I
understand (Robin Collins)
Re: complex math in a device driver ("Dan Miller")
Problems in System Load Measurement (Aki T Immonen)
Re: Struct size and allocate problem! need help. (Kevin Smith)
Re: Semaphore quustion ... part 2!! Bug ? ("Lawrence K. Chen, P.Eng.")
Re: [Q] How to change the max. amount of open files ("Lawrence K. Chen, P.Eng.")
Re: bug: same dir content after changing disks (Rob Komar)
Backing out of ext3 filesystem (C. Chan)
rmmod -a does not remove unused modules! ("Beno�t Cousson")
Logitech Srollpoint ("Leif Erik Tronstad Svan�")
Re: Struct size and allocate problem! need help. (Charles Bryant)
Re: Binary compatibility: what kind of crack are they smoking? (Christopher Browne)
Re: Why a file system ? (Christopher Browne)
unresolved Symbols in modules (nilesh patel)
----------------------------------------------------------------------------
From: Gregory Neil Bastow <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.advocacy,comp.os.linux.setup
Subject: Re: Binary compatibility: what kind of crack are they smoking?
Date: 1 Mar 2000 17:34:21 GMT
In comp.os.linux.development.system Mario Klebsch <[EMAIL PROTECTED]> wrote:
: [EMAIL PROTECTED] (Stephen Harris) writes:
:>Mario Klebsch ([EMAIL PROTECTED]) wrote:
:>: When writing a Program for e.g. Linux 2.2.13, I cannot rely on
:>You are writing code to a kernel version?
: The kernel is the thing called linux, so 2.2.13 is a linux version.
It's taken this long to be sure, but now I _know_ he's a troll.
:>Sorry, the OS is bigger than just the kernel.
: I know, bit Linux isn't. :-( That is what I am arguing the last
: days. And IMHO Linux better becomes an OS.
It's the astral projection of Richard Stallman in Mario's form...
Just make sure you say GNU/Linux when you mean more than the kernel, boys
and girls.
-Greg
------------------------------
From: Tom Glass <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Electric Fence for C++ ???
Date: Wed, 01 Mar 2000 11:22:03 -0800
Reply-To: [EMAIL PROTECTED]
Kaz Kylheku wrote:
>
> On Wed, 01 Mar 2000 17:42:46 +0100, Anes Lihovac <[EMAIL PROTECTED]> wrote:
> >Hi !
> >
> >I am searching for a Library which like EFENCE
> >but for C++ !!!
>
> Efence supports C++ if your operators new and delete are
> implemented in terms of malloc and free.
>
This is the case with the g++ compiler, I use efence and it works well
for me.
> If they are not you can write your own overloads which are.
------------------------------
From: Robin Collins <[EMAIL PROTECTED]>
Subject: Re: GCC and EGCS, SuSE say they can co-exist, I don't see how - Thanks Guys,
Now I understand
Date: Wed, 01 Mar 2000 20:08:42 +0000
Thanks to you both, I think I knew about -V (though somehow forgot it
and confused it with the --specs option), but I'd not have thought of
touching the Makefile (too scary without knowing what's going on for
someone as new to this as me :).
Appreciate the suggestions, very helpful.
Cheers,
Robin
On 01 Mar 2000 14:13:18 +0100, Martin von Loewis
<[EMAIL PROTECTED]> wrote:
>Markus Kossmann <[EMAIL PROTECTED]> writes:
>
>> If you use the switch -V2.7.2.3 the egcs gcc frontend will run the
>> gcc-2.7.2.3 backend.
>>
>> To compile the kernel, edit the toplevel kernel Makefile and add that
>> switch to the line
>> CC =$(CROSS_COMPILE)gcc -D__KERNEL__ -I$(HPATH)
>
>Alternatively, after installing 2.7.2.3, you can rename the front-end
>to, say, kgcc. Then you install egcs, and 'gcc' will be egcs; 'kgcc'
>will continue to be 2.7.2.3. If you set CROSS_COMPILE to 'k', you
>don't even need to edit the Makefile - but you'll also need 'kas' and
>'kld'.
>
>Regards,
>Martin
------------------------------
From: "Dan Miller" <[EMAIL PROTECTED]>
Subject: Re: complex math in a device driver
Date: Wed, 1 Mar 2000 12:11:32 -0800
Charles Bryant wrote in message <[EMAIL PROTECTED]>...
>In article <89gv8n$dvh$[EMAIL PROTECTED]>,
>Dan Miller <[EMAIL PROTECTED]> wrote:
>... operations in a driver ...
>>This is all well and good, but my computational requirements are *much*
more
>>complex than A/D conversion. A typical computation in my set is:
>>
>> temp2usl = 0x0000000f & (unsigned long) floor( 0.5 + 16.0*(( m1a *
>>
pow(2.0,-1.0*(double)( floor(log10( m1a )/log10of2) )) ) -
>>1.0) );
>
>That seems to be a very expensive way of portably doing:
> 0xf & (v >> 23)
>where 'v' is 'm1a' as an int. In other words, it's extracting the
>four most significant bits of the mantissa. Maybe if you could give
>more information about what you're trying to do the requirement to do
>it using floating point could be eliminated.
>
Hmmm... I hadn't even *thought* of rewriting the equations... there are so
many, I just saw complex stuff and said "how am I going to do this??"...
They are the equations for programming the Harris (Intersil) DCL and DQT
chips... (HSP50110/HSP50120). The equations themselves came from
sample code which was provided long ago by Harris...
Thanks, I *will* take a more intelligent look at them, now!!
(the only thing more dangerous than a smart software engineer is an
inattentive one...)
Dan Miller
------------------------------
From: Aki T Immonen <[EMAIL PROTECTED]>
Subject: Problems in System Load Measurement
Date: Wed, 01 Mar 2000 20:48:26 +0000
Environment: Redhat Linux 6.1, kernel 2.2.12-20, 2.2.14
I came up of a very serious problem in system load measurement.
I have a computer configured as a gateway between two LANs. I'm testing
the performance of the network and the load caused by the network
traffic
on the gateway. I use netperf to generate tons of ip-traffic between the
LANs. Everything works fine, and I get good throughput etc...
But. The system load of the gateway machine stays at 0%, even if it is
so busy passing packets between the network interfaces that it becomes
quite unresponsive to user actions. 'top' outputs something like this:
10:23pm up 58 min, 5 users, load average: 0.00, 0.10, 0.26
73 processes: 70 sleeping, 2 running, 0 zombie, 1 stopped
CPU states: 0.9% user, 0.2% system, 0.0% nice, 98.9% idle
Mem: 127464K av, 124292K used, 3172K free, 86188K shrd, 11876K buff
Swap: 160608K av, 8604K used, 152004K free 51008K
cached
To measure the real load caused by the network traffic I came up with
following solution (which is in, my opinion, a really ugly hack):
create a user process which sits in a tight loop (for(;;){}), and run it
by nice. Then the 'top' outputs following:
10:25pm up 1:00, 5 users, load average: 0.50, 0.20, 0.28
74 processes: 70 sleeping, 3 running, 0 zombie, 1 stopped
CPU states: 0.6% user, 72.5% system, 26.9% nice, 0.0% idle
Mem: 127464K av, 124396K used, 3068K free, 86436K shrd, 11892K buff
Swap: 160608K av, 8604K used, 152004K free 51008K
cached
Now it is possible to see that the network traffic causes 75% load on
the
system!
I need to measure the REAL system load accurately from inside a kernel
module, since the project i'm working on consists of creating a
load-balancing
system.
Any help appreciated!
T:Aki
------------------------------
From: [EMAIL PROTECTED] (Kevin Smith)
Crossposted-To:
alt.os.linux,comp.os.linux.development.apps,comp.unix.sco.misc,comp.unix.sco.programmer,comp.unix.unixware.misc,tw.bbs.comp.linux
Subject: Re: Struct size and allocate problem! need help.
Date: 1 Mar 2000 15:39:33 -0500
In article <[EMAIL PROTECTED]> "Jaron" <[EMAIL PROTECTED]> writes:
>Hi,
> I encounter a compiling program as below:
>
> struct a {
> unsigned char a1;
> unsigned char a2;
> unsigned short a3
> unsigned short a4
> unsigned long a5;
> };
>
>the structure size must be 10 but use sizeof print out is 12...
>...snip...
You don't say why it has to be 10. Usually this means you are overlaying
the structure on some external data (i.e. a file) and this is how you
bring the data into the program (or back out).
I gave up trying to do that years ago due to constant packing and byte
order problems. Now-a-days I use an unsigned char array for the external
representation and map the data in and out of my internal structures
with appropriate functions (or macros).
--
Do two rights make | Kevin Smith, ShadeTree Software, Philadelphia, PA, USA
a libertarian | 001-215-487-3811 shady.com,kevin bbs.cpcn.com,sysop
| dvtug.org,kevins--Deleware Valley Transit Users Group
------------------------------
From: "Lawrence K. Chen, P.Eng." <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Semaphore quustion ... part 2!! Bug ?
Date: Wed, 01 Mar 2000 14:51:43 -0500
Each process pretty much locks the semaphore again right after it
unlocks....which effectively prevents any body else from getting a chance to
lock the semaphore. Either do some more work between unlock->lock
periods...or do something that at least causes a context switch so at least
another process gets a crack at trying to do something.
Either that....or use a two stage semaphore.
something like:
lock semaphore 1
lock semaphore 2
free semaphore 1
do operation
free semaphore 2
mark wrote:
>
> Hi all,
> I know I recently posted a question one semaphores (Thanks for the
> replies) but I'm still having problems with them ... not convinced
> they're working properly!
>
> This is an interleaving of what I can see happening (Where the Writer
> process starts a little before the Reader - not that this should cause a
> problem).
>
> Writer Gets Semaphore
> Writer Returns Semaphore
> Writer Gets Semaphore
> Reader Tries Semaphore - Blocked
> Writer Returns Semaphore
> Writer Gets Semaphore
> Writer Returns Semaphore
> etc...
> Reader might get to play if its lucky
>
> Its not helped by the fact its not always the same process that does
> this (The Reader can end up with the semaphore for ages as well.)
>
> The problem is one process is effectively able to jump the queue
> (Somehow!!) and keep the semaphore for itself - even when the other
> process was blocked that semaphore. The programs are so simple its
> either some really stupid I'm doing (Quite possible!) or the semaphore
> semop() function has a bug.
>
> I dumped the code for the Reader and Writer processes below. If anyone
> is able to try it out I'd really appreciate it. This is pretty annoying
> ! :) Another odd fact is you'll notice there are two lines in each bit
> commented out (All they do is print out the Semaphore at that time). The
> problem doesn't seem so bad when there compiled in!!???
>
> I've also tried using shed_yeild() when the processes gives up the
> semaphore, however I don't believe it will make any difference as the
> process should block anyway.
>
> These are System V semaphores, are there any known problems with them?
> POSIX any better? If so where can I get info on how to use them (I
> assume there more up to date).
>
> Just for the record I'm running Linux 2.2.14
>
> Thanks in advance
>
> Mark
>
--
Who: Lawrence Chen, P.Eng. Email: [EMAIL PROTECTED]
What: Software Developer URL: http://www.opentext.com/basis
Where: Open Text, BASIS Division Phone: 614-761-7449
5080 Tuttle Crossing Blvd. Fax: 614-761-7269
Dublin, OH 43016 ICQ: 12129673
DISCLAIMER: All opinions expressed are mine and *NOT* my employers
------------------------------
From: "Lawrence K. Chen, P.Eng." <[EMAIL PROTECTED]>
Subject: Re: [Q] How to change the max. amount of open files
Date: Wed, 01 Mar 2000 15:00:12 -0500
That didn't work for me.
I tried it with $NEW_VALUE == 2048 and 10240, but the maximum that I can get
is still 1024.
And my application can use up to 2048 (which it automatically tries to get
when it starts up by using getrlimit/setrlimit).
[EMAIL PROTECTED] wrote:
>
> In article <89ilcc$8jt$[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] wrote:
> > Hi..
> >
> > can anyone point me to the source file, which i would need to change
> in a
> > SuSE Linux Distribution, in order to increase the maximum open files
> allowed
> > ? I need to increase this value, since some applications (like SQUID)
> handle
> > too much open files for the system right now, which causes SQUID
> (e.g.) to
> > stop working. You would do me a favor, if you could not only respond
> to the
> > forum, but also to my email address, since i only can check the forum
> via
> > DejaNews.
> >
> >
>
> To extent those values is much easier, just:
>
> echo $NEW_VALUE > /proc/sys/file-max
> echo $NEW_VALUE > /proc/sys/inode-max
>
> You will find lots of other interesting info in /proc, like:
> /proc/interrupts
> /proc/ioports
> /proc/dma
> /proc/<processID>/...
>
> Hope it helps
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
Who: Lawrence Chen, P.Eng. Email: [EMAIL PROTECTED]
What: Software Developer URL: http://www.opentext.com/basis
Where: Open Text, BASIS Division Phone: 614-761-7449
5080 Tuttle Crossing Blvd. Fax: 614-761-7269
Dublin, OH 43016 ICQ: 12129673
DISCLAIMER: All opinions expressed are mine and *NOT* my employers
------------------------------
From: Rob Komar <[EMAIL PROTECTED]>
Subject: Re: bug: same dir content after changing disks
Date: Wed, 1 Mar 2000 10:49:32 -0800
Ul f Dambacher <[EMAIL PROTECTED]> wrote:
> Hi again
> I found out that there is a big discussion on the kernel mailing list about
> the topic of
> not flushing the buffer cache after umount.
> Some think it is a feature not having to read everything again after
> remount, others
> think it is a bug for flexible media
> A patch exists, but Alan Cox thinks this has to be done in user space.
> Any other information?
What about using mtools to access the removable medium? Perhaps the
problem with the VFS isn't triggered by mtools.
Cheers,
Rob Komar
------------------------------
From: [EMAIL PROTECTED] (C. Chan)
Subject: Backing out of ext3 filesystem
Date: 1 Mar 2000 16:12:51 -0600
I'd to experiment with the ext3 journaling patches. Is it possible
to mount a filesystem as ext2 after it has been mounted as ext3
with the journalling option? Also, if it is possible, can the
filesystem then be unmounted and remounted again as ext3, and if
so does the journal need to be cleared?
--
C. Chan < [EMAIL PROTECTED] >
PGP Public Key: finger [EMAIL PROTECTED]
------------------------------
From: "Beno�t Cousson" <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux.mandrake
Subject: rmmod -a does not remove unused modules!
Date: Wed, 01 Mar 2000 22:15:00 GMT
Hi,
I've built modules samples from Rubini's book about Linux Device Driver on a
Mandrake 7.0 distribution.
I have configured /etc/conf.modules to load automatically "snull" module
whith "sn1" alias.
When I start sn1 interface using "ifconfig up", snull module is loaded in
the kernel, but when I stop it (using ifconfig down), the module is marked
unused but is never removed. Even after a rmmod -as.
I have also tried with a real driver like ppp, and it does not work either.
Rubini's book is mainly based on 2.0 kernel, so I wonder if autoclean does
not work anymore with 2.2 kernel or if it is due to Mandrake distribution???
Thanks in advance.
Benoit.
------------------------------
From: "Leif Erik Tronstad Svan�" <[EMAIL PROTECTED]>
Subject: Logitech Srollpoint
Date: Wed, 01 Mar 2000 23:24:41 +0100
I've got a mouse labeled IBM which I think really is a Logitech
Scrollpoint mouse. Does anyone know of a driver that will make this
mouse work properly?
------------------------------
From: Charles Bryant <[EMAIL PROTECTED]>
Crossposted-To:
alt.os.linux,comp.os.linux.development.apps,comp.unix.sco.misc,comp.unix.sco.programmer,comp.unix.unixware.misc,tw.bbs.comp.linux
Subject: Re: Struct size and allocate problem! need help.
Date: 2 Mar 2000 02:32:33 -0000
In article <[EMAIL PROTECTED]>,
Jaron <[EMAIL PROTECTED]> wrote:
>Hi,
> I encounter a compiling program as below:
>
> struct a {
> unsigned char a1;
> unsigned char a2;
> unsigned short a3
> unsigned short a4
> unsigned long a5;
> };
>
>the structure size must be 10
No. It can be any value greater than or equal to five.
--
Eppur si muove
------------------------------
From: [EMAIL PROTECTED] (Christopher Browne)
Crossposted-To: comp.os.linux.advocacy,comp.os.linux.setup
Subject: Re: Binary compatibility: what kind of crack are they smoking?
Reply-To: [EMAIL PROTECTED]
Date: Thu, 02 Mar 2000 03:22:59 GMT
Centuries ago, Nostradamus foresaw a time when Gregory Neil Bastow would say:
>In comp.os.linux.development.system Mario Klebsch <[EMAIL PROTECTED]> wrote:
>: [EMAIL PROTECTED] (Stephen Harris) writes:
>:>Mario Klebsch ([EMAIL PROTECTED]) wrote:
>:>: When writing a Program for e.g. Linux 2.2.13, I cannot rely on
>:>You are writing code to a kernel version?
>: The kernel is the thing called linux, so 2.2.13 is a linux version.
>
>It's taken this long to be sure, but now I _know_ he's a troll.
It would seem so.
>:>Sorry, the OS is bigger than just the kernel.
>: I know, bit Linux isn't. :-( That is what I am arguing the last
>: days. And IMHO Linux better becomes an OS.
>
>It's the astral projection of Richard Stallman in Mario's form...
>Just make sure you say GNU/Linux when you mean more than the kernel, boys
>and girls.
The observation that "Linux, the kernel" != "Linux, the system" was,
and is, a useful observation.
The observation that "Linux, the system" depends on a lot of software
that the FSF had some part in producing was also a relevant
observation.
Had "intent" stopped there, that might have been well and fine.
Much of the "politicalization" (is there a good word for that?) of the
issue has been "less clearly good." It looks more like RMS is begging
for recognition, and if he had been a bit more gracious about this,
there wouldn't have been the flame wars.
I think I'd prefer it if the attempt to control naming had been more
straightforward, with either:
RMS/Linux
or
FSF/Linux
After all, there's surprising ambiguity between "GNU," "FSF," and
"RMS."
--
If con is the opposite of pro, is Congress the opposite of progress?
[EMAIL PROTECTED] <http://www.hex.net/~cbbrowne/lsf.html>
------------------------------
From: [EMAIL PROTECTED] (Christopher Browne)
Subject: Re: Why a file system ?
Reply-To: [EMAIL PROTECTED]
Date: Thu, 02 Mar 2000 03:22:54 GMT
Centuries ago, Nostradamus foresaw a time when
[EMAIL PROTECTED] would say:
>On Tue, 29 Feb 2000 02:08:35 GMT Christopher Browne
<[EMAIL PROTECTED]> wrote:
>| There is certainly room to use the (from-database management) notion
>| of having multiple "views" on data. In SQL, you can create something
>| called a "view," which is a sort of "virtual table" that is a closure
>| that may join together tables and some implicit selection criteria.
>|
>| It is certainly a reasonable idea to do the same sort of thing with a
>| filesystem, having some alternative views on data.
>|
>| But the notion of pushing everything into databases is not
>| realistically useful.
>|
>| In particular, I would contend that it does not do anything to keep
>| the system "clean."
>
>If you have everything on a database, then what is the definition of
>the layer the database is on? The current notion in UNIX is that a
>database engine sees the same process API layer than any other program
>does, save for the extended permissions and access it is granted.
>
>But in a system where everything is in the database, then would that
>database still be in a process as it is now? Or would it be inside
>the kernel?
>
>In order to give all processes that need the data an abstraction to
>access the data, and to give the database engine itself an abstraction
>to access the hardware, you'd have to add another layer between the
>kernel and user space processes, and it would be more than just the
>pseudo-layer of processes with root permissions.
>
>It could be a particularly obese kernel. It would most definitely
>be "unclean".
This is the point at which microkernels start to look attractive;
you'd have the system organized as a multiserver, with things like:
- A filesystem server
- A database server
- An authentication server
...
It would make a lot of sense for the database to "take over" a disk
partition so that you might have some partitions that are accessed as
filesystems, and others that are accessed purely as database.
Hacking it into Linux would likely be "unclean;" adding it to
something like Hurd wouldn't have to be.
I have no problem with the notion of accusing it of being "obese"...
>| In the same manner that you can see a file system get "crufty" when
>| people strew trash everywhere, a database system can suffer from
>| *exactly the same problem.*
>
>Absolutely. Now what tools have we handy to clean this up? What?
>we need a whole NEW set of tools?
Right.
>| It would, for instance, be a slick idea if I could do:
>| % mkdir ~/Databases/mydb
>| % usermount -t gdbm ~/DBs/something.dbm ~/Databases/mydb
>| % cd ~/Databases/mydb
>| % ls
>| key1
>| key2
>| key3
>| key4
>| key5
>|
>| where the mapping would be that each file in the directory is named
>| after the key in the GDBM DB, and the contents of the file are the
>| values associated with the keys...
>
>Interesting idea. Of course there are complications such as more
>than one key. But then, in a hierarchy, you can have as many branches
>as you want. You can make the table be one level and each key the
>next.
Actually, in the situation I describe above, that is *not* an option.
gdbm doesn't permit hierarchy. Furthermore, there is no "multiple
key" problem; if you reuse a key, that overwrites the original value.
>| Something similar could be done for an SQL DBMS:
>|
>| % usermount -t postgresql "localhost:3144 somedb userid password" \
>| ~/Databases/thebigdb
>|
>| and you'd be able to see a directory of tables and such...
>
>Or each of the different views. Or make new views.
Accessing views would be entirely logical.
Write access would be rather more troublesome, and I'm not sure that
it would be realistic to create new views via filesystem
manipulations.
It would, after all, be Very Slick to have views implemented via hard
links.
But establishing the semantics that "ln this that" inserts records
into the database to represent foreign key linkages strikes me as a
Very Hard Problem.
What I'd see as a *far* more fruitful approach would be to create a
tuned version of ReiserFS that:
a) Logs updates to something akin to an Oracle "archive log,"
b) Removes some of the metadata associated with a file (e.g. -
*perhaps* GECOS fields, device ID, and probably all the dates) so
that the basic space consumption drops by 20-30 bytes,
and then implement an SQL DBMS on top of that where each table has its
own directory, and each record its own file.
That would mean that at the base, the physical representation would be
a UNIX-style directory/file hierarchy, with some set of (hopefully)
reasonable rules as to what you are supposed to do to safely
manipulate it.
--
The *Worst* Things to Say to a Police Officer: Hey, is that a 9 mm?
That's nothing compared to this .44 magnum.
[EMAIL PROTECTED] <http://www.hex.net/~cbbrowne/lsf.html>
------------------------------
From: nilesh patel <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: unresolved Symbols in modules
Date: Thu, 02 Mar 2000 09:45:27 +0530
I am able to compile a module but when I try to insmod it it says
that the printk_R**** is unresolved .
What is the reason for the unresolved symbols ??
Nilesh
------------------------------
** 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
******************************