Linux-Development-Sys Digest #430, Volume #8 Fri, 19 Jan 01 13:13:12 EST
Contents:
How to get the source of the file utilities? ("Alan Po")
Re: ������� ������ ����� � ������? ("�������� ��������")
Re: How to get the source of the file utilities? ("John Daragon")
Re: initrd problem (Jerome Corre)
semaphores,mutex,rw_lock,spinlock ("Massimiliano Caovilla")
help needed.... ("Nitin")
help needed... ("Nitin")
Re: initrd problem (Mats Liljegren)
Re: Kickstart creation (Dirk Groeneveld)
Re: Module programming (Andrey Valik)
pull device driver (Matthew Impett)
Re: Module programming (Russell Iannuzzelli)
directory file size (Zhihui Zhang)
Re: Module programming (Andrey Valik)
Re: Kickstart creation (Lee Allen)
Re: How to get the source of the file utilities? ([EMAIL PROTECTED])
Distributed FileSystem ("Joff")
Re: directory file size
Re: double mmap calls ("Arthur H. Gold")
RE: directory file size ("Massimiliano Caovilla")
Why can't I login as root in my 2.4.0 kernel??? (David Vidal Rodriguez)
Re: measuring time (Mark Hahn)
----------------------------------------------------------------------------
From: "Alan Po" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.questions,linux.dev.kernel
Subject: How to get the source of the file utilities?
Date: Fri, 19 Jan 2001 16:15:08 +0800
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]
------------------------------
From: "�������� ��������" <[EMAIL PROTECTED]>
Crossposted-To: linux.sources.kernel,comp.os.linux.questions
Subject: Re: ������� ������ ����� � ������?
Date: Fri, 19 Jan 2001 11:27:01 +0300
������� ������ ����� � ������?
------------------------------
From: "John Daragon" <[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 08:56:12 -0000
Alan Po <[EMAIL PROTECTED]> wrote in message
news:948t66$[EMAIL PROTECTED]...
> 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]
>
Well, cd is built into the shell, so you could download the source from
ftp://ftp.gnu.org/gnu/bash/bash02.04.tar.gz (for the GNU Bourne-again
shell).
ls and cp are part of the GNU fileutils package; you should be able to
download
that from almost any distribution.
jd
-- -------------------------------------------------------------------------
======
John Daragon [EMAIL PROTECTED]
argv[0] limited, The Willows, Compton Chamberlayne, SP3 5DF, UK
(v) +44 1722 714475 (f) +44 1722 714576 (m) +44 7836 576 127
PGP Public key available on request or from ldap://certserver.pgp.com
------------------------------
From: Jerome Corre <[EMAIL PROTECTED]>
Subject: Re: initrd problem
Date: Fri, 19 Jan 2001 11:07:40 GMT
> Hi all,
>
> I sent a question about an initrd problem I had without getting any
> answers. If the reason for this is that I'm being in the wrong forum,
> please let me know! Of course I'd like to know what forum is the right
> one, in this case...
>
> Here comes the question again:
>
> I boot a 8MB 486 system using a floppy disk. This disk is formatted
with
> Minix file system, and uses Lilo as boot loader. It contains a kernel
> image (no modules) and an initrd image.
>
> The kernel starts ok, unpacks the initrd image and executes the
initial
> script (don't remember the name of it, is it /initrc?). It then says
> it's mounting Minix file system /dev/ram as root followed by a panic
> message saying it can't mount device 0x01 0x01. The initrd image is a
> Minix file system.
The script is called linuxrc. (more info on how it works can be found
in the initrd man page).
If the kernel cannot mount /dev/ram it may be because:
-Minix support is not compiled into the kernel
- or there is no valid filesystem on /dev/ram
>
> Reading initrd.txt in the Documentation directory in the Linux kernel
> source directory, I get the impression that using "root=/dev/ram"
> (lilo), you would use initrd as root file system.
If you want to use initrd as the root filesystem you need to
use 'root=/dev/ram0' in lilo.conf not "root=/dev/ram"
(as described in the initrd man page, the initrd image is unpacked
in /dev/ram0. if you want /dev/ram to be the root filesystem then need
to put a valid filesystem on it within the linuxrc script)
>
> Apparently I'm doing something wrong, as the kernel tries to remount
the
> root file system.
>
> So my question is, how do I make the initrd image my root file system?
>
> Regards,
> Mats
>
--
Jerome Corre
Sent via Deja.com
http://www.deja.com/
------------------------------
From: "Massimiliano Caovilla" <[EMAIL PROTECTED]>
Subject: semaphores,mutex,rw_lock,spinlock
Date: Fri, 19 Jan 2001 13:23:41 +0100
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
spinlocks? Where do I found some docs related to semaphorization problems in
linux?
Thanks for any help!
------------------------------
From: "Nitin" <[EMAIL PROTECTED]>
Subject: help needed....
Date: Mon, 15 Jan 2001 18:28:37 +0530
Hi,
Is there any way to estimate the size of an executable file , from object
files before building executable file from these object files.....?
Thanks in advance,
Nitin
------------------------------
From: "Nitin" <[EMAIL PROTECTED]>
Subject: help needed...
Date: Fri, 19 Jan 2001 18:32:38 +0530
Hi,
Is there any way to estimate the size of an executable file , from object
files before building executable file from these object files.....?
Thanks in advance,
Nitin
------------------------------
From: Mats Liljegren <[EMAIL PROTECTED]>
Subject: Re: initrd problem
Date: Fri, 19 Jan 2001 14:42:08 +0100
> The script is called linuxrc. (more info on how it works can be found
> in the initrd man page).
> If the kernel cannot mount /dev/ram it may be because:
> -Minix support is not compiled into the kernel
> - or there is no valid filesystem on /dev/ram
Minix filesystem is working, or the linuxrc (thanks for the name)
wouldn't run. But as I'm beginning to understand below, my problem seems
to be using /dev/ram as root instead of /dev/ram0.
I was reading the initrd.txt found with the kernel sources, it only
mentioned /dev/ram (unless I missed something there!). But I didn't know
there was a man-page also, I'll check that one out. Thanks!
> If you want to use initrd as the root filesystem you need to
> use 'root=/dev/ram0' in lilo.conf not "root=/dev/ram"
> (as described in the initrd man page, the initrd image is unpacked
> in /dev/ram0. if you want /dev/ram to be the root filesystem then need
> to put a valid filesystem on it within the linuxrc script)
I'll try /dev/ram0. Thanks again!
/Mats
------------------------------
From: Dirk Groeneveld <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc,comp.os.linux.setup
Subject: Re: Kickstart creation
Date: Fri, 19 Jan 2001 15:58:32 +0100
bill davidsen wrote:
> I have to install a bunch of servers, and for various reasons will be
> using Redhat.
[wanna use kickstart]
Why don't you use some drive imaging program? That would be the first thing
coming to my mind...
------------------------------
From: Andrey Valik <[EMAIL PROTECTED]>
Crossposted-To: linux.sources.kernel,comp.os.linux.questions
Subject: Re: Module programming
Date: Fri, 19 Jan 2001 19:51:36 +0500
Sergui Vassiliev wrote:
>
> Hello,
>
> I tried to insmod this small module to kernel
> but got error:
> hello.o: kernel-module version mismatch
> hello.o was compiled for kernel version 2.2.18
> while this kernel is version 2.4.0
>
> I have kernel 2.4.0, and I have compiled this
> program on 2.4.0 too.
> If you look in file linux/version.h you will see:
> #define UTS_RELEASE "2.2.18"
> Maybe here is a problem, but I am not sure
Yes. You need install kernel 2.4.0 source.
And you can try force loading:
insmod -f your_module
--
+----------------------+
| Andrey V. Valik |
| Papillon Systems |
|Mailto:[EMAIL PROTECTED]|
+----------------------+
------------------------------
From: Matthew Impett <[EMAIL PROTECTED]>
Subject: pull device driver
Date: 19 Jan 2001 15:04:58 GMT
Hi all.. I am interested in writing a device driver for linux where the
device that I will be controlling will pull data from linux instead of
having linux push data to it.
First off, does anyone know if such a driver already exists and if so,
could you please point me to it.
Second, these are the few ideas I have of how to handle this, perhaps you
all can let me know how this sounds. First, the queue above this device
driver is going to be written by me. This is what I think: the card is going
to generate an interrupt when it wants data. When my device driver traps this
interrupt, it will dequeue and send, all in the interrupt handler. I hope that
this dequeue and send is quick enough to do in a fast interrupt handler, but
I feel like it should be very fast. Second, I need to stop the linux kernel
from trying to push data out. I think this should be very simple, and should
only entail the driver doing a netif_stop_queue at init time and never
starting the queue.
Finally, just so you all know, I am planning on writing this for 2.4.x kernel.
Matthew Impett
University of Maryland
------------------------------
From: Russell Iannuzzelli <[EMAIL PROTECTED]>
Crossposted-To: linux.sources.kernel,comp.os.linux.questions
Subject: Re: Module programming
Date: Fri, 19 Jan 2001 10:16:05 -0500
the problem is that the include in the make file is pointing to
/usr/include/linux/.....versions.h which says
2.4.0....., change that any you will be ok, or just specify the incl dir
to be the one you know is ok.
Russ
Sergui Vassiliev wrote:
> Hello,
>
> I tried to insmod this small module to kernel
> but got error:
> hello.o: kernel-module version mismatch
> hello.o was compiled for kernel version 2.2.18
> while this kernel is version 2.4.0
>
> I have kernel 2.4.0, and I have compiled this
> program on 2.4.0 too.
> If you look in file linux/version.h you will see:
> #define UTS_RELEASE "2.2.18"
> Maybe here is a problem, but I am not sure
>
> Why does it happen?
>
> Thanks,
> SV
> ----------------------------------
> * Copyright (C) 1998 by Ori Pomerantz
> *
> * "Hello, world" - the kernel module version.
> */
>
> /* The necessary header files */
>
> /* Standard in kernel modules */
> #include <linux/kernel.h> /* We're doing kernel work */
> #include <linux/module.h> /* Specifically, a module */
>
> /* Deal with CONFIG_MODVERSIONS */
> #if CONFIG_MODVERSIONS==1
> #define MODVERSIONS
> #include <linux/modversions.h>
> #endif
>
> /* Initialize the module */
> int init_module()
> {
> printk("Hello, world - this is the kernel speaking\n");
>
> /* If we return a non zero value, it means that
> * init_module failed and the kernel module
> * can't be loaded */
> return 0;
> }
>
> /* Cleanup - undid whatever init_module did */
> void cleanup_module()
> {
> printk("Short is the life of a kernel module\n");
> }
------------------------------
Date: Fri, 19 Jan 2001 10:30:01 -0500
From: Zhihui Zhang <[EMAIL PROTECTED]>
Subject: directory file size
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.
-Zhihui
------------------------------
From: Andrey Valik <[EMAIL PROTECTED]>
Crossposted-To: linux.sources.kernel,comp.os.linux.questions
Subject: Re: Module programming
Date: Fri, 19 Jan 2001 20:33:07 +0500
Andrey Valik wrote:
>
> Sergui Vassiliev wrote:
> >
> > Hello,
> >
> > I tried to insmod this small module to kernel
> > but got error:
> > hello.o: kernel-module version mismatch
> > hello.o was compiled for kernel version 2.2.18
> > while this kernel is version 2.4.0
> >
> > I have kernel 2.4.0, and I have compiled this
> > program on 2.4.0 too.
> > If you look in file linux/version.h you will see:
> > #define UTS_RELEASE "2.2.18"
> > Maybe here is a problem, but I am not sure
>
> Yes. You need install kernel 2.4.0 source.
Sorry -^^^^^^^ - headers.
--
+----------------------+
| Andrey V. Valik |
| Papillon Systems |
|Mailto:[EMAIL PROTECTED]|
+----------------------+
------------------------------
From: [EMAIL PROTECTED] (Lee Allen)
Crossposted-To: comp.os.linux.misc,comp.os.linux.setup
Subject: Re: Kickstart creation
Reply-To: [EMAIL PROTECTED]
Date: Fri, 19 Jan 2001 15:33:43 GMT
On 18 Jan 2001 19:54:34 GMT, [EMAIL PROTECTED] (bill davidsen) wrote:
>
>I have to install a bunch of servers, and for various reasons will be
>using Redhat. I see how to install using a kickstart file, but how do I
>create the kickstart file? There are references to a utility which takes
>the current installation and creates the ks.cfg file based on the
>current install. Obviously there is such a thing, but I sure don't see
>the name of it.
>
>I have several 600+ page Redhat books, but they all want to tell me how
>to use a ks.cfg, not how to create one in some way better than by hand.
Here's the URL of an online manual for RedHat 6.2, section F is the
kickstart documentation. I am sure there is an equivalent doc for
RedHat 7.0.
http://www.redhat.com/support/manuals/RHL-6.2-Manual/ref-guide/
I highly recommend kickstart. It is a great way of creating identical
or reproducible system configurations, especially when the hardware
varies.
I also recommend building the kickstart configuration file from
scratch -- it's not that hard.
There are some undocumented features and workarounds so post something
if you get stuck.
-Lee Allen
------------------------------
From: [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 15:25:23 GMT
In article <948t66$[EMAIL PROTECTED]>,
"Alan Po" <[EMAIL PROTECTED]> 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]
>
I am not exactly sure what you mean by modify, but if all you want
to do is have the ls command do a ls -a for example all you would have
to do is alias the command you want to run to the word you want to type
to have that command execute.
example alias ls=ls -a
or alias dir=ls
Read the man pages for the commands and their options to see which
options fit your needs and alias the commands to your liking.
--
Tim Coble
Support provided by Linuxgruven, Inc.
www.linuxgruven.com
314-727-0918
Sent via Deja.com
http://www.deja.com/
------------------------------
From: "Joff" <[EMAIL PROTECTED]>
Subject: Distributed FileSystem
Date: Fri, 19 Jan 2001 15:52:24 -0000
I'm trying to write from scratch a Distributed FileSystem for Linux.
I don't know very well how to start. :)
Does anyone have some experience, or links, or anything that can share with
me for some help?
Thanks in advance,
Jos� Ferreira.
------------------------------
From: <[EMAIL PROTECTED]>
Subject: Re: directory file size
Date: Fri, 19 Jan 2001 15:58:57 GMT
Zhihui Zhang <[EMAIL PROTECTED]> 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.
It's wholey dependant on the file system, but in ext2 no, they never
shrink. That actually turns out to be a mostly reasonable approach
though, since by and large huge directories tend to fill up again.
If it's an occasional problem, (And I have one where it is too, don't
feel alone :) you can work around it by creating a new directory
sometimes. In my case, it's a temporary directory which I "adjust" by
unlinking while it's empty occasionaly. If it's a regular problem, you
may want to look at ReiserFS instead, which rumor has it deals more
gracefully with that situation. (And stealthily merged into the latest
kernel, to the surprise of many)
--
Matt Gauthier <[EMAIL PROTECTED]>
------------------------------
Date: Thu, 18 Jan 2001 23:32:17 -0600
From: "Arthur H. Gold" <[EMAIL PROTECTED]>
Subject: Re: double mmap calls
[EMAIL PROTECTED] wrote:
>
> Does Linux support double mmap calls where a 2nd mmap() can be used
> to overlay an existing memory map to another address? I tired of
> following all the calls through from sys_mmap() to see if it does
> or not (got pretty deep, but nothing obvious one way or the other).
>
> --
I'm not sure I understand you, but could you be thinking of
mremap()?
HTH,
--ag
--
Artie Gold, Austin, TX (finger the cs.utexas.edu account
for more info)
mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED]
--
A: Yes I would. But not enough to put it out.
------------------------------
From: "Massimiliano Caovilla" <[EMAIL PROTECTED]>
Subject: RE: directory file size
Date: Fri, 19 Jan 2001 17:44:40 +0100
Zhihui Zhang <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]
>
> 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.
>
> -Zhihui
>
I'm very new to filesystem programming, but here is what I think:
On the filesystem there is an inode for each file and an inode for each
directory, and they contain pointers to the blocks that hold the data
corresponding to the file or the directory. In the case of a file, the
contents of the file will be stored in those blocks, in the case of a
directory, in those blocks you will find a list of dir entry structures (see
dirent.h in the linux source tree), one for each file or directory that
resides in this directory. The size of a dentry is very small compared to
the size of a block, so I think that you must put *many* files in a
directory to need to allocate more then 1 block to store it's corresponding
dentries!
If you mean that you managed to "grow" a directory to more than 1 block and
than you noticed that it didn't shrink after removing the files, I don't
know... the above is just an ipothesis.
Ciao
------------------------------
From: David Vidal Rodriguez <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc,comp.os.linux.secutity,comp.os.linux.setup
Subject: Why can't I login as root in my 2.4.0 kernel???
Date: Fri, 19 Jan 2001 18:28:38 +0100
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."
------------------------------
From: Mark Hahn <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: measuring time
Date: 19 Jan 2001 17:32:13 GMT
> If you have a PentiumPro or higher, you can use the TSC register. It
P5 or better, actually.
> __asm__ volatile ("rdtsc" : "=A" (x));
it's not hard to calibrate this versus absolute (gettimeofday),
to obtain an accurate conversion factor.
------------------------------
** 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
******************************