Linux-Development-Sys Digest #309, Volume #8 Wed, 29 Nov 00 10:13:06 EST
Contents:
Re: System V Semphores and Linux ("Geoff Winkless")
Re: [Q] How to get the Ethernet address ? ([EMAIL PROTECTED])
Re: CIFS.. (Lew Pitcher)
How to remap PCI memory into user space? (Heiko Bachmann)
Re: CIFS.. (Anders Larsen)
Re: How to remap PCI memory into user space? (Arne Driescher)
Timer in Linux (Sasha)
Does filesystem fragment? (Al Byers)
floating point in kernel... (Perego Paolo)
Re: How to remap PCI memory into user space? (Heiko Bachmann)
Re: CIFS.. (Daryl Fonseca-Holt)
Re: nvidia kernel module under 2.4.0-test11 (Toby Haynes)
Re: I admit it! (Toby Haynes)
Re: floating point in kernel... ([EMAIL PROTECTED])
Re: floating point in kernel... ([EMAIL PROTECTED])
Re: Does filesystem fragment? ([EMAIL PROTECTED])
----------------------------------------------------------------------------
From: "Geoff Winkless" <[EMAIL PROTECTED]>
Subject: Re: System V Semphores and Linux
Date: Wed, 29 Nov 2000 10:43:13 -0000
<[EMAIL PROTECTED]> wrote in message
news:902e6n$cmk$[EMAIL PROTECTED]...
: Hi,
:
: over the last few months I developed an IPC-Library which encapsulates the
: system calls needed to access semaphores, shared memory, pipes, and so on
: (based on Steven's book). It is designed to support either System V or
POSIX.
: The basic problem is the support for Linux _and_ SGI's IRIX. IRIX is
causing
: no problems, but porting the Lib to Linux reveales some strange behaviour.
: Basically porting the System V implementation to Linux should work, but on
: some maschines it only seems to run. Getting a semphore using semget
returns
: a "normal" identifier and all operations on this semaphore cause no
errors,
: but when I look at the IPC state using ipcs then I'm told that there is no
: semaphore allocated not to mention that all semaphore operations have no
: effect. To top all this: on some maschines it works.
Make sure you have IPC support compiled into the kernel.
Geoff
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: [Q] How to get the Ethernet address ?
Date: Wed, 29 Nov 2000 12:07:00 -0000
On Mon, 27 Nov 2000 03:39:31 GMT scz <[EMAIL PROTECTED]> wrote:
| [EMAIL PROTECTED] wrote:
|>
|> On Sun, 26 Nov 2000 02:33:40 GMT scz <[EMAIL PROTECTED]> wrote:
|>
|> | Since the original post reads "the Ethernet address", one might
|> | infer that the machine has one (1) Ethernet interface. Tricky,
|> | eh?
|>
|> Or one might infer that the original poster could not imagine
|> a machine having more than one, because (as you so kindly point
|> out) his has only one, but that he may be faced with a program
|> he is developing that needs to have "the Ethernet address".
|
| True. But the majority of userland (ie desktop) systems have only
| one interface, and he may be developing for machines serving in
| this particular role. However, I don't know this to be true - and
| neither, I suspect, do you. I would like to reiterate the need
| for clarification before jumping to conclusions.
I concluded nothing. I broadened the question as it should be considered by
a designer.
|> | Note also the domain from which the original post was sent:
|> | swisscom.com. A quick perusal of www.swisscom.com shows that
|> | content is available in a number of languages. Perhaps Cedric
|> | is not a native speaker of English, and he meant "an" vice "the".
|> | Why don't you ask him for clarification instead of providing
|> | empty (and nitpicky) rhetoric in response?
|>
|> The response was quite far from empty. It was full of advice
|> on how to understand the complexity of computer concepts that
|> frequently escape people who make limited observations of just
|> a few sample machines. Of course he might have mean "an".
|
| If he is developing *only* for that limited subset - entirely possible,
| such as in a lab environment - then the extraneous points you introduce
| become quite obviously irrelevant.
He may be. But if he does limit his knowledge base to just what he has in
the lab, then he won't be able to go very far with development.
|> In that case my response might be slightly rephrased because
|> just "an" address suggests one of many. But which one? The
|> one the application currently has a socket open with?
|
| Possibly. But you won't know unless you ask for clarification. I
| go back to the original request, which seemed rather straightforward:
| "How can I get the Ethernet address from my C++ application ?" I
| daresay that most reasonable folk would infer that he meant the
| Ethernet address of the [desktop] machine on which he is working.
I do not agree that this would be the only case. Perhaps MOST folk may make
such an assumption. But such assumptions are also the kinds of things that
are causing so many people to produce so much crap they call software.
|> |> Or maybe you want the address associated with the name the
|> |> machine is called? And what if there are multiple of those?
|> |> What if the machine has many alias hostnames? You want those,
|> |> too?
|> |
|> | He didn't ask for hostnames or hostids, either. Why is this
|> | so confusing [to you]?
|>
|> I believe you are the one who is confused. Why do you insist on
|> responses being very narrow and, in the case of an ill-formed
|> question, possibly being misleading?
|
| By way of an analogy, if someone asks for the current time you needn't
| tell him how to build a clock: sometimes the very simple answer is
| entirely correct/appropriate.
Your analogy shows that you entirely misunderstand the situation.
People who check time do not need to build clocks. However, they may need
to be able to read some different kinds of clocks. So if someone asks how
do I tell what time it is on my clock, you might first ask them what kind of
clock it is (e.g. is it a 12 hour clock or a 24 hour clock, or does it have
2 hands or 3 hands), while I would proceed to tell them how to read clocks
with 12 hours or 24 hours, and clocks with 2 hands and clocks with 3 hands.
You would have taught them how to read 1 type of clock in 2 messages,
whereas I would have taught them how to read 4 types of clocks in 1 message.
|> |> Do you want ethernet MAC addresses, or IP addresses? Do you
|> |> want IPv4 addresses or IPv6 addresses?
|> |
|> | Let's ask a few more farfetched and irrelevant questions. The
|> | answer to all of your rambling is, of course, mu. 'Mu' is the
|> | correct response to a question predicated upon an incorrect
|> | assumption.
|>
|> Utterly useless.
|
| Just a bit of information - lost on you, apparently - regarding
| incorrect suppositions and their effect on discourse. This was a vain
| attempt on my part to point out that your IP-address-related questions
| are irrelevant because Ethernet address != IP address.
At least I realize there is a difference, and also know that most people do
not know this difference and do use the term "ethernet address" when they
mean "IP address assocaited with my ethernet interface".
|> |> Will your program become corrupt if a syscall returns an array
|> |> of over 20000 addresses (yes, I've had that many on one machine)?
|> |
|> | That would be up to him, I imagine. And I'm sure he is mightily
|> | impressed by the size of your array.
|>
|> There are way too many poorly designed (indeed too often not even
|> designed at all) programs out there to just stand by and let yet
|> another misunderstanding go by. In your case, I won't bother.
|> But the original poster has not offended me in any way, so I am
|> willing to help him and point out all the issues he may need to
|> consider (in his development project I suspect he may be doing).
|
| In the time you spent trying to read volumes into a very simple
| question, you could have gotten clarification on Cedric's problem
| and provided some [potentially] useful feedback. If you haven't
| contacted him directly (and I gather you haven't), doing so is
| likely the most productive action to take.
And left him with a misunderstanding of the real scope of things he may need
to consider? There is no way I will do this. I have had this kind of thing
done to me many times in the past and left me with knowledge that was useful
in only a limited circumstance. I had to re-learn concepts when I went into
the real world. Ironically, it was academic types who were short-changing
me on knowledge.
--
=================================================================
| Phil Howard - KA9WGN | Dallas | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/ |
=================================================================
------------------------------
From: [EMAIL PROTECTED] (Lew Pitcher)
Subject: Re: CIFS..
Reply-To: [EMAIL PROTECTED]
Date: Wed, 29 Nov 2000 13:02:36 GMT
On 29 Nov 2000 07:15:05 GMT, [EMAIL PROTECTED] (Volker
Kuhlmann) wrote:
>> Linux has smbfs (Samba) support and has for a long time. CIFS is MicroSoft's
>> name for smb. I use the smbfs support in the kernel along with the Samba
>> package to connect a Network Neighborhood of two Win98 machines via my Linux
>> server.
>
>The linux smbfs seems to work now, but the dates and times it displays
>for files are completely shot (the linux fat fs is buggy too - where do
>I report this to?).
It could be your setup rather than smbfs and msdos support. If you
don't have timezones and your clock properly configured, the MSDOS
file dates look screwy.
>For a very nice product, try
>
>http://www.obdev.at/Products/Sharity.html
>
>Use the 2.4 beta, it's pretty stable. The automounter (and netowrk
>neighbourhood) are pretty nifty. There are rpms as well.
>
>Volker
>
>--
>Volker Kuhlmann ([EMAIL PROTECTED])
Lew Pitcher
Information Technology Consultant
Toronto Dominion Bank Financial Group
([EMAIL PROTECTED])
(Opinions expressed are my own, not my employer's.)
------------------------------
From: Heiko Bachmann <[EMAIL PROTECTED]>
Subject: How to remap PCI memory into user space?
Date: Wed, 29 Nov 2000 14:04:55 +0100
Hi,
I want to access PCI device memory per mmap() method from
user space. My driver does a ioremap(), and provides a /dev
for mmap()-access. But remapping (remap_page_range()) with
the address I got from ioremap() only gives me lots of 0xff
at user space side.
Thanks for any hint!
Heiko.
([EMAIL PROTECTED])
------------------------------
From: Anders Larsen <[EMAIL PROTECTED]>
Subject: Re: CIFS..
Date: Wed, 29 Nov 2000 13:52:46 +0100
Volker Kuhlmann wrote:
[snip]
> The linux smbfs seems to work now, but the dates and times it displays
> for files are completely shot (the linux fat fs is buggy too - where do
> I report this to?
$ grep -A5 SMB /usr/src/linux/MAINTAINERS
$ grep -A5 FAT /usr/src/linux/MAINTAINERS
--
Anders Larsen
------------------------------
From: Arne Driescher <[EMAIL PROTECTED]>
Subject: Re: How to remap PCI memory into user space?
Date: Wed, 29 Nov 2000 14:22:23 +0100
Heiko Bachmann wrote:
>
> Hi,
>
> I want to access PCI device memory per mmap() method from
> user space. My driver does a ioremap(), and provides a /dev
> for mmap()-access. But remapping (remap_page_range()) with
> the address I got from ioremap() only gives me lots of 0xff
> at user space side.
>
> Thanks for any hint!
> Heiko.
>
> ([EMAIL PROTECTED])
Hmm, let's guess ....
virt_pci_addr = ioremap (unsigned long phys_pci_addr, unsigned long
pci_region_size)
remap_page_ranges(virt_addr, phys_addr,size,prot);
You don't have by chance used virt_pci_addr as phys_addr in
remap_page_range?
Just a guess :-)
-Arne
------------------------------
From: Sasha <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Timer in Linux
Date: Wed, 29 Nov 2000 13:23:56 GMT
Hi everyone
I was wandering what kind of timer is used in Linux TCP implementation
to retransmit a packet. Because if a packet is not acknowledged in a
very short period of time it will be retransmitted. That means the
timer is independent of CPU's speed.
Could it be the same time function we use in C to show the time of the
day or what ?
Hope some body could give some answer.
Thanks in advance Sasha
------------------------------
From: Al Byers <[EMAIL PROTECTED]>
Subject: Does filesystem fragment?
Date: Wed, 29 Nov 2000 08:48:41 -0500
I am looking to build an intermediate storage system for temporarily
storing variable length XML strings that come from multiple sources. I
originally did it using the MySQL database, but the insertion was very
slow due to multiple keys and inefficient programming. I could work on
that aspect, but the thought occurred that simple flat files will give
me what I want - sequential storage and access, keyed by one value (the
file name), easy to maintain (use "find" to remove dead files). My
concern is that with all the creating and destroying of files, that the
filesystem will get hopelessly fragmented. I am running Redhat 6.2. Is
that a valid concern? Are there steps that I can take to deal with it?
Thanks for any help, including flames.
-Al
--
Al Byers
Local Square, Inc.
826 N. Augusta St.
Staunton, VA 24401
540.213.0500
www.localsquare.com
[EMAIL PROTECTED]
------------------------------
From: Perego Paolo <[EMAIL PROTECTED]>
Subject: floating point in kernel...
Date: 29 Nov 2000 13:46:08 GMT
Hi guys, I know that I can't use floating point in my kernel module but
I need to calculate a thing like system load.
I've got the number of packets proccessed by my module end the number
of seconds my module's up ( I've used jiffies and jiffies_to_timespec )
; now I need to perform (number of packets/time) to have a sort of
module load.
My problem is that I can't achieve a floating point in any manner, so
can you give same ideas.
Ps: I've already "sniffed" /usr/include/linux/sched.h but it doesn't
help me anymore :(
Thanks
--
$>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: Heiko Bachmann <[EMAIL PROTECTED]>
Subject: Re: How to remap PCI memory into user space?
Date: Wed, 29 Nov 2000 15:04:49 +0100
Arne Driescher wrote:
> Hmm, let's guess ....
>
> virt_pci_addr = ioremap (unsigned long phys_pci_addr, unsigned long
> pci_region_size)
>
> remap_page_ranges(virt_addr, phys_addr,size,prot);
>
> You don't have by chance used virt_pci_addr as phys_addr in
> remap_page_range?
That's it! Using the physical PCI address seems to work.
Thanks,
Heiko.
------------------------------
From: [EMAIL PROTECTED] (Daryl Fonseca-Holt)
Subject: Re: CIFS..
Reply-To: [EMAIL PROTECTED]
Date: Wed, 29 Nov 2000 08:04:29 -0600
Hmm, dates and times work fine for me. And the linux fat fs is separate issue.
FAT disks mount through Samba work fine as do VFAT disks.
And most of all, Sharity is not free. Samba is.
On 29 Nov 2000 07:15:05 GMT, Volker Kuhlmann
<[EMAIL PROTECTED]> wrote:
>> Linux has smbfs (Samba) support and has for a long time. CIFS is MicroSoft's
>> name for smb. I use the smbfs support in the kernel along with the Samba
>> package to connect a Network Neighborhood of two Win98 machines via my Linux
>> server.
>
>The linux smbfs seems to work now, but the dates and times it displays
>for files are completely shot (the linux fat fs is buggy too - where do
>I report this to?). For a very nice product, try
>
>http://www.obdev.at/Products/Sharity.html
>
>Use the 2.4 beta, it's pretty stable. The automounter (and netowrk
>neighbourhood) are pretty nifty. There are rpms as well.
>
>Volker
>
>--
>Volker Kuhlmann ([EMAIL PROTECTED])
------------------------------
From: Toby Haynes <[EMAIL PROTECTED]>
Subject: Re: nvidia kernel module under 2.4.0-test11
Date: 29 Nov 2000 09:04:38 -0500
On Tue, 28 Nov 2000, [EMAIL PROTECTED] wrote:
> Hi,
>
>>> NVIDIA GeForce graphics card. [...]
>>> I have got a version which is claimed to compile on 2.3.x but
>>> it fails on 2.4.0-test11. [...]
>
>> go to irc.openprojects.net #nvidia !
>
> Is there a way to solve the problem without going into IRC?
http://www.linuxgames.com/misc/patch-nvdriver-2.4.0-test11-2
should do the trick.
Cheers,
Toby Haynes
--
Toby Haynes
The views and opinions expressed in this message are my own, and do
not necessarily reflect those of IBM Canada.
------------------------------
From: Toby Haynes <[EMAIL PROTECTED]>
Subject: Re: I admit it!
Date: 29 Nov 2000 09:13:15 -0500
On Mon, 27 Nov 2000, [EMAIL PROTECTED] wrote:
> On Sun, 26 Nov 2000 22:40:39 GMT, Andreas Haberstroh <[EMAIL PROTECTED]>
> wrote:
>>Is there something like this in linux?
>>Not the gdb, but, something with a GUI.
>
> There are GUI front ends to gdb, like xxgdb or ddd. In ddd you can plot views
> of variables on a graph-like thing. Can't speak from experience; I looked
> over the shoulder of someone who was odoing it. ;)
I've started to invest some time on DDD learning its tricks (formerly I used
xxgdb). Having played with Solaris WorkShop and the xldb debugger on AIX, I'm
pretty impressed with DDD. Hell, I'm pretty impressed with GDB - it offers
features like casting arbitrary parts of memory to structures and setting
breakpoints on trigger conditions which are difficult if not impossible with a
lot of debuggers. I've even managed to successfully attach DDD to the DB2 UDB
source code I work on, and that is a large project :-)
DDD is particularly useful for interogating complex data structures such as
trees, linked lists as it can lay them out graphically for you while still
giving you all the important info (memory addresses, pointers, node
information). It also has tricks to push data out to bar charts and other types
of graphical display as long as you have gnuplot on your machine.
I seriously recommend printing out the manuals for both DDD and GDB if you want
to do serious work with these tools. There are vast numbers of options to play
with to control execution of the program and trace problems and you'll miss
useful tricks if you don't have the manual. The manual for GDB gives you a
thorough grounding in what the debugger is capable of, and the DDD manual tells
you how to access that information without resorting to the gdb command line.
Cheers,
Toby Haynes
--
Toby Haynes
The views and opinions expressed in this message are my own, and do
not necessarily reflect those of IBM Canada.
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: floating point in kernel...
Date: Wed, 29 Nov 2000 14:26:33 GMT
Perego Paolo <[EMAIL PROTECTED]> wrote:
> Hi guys, I know that I can't use floating point in my kernel module but
> I need to calculate a thing like system load.
> I've got the number of packets proccessed by my module end the number
> of seconds my module's up ( I've used jiffies and jiffies_to_timespec )
> ; now I need to perform (number of packets/time) to have a sort of
> module load.
> My problem is that I can't achieve a floating point in any manner, so
> can you give same ideas.
You can do this sort of stuff with integer math if you are just careful
to scale your numbers appropriately. Perhaps just multiple the number
of packets by 1000, then divide. You can put the decimal in place
artificially then, and get the answer to three dec places. ( that was
an example, not sure what you precisely want to do).
I found it helpful to look at the kernel bogomips calculation.
Taavo.
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: floating point in kernel...
Date: Wed, 29 Nov 2000 14:32:07 GMT
Perego Paolo <[EMAIL PROTECTED]> writes:
> Hi guys, I know that I can't use floating point in my kernel module but
> I need to calculate a thing like system load.
> I've got the number of packets proccessed by my module end the number
> of seconds my module's up ( I've used jiffies and jiffies_to_timespec )
> ; now I need to perform (number of packets/time) to have a sort of
> module load.
>
> My problem is that I can't achieve a floating point in any manner, so
> can you give same ideas.
The problem with FP is that FP operations need to have some equivalent
to libm in order to implement them, but libm lives in user space, not
in kernel space. That _is_ a necessary constraint; Linux runs on
processors that don't have FP, thus meaning that making FP a kernel
dependancy would be a Bad Thing.
Perhaps you want to use fixed point math instead? You'd have to shift
the decimal point yourself, for display purposes, not that the decimal
point would actually be particularly _meaningful_...
--
(concatenate 'string "cbbrowne" "@hex.net") <http://www.ntlug.org/~cbbrowne/>
One man's constant is another man's variable. -- Alan Perlis
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Does filesystem fragment?
Date: Wed, 29 Nov 2000 14:51:50 GMT
Al Byers <[EMAIL PROTECTED]> writes:
> I am looking to build an intermediate storage system for temporarily
> storing variable length XML strings that come from multiple sources. I
> originally did it using the MySQL database, but the insertion was very
> slow due to multiple keys and inefficient programming. I could work on
> that aspect, but the thought occurred that simple flat files will give
> me what I want - sequential storage and access, keyed by one value (the
> file name), easy to maintain (use "find" to remove dead files). My
> concern is that with all the creating and destroying of files, that the
> filesystem will get hopelessly fragmented. I am running Redhat 6.2. Is
> that a valid concern? Are there steps that I can take to deal with it?
The problem you would likely hit would not be of fragmentation, but
rather of the directory in use growing in size, perhaps getting rather
inefficient to access.
This _won't_ matter much if we're talking about the number of files
being 500; it _will_ start to matter if the number of different tags
heads up into the thousands or tens of thousands.
Basically, you'll get the situation where a directory will get very
large even though it might not presently be referencing a lot of
files.
For instance, my mail messages get spooled into ~/Maildir/cur, which
grows rather large:
% ls -l ~/Maildir
total 55
drwxrwxr-x 2 cbbrowne cbbrowne 49152 Nov 29 08:47 cur
drwxrwxr-x 2 cbbrowne cbbrowne 5120 Nov 29 08:47 new
drwx------ 2 cbbrowne cbbrowne 1024 Nov 29 08:47 tmp
There used to be 800-odd files in cur; right now there are NONE, but
the directory structure is still big.
If you wind up having huge hordes of tags, on the order of tens of
thousands, this will be a problem.
The Clever Answer, used by all sorts of Unix tools that have the
potential to spool lots of files into a common "soup," is to
essentially do a radix sort.
If your tag is <THIS>, then strip off the first character or so, so
that the file associated with it is:
/database/T/HIS
Tag <THAT> maps to:
/database/T/HAT
Tag <WHATEVER> maps to:
/database/W/HATEVER
If you expect that there will be hordes of tags with the same first
letter, you might want to take this an extra layer deep:
/database/T/H/IS
/database/T/H/AT
/database/W/H/ATEVER
or perhaps to group together in twos [26*26 = 576, which is not
outrageously big]:
/database/TH/IS
/database/TH/AT
/database/WH/ATEVER
You need a little special handling in the case of a short tag like
<A>, but that shouldn't be prohibitively difficult.
Fragmentation is generally only an issue if you're trying to fit
Pretty Big Files into a Pretty Full Filesystem, which is quite
distinct from your likely problems...
--
(concatenate 'string "cbbrowne" "@hex.net") <http://www.ntlug.org/~cbbrowne/>
Rules of the Evil Overlord #91. "I will not ignore the messenger that
stumbles in exhausted and obviously agitated until my personal
grooming or current entertainment is finished. It might actually be
important." <http://www.eviloverlord.com/>
------------------------------
** 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
******************************