Linux-Development-Sys Digest #918, Volume #7 Tue, 30 May 00 12:13:12 EDT
Contents:
source of ipchains ("Sake")
Re: Winmodems )Re: Need ideas for university funded project for linux)
([EMAIL PROTECTED])
Re: oops messages and wait queue declaration (Arnaud Westenberg)
Re: kernel debugger KGDB (Jean-Francois MOINE)
Linker does not find libs in some cases ("Timo Volkmer")
Re: Technical advantages/disadvantages of Linux (steve@n)
Re: Keyboards (Nix)
Re: virt_to_phys vs pgd/pmd/pte_offset calls (Robert Kaiser)
Re: kernel documentation, memory management, kmalloc, mmap. (Robert Kaiser)
kernel patch info (Kuang-chun Cheng)
Which system call can change the address of gateway or netmask? (Chan Chi Lung)
Re: oops messages and wait queue declaration (Arnaud Westenberg)
mmap on /dev/kmem: sample code? (Emmanuel Dreyfus)
Re: kernel patch info (Arnaud Westenberg)
assembler problems (frank sinner)
webcam installation ("Federica Ferretti")
Re: Technical advantages/disadvantages of Linux (Grant Edwards)
LDFLAGS doesn't work as expected w/ GNU Make ("William D. Ezell")
Re: naming a thread created from kernel_thread() in a module (Travis Hein)
----------------------------------------------------------------------------
From: "Sake" <[EMAIL PROTECTED]>
Subject: source of ipchains
Date: Mon, 29 May 2000 22:25:59 -0400
Hi,
Can anybody point me to the source code of the 'ipchains' utility ?
Thanks you very much.
------------------------------
Crossposted-To:
comp.os.linux,comp.os.linux.development,comp.os.linux.development.apps,comp.os.linux.misc,comp.os.linux.setup,comp.os.linux.advocacy
Subject: Re: Winmodems )Re: Need ideas for university funded project for linux)
From: [EMAIL PROTECTED]
Date: Tue, 30 May 2000 04:06:10 GMT
[EMAIL PROTECTED] (Victor Wagner) writes:
[using internal power supply connectors to drive external devices]
> But you have various connectors inside case - for hard disks and so on.
> Have ever seen how indicators on front panel or 486's coolers are
> connected to them? Solder a long cable to such a device (female and
> male connectors connected with 5cm of cable) and you only need to find a
> hole in case to lead this cable outside.
In so doing, of course, you run the risk of introducing unpleasant
interference from the external world. And you also drive the PS
harder, which makes it heat up faster and last longer.
Maybe I'm a special case, but I already ruined a motherboard by
driving it from an inadequate PS. And I burn through roughly one
PS per year. Bear in mind that, with that one exception, all the PSes
have been at or above the rated level. I don't want to think how fast
I'd be flying through 'em if I started hooking in all the other crap
I've got.
--
Eric P. McCoy ([EMAIL PROTECTED])
non-combatant, n. A dead Quaker.
- Ambrose Bierce, _The Devil's Dictionary_
------------------------------
Date: Tue, 30 May 2000 06:48:48 +0200
From: Arnaud Westenberg <[EMAIL PROTECTED]>
Subject: Re: oops messages and wait queue declaration
Kaz Kylheku wrote:
> [ please don't post MIME encoded messages with attachments to discussion
> groups ]
Sorry, I didn't know an attachment makes it MIME, won't happen again!
> What about ``some code to set up the wait queue?'' How did you initialize
> the wq member of the structure by calling init_waitqueue(&new_entry->wq) ?
Hmm, I've never seen this before since I'm used to declare the
structures static (should have thought of it myself).
> Also, did you protect your linked list insertion and deletion with a spinlock
> or semaphore?
Yes, I've used a spinlock but I left that code out in my explanation.
Thanks Arnaud
------------------------------
From: [EMAIL PROTECTED] (Jean-Francois MOINE)
Subject: Re: kernel debugger KGDB
Date: 30 May 2000 07:13:07 GMT
Song Sam Liang <[EMAIL PROTECTED]> a skrivas:
>Hello,
Hello Sam,
> Has anybody used the kernel debugger KGDB
>(http://oss.sgi.com/projects/kgdb/)? What's your experience
>with it?
I did. It works fine, but I found the following problems:
- removing the C flags '-fomit-frame-pointer' at the toplevel
Makefile seems not enough: it is added somewhere else.
- debugging the kernel modules is not easy: the sections
are not contiguous. I got the latest GDB (5.0) which has
an extended 'add-symbol-file' command and I will try it
today. Trick: if you forgot the '-m' when installing a
module, you may get the sections offsets using
'insmod -n -m <module>'.
> There is very little information as to how to set it up.
>How should I connect the machine on which I run the kernel
>and the machine on which I run gdb? Should I use a so
>called "null modem cable", with pin #2 and pin #3
>crossed-over?
Indeed. You may test the connection using 'cat' as described
in the documentation.
> Other than applying the patch and recompile the kernel, do
>I need to do any other configuration on either machine?
No, except having CONFIG_SERIAL set (Y or M) in both kernels!
--
Ken ar c'henta� ** Breizh ha Linux atav ! **
mailto:[EMAIL PROTECTED]
Jef (home mailto:[EMAIL PROTECTED])
http://moinejf.free.fr/
------------------------------
From: "Timo Volkmer" <[EMAIL PROTECTED]>
Subject: Linker does not find libs in some cases
Date: Tue, 30 May 2000 09:16:09 +0200
Hi everybody,
I am not an advanced user and I am having problems linking some of my C++
programs.
I use SuSE-Linux 6.2 and g++ (egcs 2.91.66). The linker does often not find
libraries which are
accessed via a softlink. For example:
Linker command:
g++ -Wl,shared -L/usr/oracle/V8.0.5/lib -lclntsh ...
The error-message says "clntsh: no such file or directory ..."
When I look into the directory I can find the following:
lrwxrwxrwx 1 root root 16 Feb 7 20:00 libclntsh.so ->
libclntsh.so.1.0*
-rwxr-xr-x 1 oracle dba 4381924 Feb 7 19:48 libclntsh.so.1.0*
When I change the linker command to the following:
-Wl,-static -L/usr/oracle/V8.0.5/lib /usr/oracle/V8.0.5/lib/libclntsh.so
then it works.
What can the problem be? I have this kind of problem experienced with many
different libs and also while I was trying to include some header-files. I
am a kind of deserted here ...
I'll appreciate any help ... Thanks!
Timo.
eMail: [EMAIL PROTECTED]
------------------------------
From: steve@n
Subject: Re: Technical advantages/disadvantages of Linux
Date: 29 May 2000 23:46:01 -0700
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
>>To start with, you need to come up with a list of the functionalities
>>that Linux provides, and do the same for the OS's you are trying
>>to compare it with.
>
>Nope. You need to come up with a list of functionalities your application
>needs
Nope.
There are millions of applications out there. You can not do it from
the application point of view.
As was said, you come up of list of functionalities a product provides,
and then see if it provides what you want. The original poster was
asking for technical features of linux (read the title befor you
respond next time), he was not asking if Linux is good run some specific
applicatin on.
steve
------------------------------
From: Nix <$}xinix{[email protected]>
Subject: Re: Keyboards
Date: 30 May 2000 00:06:02 +0100
Marc Baker <[EMAIL PROTECTED]> writes:
> Does anyone know of a way to find out what signals are sent from the
> multimedia keys on the ever so special multimedia/Internet keyboards we
> see so much of these days?
dumpkeys, xev.
> --------------52B9D9C97A365ABC7D0E51E1
> Content-Type: text/html; charset=us-ascii
Turn this off, please.
--
`People's needs are not `finance'. You can't eat a bank.' --- Alan Rosenthal
------------------------------
From: [EMAIL PROTECTED] (Robert Kaiser)
Subject: Re: virt_to_phys vs pgd/pmd/pte_offset calls
Date: 30 May 2000 08:31:10 GMT
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Emmanuel Dreyfus) writes:
> I understood that kernel virtual addresses were the physical addresses.
> I'm now completely confused about kernel adressing mode, since I can
> read in <asm/io.h> that
> virt_to_phys(x) = x & ~0xc0000000
>
Actually, it's x & ~PAGE_OFFSET, where PAGE_OFFSET is 0xc0000000
by default, but can also be configured to assume different values.
Kernel addresses are physical address _plus_ an offset of PAGE_OFFSET.
Thus, the kernel address space is mapped linear (i.e. to convert kernel
to physical or vice versa, you just have to subtract or add an offset).
This is not the case with user space addresses. Their physical-to-
virtual mapping is nonlinear (i.e. determined by a translation table).
> if a kernel virtual address is the physical address, I would have
> expected virt_to_phys(x) = x
AFAIK, this used to be the case with older kernels (2.0.x (?)), but
it is definitely not true for the 2.2.x kernels.
Cheers
Rob
================================================================
Robert Kaiser email: rkaiser AT sysgo DOT de
SYSGO RTS GmbH
Klein-Winternheim / Germany
------------------------------
From: [EMAIL PROTECTED] (Robert Kaiser)
Subject: Re: kernel documentation, memory management, kmalloc, mmap.
Date: 30 May 2000 09:00:22 GMT
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Emmanuel Dreyfus) writes:
> Let's try to describe the big picture. Please tell me where I'm wrong.
>
> 1) What my PCI device sees is not the physical address but the bus
> address (which is the same on x86 but might be different on other
> plateforms)
>
> 2) When running in kernel mode, the CPU sees the memory as it is
> physically, but translated to 0xc0000000. To get a bus address from a
> kernel virtual address, I should use virt_to_bus (this macro will just
> untraslate the address from 0xc0000000)
<picking nits>
please note that 0xc0000000 is actually PAGE_OFFSET
which _may_ be defined to have a value different from 0xc0000000.
</picking nits>
>
> 3) To get a bus address from a user virtual address, I should walk
> through the pgd/pmd/pte stuff, and then do a virt_to_bus on it. I must
> be in kernel mode to do that, and I must have mlock()'ed the page to
> ensure they are not swapped.
Seems OK so far. Two potential pitfalls though:
1) Unlike the kernel address space, the mapping set up by the
pgd/pmd/pte stuff is nonlinear. This means that you have to
go through the pgd/pmd/pte stuff for each individual page
that makes up your buffer. The buffer appears to be contiguous
in user space, but it's pages (i.e. 4K chunks) may be arbitrarily
scattered across the physical address space.
2) If your user program -for instance- obtained the buffer from
malloc(), the pages belonging to that buffer will typically
not be mapped yet. Linux uses a technique called "copy-on-write"
(COW) for these pages: As long as you don't write to the pages,
they are all mapped read-only to a single physical page. Then,
once the CPU writes to one of these pages, it receives a page
fault because the mapping was read-only. The page fault handler
in the kernel then allocates a fresh page and maps it read-write.
The nice thing about this technique is that buffers don't consume
memory until they are actually being used (i.e. written to).
However, if it's an external bus master (e.g. a PCI card) that
writes to the buffer, the COW technique won't work.
Unfortunately, mlock() just ensures that the buffers won't be
swapped out, but it does not ensure that they are mapped to
valid memory in the fist place. To solve this, you must have
the CPU write at least once to each page of the buffer after
mlock()ing it.
Have a look at ftp://ftp.sysgo.de/pub/Linux for a patch to allow
user-space DMA in Linux.
BTW: I sent this patch to Linus long ago, requesting it should be
added into the standard kernel, but he rejected it. I understand that
the 2.3.x kernels now (finally!) have the functionality to do user-
space DMA. Of course the API is completely different from the functions
added by my patch, but I'm glad to see that Linux is now able to
do user-space DMA.
Cheers
Rob
================================================================
Robert Kaiser email: rkaiser AT sysgo DOT de
SYSGO RTS GmbH
Klein-Winternheim / Germany
------------------------------
From: Kuang-chun Cheng <[EMAIL PROTECTED]>
Subject: kernel patch info
Date: 30 May 2000 09:42:13 GMT
Hi,
I want to know the major change between Linux kernel from 1.2.x
to 2.3.x. And most important, what Linux want to achieve when switch
to new kernel series. Where can I found such information, thanks.
Kuang-chun Cheng
[EMAIL PROTECTED]
------------------------------
From: Chan Chi Lung <[EMAIL PROTECTED]>
Subject: Which system call can change the address of gateway or netmask?
Date: 30 May 2000 10:13:53 GMT
As Title.
I want to ask which system call is used to change the address of
gateway and netmask of a ethernet device. Or where can I find the
relevant information.
------------------------------
Date: Tue, 30 May 2000 11:20:04 +0200
From: Arnaud Westenberg <[EMAIL PROTECTED]>
Subject: Re: oops messages and wait queue declaration
Kaz Kylheku wrote:
> What about ``some code to set up the wait queue?'' How did you initialize
> the wq member of the structure by calling init_waitqueue(&new_entry->wq) ?
Please correct me if I'm wrong.
init_waitqueue(&queue) produces a single queue (circular to itself) so
there is no need to properly cleanup the queue since it isn't linked to
other queues?
Thanks
Arnaud
------------------------------
From: [EMAIL PROTECTED] (Emmanuel Dreyfus)
Subject: mmap on /dev/kmem: sample code?
Date: Tue, 30 May 2000 14:03:12 +0200
I'm looking for some sample code that mmap an area of /dev/kmem in a
user process, in order to understand what's wrong with my code.
Any suggestion?
--
Emmanuel Dreyfus
[EMAIL PROTECTED]
------------------------------
Date: Tue, 30 May 2000 13:21:00 +0200
From: Arnaud Westenberg <[EMAIL PROTECTED]>
Subject: Re: kernel patch info
Kuang-chun Cheng wrote:
>
> Hi,
>
> I want to know the major change between Linux kernel from 1.2.x
> to 2.3.x. And most important, what Linux want to achieve when switch
> to new kernel series. Where can I found such information, thanks.
I assume you ment from 2.2.x to 2.3.x. The 2.[oneven number] are
development (== unstable) kernels and 2.[even number] are stable
kernels.
For changes check out http://kernelnotes.org/ here all changes in the
kernel are discussed.
I don't know what you mean with "what Linux want to achieve when switch
to new kernel series" but obviously new features etc.
Arnaud
------------------------------
From: frank sinner <[EMAIL PROTECTED]>
Subject: assembler problems
Date: Tue, 30 May 2000 16:14:59 +0200
hello,
i've got an assembler programm which was written for windows NT. I would
like to port it to LINUX. Which programm should i use? NSAM has serious
problems with the code!!
thanks in advance
frank
------------------------------
From: "Federica Ferretti" <[EMAIL PROTECTED]>
Subject: webcam installation
Date: Tue, 30 May 2000 17:19:13 +0200
Hi to all,
I have to install the video-cam in a linux machine (RedHat 6.1).
I tried to do it, but we are confused about installation of drivers.
I only want that the cam aquire a video by start and stop command or button.
I don't know the step necessary.
I try to follow an procedure but i'm unable to do advanced operation with
the kernel.
Can you give me full details of this or any help about the easy way to the
basic operation like aquire a video?
p.s. Sorry but my English is not very well.
I hope in your help.
Best Regards,
--Federica
------------------------------
From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: Technical advantages/disadvantages of Linux
Date: Tue, 30 May 2000 15:33:35 GMT
In article <8gvo39$[EMAIL PROTECTED]>, steve@n wrote:
>>>To start with, you need to come up with a list of the functionalities
>>>that Linux provides, and do the same for the OS's you are trying
>>>to compare it with.
>
>>Nope. You need to come up with a list of functionalities your application
>>needs
>
>Nope.
>
>There are millions of applications out there. You can not do it from
>the application point of view.
If you don't use your Linux system to run applications, then
what _do_ you do with it?
>As was said, you come up of list of functionalities a product
>provides, and then see if it provides what you want.
For an OS, that functionality is to allow you to run
applications. You've got to pick the applications you want to
run and then evaluate how well the OS supports them.
>The original poster was asking for technical features of linux
>(read the title befor you respond next time), he was not asking
>if Linux is good run some specific applicatin on.
But running applications is what an OS is _for_. It would be
silly to evaluate it on anything else.
--
Grant Edwards grante Yow! Two with FLUFFO,
at hold th' BEETS...side of
visi.com SOYETTES!
------------------------------
From: "William D. Ezell" <wd~[EMAIL PROTECTED]>
Reply-To: wd~[EMAIL PROTECTED]
Subject: LDFLAGS doesn't work as expected w/ GNU Make
Date: 30 May 2000 10:45:37 -0600
I'm venturing into Liunx development for the first time and am
encountering unexpected behavior from GNU Make 3.77. Essentially, the
following Makefile target links as expected:
collapse: collapse.o spropcase.o
gcc -o collapse collapse.o spropcase.o
-L/usr/local/mysql/lib/mysql \
-lmysqlclient -lnsl
(actual Makefile has all gcc options on same line, e.g., no '\' )
However, the following construction yields series of 'undefined
reference to function xxx' error messages (which appear to result from
link failures):
LDFLAGS = -L/usr/local/mysql/lib/mysql -lmysqlclient -lnsl
collapse: collapse.o spropcase.o
gcc -o collapse collapse.o spropcase.o
Shouldn't the LDFLAGS Make variable serve the same purpose as inline
linker parameters (as in the first syntax)? I'm sure I'm overlooking
something simple but can't seem to make this work.
My environment:
Red Hat 6.1 (2.2.12-20)
GNU Make 3.77
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
Advice and/or enlightenment appreciated. Please reply via e-mail if
possible (note the anti-spam instructions below).
Thanks,
William D. Ezell
****** To reply, remove the "~" from "wd~[EMAIL PROTECTED]" ******
======================================================================
Proud Member, US Federal Witness Protection Program
======================================================================
------------------------------
From: Travis Hein <[EMAIL PROTECTED]>
Subject: Re: naming a thread created from kernel_thread() in a module
Date: Tue, 30 May 2000 11:52:48 -0400
thank you very much for the help
it is exactly what i needed.
"Morton, Andrew [WOLL:4009-M:EXCH]" wrote:
> Travis Hein wrote:
> >
> > i am using the kernel_thread() function to create a sepearate thread during
> > module initialization. Creating it and killing it works ok,
> >
> > For asteic reasons, i am looking for a way to change the running process name
> > when i load the module using insmod, the thread created always has the "insmod"
> > as its process name.
>
> strcpy(current->comm, "newname");
> current->mm->arg_start = current->mm->arg_end = 0;
>
> Then it will appear as '[newname]' in 'ps' output.
>
> Note that task_struct.comm is 16 bytes only.
------------------------------
** 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
******************************