Linux-Development-Sys Digest #685, Volume #8 Wed, 2 May 01 16:13:10 EDT
Contents:
Re: Need your recommendation for a full-featured text editor ("Nick Lockyer")
Re: Why is RedHat 7.1 so fast? (Rex Dieter)
Re: How to write to a file in Linux Kernel (Massimiliano Caovilla)
kernel debugger again and again (sorry) (Massimiliano Caovilla)
execute command line from within kernel mod? ("Wayne")
a good site about the kernel code? in depth? ("Wayne")
Re: How to find out whether the device(floppy drivers,zip drives) is removable on
linux ("Nick Lockyer")
Re: Critical sections (Richard Bos)
Re: execute command line from within kernel mod? (Lew Pitcher)
times() on Linux is returning strange numbers ("Alex Ho")
Re: Need your recommendation for a full-featured text editor ("Nils O. Sel�sdal")
Re: __buggy_fxr_alignment... (Bill Pringlemeir)
Re: Startup service (Xiaomu Zeng)
Re: More on reading ethernet frames (Grant Edwards)
Re: More on reading ethernet frames (Grant Edwards)
Cannot load shared object file (Martin)
Re: execute command line from within kernel mod? (Pete Zaitcev)
Re: times() on Linux is returning strange numbers (Craig Kelley)
Statically linking with libnss (Bernie Boudet)
Re: Cannot load shared object file (Craig Kelley)
----------------------------------------------------------------------------
From: "Nick Lockyer" <[EMAIL PROTECTED]>
Crossposted-To:
alt.comp.shareware.programmer,comp.editors,comp.lang.java.help,comp.lang.java.programmer,comp.lang.java.softwaretools,comp.os.linux.advocacy
Subject: Re: Need your recommendation for a full-featured text editor
Date: Wed, 2 May 2001 15:39:29 +0100
ultra edit version 8 for Windows
How about kdevelop, part of the KDE. It is a compete
editor/compiler/linker/debugger all in one!
James Kanze <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Tor Arntsen wrote:
>
> > Ken Tough <[EMAIL PROTECTED]> writes:
> > >Paul Shirley <[EMAIL PROTECTED]> wrote:
>
> > >><[EMAIL PROTECTED]> writes
> > >>>Syntax highlighting is useful for NOVICE programmers.
>
> > >>>Most experienced programmers have used one-color text
> > >>>for program code for years...
>
> > >>...although the ones that earn a living at it mostly side with the
> > >>novices.
>
> > >I think there's probably a UNIX/realtime - "enterprise" divide
> > >here. Quick straw poll -- how many UNIX programmers use 1 colour?
>
> > None where I work (although we used to use 2 colours way back :-)
> > All of us, many with "enterprise"/Unix experience going decades
> > back, are using XEmacs w/colour highlighting. Those that claim that
> > experienced programmers have no use for more than 1 (sic) colour
> > don't know what they are talking about. It simply means they have
> > never really tried it.
>
> I'll second that. With 25 years experience programming, and the last
> 15 almost exclusively on Unix, I really appreciate the benefits of
> syntax coloring. (I might add that even under Windows, I use the
> CygWin toolkit, emacs, etc., to have a Unix-like environment.)
>
> --
> James Kanze mailto:[EMAIL PROTECTED]
> Conseils en informatique orient�e objet/
> Beratung in objektorientierter Datenverarbeitung
> Ziegelh�ttenweg 17a, 60598 Frankfurt, Germany Tel. +49(069)63198627
------------------------------
From: Rex Dieter <[EMAIL PROTECTED]>
Subject: Re: Why is RedHat 7.1 so fast?
Date: Wed, 2 May 2001 09:52:26 -0500
jtnews wrote:
> I'm getting 5MB/sec dump transfer rates
> across an NFS filesystem with RedHat 7.1
> where I used to get only about 1.5MB/sec.
...
> Why the sudden performance increase?
> Is it the new 2.4 kernel or the tulip
> driver?
Probably a combination of improvements in the 2.4 kernel, NFS
updates/improvments (depending on what combination of kernel+nfs-utils you
WERE using), and maybe even better tulip driver (again, depending on your
previous kernel version).
--
Rex A. Dieter [EMAIL PROTECTED]
Computer System Administrator http://www.math.unl.edu/~rdieter/
Mathematics and Statistics
University of Nebraska Lincoln
------------------------------
From: Massimiliano Caovilla <[EMAIL PROTECTED]>
Subject: Re: How to write to a file in Linux Kernel
Date: Wed, 02 May 2001 14:56:56 GMT
ouyang wrote:
>
> I am using Linux Kernel 2.2.16.
> I want to write to a file when I am in kernel.
> What should I do?
> Your help will be greatly appreciated.
>
> vincent
Hi
everyone on the newsgroup will tell you not to do it. But if you really
want to, you have to allocate a struct file *, get it via a filp_open(),
then directly access write/read/ioctl or whatever via the pointers in
the file struct. kind of this
struct file *pr_file;
oldfs mm_offset_t;
pr_file = filp_open("/etc/pino.conf",O_RDONLY,600);
if IS_ERR(pr_file) {
printk("error \n");
return(-EINVALID);
}
oldfs=get_fs();
set_fs(KERNEL_DS);
pr_file->f_op->write(pr_file,(caddr_t)base,len,&pr_file->f_pos);
set_fs(oldfs);
fput(pr_file);
The oldfs stuff is needed because usually write and read work with user
memory buffers.
Ciao, if u want more help write me also at [EMAIL PROTECTED]
Massimiliano
you will have to
------------------------------
From: Massimiliano Caovilla <[EMAIL PROTECTED]>
Subject: kernel debugger again and again (sorry)
Date: Wed, 02 May 2001 15:03:58 GMT
hello again,
I'm sorry to bother but I really feel this question.
I need a way to debug a kernel module wich makes use of kernel threads,
I have some lock problems wich are very hard to track without (let's
say) a threadlist or something like solaris adb. I've been pointed to
chech pice and some kernel debugging patch, but they all don't work /
result unusable. What is the OFFICIAL linux kernel debugging way? There
MUST be a way to debug a module!!! I'm opened to all possibilities,
please just suggest me one. Should I write to Linus directly to get
hints about this?? I don't want to annoy him!!!!
Ciao
Massimiliano
------------------------------
From: "Wayne" <[EMAIL PROTECTED]>
Subject: execute command line from within kernel mod?
Date: Wed, 2 May 2001 09:59:46 -0500
Is it possible or even desireable to try to do this?
------------------------------
From: "Wayne" <[EMAIL PROTECTED]>
Subject: a good site about the kernel code? in depth?
Date: Wed, 2 May 2001 10:02:32 -0500
Is there a good site about the kernel code that goes into some depth?
------------------------------
From: "Nick Lockyer" <[EMAIL PROTECTED]>
Crossposted-To: linux.act.gcc,linux.dev.c-programming
Subject: Re: How to find out whether the device(floppy drivers,zip drives) is
removable on linux
Date: Wed, 2 May 2001 15:34:59 +0100
examine source code to the df -k program!
Luiz Rafael Culik Guimaraes <[EMAIL PROTECTED]> wrote in message
news:CbBG6.1046$[EMAIL PROTECTED]...
>
> Dear Friends
>
> As subject
>
> also I need help on this:
> How to retreive the free space on a device pointed by the filepath.
>
> Regards
>
> Luiz Rafael Culik
>
>
>
------------------------------
From: [EMAIL PROTECTED] (Richard Bos)
Crossposted-To: comp.lang.c,gnu.glibc.bug,linux.dev.kernel
Subject: Re: Critical sections
Date: Wed, 02 May 2001 15:17:02 GMT
"Dean Wakerley" <[EMAIL PROTECTED]> wrote:
> Whats the standard way in C of enforcing mutual exclusion on a section of
> code?
There isn't one. Standard C has no provisions for parallel code, because
it would be nearly impossible to make such things truly portable. You'll
need to look into a system-specific extension to do this.
Richard
------------------------------
From: [EMAIL PROTECTED] (Lew Pitcher)
Subject: Re: execute command line from within kernel mod?
Reply-To: [EMAIL PROTECTED]
Date: Wed, 02 May 2001 15:35:22 GMT
On Wed, 2 May 2001 09:59:46 -0500, "Wayne" <[EMAIL PROTECTED]> wrote:
>Is it possible or even desireable to try to do this?
Phylosophical question, but already answered by the kernel team and
blessed by Linus T himself. The answer is "yes". See kerneld, khttpd,
etc. for actual implementations.
Lew Pitcher, Information Technology Consultant, Toronto Dominion Bank Financial Group
([EMAIL PROTECTED])
(Opinions expressed are my own, not my employer's.)
------------------------------
From: "Alex Ho" <[EMAIL PROTECTED]>
Subject: times() on Linux is returning strange numbers
Date: 02 May 2001 15:39:36 GMT
Pthreads on Linux is spawning a new process for each new thread created. To
gather total CPU times for a process, in my program, I do this:
call times()
fork a new process which spawns 10 threads, each of those
threads will spawn a new thread, totalling 20 threads
wait for the process to finish
call times()
Subtracting the results in the first times() from the second times() should
give me the exact cpu times of the new process (which should include all of
its dead children process, 20 of them in this example). But, the total
returned in my program is smaller than what "top" shows. For example, "top"
shows that each of 20 threads have used exactly 10 seconds when the process
finishes. I expect to get from times() at least 200 seconds. Instead,
times() is giving me a number much smaller than 200.
Can anyone explain this?
Thanks in advance!
Best Regards
Alex Ho
------------------------------
Reply-To: "Nils O. Sel�sdal" <[EMAIL PROTECTED]>
From: "Nils O. Sel�sdal" <[EMAIL PROTECTED]>
Crossposted-To:
alt.comp.shareware.programmer,comp.editors,comp.lang.java.help,comp.lang.java.programmer,comp.lang.java.softwaretools,comp.os.linux.advocacy
Subject: Re: Need your recommendation for a full-featured text editor
Date: Wed, 2 May 2001 17:49:17 +0200
"Nick Lockyer" <[EMAIL PROTECTED]> wrote in message
news:9cp672$hs0$[EMAIL PROTECTED]...
> ultra edit version 8 for Windows
> How about kdevelop, part of the KDE. It is a compete
> editor/compiler/linker/debugger all in one!
Unfortunatly it doesnt work wery well...
------------------------------
Crossposted-To: linux.sources.kernel,linux.dev.kernel
Subject: Re: __buggy_fxr_alignment...
From: Bill Pringlemeir <[EMAIL PROTECTED]>
Date: Wed, 02 May 2001 15:57:52 GMT
>>>>> "WJP" == Bill Pringlemeir <[EMAIL PROTECTED]> writes:
[snip]
WJP> I think that the extern is a rouse to get the linker to complain
WJP> about the misaligned structure. Unfortunately, the source
WJP> doesn't give a comment about how to fix this.
{use the source Luke...}
I inserted the following code,
/*
* Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
*/
if (offsetof(struct task_struct, thread.i387.fxsave) & 15) {
printk("WJP: value is %x.\n", offsetof(struct task_struct,
thread.i387.fxsave) & 15);
while(1);
/* extern void __buggy_fxsr_alignment(void); */
/* __buggy_fxsr_alignment(); */
}
The kernel compiles and install. The printk show a value of `8'.
I then modified processor.h
...
unsigned long cr2, trap_no, error_code;
/* floating point info */
unsigned char wjpDummy[8];
union i387_union i387;
...
And reenabled the __buggy_fxsr_alignment function call. Again the
kernel compile, and this time it boot as I would expect. Although my
SBLive drivers seem to skip a little, but perhaps this is due to the
fact that I had ALSA version set up on my system.
I think that it would be possible to create a script that compiled a
dummy program and examined the alignment of the i387 union (via bfd
etc). It could then define an array size to insert in a configuration
file. Unless of course there is something wrong with what I have
done. {I have a bad feeling about this... }
fwiw,
Bill Pringlemeir.
--
Have you ever tried to make moldy milk generate weird AT&T scenarios?
Or seen a small midget throw sparks at you 29 times in a row? You
will. And the company that will bring it to you: AT&T.
------------------------------
From: Xiaomu Zeng <[EMAIL PROTECTED]>
Subject: Re: Startup service
Date: Wed, 02 May 2001 11:54:25 -0400
"D. Stimits" wrote:
> >
> > aha so it is rc.local i am looking for?
>
> If your only concern is to run some command at startup, yes. If it must
> be controlled for start and stop activity at various runlevels, you'd
> create a script to go in the init.d subdirectory; then links from the
> various runlevel directories would determine whether the script is
> called with a start or stop at the given runlevels. inetd is a sample of
> something controlled at various runlevels, as well as a few other
> daemons. To see a list of what is controlled to start or stop, try this:
> chkconfig --list
> (chkconfig might not be available under all distributions, I haven't
> checked)
>
So rc.local will always be ran, at any init level (even single user mode)?
Xiaomu
------------------------------
From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: More on reading ethernet frames
Date: Wed, 02 May 2001 16:08:22 GMT
In article <38PG6.1822$[EMAIL PROTECTED]>, Cameron Kerr wrote:
>Hello, I've happily got my program reading raw ethernet
>frames, using a socket( AF_PACKET, SOCK_RAW, ETH_P_ALL),
>but when decoding, I occasionally get bad packets, or
>possibly even network protocols that are unsupported.
>
>This is bad, since it means that I don't know where the
>next ethernet frame starts, and therefore have to abondon
>decoding the data.
Eh? Each read() should return a single Ethernet frame. If you
don't care about the frame or can't understand it, then just
ignore and do another read().
>Does anyone know of either some real documentation for
>this, other than the man page for packet?
>
>Or does anyone know how I can distinguish the end of
>a frame from the socket, or how to read a whole frame
>at a time?
What size buffer are you using for read()? I'm not sure what
happens if you call read() with a buffer that isn't large
enough for the next frame.
--
Grant Edwards grante Yow! Four thousand
at different MAGNATES, MOGULS
visi.com & NABOBS are romping in my
gothic solarium!!
------------------------------
From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: More on reading ethernet frames
Date: Wed, 02 May 2001 16:09:11 GMT
In article <9cp5t6$hnb$[EMAIL PROTECTED]>, Nick Lockyer wrote:
>> Hello, I've happily got my program reading raw ethernet
>> frames, using a socket( AF_PACKET, SOCK_RAW, ETH_P_ALL),
>> but when decoding, I occasionally get bad packets, or
>> possibly even network protocols that are unsupported.
>>
>> This is bad, since it means that I don't know where the
>> next ethernet frame starts, and therefore have to abondon
>> decoding the data.
>TCP_IP Illustraed Volume 1 and 2 by W. Richard Stevens! Really good books
Yes they are, but the don't address the behavior of the Linux
packet mode socket API.
--
Grant Edwards grante Yow! I FORGOT to do the
at DISHES!!
visi.com
------------------------------
From: Martin <martin.o_brien@[no-spam]which.net>
Subject: Cannot load shared object file
Reply-To: martin.o_brien@[no-spam]which.net
Date: Wed, 2 May 2001 19:08:18 +0100
I've asked on other Linux forums about this but no luck. So I'm
asking here.
I have upgraded from Linux-Mandrake 7.2 to 8.0.
When I try to run certain apps. I get
error while loading shared libraries:
libstdc++-libc6.1-2.so.3: cannot load shared object file: No
such file or directory
ls -l /usr/lib/libstdc++-libc6.1-2.so.3
gives me
lrwxrwxrwx 1 root root 31 Apr 24 22:13
/usr/lib/libstdc++-libc6.1-2.so.3 ->
libstdc++-3-libc6.1-2-2.10.0.so
and libstdc++-3-libc6.1-2-2.10.0.so does not exist anywhere on
my system, or on the installation CDs.
I'd be grateful for any useful advice on resolving this.
Martin
http://homepages.which.net/~martin.o_brien/
------------------------------
From: Pete Zaitcev <[EMAIL PROTECTED]>
Subject: Re: execute command line from within kernel mod?
Date: Wed, 02 May 2001 11:35:58 -0700
> Is it possible or even desireable to try to do this?
The "classic UNIX" school of thought says that it is a
dumb idea. However, Linux does it routinely, in several
places. Grep for "exec_userhelper" to get the idea.
Done uncarefuly, it is a serious security hazard.
The latest problem was doing "ifconfig blah" that
caused ifconfig to ask for a bogus interface name
with shell metacharacters. Kernel then executed
garbage instead of modprobe.
-- Pete
------------------------------
From: Craig Kelley <[EMAIL PROTECTED]>
Subject: Re: times() on Linux is returning strange numbers
Date: 02 May 2001 13:37:01 -0600
"Alex Ho" <[EMAIL PROTECTED]> writes:
> Pthreads on Linux is spawning a new process for each new thread created. To
> gather total CPU times for a process, in my program, I do this:
>
> call times()
> fork a new process which spawns 10 threads, each of those
> threads will spawn a new thread, totalling 20 threads
> wait for the process to finish
> call times()
>
> Subtracting the results in the first times() from the second times() should
> give me the exact cpu times of the new process (which should include all of
> its dead children process, 20 of them in this example). But, the total
> returned in my program is smaller than what "top" shows. For example, "top"
> shows that each of 20 threads have used exactly 10 seconds when the process
> finishes. I expect to get from times() at least 200 seconds. Instead,
> times() is giving me a number much smaller than 200.
>
> Can anyone explain this?
times reports the user and system times (cpu usage) -- not the elapsed
time.
--
It won't be long before the CPU is a card in a slot on your ATX videoboard
Craig Kelley -- [EMAIL PROTECTED]
http://www.isu.edu/~kellcrai finger [EMAIL PROTECTED] for PGP block
------------------------------
From: Bernie Boudet <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.setup,comp.os.linux.embedded
Subject: Statically linking with libnss
Date: Wed, 02 May 2001 20:39:02 +0100
Hi,
I'm trying to put together a mini linux distro for an embedded system.
I've got a working system with a cut down linux 2.2.18 and busybox
statically linked against the glibc 2.1.3 resident on my development
box (Debian stable). I can ping the embedded system from the Debian
box on the same network.
The problem is in getting any network apps, which invariably require
nss, to work. I've read the glibc FAQ, and the info libc section on
nss, but I am still completely stumped by this after a whole day of
hacking. Any pointers to what could be wrong will be greatly
appreciated.
To investigate the problem, I'm using test-netdb from the glibc-2.2.2
distribution. I've tried two approaches, without success:
1. Statically link against the libc on the Debian box, and cp -a
/lib/libnss* to the target:
~/glibc-2.2.2/nss$ gcc -s -static test-netdb.c -o test-netdb
test-netdb returns NULL for every test except the first two:
gethostbyname("127.0.0.1") and gethostbyname("10.1234").
2. Build glibc-2.2.2 and statically link test-netdb against this and
the nss libraries:
~/glibc-2.2.2/nss$ gcc -s -static test-netdb.c -o test-netdb \
-I../ ../libc.a ./libnss_files.a ../resolv/libnss_dns.a \
../resolv/libresolv.a
test-netdb exits to the command line without printing anything.
AFAICT, it is dying inside the first call to gethostbyname().
Here are the contents of /lib, and relevant files in /etc on the
embedded system:
/lib:
libnss_compat-2.1.3.so libnss_dns.so.2 libnss_nis-2.1.3.so
libnss_compat.so.2 libnss_files-2.1.3.so libnss_nis.so.2
libnss_db-2.1.3.so libnss_files.so.2 libnss_nisplus-2.1.3.so
libnss_db.so.2 libnss_hesiod-2.1.3.so libnss_nisplus.so.2
libnss_dns-2.1.3.so libnss_hesiod.so.2
==========================================================================
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat
group: compat
shadow: compat
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
==========================================================================
# /etc/resolv.conf
nameserver 127.0.0.1
==========================================================================
# /etc/host.conf
order hosts,bind
multi on
==========================================================================
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server. Just add the names, addresses
# and any aliases to this file...
#
127.0.0.1 localhost
# End of hosts.
==========================================================================
#
# protocols This file describes the various protocols that are
# available from the TCP/IP subsystem. It should be
# consulted instead of using the numbers in the ARPA
# include files, or, worse, just guessing them.
#
ip 0 IP # internet protocol, pseudo protocol number
icmp 1 ICMP # internet control message protocol
igmp 2 IGMP # internet group multicast protocol
ggp 3 GGP # gateway-gateway protocol
tcp 6 TCP # transmission control protocol
pup 12 PUP # PARC universal packet protocol
udp 17 UDP # user datagram protocol
idp 22 IDP # WhatsThis?
raw 255 RAW # RAW IP interface
# End.
------------------------------
From: Craig Kelley <[EMAIL PROTECTED]>
Subject: Re: Cannot load shared object file
Date: 02 May 2001 13:39:35 -0600
Martin <martin.o_brien@[no-spam]which.net> writes:
> I've asked on other Linux forums about this but no luck. So I'm
> asking here.
>
> I have upgraded from Linux-Mandrake 7.2 to 8.0.
>
> When I try to run certain apps. I get
>
> error while loading shared libraries:
> libstdc++-libc6.1-2.so.3: cannot load shared object file: No
> such file or directory
>
> ls -l /usr/lib/libstdc++-libc6.1-2.so.3
>
> gives me
>
> lrwxrwxrwx 1 root root 31 Apr 24 22:13
> /usr/lib/libstdc++-libc6.1-2.so.3 ->
> libstdc++-3-libc6.1-2-2.10.0.so
>
> and libstdc++-3-libc6.1-2-2.10.0.so does not exist anywhere on
> my system, or on the installation CDs.
>
> I'd be grateful for any useful advice on resolving this.
You probably want to force-install the stdc library:
cd /path/to/source/cd/RPMS
rpm -i libstdc++*rpm
You may have to tell rpm to '--force' if you have a broken setup (ie,
if the files were moved without RPM's knowledge); any dependencies
need to be checked out as well if you get a warning.
--
It won't be long before the CPU is a card in a slot on your ATX videoboard
Craig Kelley -- [EMAIL PROTECTED]
http://www.isu.edu/~kellcrai finger [EMAIL PROTECTED] for PGP block
------------------------------
** 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
******************************