Linux-Development-Sys Digest #717, Volume #8     Mon, 14 May 01 13:13:15 EDT

Contents:
  Re: [kernel] capturing packets ("Cameron Kerr")
  [Q]How to show Bitmap on monitor without X library?? ("songjg")
  Re: [kernel] capturing packets (Vyacheslav Burdjanadze)
  Re: Directory Protector (Chris)
  Re: [kernel] capturing packets (Vyacheslav Burdjanadze)
  malloc returns NULL! ([EMAIL PROTECTED])
  Re: malloc returns NULL! ("Cameron Kerr")
  Re: [Q]How to show Bitmap on monitor without X library?? ("Cameron Kerr")
  pipe buffer size ("Norbert Lakatos")
  Re: malloc returns NULL! (Joergen Pihlflyckt)
  Re: pipe buffer size (Florian =?iso-8859-1?Q?Gro=DFe=2DCoosmann?=)
  Re: Red Hat Device Driver training (Mark Langsdorf)
  Re: malloc returns NULL! (David Konerding)
  Recompile Kernel fails (Heinz Ruffieux)
  Loading modules permanently (Heinz Ruffieux)
  Re: Recompile Kernel fails
  Re: Loading modules permanently
  pthread_cond_timedwait !!! ("Ivor Cox")
  Re: malloc returns NULL! (Greg Copeland)
  Re: malloc returns NULL! ([EMAIL PROTECTED])
  Re: malloc returns NULL! (Greg Copeland)

----------------------------------------------------------------------------

From: "Cameron Kerr" <[EMAIL PROTECTED]>
Subject: Re: [kernel] capturing packets
Date: Mon, 14 May 2001 22:11:41 +1200

In article <[EMAIL PROTECTED]>, "Vyacheslav Burdjanadze"
<[EMAIL PROTECTED]> wrote:

> Hello.
> 
> Just wondering if following is possible: I want to grab *outcoming* IP
> packet on specified interface and taking some action on it.
> Then I need to replace original packet with my data and let the
> underlying system to pass packet his way. This is required to
> transparent encrypting of IP packets. What mechanism exists in Linux
> kernel
> to do this? I read about netlink socket interface but it doesn't seem to
> help me. :(

Hmm, I think you want to be using the TUN/TAP interface.
<kernel_source>/Documentation/networking/tuntap.txt perhaps

-- 
Cameron Kerr -- cameron.kerr @ paradise.net.nz
Praise Slackware, our baud and saviour!
--

------------------------------

From: "songjg" <[EMAIL PROTECTED]>
Subject: [Q]How to show Bitmap on monitor without X library??
Date: Mon, 14 May 2001 19:11:22 +0900

Hello.

I want to show Bitmap and dialog box on monitor without X library.

I don't know wheater the method that sovle this problem exist or not.

I guess NCURSES solves this problem, right??

I'll wait your reply...

Thanks for reading the article.



------------------------------

Date: Mon, 14 May 2001 14:18:32 +0400
From: Vyacheslav Burdjanadze <[EMAIL PROTECTED]>
Subject: Re: [kernel] capturing packets

Aminudin Khalid wrote:
> 
> Is it a kernel level programming ? .  AFAIK libcap can be used to capture
> packet.
Can I use libpcap to inject packets back?

> 
> Vyacheslav Burdjanadze wrote:
> 
> > Hello.
> >
> > Just wondering if following is possible:
> > I want to grab *outcoming* IP packet on specified interface and taking
> > some action on it.
> > Then I need to replace original packet with my data and let the
> > underlying system to pass packet his way. This is required to
> > transparent encrypting of IP packets. What mechanism exists in Linux
> > kernel
> > to do this? I read about netlink socket interface but it doesn't seem to
> > help me. :(

------------------------------

From: Chris <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development,comp.unix.programmer
Subject: Re: Directory Protector
Date: Mon, 14 May 2001 11:28:52 +0100

Aminudin Khalid wrote:
> 
> Hi,
> 
> So  the best  solution is the implement this program in the kernel. I would
> be happy if I can do this without compiling the kernel at reboot all the time
> to test the program . What I am thinking right now is to do some kernel
> module programming that can detect these dedicated directories when there are
> accessed . Any idea how to do this ?
> 
> May some client server architecture could help this implemention .

You could always use the user-mode NFS server trick, and
implement a filesystem on top of that (or use a `real'
filesystem and encrypt the files).

-- 
Chris Lightfoot -- chris at ex dash parrot dot com -- www.ex-parrot.com/~chris/
 ``You can't say that, because it's true.''
   (unnamed Russian censor, to Malcom Muggeridge, 1933)

------------------------------

Date: Mon, 14 May 2001 15:11:08 +0400
From: Vyacheslav Burdjanadze <[EMAIL PROTECTED]>
Subject: Re: [kernel] capturing packets

Cameron Kerr wrote:
> 
> In article <[EMAIL PROTECTED]>, "Vyacheslav Burdjanadze"
> <[EMAIL PROTECTED]> wrote:
> 
> > Hello.
> >
> > Just wondering if following is possible: I want to grab *outcoming* IP
> > packet on specified interface and taking some action on it.
> > Then I need to replace original packet with my data and let the
> > underlying system to pass packet his way. This is required to
> > transparent encrypting of IP packets. What mechanism exists in Linux
> > kernel
> > to do this? I read about netlink socket interface but it doesn't seem to
> > help me. :(
> 
> Hmm, I think you want to be using the TUN/TAP interface.
> <kernel_source>/Documentation/networking/tuntap.txt perhaps
Oh, thanks , it seems something I looking for.

------------------------------

From: [EMAIL PROTECTED]
Subject: malloc returns NULL!
Date: 10 May 2001 21:53:39 GMT


Hello all,

        We have an application that makes repeated calls to malloc(), each
time requesting small amount of memory (around 10 bytes or less). By
"repeated
calls", I mean over 70 million calls...

        Ok, so the problem is this: eventually, malloc will return NULL even
though there is free memory available (the machine has 2 GB of RAM).

        Does anybody have any work-arounds for this feature of malloc? I tried
to disable mmap (using mallopt(M_MMAP_MAX , 0)) but it did not work...

        If possible, please reply by email to [EMAIL PROTECTED]

        Thanks!

Armando



 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email [EMAIL PROTECTED]

------------------------------

From: "Cameron Kerr" <[EMAIL PROTECTED]>
Subject: Re: malloc returns NULL!
Date: Tue, 15 May 2001 00:51:53 +1200

In article <9df2l3$arn$[EMAIL PROTECTED]>, "Unknown"
<[EMAIL PROTECTED]> wrote:

> Hello all,
> 
>       We have an application that makes repeated calls to malloc(), each
> time requesting small amount of memory (around 10 bytes or less). By
> "repeated
> calls", I mean over 70 million calls...
> 
>       Ok, so the problem is this: eventually, malloc will return NULL even
> though there is free memory available (the machine has 2 GB of RAM).

It may be that the memory in the system is too fragmented. What does
perror() print out (after malloc returns NULL)

-- 
Cameron Kerr -- cameron.kerr @ paradise.net.nz
Praise Slackware, our baud and saviour!
--

------------------------------

From: "Cameron Kerr" <[EMAIL PROTECTED]>
Subject: Re: [Q]How to show Bitmap on monitor without X library??
Date: Tue, 15 May 2001 00:54:32 +1200

In article <9dob4j$593$[EMAIL PROTECTED]>, "songjg"
<[EMAIL PROTECTED]> wrote:

> Hello.
> 
> I want to show Bitmap and dialog box on monitor without X library.
> 
> I don't know wheater the method that sovle this problem exist or not.
> 
> I guess NCURSES solves this problem, right??

No, ncurses is character based.

By "without X library", I assume you mean directly on the console, in
which case you might want to check out SVGAlib, or, for more advanced
stuff (eg. 3dgames) DRI (Direct Rendering Infrastructure), which is
used under X, but doesn't use any X protocols.

Hope it helps
-- 
Cameron Kerr -- cameron.kerr @ paradise.net.nz
Praise Slackware, our baud and saviour!
--

------------------------------

From: "Norbert Lakatos" <[EMAIL PROTECTED]>
Subject: pipe buffer size
Date: Mon, 14 May 2001 15:44:31 +0200

Does anybody knows how to change its size?

TIA!



------------------------------

From: [EMAIL PROTECTED] (Joergen Pihlflyckt)
Subject: Re: malloc returns NULL!
Date: 14 May 2001 16:51:08 +0300

[EMAIL PROTECTED] writes:

>Hello all,

>       We have an application that makes repeated calls to malloc(), each
>time requesting small amount of memory (around 10 bytes or less). By
>"repeated calls", I mean over 70 million calls...

Your application is hogging a whole gigabyte of RAM, and if you're doing
this on a 32-bit PC you'll be running out of addressable memory quite soon.

>       Ok, so the problem is this: eventually, malloc will return NULL even
>though there is free memory available (the machine has 2 GB of RAM).

Get a 64-bit machine, and you should be OK.
=====
eMail:  [EMAIL PROTECTED]           Home: +358-9-87750100
        [EMAIL PROTECTED]          Work: +358-9-4514777
        [EMAIL PROTECTED]    GSM:  +358-50-3653601
WWW:    http://pihlflyckt.hut.fi/   Fax:  +358-50-83653601

------------------------------

From: Florian =?iso-8859-1?Q?Gro=DFe=2DCoosmann?= <[EMAIL PROTECTED]>
Subject: Re: pipe buffer size
Date: Mon, 14 May 2001 15:59:14 +0200

Norbert Lakatos wrote:
> 
> Does anybody knows how to change its size?
> 
> TIA!

A normal nameless pipe has a fixed buffer size of one page, e.g. 4KB on x86.

Cheers, Florian

------------------------------

From: Mark Langsdorf <[EMAIL PROTECTED]>
Subject: Re: Red Hat Device Driver training
Date: Mon, 14 May 2001 14:33:22 GMT

Steve Millman <[EMAIL PROTECTED]> wrote:
> Hi,
> Has anyone taken the Red Hat Linux Device Driver course (RHD221) and if
> so how would they rate it.  Are there any other training courses given by
> other companies for Linux device drivers?

        I took it in September of 2000.  It's a five day course.  
        It covers the basics of kernel methods, threads, modules,
kernel debugging techniques, memory management, ioctls, time
management, interrupt handling, and char, block, and network driver
details.  It's a mix of lecture and lab exercises, one of which is
to create a serial mouse driver and interface it with X.
        I had experience working with Linux Device Drivers before and
did not find the class amazingly useful, though it did clarify a few
weak points and give me a much better understanding of the theory.  My
co-worker who had not been working with Linux device drivers found it
much more useful.
        As of September 2000, the Redhat course was the only Linux
driver course available.  That may have changed but I doubt it.

-Mark Langsdorf
AMD, Inc.


------------------------------

From: [EMAIL PROTECTED] (David Konerding)
Subject: Re: malloc returns NULL!
Date: 14 May 2001 14:20:02 GMT
Reply-To: [EMAIL PROTECTED]

On 14 May 2001 16:51:08 +0300, Joergen Pihlflyckt <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] writes:
> 
>>Hello all,
> 
>>      We have an application that makes repeated calls to malloc(), each
>>time requesting small amount of memory (around 10 bytes or less). By
>>"repeated calls", I mean over 70 million calls...
> 
> Your application is hogging a whole gigabyte of RAM, and if you're doing
> this on a 32-bit PC you'll be running out of addressable memory quite soon.
> 
>>      Ok, so the problem is this: eventually, malloc will return NULL even
>>though there is free memory available (the machine has 2 GB of RAM).
> 
> 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.

Dave

------------------------------

From: Heinz Ruffieux <[EMAIL PROTECTED]>
Subject: Recompile Kernel fails
Date: Mon, 14 May 2001 15:30:54 -0000

Hi,

Just tried to recompile my 2.4.2 kernel to modify processor type to AMD.

After running make xconfig, make dep, make clean, the command make boot
fails at the with the following error:

gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o tools/build
tools/build.c -I/usr/src/linux-2.4/include
objcopy -O binary -R .note -R .comment -S compressed/vmlinux
compressed/vmlinux.out
tools/build bootsect setup compressed/vmlinux.out CURRENT > zImage
Root device is (3, 6)
Boot sector 512 bytes.
Setup is 2372 bytes.
System is 932 kB
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?

Thanks

Heinz


--
Posted via CNET Help.com
http://www.help.com/

------------------------------

From: Heinz Ruffieux <[EMAIL PROTECTED]>
Subject: Loading modules permanently
Date: Mon, 14 May 2001 15:31:46 -0000

Hi,

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.

Anybody who can help on this?

Thanks a lot

Heinz

--
Posted via CNET Help.com
http://www.help.com/

------------------------------

From: [EMAIL PROTECTED] ()
Subject: Re: Recompile Kernel fails
Date: Mon, 14 May 2001 15:39:25 -0000

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: [EMAIL PROTECTED] ()
Subject: Re: Loading modules permanently
Date: Mon, 14 May 2001 15:41:25 -0000

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

------------------------------

From: "Ivor Cox" <[EMAIL PROTECTED]>
Subject: pthread_cond_timedwait !!!
Date: Mon, 14 May 2001 16:47:57 +0100

Hi,

I am getting EINVAL from all calls to pthread_cond_timedwait() in my
implemetation of an event posting mechanism. This is lifted from a working
Neutrino version of same (using pthread also). If I replace the call by
pthread_cond_wait() there is no error. I have tested the code section in a
simple test prog and it works fine - so the setup of the time seems ok.

I am using RedHat 7 out of the box and compile with REENTRANT etc. The
application consists of a set of shared modules which seem to run fine when
I kludge the failing section using sleeps.

Has anyone any ideas or suggestions what the error might imply - the first
parameters must be ok as they are accepted by the non-timed function and the
time value setup seemed ok in a test program.

Many thanks for your attention.

Ivor Cox








------------------------------

Subject: Re: malloc returns NULL!
From: Greg Copeland <[EMAIL PROTECTED]>
Date: 14 May 2001 11:20:07 -0500


As someone pointed out, you may be fragmenting memory too badly for it to
be reused.  You didn't say if you had been freeing any of it along the way.
Assuming that you are really not running out of memory (you indicate
70,000,000 x 10 bytes / 1024 bytes / 1024 byts = 667 Meg of RAM.  Now then,
that doesn't take into account the number of pointers that you are using to
keep track of all that.  Are you using 70,000,000 million pointers too?
If so, that would be another 267M of RAM (total of 934M) worth of 32-bit
pointers.

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'll also need to make sure, assuming that you're writing to the allocations,
that you have enough physical and/or virtual memory to handle that kind of
memory hit.

Greg

[EMAIL PROTECTED] writes:

> Hello all,
> 
>       We have an application that makes repeated calls to malloc(), each
> time requesting small amount of memory (around 10 bytes or less). By
> "repeated
> calls", I mean over 70 million calls...
> 
>       Ok, so the problem is this: eventually, malloc will return NULL even
> though there is free memory available (the machine has 2 GB of RAM).
> 
>       Does anybody have any work-arounds for this feature of malloc? I tried
> to disable mmap (using mallopt(M_MMAP_MAX , 0)) but it did not work...
> 
>       If possible, please reply by email to [EMAIL PROTECTED]
> 
>       Thanks!
> 
> Armando

-- 
Greg Copeland, Principal Consultant
Copeland Computer Consulting
==================================================
PGP/GPG Key at http://www.keyserver.net
DE5E 6F1D 0B51 6758 A5D7  7DFE D785 A386 BD11 4FCD
==================================================

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: malloc returns NULL!
Date: 14 May 2001 15:20:39 GMT

On 10 May 2001 21:53:39 GMT [EMAIL PROTECTED] wrote:

|       We have an application that makes repeated calls to malloc(), each
| time requesting small amount of memory (around 10 bytes or less). By
| "repeated
| calls", I mean over 70 million calls...
|
|       Ok, so the problem is this: eventually, malloc will return NULL even
| though there is free memory available (the machine has 2 GB of RAM).
|
|       Does anybody have any work-arounds for this feature of malloc? I tried
| to disable mmap (using mallopt(M_MMAP_MAX , 0)) but it did not work...
|
|       If possible, please reply by email to [EMAIL PROTECTED]

Add some code around the malloc() calls to keep track of:
1.  The total space requested
2.  The lowest address ever obtained
3.  The highest address ever obtained
Then when it gets a NULL, have it print out:
1.  The total space requested
2.  The difference between the highest and lowest address
This should help us figure out what is happening.

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

------------------------------

Subject: Re: malloc returns NULL!
From: Greg Copeland <[EMAIL PROTECTED]>
Date: 14 May 2001 11:25:50 -0500


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


[EMAIL PROTECTED] (Joergen Pihlflyckt) writes:

> [EMAIL PROTECTED] writes:
> 
> >Hello all,
> 
> >     We have an application that makes repeated calls to malloc(), each
> >time requesting small amount of memory (around 10 bytes or less). By
> >"repeated calls", I mean over 70 million calls...
> 
> Your application is hogging a whole gigabyte of RAM, and if you're doing
> this on a 32-bit PC you'll be running out of addressable memory quite soon.
> 
> >     Ok, so the problem is this: eventually, malloc will return NULL even
> >though there is free memory available (the machine has 2 GB of RAM).
> 
> Get a 64-bit machine, and you should be OK.
> -----
> eMail:  [EMAIL PROTECTED]           Home: +358-9-87750100
>         [EMAIL PROTECTED]          Work: +358-9-4514777
>         [EMAIL PROTECTED]    GSM:  +358-50-3653601
> WWW:    http://pihlflyckt.hut.fi/   Fax:  +358-50-83653601

-- 
Greg Copeland, Principal Consultant
Copeland Computer Consulting
==================================================
PGP/GPG Key at http://www.keyserver.net
DE5E 6F1D 0B51 6758 A5D7  7DFE D785 A386 BD11 4FCD
==================================================

------------------------------


** 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
******************************

Reply via email to