Linux-Development-Sys Digest #431, Volume #8 Fri, 19 Jan 01 20:13:15 EST
Contents:
kernel headers, SMP and glibc ([EMAIL PROTECTED])
Re: semaphores,mutex,rw_lock,spinlock (Kaz Kylheku)
Two (easy?) 2.4 VFS questions. (Jay Miller)
Re: Why can't I login as root in my 2.4.0 kernel??? (Mike E.)
Accessing Kernel Process Structs from a Module (Bob Dilworth)
Re: Two (easy?) 2.4 VFS questions. (Kaz Kylheku)
Kernel-Programming ("Aschenbrenner Klaus")
Re: Two (easy?) 2.4 VFS questions. (Jay Miller)
Re: Two (easy?) 2.4 VFS questions. (Jay Miller)
Re: Kernel-Programming (Jay Miller)
Re: semaphores,mutex,rw_lock,spinlock (Jay Miller)
explanation of hard_header_cache??? ([EMAIL PROTECTED])
Re: Automatically loading SCSI module (Jos� Manuel Sousa Pereira)
Re: Automatically loading SCSI module (Jos� Manuel Sousa Pereira)
netlink socket option in kernel ("Oliver Kowalke")
Re: How to get the source of the file utilities? (Sid Boyce)
Re: directory file size (Juergen Heinzl)
Re: What is "MODULE_PARM" ? ([EMAIL PROTECTED])
How can I find port addresses of devices? ([EMAIL PROTECTED])
----------------------------------------------------------------------------
From: [EMAIL PROTECTED]
Subject: kernel headers, SMP and glibc
Date: Fri, 19 Jan 2001 18:11:52 GMT
I'm trying to build the 2.4.0 kernel and glibc along with various other
packages that will make up my own Linux "distribution". I know that
glibc uses some of the kernel headers during when being built. What
I'm trying to find out is, what changes in the kernel configuration
will cause me to have to rebuild glibc?
The most important change to me right now is SMP vs. non-SMP kernels.
Is glibc affected by this change to the kernel configuration, or any
other change for that matter?
Thanks in advance for any help, or for pointers to where to find help.
michael
Sent via Deja.com
http://www.deja.com/
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: semaphores,mutex,rw_lock,spinlock
Reply-To: [EMAIL PROTECTED]
Date: Fri, 19 Jan 2001 18:48:37 GMT
On Fri, 19 Jan 2001 13:23:41 +0100, Massimiliano Caovilla
<[EMAIL PROTECTED]> wrote:
> Hi
>I'm porting a filesystem to linux from solaris: the original code makes an
>heavy use of mutexes, rw_enter/rw_entry/rw_lock and sema, so I must find out
>linux's equivalent.
>I found thread mutexes, but what about rw_entry/exit/lock? What about
Thread mutexes are useless because you are doing kernel programming.
>spinlocks? Where do I found some docs related to semaphorization problems in
>linux?
reading /usr/src/linux/Documentation/spinlocks.txt might be a start.
------------------------------
From: [EMAIL PROTECTED] (Jay Miller)
Subject: Two (easy?) 2.4 VFS questions.
Date: Fri, 19 Jan 2001 19:38:34 GMT
Hi there. I've been going through the 2.4 fs source and I have a
couple of quick questions illustrating my stupidity:
1) How is it that the operations structures can now use a format
like:
llseek: ext2_llseek,
fsync: ext2_fsync,
etc.
Instead of the old batch of NULLs? Some C thing I dunno about?
2) Why do filesystem drivers no longer need MOD_[ID][NE]C_USE_COUNTs?
The other drivers all seem to have them.. does it have something to do
with the new init routines in the fsds?
Thanks a lot for any help!
--
Jay Miller
ICQ: 32123421 | YM: ladenedge | http://www.cryptofreak.org
PGP: 0xedc9bb8c | 41a6428c 46abd36b 6b259b68 8a28ca4c edc9bb8c
------------------------------
From: Mike E. <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc,comp.os.linux.secutity,comp.os.linux.setup
Subject: Re: Why can't I login as root in my 2.4.0 kernel???
Date: Fri, 19 Jan 2001 19:39:41 GMT
In article <[EMAIL PROTECTED]>,
David Vidal Rodriguez <[EMAIL PROTECTED]> wrote:
> Hi there! (and excuse my bad English!)
>
> My Linux is an hybrid of SuSE 6.2 and 6.4...
>
> I've installed the 2.4.0 kernel with devfs support and solved almost
all
> the problems I've encountered by now. But the really big thing is
still
> there: I can't start a login session as root! I always have to enter
as
> a normal user and then use the su-command. However, I by giving the
"-b"
> kernel option I can login; thus I **think** it could have something to
> do with PAM, /etc/securetty and the new /dev structure.
>
> The only things I've changed were, as said, the kernel, the /dev and
the
> start scripts so that they point to the right devices. Could somebody
> point me to the right direction in finding a solution for this
> (embarrasing) problem?
>
> Thanks in advance,
> --
>
========================================================================
> David Vidal R. ([EMAIL PROTECTED])
> http://dvr.ismad.com
> "Ein Computer ohne Windows ist wie ein Fisch ohne Fahrrad."
>
>
/etc/securetty lists the terminals that root CAN login at. After making
sure at least one is listed there, go to your PAM configuration if you
still cannot login as root at that terminal. Of course, after finding
the problem you may decide to change it back because not logging in as
root and su'ing over when needed is not a bad way of doing things. In
fact, it is pretty good. Or maybe even use sudo instead.
Mike
--
Support provided by Linuxgruven, Inc.
http://www.linuxgruven.com
314-727-0918
Sent via Deja.com
http://www.deja.com/
------------------------------
From: Bob Dilworth <[EMAIL PROTECTED]>
Subject: Accessing Kernel Process Structs from a Module
Date: Fri, 19 Jan 2001 14:28:49 -0500
All:
One of my personal projects for this year is to familiarize myself with
the Linux Kernel. To supplement the source code I've purchased the
O'Reilly Understanding the Linux Kernel and a book called Kernel
Projects for Linux. I'm starting with kernel modules to ease into
things and have been able to write a simple proc file module to display
a couple of the xtime sub-fields.
xtime is one of the exported symbols available to modules and I can see
it (the symbol) in /proc/ksyms. So far so good. What I'd like to do
next is walk down the process list and perhaps display the name of a
file that a process on the list has open. I can see how to reach the
d_name field in the dentry object from the process descriptor structure
but I can't figure out how to find the head of the process list to start
grabbing the process descriptors for the processes on the list.
/proc/ksyms doesn't seem to have a symbol corresponding to the head of
the process list - at least I can't seem to find such a symbol. Does
this mean that the pointer to the head of the process list is
unavailable from a kernel module? So ... how does one obtain the head
of the process list from a kernel module?
Any pointers (no pun intended) or nudges in the right direction would be
greatly appreciated.
Thanks in Advance!!!!
Bob Dilworth
Toledo, Ohio
[EMAIL PROTECTED]
[EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Two (easy?) 2.4 VFS questions.
Reply-To: [EMAIL PROTECTED]
Date: Fri, 19 Jan 2001 20:01:54 GMT
On Fri, 19 Jan 2001 19:38:34 GMT, Jay Miller <[EMAIL PROTECTED]> wrote:
>Hi there. I've been going through the 2.4 fs source and I have a
>couple of quick questions illustrating my stupidity:
>
>1) How is it that the operations structures can now use a format
>like:
>
>llseek: ext2_llseek,
>fsync: ext2_fsync,
>etc.
>
>Instead of the old batch of NULLs? Some C thing I dunno about?
This is using a GNU C language extension that is made obsolete
by C99 designated initializers. C99 designated initializers look
something like this:
struct foo { int bar; long baz; };
struct foo x = { .baz = 3, .bar = 4 };
Also:
int x[10] = { [5] = 42; }
More complex example, probably incorrect:
struct foo x[3] = { [2].baz = 3 };
The GNU C extension used in the fs code is called ``labelled
initializer elements''. Look it up in the GCC info page under the node
``C Extensions''. The info page claims that the C99 compatible .member
syntax is also supported.
------------------------------
From: "Aschenbrenner Klaus" <[EMAIL PROTECTED]>
Crossposted-To: linux.dev.c-programming,linux.dev.kernel
Subject: Kernel-Programming
Date: Fri, 19 Jan 2001 21:23:30 +0100
Hello!
I want to learn the Linux-Kernel-Programming. Which books should I read?
Which books covers the Kernel-Programming in detail?
I have good experience in C and C++.
Best regards
Aschenbrenner Klaus
------------------------------
From: [EMAIL PROTECTED] (Jay Miller)
Subject: Re: Two (easy?) 2.4 VFS questions.
Date: Fri, 19 Jan 2001 20:50:52 GMT
On Fri, 19 Jan 2001 20:01:54 GMT, [EMAIL PROTECTED] (Kaz
Kylheku) wrote:
>This is using a GNU C language extension that is made obsolete
>by C99 designated initializers.
How strange that these 'labeled initializer elements' would be new to
the linux kernel (they didn't exist in 2.2.x) even while they have
been obsolete since GCC 2.5! (I did as you suggested and looked them
up. I found the reference here:
http://www.gnu.org/software/gcc/onlinedocs/gcc_toc.html#TOC91
). Why would the kernel developers do this? Why not in fact use the
C99 standard? It would still be just as clean - and current..
--
Jay Miller
ICQ: 32123421 | YM: ladenedge | http://www.cryptofreak.org
PGP: 0xedc9bb8c | 41a6428c 46abd36b 6b259b68 8a28ca4c edc9bb8c
------------------------------
From: [EMAIL PROTECTED] (Jay Miller)
Subject: Re: Two (easy?) 2.4 VFS questions.
Date: Fri, 19 Jan 2001 20:52:54 GMT
On Fri, 19 Jan 2001 19:38:34 GMT, [EMAIL PROTECTED] (Jay Miller)
wrote:
>2) Why do filesystem drivers no longer need MOD_[ID][NE]C_USE_COUNTs?
>The other drivers all seem to have them.. does it have something to do
>with the new init routines in the fsds?
I have found the answer to this question. Isn't it funny how you can
look and look for something like this and then just happen upon it
right as you ask about it?
Anyway, if you care, the VFS handles the MOD_INC/DEC now (if
necessary) upon filesystem registration in its get_filesystem() and
put_filesystem() calls.
--
Jay Miller
ICQ: 32123421 | YM: ladenedge | http://www.cryptofreak.org
PGP: 0xedc9bb8c | 41a6428c 46abd36b 6b259b68 8a28ca4c edc9bb8c
------------------------------
From: [EMAIL PROTECTED] (Jay Miller)
Crossposted-To: linux.dev.c-programming,linux.dev.kernel
Subject: Re: Kernel-Programming
Date: Fri, 19 Jan 2001 21:01:39 GMT
On Fri, 19 Jan 2001 21:23:30 +0100, "Aschenbrenner Klaus"
<[EMAIL PROTECTED]> wrote:
>I want to learn the Linux-Kernel-Programming. Which books should I read?
>Which books covers the Kernel-Programming in detail?
>I have good experience in C and C++.
I would recommend the two O'Reilly books I have:
Bovet & Cesati, _Understanding the Linux Kernel_, and
Rubini, _Linux Device Drivers_.
They have been very good for me, and having both covers much of the
things a developer might do in the kernel. I also would recommend
this one:
Beck, et al., _Linux Kernel Internals_.
It's quite outdated (first edition was for 2.0 series), but still
useful for 2.2 hacking.
The problem with learning about the linux kernel via books at this
point in time is that a new kernel has just come out that is
significantly different. The fact that it is so new means there are
very few (none?) books about it, so books you pick up now will
probably have a pretty short span of usefullness. If you can, I would
wait a couple of months for a book focusing on 2.4 and in the meantime
peruse the source. (or, depending on how new you are to these things,
an OS-theory book.)
Good luck!
--
Jay Miller
ICQ: 32123421 | YM: ladenedge | http://www.cryptofreak.org
PGP: 0xedc9bb8c | 41a6428c 46abd36b 6b259b68 8a28ca4c edc9bb8c
------------------------------
From: [EMAIL PROTECTED] (Jay Miller)
Subject: Re: semaphores,mutex,rw_lock,spinlock
Date: Fri, 19 Jan 2001 21:05:29 GMT
On Fri, 19 Jan 2001 18:48:37 GMT, [EMAIL PROTECTED] (Kaz
Kylheku) wrote:
>reading /usr/src/linux/Documentation/spinlocks.txt might be a start.
Also, this is a pretty thick doc:
http://netfilter.kernelnotes.org/unreliable-guides/kernel-locking/lklockingguide.html
--
Jay Miller
ICQ: 32123421 | YM: ladenedge | http://www.cryptofreak.org
PGP: 0xedc9bb8c | 41a6428c 46abd36b 6b259b68 8a28ca4c edc9bb8c
------------------------------
From: [EMAIL PROTECTED]
Subject: explanation of hard_header_cache???
Date: Fri, 19 Jan 2001 21:32:10 GMT
Could anyone out there give me an explanation of this field in
dst_entry? And while you're at it the whole "neighbour" idea.
Thanks
Chip
Sent via Deja.com
http://www.deja.com/
------------------------------
From: [EMAIL PROTECTED] (Jos� Manuel Sousa Pereira)
Subject: Re: Automatically loading SCSI module
Date: 19 Jan 2001 22:23:25 +0000
I have a SCSI card (an old Adaptec 152x) with a SyQuest drive hanging off of
it. There's nothing else on the SCSI card.
I have built my kernel (2.2.18) to include support for this card as a module
(aha152x.o). I have also built SCSI disk support, etc., all as modules.
I have added this to my /etc/modules.conf file:
options aha152x aha152x=0x340,9 alias scsi_hostadapter aha152x
(these options are required to use the card). I have added this to my
/etc/fstab file:
/dev/sda1 /syext ext2 noauto,user 0 0
Now, what I want to happen is that I just say:
# mount /syext
and Linux will automatically load the aha152x module with the proper
configuration. But, that's not happening. When the module is not loaded and I
try the above mount command, I get:
mount: /dev/sda1 is not a valid block device
If I load the module by hand using "insmod 152x", _then_ it all works fine and
I can mount the filesystem on /dev/sda1, use it, whatever.
If I use "modprobe scsi_hostadapter", then the 152x module is also loaded
correctly in that case.
What do I need to do to convince Linux to load that module when I try to mount
/dev/sda1? I thought the kmod daemon (which I do have all that support enabled
in my kernel) was supposed to managte all that; the kernel proper calls the
kmod code to resolve the issu, and it calls modprobe with proper arguments,
and problem solved.
What am I missing here?
--
===============================================================================
Paul D. Smith <[EMAIL PROTECTED]> HASMAT--HA Software Methods & Tools
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
===============================================================================
These are my opinions---Nortel Networks takes no responsibility for them.
-- Jose' Pereira Tel. +351.21.841 9340 DEEC - Dep. of Electrical and Computer
Engineering Fax. +351.21.841 7499 Instituto Superior Tecnico - Technical
University of Lisboa Av. Rovisco Pais - 1049-001 Lisboa - Portugal
------------------------------
From: [EMAIL PROTECTED] (Jos� Manuel Sousa Pereira)
Subject: Re: Automatically loading SCSI module
Date: 19 Jan 2001 22:34:02 +0000
"PDS" == Paul D Smith <[EMAIL PROTECTED]> writes:
PDS> I have a SCSI card (an old Adaptec 152x) with a SyQuest drive hanging
PDS> off of it. There's nothing else on the SCSI card.
PDS> I have built my kernel (2.2.18) to include support for this card as a
PDS> module (aha152x.o). I have also built SCSI disk support, etc., all as
PDS> modules.
PDS> I have added this to my /etc/modules.conf file:
PDS> options aha152x aha152x=0x340,9
PDS> alias scsi_hostadapter aha152x
PDS> (these options are required to use the card). I have added this to my
PDS> /etc/fstab file:
PDS> /dev/sda1 /syext ext2 noauto,user 0 0
I use automount for removables.
PDS> Now, what I want to happen is that I just say:
PDS> # mount /syext
PDS> and Linux will automatically load the aha152x module with the proper
PDS> configuration. But, that's not happening. When the module is not
PDS> loaded and I try the above mount command, I get:
PDS> mount: /dev/sda1 is not a valid block device
PDS> If I load the module by hand using "insmod 152x", _then_ it all works
PDS> fine and I can mount the filesystem on /dev/sda1, use it, whatever.
Good.
PDS> If I use "modprobe scsi_hostadapter", then the 152x module is also
PDS> loaded correctly in that case.
Fair enough.
PDS> What do I need to do to convince Linux to load that module when I try to
PDS> mount /dev/sda1? I thought the kmod daemon (which I do have all that
PDS> support enabled in my kernel) was supposed to managte all that; the
PDS> kernel proper calls the kmod code to resolve the issu, and it calls
PDS> modprobe with proper arguments, and problem solved.
PDS> What am I missing here?
Something in /etc/modules.conf like:
add below sd_mod aha152x
or, if you have really old modutils:
pre-install sd_mod modprobe -k aha152x
Yes, it's really this simple. Makes one want to bang the head against the
nearest keyboard. ;-)
--
Jose' Pereira Tel. +351.21.841 9340
DEEC - Dep. of Electrical and Computer Engineering Fax. +351.21.841 7499
Instituto Superior Tecnico - Technical University of Lisboa
Av. Rovisco Pais - 1049-001 Lisboa - Portugal
------------------------------
From: "Oliver Kowalke" <[EMAIL PROTECTED]>
Subject: netlink socket option in kernel
Date: Fri, 19 Jan 2001 23:54:18 +0100
Hi,
how is the netlink socket (option in kernel config) related to routing
socket and datalink socket (I'm currently reading Stevens UNP v1).
thanks,
Oliver
------------------------------
From: Sid Boyce <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.questions,linux.dev.kernel
Subject: Re: How to get the source of the file utilities?
Date: Fri, 19 Jan 2001 22:52:48 +0000
http://freshmeat.net and search keyword "fileutils".
Regards
Sid.
Alan Po wrote:
>
> Dear all
>
> I am try to modify some commands such as ls, cd or cp. However, where and
> how to get the sources code of these commands? Please advice.
>
> Thanks a lot
>
> Alan Po
> [EMAIL PROTECTED]
--
Sid Boyce ... hamradio G3VBV ... Cessna/Warrior Pilot
Linux only shop
------------------------------
From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: directory file size
Date: 19 Jan 2001 23:44:06 GMT
In article <Pine.GSO.BU-L4.10.10101191028180.9406-100000@bingsun2>, Zhihui Zhang wrote:
>
>It seems to me that a directory file never shrink. If you create a
>direcory and put a lot of files in it, and later you delete these files,
>the size of the directory file remains the same. is this true? Why this
>is the case? Thanks.
[-]
Yes and that is not an unusual behaviour for directories in Unix. Actually,
some, like lost+found, require it.
Solution for somedir ...
mkdir somedir.new
mv somedir/* somedir.new
rmdir somedir
mv somedir.new somedir
...
Cheers,
Juergen
--
\ Real name : J�rgen Heinzl \ no flames /
\ EMail Private : [EMAIL PROTECTED] \ send money instead /
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: What is "MODULE_PARM" ?
Date: Sat, 20 Jan 2001 00:39:14 GMT
Thanks a lot.. :-)
In article <[EMAIL PROTECTED]>,
Josef Moellers <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > =
>
> > Hi..
> > I am studying linux device driver.
> > now I am looking through mouce device driver, "busmouse.c".
> > However, I could not understand "MODULE_PARM(mouse_irq, "i");
> > I searched the parts of linux kernel source. but, the source is very
> > complicated. I want to know the function of the sentence.
> > Thanks in advance.
> > =
>
> > Sent via Deja.com
> > http://www.deja.com/
>
> The directive is used to define a module parameter (hence the name)
> "mouse_irq" which is a single integer. You can the load the driver
using
> e.g.
> "insmod busmouse.o mouse_irq=3D12"
>
> -- =
>
> Josef M=F6llers (Pinguinpfleger bei FSC)
> If failure had no penalty success would not be a prize (T.
Pratchett)
>
Sent via Deja.com
http://www.deja.com/
------------------------------
From: [EMAIL PROTECTED]
Subject: How can I find port addresses of devices?
Date: Sat, 20 Jan 2001 00:49:43 GMT
Hi.
I am about to make program to control some devices attached to my
computer.
However, I have not yet known their port addresses.
I don't know where I begin from.
Do the base address depend on main board?
Do I have to find the address from main board manual?
But, I couldn't find the information from it.
Please, teach me the method to get information of Hardware.
Thanks in advance.
Sent via Deja.com
http://www.deja.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 by posting to the
comp.os.linux.development.system newsgroup.
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
******************************