Linux-Development-Sys Digest #718, Volume #8 Mon, 14 May 01 23:13:15 EDT
Contents:
Linux, socket, IPv6, Traffic Class ([EMAIL PROTECTED])
getting memory status (malicorne)
How many programmers does it take to program a WinModem driver?
([EMAIL PROTECTED])
Re: malloc returns NULL! ("Karl Heyes")
Re: Loading modules permanently ("Karl Heyes")
Re: getting memory status ("Karl Heyes")
Re: getting memory status (malicorne)
getrusage() and system resources (James Stephens)
Re: segfault in module, how can I remove it ? (Luc Van Oostenryck)
Re: Best solution for fast IPC? (Roland Smith)
Re: Maximum subdirectories under one directory? ("Lee Ho")
kernel timer: microsecond ?? (NortonNg)
dst cache overflow ([EMAIL PROTECTED])
module programming / input question (Abhijit Bose)
Re: malloc returns NULL! ("Cameron Kerr")
Re: transpareny
Re: malloc returns NULL!
Re: Directory Protector (Kevin D. Quitt)
Re: Recompile Kernel fails ("BrentRBrian")
Re: David Hinds ,APA 1480 PCMCIA Support in kernel 2.4.4 Question? ("BrentRBrian")
AIX coff binaries ("BrentRBrian")
----------------------------------------------------------------------------
From: [EMAIL PROTECTED]
Subject: Linux, socket, IPv6, Traffic Class
Date: Mon, 14 May 2001 17:50:36 +0000 (UTC)
Hi! How can I set Traffic Class field of IPv6 header?
_________________________________________________________________________=
Hai perso l'ispirazione? La frase da inviare via SMS te la suggerisce =
Ciaoweb:=20
http://www.ciaoweb.it/sms/public
--
Posted from [151.88.109.26]
via Mailgate.ORG Server - http://www.Mailgate.ORG
------------------------------
From: malicorne <[EMAIL PROTECTED]>
Subject: getting memory status
Date: Mon, 14 May 2001 20:06:27 +0200
Reply-To: [EMAIL PROTECTED]
Hi all,
Is there a function call returns the available total memory of the system
?
Sure, I can do a system("/proc/meminfo > file") and the parse the file,
but I was wondering if there is a system call that provides the same
information more directly. Am using gcc in plain C mode.
Thanks for any suggestions,
Alain
------------------------------
From: [EMAIL PROTECTED]
Subject: How many programmers does it take to program a WinModem driver?
Date: Mon, 14 May 2001 14:24:32 -0400
Hello,
I am working on a driver for the Conexant HCF chip, I am aware that several
other people are working on it as well. Is there any place where device driver
programmers can post a message saying that they are "offically" working on the
driver, to avoid redundant coding? I have heard five people say they are
working on the driver, but I haven't seen any progress from this work. If you
know of any websites or anything to aid my quest for information on the
Conexant HCF driver development, please reply. Thanks!
Bjorn.
PS HCF != HSF, Olitec only has an HSF driver (does not work on HCF).
------------------------------
From: "Karl Heyes" <[EMAIL PROTECTED]>
Subject: Re: malloc returns NULL!
Date: Mon, 14 May 2001 19:53:32 +0100
In article <[EMAIL PROTECTED]>, "Greg Copeland"
<[EMAIL PROTECTED]> wrote:
> You are correct. I think there is a kernel compile option which will allow
> for what, 64G using PAE on newer processors. The kernel option in 2.4.x
> looks like this:
> High Memory Support (off, 4GB, 64GB) [off] ? The info says that if you have
> between one and four gig, select 4GB. If you have more, and your CPU
> supports PAE, then select 64G. Since PAE uses another paging scheme, I
> suspect that because of overhead, you wouldn't want to use it unless you
> REALLY have a need for it. I'm glad you said that because it reminded me
> about the option on 32-bit systems.
> Greg
On 32bit machines only 4G is accessible. PAE is used for having a three level
paging so that upto 64G can be used by the system as a whole. but each
process is limited to a 4Gig range, of which less can actually be used by the
process, mainly 2G but can be tweaked to 3G.
Allocating 10 bytes a time using the standard malloc is very wasteful,
typically (If I remember my data structures classes) about 6 pointers
get used for each allocation, ie 24 bytes, as well the actual space requested
and any alignment. If it is the case of many 10 bytes segments then use
your own allocator from a static array.
karl.
------------------------------
From: "Karl Heyes" <[EMAIL PROTECTED]>
Subject: Re: Loading modules permanently
Date: Mon, 14 May 2001 19:56:57 +0100
In article <[EMAIL PROTECTED]>, "Unknown" <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>, Heinz Ruffieux
> <[EMAIL PROTECTED]> wrote:
>>I know how to load and unload modules on my RH7.1 box. Can anybody tell me
>>how to configure my box in a way, that it always loads the desired modules
>>(e.g. msdos.o) at startup.
>>I know, that this can be done, but do not find out how.
> Add the line (e.g. "insmod msdos") to /etc/rc.d/rc.local. --
> http://www.spinics.net/linux
better to use modprobe, as it will check the /etc/modules.conf file for
options to added to the module as well as sorting out requirements for
the module..
karl.
------------------------------
From: "Karl Heyes" <[EMAIL PROTECTED]>
Subject: Re: getting memory status
Date: Mon, 14 May 2001 19:58:23 +0100
In article <9dp6h8$5ml$02$[EMAIL PROTECTED]>, "malicorne"
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Is there a function call returns the available total memory of the system
> ?
>
> Sure, I can do a system("/proc/meminfo > file") and the parse the file,
> but I was wondering if there is a system call that provides the same
> information more directly. Am using gcc in plain C mode. Thanks for any
> suggestions,
>
use the stat syscall on /proc/kcore and check it's size.
karl.
------------------------------
From: malicorne <[EMAIL PROTECTED]>
Subject: Re: getting memory status
Date: Mon, 14 May 2001 21:11:25 +0200
Reply-To: [EMAIL PROTECTED]
Karl Heyes wrote:
> In article <9dp6h8$5ml$02$[EMAIL PROTECTED]>, "malicorne"
> <[EMAIL PROTECTED]> wrote:
> > Is there a function call returns the available total memory of the
> > system
> > ?
> > Sure, I can do a system("/proc/meminfo > file") and the parse the
> > file,
> > but I was wondering if there is a system call that provides the same
> > information more directly. Am using gcc in plain C mode. Thanks for
> > any suggestions,
> use the stat syscall on /proc/kcore and check it's size.
Very nice! I haven't checked it on other systems, but it sure seems nice.
Alain
------------------------------
From: James Stephens <[EMAIL PROTECTED]>
Subject: getrusage() and system resources
Date: Mon, 14 May 2001 15:28:09 -0400
just to make sure we are on the same page, I mean ./linux/kernel/sys.c
routine:
int getrusage(struct task_struct *p, int who, struct rusage *ru);
I am interested in measuring system resources over a period of time for
a particular task (my granularity precludes the launching of a
shell/process such as sar - as such activity would polute other
measures). This implementation seems to be lacking, in that it leaves a
majority of the rusage->* fields NULL.
Questions: 1) is the implementation incomplete because it is really the
wrong approach to resource observation; or 2) because there is just a
lot of work of higher priority in the queue; or 3) oops!
More Questions: 1) is there an alternative routine; 2) if anybody is
looking at updating this code, please let me know, I would love to
contribute/debug/test
James
------------------------------
From: Luc Van Oostenryck <[EMAIL PROTECTED]>
Subject: Re: segfault in module, how can I remove it ?
Date: Mon, 14 May 2001 22:04:10 +0200
Reply-To: [EMAIL PROTECTED]
Roman Himmes wrote:
>
> Hello,
>
> I try to write an driver for a Webcam for USB. During this work the driver
> segfaults during the probe function while initializing. If I want to remove
> the module after this, the system tells me that the device is busy.
> /proc/module tless me the driver is initializing. After the kernel oops
> the system seems to be ok. is there a way to remove the driver againm or do
> I have to reboot ?
>
> Thanks,
>
> Roman
'Normally' you should reboot, but a usefull trick for this sort of case
is to create
a ioctl for this device that force to zero the use count of this module,
after that you can
remove the module. Of course I suppose that some resource are not
properly cleaned,
but for me it was OK during the development.
happy hacking
--
Luc Van Oostenryck
Do not use the address in the 'reply-to' field, but this instead:
<luc dot vanoostenryck at easynet dot be>
------------------------------
Subject: Re: Best solution for fast IPC?
From: Roland Smith <[EMAIL PROTECTED]>
Date: 14 May 2001 22:08:48 +0200
[EMAIL PROTECTED] (Jim Cochrane) writes:
> What is the fastest portable solution for IPC between two processes? By
> portable I mean being able to port the resulting code from Linux to
> Windows (as well as to other UNIXes) with very little effort.
If using something like cygwin (the GNU/unix environment ported to windows)
is an option, you can stick with a single sourcebase, with the bonus of a
tool-rich build environment.
Otherwise I've heard there is an extension for windows NT available that
makes it (mostly?) POSIX compliant.
> The task I have in mind is mostly a one-way communication: process A will
> obtain data for a stock (date, open, high, low, close, volume) from
> process B. The amount of data transfered at one time will be rather
> large, but not huge - generally not more than 1MB (and more commonly
> under 150KB).
You could use files? Either by popen(3) or a fork(2)/pipe(2)/exec(3)
combination. The popen call is POSIX.2, so I don't know if it's available
in the MS C library. Fork, pipe and exec are also POSIX. Fork and exec are
also accessible in perl, but their functionality might be
different/incomplete on windows.
> I think TCP/IP sockets would be too slow. Shared memory would be fast,
> but I'm not sure if it is portable.
I don't think there's any portable way of doing it. The Windows API is
wildly different from the unix API.
But you could probably roll-your-own copies of the relevant unix API's on
windows with a couple of #ifdefs.
Roland
--
Roland Smith "Traveler, there is no path.
r s m i t h @ x s 4 a l l . n l You make the path as you walk."
http://www.xs4all.nl/~rsmith/
------------------------------
From: "Lee Ho" <[EMAIL PROTECTED]>
Subject: Re: Maximum subdirectories under one directory?
Date: Tue, 15 May 2001 05:20:27 +0900
No problem.
In EXT2 filesystem, you can create up to EXT2_LINK_MAX
directories, and the default value of the macro is 32000.
If the filesystem has enough free inodes, there is no other
probelm.
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Lee, Ho. Software Engineer, Embedded Linux Dep, LinuxOne
Mail : [EMAIL PROTECTED] (work), [EMAIL PROTECTED] (personal)
Homepage : http://flyduck.com, http://linuxkernel.to
Jay Schwantes Wrote:
>Is there a maximum number of subdirectories under one directory in a
>linux environment?
>I have a need to create about 1000 subdirectories under one directory -
>will I create any problems doing so?
------------------------------
From: NortonNg <[EMAIL PROTECTED]>
Subject: kernel timer: microsecond ??
Date: Mon, 14 May 2001 20:56:55 +0000 (UTC)
hi all,
i would like to set a timer in kernel space for doing something.
however, i wonder if i can set a 50us(microsecond) timer, after it expired,
i would like to do something.
I have read the code in /usr/src/linux/net/sched/sch_tbf.c . it use
timer_list structure and call add_timer() to set a timer. but i suppose the
timer is ms(millisecond), isn't it?
the code is something like that:
struct timer_list wd_timer; /* Watchdog timer */
int delay;
...
delay=1;
del_timer(&wd_timer);
wd_timer.expires = jiffies + delay;
add_timer(&wd_timer);
///////////
jiffies is 10ms, i suppose. How can i set a timer with 50us??
Regards,
jkng
------------------------------
From: [EMAIL PROTECTED]
Subject: dst cache overflow
Date: Mon, 14 May 2001 21:04:36 GMT
Hi everybody,
this `dst cache overflow' bug is a pretty strange and long lasting one.
I am running 2.2.14 and I can see bug reports even for 2.3.x and I still
haven't found a patch for it. Several months ago, after I posted the
question on Linux kernel mailing list, I got response from David Miller,
one of the Linux networking gurus, in which he said that bug is well
known and that fix is to bring up loopback interface before trying to
use network. I implemented that and it worked for me until recently,
when I started getting these messages again, although I didn't change
anything in that part of application.
I would like to know if there is a patch for this bug.
Regards,
Damir Cosic
P.S. Please no `what are you doing with that old kernel' responses ;-)
------------------------------
From: Abhijit Bose <[EMAIL PROTECTED]>
Subject: module programming / input question
Date: Mon, 14 May 2001 17:18:20 -0400
Hello,
I would like to have a user process dump some data structure into a file
in /proc (or some other
directory) and have a kernel module read the contents of the file. I
would then use this data
in one of the functions in /net directory (ip_output.c) to change
contents of an
outgoing packet. My question is:
will the data be available to the entire kernel if i export the symbols
corresponding to these
data variables from the module after it reads the data from the file in
/proc ? e.g. i can define a structure in the module and have this
structure as well as the actual variable (object) exported.
I plan to use
get_user in asm/uaccess.h - is this recommended for 2.2.x - 2.4.x
kernels ? Thanks very much,
Abhijit Bose
------------------------------
From: "Cameron Kerr" <[EMAIL PROTECTED]>
Subject: Re: malloc returns NULL!
Date: Tue, 15 May 2001 09:42:33 +1200
In article <[EMAIL PROTECTED]>, "Greg Copeland"
<[EMAIL PROTECTED]> wrote:
> You may want to look into performing a single allocation of the maximum
> upper limit that your allocation will be using and access it via an
> index reference or via making a pointer from an indexed reference.
You should get an extra performance boost from this also, as malloc()
takes a long time to do what it does, so you're best to only do it once.
PS. You may want to check out what the GNU C Library Manual has to say
about your error message from perror().
--
Cameron Kerr -- cameron.kerr @ paradise.net.nz
Praise Slackware, our baud and saviour!
--
------------------------------
From: [EMAIL PROTECTED] ()
Crossposted-To:
alt.linux,comp.os.linux.development.apps,linux.redhat.devel,linux.redhat.development
Subject: Re: transpareny
Date: Mon, 14 May 2001 22:07:59 -0000
In article <dBDL6.3906$[EMAIL PROTECTED]>,
Darren LS <[EMAIL PROTECTED]> wrote:
>how would I incorporate this in my programme? would it be the first part of
>the main function or would I have to stick mymain code in a function?
I suggest looking at the source of a couple of daemons to see
how they do it.
--
http://www.spinics.net/linux
------------------------------
From: [EMAIL PROTECTED] ()
Subject: Re: malloc returns NULL!
Date: Mon, 14 May 2001 22:16:00 -0000
In article <[EMAIL PROTECTED]>,
David Konerding <[EMAIL PROTECTED]> wrote:
>> Get a 64-bit machine, and you should be OK.
>That seems like a drastic soluton. Why not just recode the application
>so instead
>of calling malloc it calls your own memory allocator, which
>pre-malloc()s and hands
>out addresses? He has enough RAM to contain the 10 bytes * 70 million requests.
That's probably the best solution. He could also see what's going on by
checking the data returned by mallinfo. There might also be a limit on
memory allocation or virtual address space set so he should check the
value from getrlimit.
--
http://www.spinics.net/linux
------------------------------
From: Kevin D. Quitt <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development,.apps,comp.unix.programmer
Subject: Re: Directory Protector
Date: Mon, 14 May 2001 17:43:43 -0700
Reply-To: [EMAIL PROTECTED]
Encrypt the files, and have the key in the smart card. A user-level
program can now read the files. Not the best, but it works.
--
#include <standard.disclaimer>
_
Kevin D Quitt USA 91351-4454 96.37% of all statistics are made up
Per the FCA, this email address may not be added to any commercial mail list
------------------------------
From: "BrentRBrian" <[EMAIL PROTECTED]>
Subject: Re: Recompile Kernel fails
Date: Mon, 14 May 2001 22:48:28 -0400
When rebuilding a kernel I do (may be overkill).
make mrproper (one time, after I unpack sources)
make menuconfig
make dep
make bzImage
I do those three to build the kernel
mv /lib/modules/2.4.2-2 /lib/modules/2.4.2-2.old
move old modules out of the way before you "rebuild them"
make modules
make modules_install
I do those to rebuild the modules
make install
(I believe this may not be needed with bzImage, anyone?)
lilo
(make install does this (as does make install?))
B
In article <[EMAIL PROTECTED]>, "Unknown" <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>, Heinz Ruffieux
> <[EMAIL PROTECTED]> wrote:
>
>>System is too big. Try using bzImage or modules. make[1]: *** [zImage]
>>Error 1
>>make[1]: Verlassen des Verzeichnisses Verzeichnis
>>�/usr/src/linux-2.4.2/arch/i386/boot� make: *** [boot] Error 2
>>
>>
>>Is there anybody who can help me with this?
>
> make bzImage
>
> --
> http://www.spinics.net/linux
------------------------------
From: "BrentRBrian" <[EMAIL PROTECTED]>
Subject: Re: David Hinds ,APA 1480 PCMCIA Support in kernel 2.4.4 Question?
Date: Mon, 14 May 2001 22:54:54 -0400
I had some weirdness introduced by the 2.4 kernel with PCMCIA.
My laptop assigned IRQ12 to mouse and IRQ15 to PCMCIA, but 2.4 kernel
tryed to push PCMCIA onto IRQ12, hung the system whenever the mouse
was touched.
Cure was to edit kernel source pci-irq.c in arch/i386/kernel and take
penalty off IRQ15 and place a penalty on IRQ12. Rebuild the kernel and
now PCMCIA is correctly placed on IRQ15 (no choice, bios does it) and
mouse on IRQ12 (ps/2 pad).
There is a kernel parm that also allows "irq flags" to be set.
5.2, 6.1 and 7.0 were sane about this, 7.1 RH (2.4) was a problem.
B
In article <9df55v$[EMAIL PROTECTED]>, "E-mu"
<[EMAIL PROTECTED]> wrote:
> WHat happend to the choice for APA 1480 in kernel 2.4.4. Is it now a
> built in driver to PCMCIA(y) or (m).
>
>
> Anyhow when I boot up kernel 2.4.4, with the AHA 1480 Adaptec Slim SCSI
> the kernel goes through some weird error. Some kinda loop after loop
> during the initiation of the PCMCIA device. Then it ends up with a dump
> stack at the end.
>
> I was unable to capture all the errors , since the the file system nor
> hard drive ever gets mounted.
>
>
> And I have contacted the maintainter for Firewire support "Andreas Bombe
> " and he said gave me a web site to check out the "CVS". He said ther
> is some support for PCMCIA Firewire support since its OCHI. Along with
> sbp-2. Anyhow doesn't this involve you to since this is cardbus. In
> other words will there be some kinda low level or whatever driver to
> drive this PCMCIA card then, take off from there as far as "Andreas
> Bombe " , working on the rest of the drivers.
>
>
------------------------------
From: "BrentRBrian" <[EMAIL PROTECTED]>
Subject: AIX coff binaries
Date: Mon, 14 May 2001 22:57:23 -0400
I have a friend running AIX 1.3 on x86. I noticed the AIX COFF binaries
mentioned in the kernel sources for 2.4, but after #define'ing the AIX
magic number in the header and rebuilding, still no luck.
Anybody have any idea what would be involved in getting the AIX binaries
to execute under Linux ?
B
------------------------------
** 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
******************************