Linux-Development-Sys Digest #275, Volume #8 Mon, 13 Nov 00 14:13:14 EST
Contents:
Re: Was: Software RAID ("U. Siegel")
Re: What C++ compiler to use for dev if you don't want to give away source for
your program? (Martin von Loewis)
Re: Measuring CPU Cache Performance (jwk)
Re: catching smurf attack... (Perego Paolo)
Allocating Non-cacheable memory (Kristof Beyls)
Re: Kernel function reference ("Z")
remove -a dont work on a kmodloaded module (Michael Palme)
Re: load/unload module dinamically -- help -- (Michael Palme)
Two ppp related questions (Sami =?iso-8859-1?Q?P=F6nk=E4nen?=)
Re: Help! Linux router between two NT networks. (David Weis)
Re: Measuring CPU Cache Performance (James Cownie)
Re: catching smurf attack... ("deadmeat")
Re: building ELF executables on NT system (Erik Hensema)
Re: Measuring CPU Cache Performance
Re: Software RAID ("Jason from The Workshop")
16-bit assembly code (@cisco.com)
Re: What C++ compiler to use for dev if you don't want to give away ("D.
Stimits")
Disk Drive Parameters in bootsector.s (@cisco.com)
Re: Kernel function reference ([EMAIL PROTECTED])
----------------------------------------------------------------------------
From: "U. Siegel" <[EMAIL PROTECTED]>
Crossposted-To:
comp.os.linux.hardware,alt.linux,comp.os.linux.misc,comp.os.linux.hardware
Subject: Re: Was: Software RAID
Date: Mon, 13 Nov 2000 10:46:56 +0100
OK, here are the /etc/raidtab's contents:
raiddev /dev/md0
raid-level 5
nr-raid-disks 3
nr-spare-disks 1
persistent-superblock 1
parity-algorithm left-symmetric
chunk-size 32
device /dev/sd[b...d]2
raid-disk [0..2]
device /dev/sde2
spare-disk 0
Of course the device and raid-disk lines are written not packed in the
raidtab.
And here is /proc/mdstat:
Personalities: [raid5]
read_ahead 1024 sectors
md0: active raid5 sde[3] sdd2[2] sdc2[1] sdb2[0]
16707456 blocks level 3, 32k chunk, algorithm 2 [3/3] [UUU]
unused devices: <none>
The filesystem was created by the command:
mke2fs -b 4096 -R stride=8 /dev/md0
After the first write attempt to array system keeps on sending following
messages to /var/log/messages
EXT2-fs error (device md(9,0)): ext2_new_block: Alloacting block in system
zone - block = 131456
EXT2-fs error (device md(9,0)): ext2_new_block: Allocating block in system
zone - block = 131457
EXT2-fs error (device md(9,0)): ext2_free_blocks: Freeing blocks in system
zones - blocks = 131458
EXT2-fs error (device md(9,0)): ext2_new_block: Allocating block in system
zone - block = 131458
Last two lines are repeated upcounting the block number until the system
crashes.
Lee Allen wrote:
> On Thu, 09 Nov 2000 14:40:40 +0100, "U. Siegel"
> <[EMAIL PROTECTED]> wrote:
>
> >Seems to be that there are several people having experience with
> >software RAID.
> >So, let's be a bit more detailed.
> >Since one week i'm trying hard to get RAID5 to work.
> >The System is a netfinity server with 2 Pentium III/933MHz, 2GB RAM and
> >5 SCSI hd's. On 4 disk i created identicall partitions, each about 8GB.
> >The first three shall be for working and the fourth as spare.
> >Creating the array wasn't a problem, also the mke2fs completed w/o
> >errors. But when i try to copy some data to the array the system
> >crashes. All i get are EXT2fs errors in block allocation. This happens
> >under kernel 2.2.17, 2.2.17, 2.3.40, 2.4.0-test9 and 2.4.0-test10.
> >Always the same errors.
> >Is there a trick about ext2fs?? I upgraded to the newest ext2fs-tools,
> >but no change :..-((
> >Can anybody help me?
> >
>
> How about posting your /etc/raidtab and /proc/mdstat files,
> ideally after mkraid.
>
> -Lee Allen
------------------------------
From: Martin von Loewis <[EMAIL PROTECTED]>
Subject: Re: What C++ compiler to use for dev if you don't want to give away
source for your program?
Date: 13 Nov 2000 12:07:25 +0100
"D. Stimits" <[EMAIL PROTECTED]> writes:
> Which facts are those? I was talking about a general way to think of
> things. It never disagreed in any place with what this license says. It
> even supports it. It basically says you need to read the license. If you
> are saying that the file is GNU, and the license is GNU, and the
> compiler in question is GNU, and that this license applies somewhere,
> then we agree. Did I miss something, other than the license quote which
> was irrelevant to the process?
I'm not sure whether you've missed something, as I can't tell what you
mean when you say a "file is GNU", a "compiler is GNU", or the
"license is GNU". For the latter one, I understood that as "the
license is the General Public License (GPL)".
You earlier said
> If you statically bind libraries that are GNU into your project,
> then you have to also follow the GNU licensing.
which, as I tried to explain, is incorrect. When you compile something
with the GNU C Compiler, it will "bind libraries that are
GNU". However, you do *not* necessarily "have to also follow GNU
licensing" (i.e. the GPL), as there is a specific exception to the
license which I've quoted.
Regards,
Martin
------------------------------
From: [EMAIL PROTECTED] (jwk)
Subject: Re: Measuring CPU Cache Performance
Date: 13 Nov 2000 11:36:18 GMT
Reply-To: [EMAIL PROTECTED]
On 12 Nov 2000 20:43:10 GMT, Kent A Vander Velden
<[EMAIL PROTECTED]> wrote:
> Is there a way with Linux and PentiumII+ to measure the cache performance
>of the CPU? I would like to know if my application is being greatly affected
>by cache misses.
>
I seem to recall a program called cacheprof, written in Haskell. You
might search for that on google and/or freshmeat.
Good luck,
Jurriaan
PS It might have been cacheprf.
--
BOFH excuse #88:
Boss' kid fucked up the machine
GNU/Linux 2.2.18pre21 SMP 2x1117 bogomips load av: 0.02 0.14 0.17
------------------------------
From: Perego Paolo <[EMAIL PROTECTED]>
Subject: Re: catching smurf attack...
Date: 13 Nov 2000 11:35:48 GMT
deadmeat <[EMAIL PROTECTED]> wrote:
>> Hi guys, I'm writing a module for my computer science thesis work.
>> I've to catch the smurf attack using netfilter firewalling scheme
>> ( so we are in 2.4.0 kernel series ).
>> How is filled the broadcast field in the sock structure, and when?
> do you mean you want to detect if you are:
> - the source amplifier in a smurf attack, or
> - the target in a smurf attack?
I have to detect if a smurf attack is starting from my server and
I have to do this in a kernel module that I'm writing. The problem is
that I can't understand how the "broadcast" field, in sk_buff structure
is filled up ! :(
Ciao :)
--
$>cd /pub
$>more beer
Perego Paolo <[EMAIL PROTECTED]>
Tutor at D.S.I. - University of Milan
I'm Linux zion 2.4.0-test9 #1 Fri Oct 20 14:09:56 CEST 2000 i586 unknown
------------------------------
From: Kristof Beyls <[EMAIL PROTECTED]>
Subject: Allocating Non-cacheable memory
Date: Mon, 13 Nov 2000 13:54:06 +0100
Is there a system call under linux 2.4 that can be used to allocate some
amount of memory with the
non-cacheable bits set, so that the allocated memory will never be
placed into the cache?
Kristof Beyls
------------------------------
From: "Z" <[EMAIL PROTECTED]>
Subject: Re: Kernel function reference
Date: Mon, 13 Nov 2000 14:17:06 +0100
Once upon a while [EMAIL PROTECTED] wrote:
> Is there some sort of online kernel function reference? I did a RedHat
> 7.0 total install but still when I type:
> Man kfree Man kmalloc Man printk Man register_chrdev Man memcpy_fromfs
> End so one�.
>
> No success I bought the book Linux device drivers and the functions I
> named above are in there but looking for a total reverence list.
>
>
> Greetings Bas
>
I think kernel hackers have the idea that code is the best
documentation. So probably you will not find any documentation
on these functions on your system.
You should get a book from your local bookstore. For
device driver development I recommend Alessandro Rubinis
"Linux Device Drivers", but you should also take a look at
Richard Gooch's Homepage at
http://www.atnf.csiro.au/~rgooch/linux/docs/porting-to-2.2.html
to see changes for Kernel 2.2 and
http://www.atnf.csiro.au/~rgooch/linux/docs/porting-to-2.4.html
for Kernel 2.4.
There are other books about the Linux Kernel which I have not
read yet, so I can't comment on them.
Z
--
LISP is worth learning for the profound enlightenment experience you
will have when you finally get it; that experience will make you a
better programmer for the rest of your days. Eric S. Raymond
------------------------------
From: Michael Palme <[EMAIL PROTECTED]>
Subject: remove -a dont work on a kmodloaded module
Date: Mon, 13 Nov 2000 13:11:24 GMT
Hello....
Ive programmed a driver module for a pci card. I put it
in /lib/modules/2.2.16/misc and made a node in /dev with an free
majornumber. I called 'depmod' and i make an alias entry for the used
majornumber in /etc/modules.conf . Now if call the driver like 'echo
test > /dev/MYNODE' the driver is successfully loaded via kmod. Now my
problem is to remove this driver automatically when its unused. Ive
made an 'rmmod -a' entry in the crontab but it does not work. I try to
test it manually (when 'lsmod' shows '(unused) (autoclean)' i
type 'rmmod -a') but after this the module is still loaded. 'Rmmod
MYMODUL' works.
So my question is how to unload such autoloaded modules automatically.
Is there another mechanism? Must I add some special code to my module ?
Whats my fault ?
Thanks in advance ... Michael Palme
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: Michael Palme <[EMAIL PROTECTED]>
Subject: Re: load/unload module dinamically -- help --
Date: Mon, 13 Nov 2000 13:24:29 GMT
Hello...
lets take a look at:
/usr/src/linux/Dokumentation/kmod.txt
/usr/src/linux/Dokumentation/modules.txt
/etc/modules.conf (or conf.modules)
/lib/modules/KERNELVERSION/modules.dep
man modules.conf
man depmad
man modprobe
it should help........
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: Sami =?iso-8859-1?Q?P=F6nk=E4nen?= <[EMAIL PROTECTED]>
Subject: Two ppp related questions
Date: Mon, 13 Nov 2000 15:39:50 +0200
Hi,
I'm doing some testing and tweaking to get maximal performance out of
a slow ppp-link. I have couple of questions I hope someone might be
able to answer:
How does the ppp driver work when the transmit buffer gets full?
It seems that on a 2.0 kernel the whole contents of the ppp transmit
buffer is lost when there is too much traffic for the ppp-link to
handle.
When using UDP protocol I noticed that when transmitting several
packets over a link (at a rate higher than the links capasity) the time
it takes to transmit the packet over the link keeps on growing until it
suddenly drops to the normal level again. At the same time several
packets are lost.
I assume what happens is that the IP layer keeps on filling the ppp
transmit buffer until it gets full. When that happens the whole buffer
is flushed and all packets in the buffer are lost. After that the
normal operation continues until the buffer gets full again. Am I on
the right tracks here?
What about 2.2 and 2.4 series kernels? Has the ppp functionality
changed from 2.0?
Then the other question: What would be the correct way to adjust the
size of the ppp transmit and receive buffers?
I would like to try what consequences adjusting has, but I haven't
found much information about this, not even in the kernel sources.
Sami P�nk�nen
[EMAIL PROTECTED]
------------------------------
From: David Weis <[EMAIL PROTECTED]>
Subject: Re: Help! Linux router between two NT networks.
Date: Mon, 13 Nov 2000 07:36:35 -0600
On Fri, 10 Nov 2000, Vulcan wrote:
> Thank you Dave:
>
> Unfortunately, I dont think configuring the Linux gateway as the master
> browser is possible ... because it (and the 2.* network) is up only for a
> few hours.
>
> I could point all the 2.* machines to an nt server on the other network to
> be the master browser ... how does one do that ? ie. how do you tell a
> machine on the 2.* network that the master browser is machine (say)
> 192.168.1.1 on the other network ?
In the network control panel, set the WINS server on the 2. network to a
server or NT machine on the 1. network. I think it needs to be an NT
machine to function.
david
>
> [EMAIL PROTECTED] (David Weis) wrote in
> <[EMAIL PROTECTED]>:
>
> >On Fri, 10 Nov 2000, UM wrote:
> >> Basically I have two networks
> >> 192.168.1.0 (255.255.255.0)
> >> 192.168.2.0 (255.255.255.0)
> >> Instead of buying a Cisco Router I decided to build a linux
> >> router/gateway to talk between these two networks. Its actually a
> >> laptop with two 3COM PCMCIA network cards running Mandrake 7.0.*
> >> After reading the docs I am able to ping a computer on 2.* network
> >> from the 1.* network.
> >> However, I want the computers to be visible in Network Neighborhood
> >> ... ie. the NT domain in 2.* should be visible in the 1.* window.
> >
> >You will need to either run the nmbd half of samba on your laptop to be
> >the master browser for both wires or point all of the machines on one
> >network to an nt server on the other network to be the master browser.
> >
> >dave
> >
>
>
>
--
David Weis | "Great spirits will always encounter violent
[EMAIL PROTECTED] | opposition from mediocre minds" - Einstein
http://www.sjdjweis.com/ |
------------------------------
From: James Cownie <[EMAIL PROTECTED]>
Subject: Re: Measuring CPU Cache Performance
Date: Mon, 13 Nov 2000 14:21:55 GMT
> On 12 Nov 2000 20:43:10 GMT, Kent A Vander Velden
> <[EMAIL PROTECTED]> wrote:
> > Is there a way with Linux and PentiumII+ to measure the cache performance
> >of the CPU? I would like to know if my application is being greatly affected
> >by cache misses.
> >
Take a look at PAPI http://icl.cs.utk.edu/projects/papi/
You'll need to rebuild your kernel, but then (for x86, at least), you should
be able to get access to the hardware counters which count things like
cache misses...
-- Jim
James Cownie <[EMAIL PROTECTED]>
Etnus, LLC. +44 117 9071438
http://www.etnus.com
------------------------------
From: "deadmeat" <[EMAIL PROTECTED]>
Subject: Re: catching smurf attack...
Date: Mon, 13 Nov 2000 15:10:51 GMT
> that I can't understand how the "broadcast" field, in sk_buff structure
can't help you there.
it doesn't matter anyway, like I said - the broadcast address of the remote
could be anything. I have no idea how to get it without using my provider's
whois server either. i suspect not all networks have functional whois
servers, so you can't rely on that.
what you will need to do is check the source IP's of the outgoing packets -
if they are not one of your own, it's spoofed - and that is bad even if it's
not being used in a smurf attack.
ipchains -A output -i eth0 ! -s $MYIP -d 0/0 -j REJECT -l
------------------------------
From: [EMAIL PROTECTED] (Erik Hensema)
Subject: Re: building ELF executables on NT system
Date: Mon, 13 Nov 2000 16:14:51 +0100
Reply-To: [EMAIL PROTECTED]
Andrew Voznytsa ([EMAIL PROTECTED]) wrote:
>I want to build ELF executables on NT systems.
Why?
>Does someone know how I can do it ?
NT doesn't support ELF, it only supports the (technically weak) COFF
format.
--
Erik Hensema ([EMAIL PROTECTED])
Please note that my From: field is spamtrapped.
------------------------------
From: <[EMAIL PROTECTED]>
Subject: Re: Measuring CPU Cache Performance
Date: 13 Nov 2000 16:49:19 GMT
Also try http://www.scl.ameslab.gov/Projects/Rabbit/
I've been using it for the past 6 months.
Rich
James Cownie <[EMAIL PROTECTED]> wrote:
>
>> On 12 Nov 2000 20:43:10 GMT, Kent A Vander Velden
>> <[EMAIL PROTECTED]> wrote:
>> > Is there a way with Linux and PentiumII+ to measure the cache performance
>> >of the CPU? I would like to know if my application is being greatly affected
>> >by cache misses.
>> >
> Take a look at PAPI http://icl.cs.utk.edu/projects/papi/
> You'll need to rebuild your kernel, but then (for x86, at least), you should
> be able to get access to the hardware counters which count things like
> cache misses...
> -- Jim
> James Cownie <[EMAIL PROTECTED]>
> Etnus, LLC. +44 117 9071438
> http://www.etnus.com
------------------------------
From: "Jason from The Workshop" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,alt.linux,comp.os.linux.misc
Subject: Re: Software RAID
Date: Mon, 13 Nov 2000 11:49:49 -0600
I've done RAID 0 and RAID 1 devices. I have not managed to get the GUI to do
a RAID10 and I havent tried a RAID5 yet, but I may just do that tonight
--
Jason
www.cyborgworkshop.com
...and the geek shall inherit the earth...
------------------------------
From: @cisco.com
Subject: 16-bit assembly code
Date: Mon, 13 Nov 2000 10:01:10 -0800
Reply-To: @cisco.com
Hi all,
I want to write 16-bit assembly code in AT&T syntax. Which assembler is
best for 16-bit code assembling ? I heard that gcc has some problems
with 16-bit code.
Thanks,
Sarat
------------------------------
Date: Mon, 13 Nov 2000 11:28:01 -0700
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: What C++ compiler to use for dev if you don't want to give away
Martin von Loewis wrote:
>
> "D. Stimits" <[EMAIL PROTECTED]> writes:
>
> > Which facts are those? I was talking about a general way to think of
> > things. It never disagreed in any place with what this license says. It
> > even supports it. It basically says you need to read the license. If you
> > are saying that the file is GNU, and the license is GNU, and the
> > compiler in question is GNU, and that this license applies somewhere,
> > then we agree. Did I miss something, other than the license quote which
> > was irrelevant to the process?
>
> I'm not sure whether you've missed something, as I can't tell what you
> mean when you say a "file is GNU", a "compiler is GNU", or the
> "license is GNU". For the latter one, I understood that as "the
> license is the General Public License (GPL)".
That would be a poor description on my side, sorry. GNU here does imply
the GPL license that GNU is primarily responsible for the creation of.
>
> You earlier said
>
> > If you statically bind libraries that are GNU into your project,
> > then you have to also follow the GNU licensing.
>
> which, as I tried to explain, is incorrect. When you compile something
> with the GNU C Compiler, it will "bind libraries that are
> GNU". However, you do *not* necessarily "have to also follow GNU
> licensing" (i.e. the GPL), as there is a specific exception to the
> license which I've quoted.
But it is the license that gives the authority to ignore it. Had the
license not specifically allowed this exception, there would be no
exception. One has to see the license to know that such an exception
exists. But if one of the libraries that the compiler uses is bound to
some other license (some other owner), then the compiler license can't
override it (a non-owner doesn't have the right to remove someone else's
rights, or grant more rights). The specific exception can't override a
third party license that wasn't part of the compiler, but which might be
used to compile.
The trick here is knowing that the libraries in question fall under the
compiler's license...one way to know this is if you can positively
identify those components as parts of the compiler, and not a third
party application. A particular point here is that much of what is being
used to compile is a loose collection of applications and files that are
being brought together to produce a final output; it's important to know
that this entire collection is covered by the license(s) you're looking
at.
>
> Regards,
> Martin
------------------------------
From: @cisco.com
Subject: Disk Drive Parameters in bootsector.s
Date: Mon, 13 Nov 2000 10:49:33 -0800
Reply-To: @cisco.com
Hi all,
I am taking a look at /usr/src/linux-2.2.5/arch/i386/boot/bootsector.S
file and have couple of questions about the disk drive parameters
related code.
What are these disk drive parameters ? I was told that there are some 12
bytes (minix source code says 11 bytes) of drive paramters ? Is it true
? If so, can any one please tell me what *each* byte means ? Are these
disk paramters stored by BIOS somewhere ? If so, where (i mean at what
address ?) I see some hardcoded address like 0x78. what is this ? and
what is at this address ? and why is this address choosen for whatever
purpose it it being used for ? Or are these disk drive parameters hard
coded in the bootsector or setup code somewhere/in the drive
itself ? Why do we need to know these paramters esp no. of sectors ?
Can anyone who is familiar with this piece of code help me out with this
? It would be great of someone can refer me to a document or URL which
describes these
disk paramaters mistery. I looked at the code of different bootsectors,
but surprisingly none of them have enough documentation.
Thanks,
Sarat
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Kernel function reference
Date: Mon, 13 Nov 2000 20:00:00 +0100
Thnx
I already found some answers in the big pile of source code.
On Mon, 13 Nov 2000 14:17:06 +0100, "Z"
<[EMAIL PROTECTED]> wrote:
>Once upon a while [EMAIL PROTECTED] wrote:
>
>> Is there some sort of online kernel function reference? I did a RedHat
>> 7.0 total install but still when I type:
>> Man kfree Man kmalloc Man printk Man register_chrdev Man memcpy_fromfs
>> End so one�.
>>
>> No success I bought the book Linux device drivers and the functions I
>> named above are in there but looking for a total reverence list.
>>
>>
>> Greetings Bas
>>
>
>I think kernel hackers have the idea that code is the best
>documentation. So probably you will not find any documentation
>on these functions on your system.
>You should get a book from your local bookstore. For
>device driver development I recommend Alessandro Rubinis
>"Linux Device Drivers", but you should also take a look at
>Richard Gooch's Homepage at
>http://www.atnf.csiro.au/~rgooch/linux/docs/porting-to-2.2.html
>to see changes for Kernel 2.2 and
>http://www.atnf.csiro.au/~rgooch/linux/docs/porting-to-2.4.html
>for Kernel 2.4.
>
>There are other books about the Linux Kernel which I have not
>read yet, so I can't comment on them.
>
> Z
------------------------------
** 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
******************************