Linux-Development-Sys Digest #354, Volume #8     Sat, 16 Dec 00 09:13:12 EST

Contents:
  Does anyone have ftp'able version of KHG (Sameer Shah)
  Re: is there a linux checkpoint facility? ([EMAIL PROTECTED])
  Re: how to use raw device (Ronald Cole)
  Re: Zombie processes? (Stefan Haller)
  Re: Count? (Stefan Haller)
  IPC in a module ("Gareth Stephens")
  Re: Compiling C++ programs with GCC --> no GPL license implications (jbs)
  Re: IPC in a module (noway@[127.1.1.2])
  Re: is there a linux checkpoint facility? (Kaz Kylheku)
  Re: Compiling C++ programs with GCC --> no GPL license implications (Peter Seebach)
  Re: is there a linux checkpoint facility? (Paul Repacholi)
  Kernel patch list? Was: raid... (Paul Repacholi)
  Re: A faster memcpy and bzero for x86 (Paul Repacholi)
  Re: Linux Driver Development (Paul Repacholi)
  Re: Compiling C++ programs with GCC --> no GPL license implications (jbs)
  Re: IPC in a module ("Gareth Stephens")
  Re: IPC in a module ("Peter T. Breuer")
  Sockets. Redirect and modify data. ("hebre")
  Re: kernel modules debugger (Arnaud Westenberg)
  Newsgroup faq? (Arnaud Westenberg)
  Re: DDD Debugger (Andy Ford)

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

From: Sameer Shah <[EMAIL PROTECTED]>
Subject: Does anyone have ftp'able version of KHG
Date: Fri, 15 Dec 2000 17:39:59 -0500

Hi,

Am unable to retrieve the ftpable version of the linux
kernel hackers guide from anywhere. Its supposed
to be at ftp.redhat.com/home/johnsonm/khg.tar.gz. But
the ftp.redhat.com site does not seem to have such a
directory. Appreciate if someone knows of a link that
works.

Thanks,
Sameer



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

From: [EMAIL PROTECTED]
Subject: Re: is there a linux checkpoint facility?
Date: Fri, 15 Dec 2000 21:43:07 GMT

Eric Taylor <[EMAIL PROTECTED]> wrote:
> Does anyone know of a checkpointing utility/capability
> for linux?

> I have a large simulation that I want to snapshot
> and be able to restore to execution later, possibly after 
> a reboot, or on a different linux box (running the same
> version of linux incl libs). I can live w/o all the i/o 
> setup being done automatically, as long as the
> program's data areas are all restored. 

Condor will do it, but you may/may not be within it's license if it's
a commercial endevor. http://www.cs.wisc.edu/condor.

> I might want to modify one or more shared librarys
> prior to restart. 

That may or may not work. I honestly don't know.

-- 
Matt Gauthier <[EMAIL PROTECTED]>

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

From: Ronald Cole <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,linux.dev.kernel
Subject: Re: how to use raw device
Date: 15 Dec 2000 16:03:36 -0800

Josef Moellers <[EMAIL PROTECTED]> writes:
> ca depend, as the French use to say.
> 
> It depends on which kernel version you use. 2.2 kernels don't have raw
> devices.

There are patches available and RedHat 7.0 includes those patches in
it's distributed kernel.  See "man raw".

> If you checked the return value of the open call, you'd get the
> message:
> 
> fd =3D open("/dev/raw/raw1", O_RDONLY);
> if (fd =3D=3D -1)
> {
>     perror("/dev/raw/raw1");
>     return; /* or exit(1) or whatever */
> }
> 
> Apparently 2.4 kernels do have raw devices, so read() and write() should
> both work.
> Again, you should check the return values from open() and read(), this
> time.

-- 
Forte International, P.O. Box 1412, Ridgecrest, CA  93556-1412
Ronald Cole <[EMAIL PROTECTED]>      Phone: (760) 499-9142
President, CEO                             Fax: (760) 499-9152
My GPG fingerprint: C3AF 4BE9 BEA6 F1C2 B084  4A88 8851 E6C8 69E3 B00B

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

From: Stefan Haller <[EMAIL PROTECTED]>
Subject: Re: Zombie processes?
Date: Fri, 15 Dec 2000 14:53:33 +0100
Reply-To: [EMAIL PROTECTED]

Hi Daniel

Daniel Lenski wrote:
> if (!fork()) {
>         handle_incoming_connection(socket);
>         close(socket);
>         exit(0)
> }
> 
> But it seems to leave me with a zombie process every time it forks and
> then exits.  How can I get rid of these zombie processes?  I don't want
> to have to do a wait() for the child processes to exit, since that would
> destroy the whole point of handling multiply client connections ...

You should have a look at the wait() call family.

Whenever a process exits, some process information in the process
table stays allocated (exit status and that stuff). A SIGCHLD is
sent to its parent process, so if you deal a lot with other
processes, a signal handler that does a wait() could be nice for
you. The wait() family gets the exit code and stuff and frees the
rest of the memory in the process table.

You seem not to check for a return code of -1 for fork(). I would
check for that, too.

With kind regards
 Stefan

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

From: Stefan Haller <[EMAIL PROTECTED]>
Subject: Re: Count?
Date: Fri, 15 Dec 2000 14:46:47 +0100
Reply-To: [EMAIL PROTECTED]

Hi Mark

"Mark R. Holbrook" wrote:
> 
> Back in my Unix/Xenix days there used to be a command called "count".
> 
> This was a handy thing to do things like:  ps -ef | count to tell you
> how many processes were running.  Or... who | count would tell you how
> many people were logged in.
> 
> What ever happened to count?

Maybe wc (word count) will suit your needs.

ps -ef|wc -l or something...

With kind regards
 Stefan

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

From: "Gareth Stephens" <[EMAIL PROTECTED]>
Subject: IPC in a module
Crossposted-To: uk.comp.os.linux,uklinux.help.misc
Date: Sat, 16 Dec 2000 01:39:33 +0000

Hi all,
        I hope that someone can guide me in the right direction here.  Basically
I want to use SYSV IPC (message queues in particular) in a kernel module.
 Is this possible and if so how?  I have looked in numerous places and it
seems to be possible but I can't actually find somewhere that says this
is how you do it.  I tried to do it the way I would in user space (i.e.
#include <sys/shm.h>, etc) but that failed - because I presume it is a
user space way of doing it.
        Also from various posts ng's it seems that SYSV IPC may not be the best
way to do this but if not then what is?

Thanks for any help,
        Gareth.

PS (If you want to reply directly take the NOSPAMEVER bit out)

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

From: jbs <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c++,gnu.misc.discuss
Subject: Re: Compiling C++ programs with GCC --> no GPL license implications
Date: Fri, 15 Dec 2000 17:57:14 -0800

Pete Becker wrote:
> There is a difference between "I know what this means" and "There could
> be problems here." The former is a legal judgment. The latter is not.

The former is a useful statement.  The latter is not.

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

From: noway@[127.1.1.2]
Crossposted-To: uk.comp.os.linux,uklinux.help.misc
Subject: Re: IPC in a module
Date: 16 Dec 2000 02:23:22 +0000

"Gareth Stephens" <[EMAIL PROTECTED]> writes:

>       Also from various posts ng's it seems that SYSV IPC may not be the best
> way to do this but if not then what is?

What do you want to communicate with? If you want to do module<->user
process communication, then netlink is probably the best bet.

http://snafu.freedom.org/linux2.2/docs/netlink-HOWTO.html

Paul

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: is there a linux checkpoint facility?
Reply-To: [EMAIL PROTECTED]
Date: Sat, 16 Dec 2000 02:42:06 GMT

On Fri, 15 Dec 2000 18:07:18 GMT, Eric Taylor <[EMAIL PROTECTED]> wrote:
>Hi:
>
>Does anyone know of a checkpointing utility/capability
>for linux?

There exist some kernel patches for doing process checkpointing.
You can freeze dry a process and some of its resources like open
file descriptors, and then restart it later.

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

Crossposted-To: comp.lang.c++,gnu.misc.discuss
Subject: Re: Compiling C++ programs with GCC --> no GPL license implications
From: [EMAIL PROTECTED] (Peter Seebach)
Date: 16 Dec 2000 05:23:59 GMT

In article <[EMAIL PROTECTED]>, jbs  <[EMAIL PROTECTED]> wrote:
>Pete Becker wrote:
>> There is a difference between "I know what this means" and "There could
>> be problems here." The former is a legal judgment. The latter is not.

>The former is a useful statement.  The latter is not.

No, the latter is also useful, because it alerts you to the possibility that,
if it would matter to you if there were problems, you might benefit from
having it reviewed.

I spent a number of hours reviewing an IP agreement.  I thought I'd caught
everything... so I showed it to a lawyer, who found a few things I missed.
"There could be problems here", even though it was all anyone could tell
me, was enough to alert me to the *potential* for it to be useful to show
it to a lawyer.

-s
-- 
Copyright 2000, All rights reserved.  Peter Seebach / [EMAIL PROTECTED]
C/Unix wizard, Pro-commerce radical, Spam fighter.  Boycott Spamazon!
Consulting & Computers: http://www.plethora.net/

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

Subject: Re: is there a linux checkpoint facility?
From: Paul Repacholi <[EMAIL PROTECTED]>
Date: 16 Dec 2000 15:59:34 +0800

Eric Taylor <[EMAIL PROTECTED]> writes:

> Hi:
> 
> Does anyone know of a checkpointing utility/capability
> for linux?
> 
> I have a large simulation that I want to snapshot
> and be able to restore to execution later, possibly after 
> a reboot, or on a different linux box (running the same
> version of linux incl libs). I can live w/o all the i/o 
> setup being done automatically, as long as the
> program's data areas are all restored. 

If you have the source...

Mod your code to memmap a file and look for a flag
structure to see if it has been inited. If it has,
go. If not, init the data areas and go. Every so
often, and/or on getting a signal, save your IO state
close files, and flush and close the memmaped file
THEN SYNC. Go back to step one... until done.

You will have to figure what to do with files that
vanish. networks etc, if you care about them...

-- 
Paul Repacholi                               1 Crescent Rd.,
+61 (08) 9257-1001                           Kalamunda.
                                             West Australia 6076
Raw, Cooked or Well-done, it's all half baked.

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

Crossposted-To: 
alt.os.linux.mandrake,alt.os.linux.slackware,alt.uu.comp.os.linux.questions
Subject: Kernel patch list? Was: raid...
From: Paul Repacholi <[EMAIL PROTECTED]>
Date: 16 Dec 2000 15:52:00 +0800

[EMAIL PROTECTED] writes:

> but i have nfi whether 2.2.18 needs a patch to be current with the state
> of a properly patched 2.2.17 kernel.

Can someone point me to a reliable set of kernel patches,
or a list of the? x86 and Alpha, deb.

-- 
Paul Repacholi                               1 Crescent Rd.,
+61 (08) 9257-1001                           Kalamunda.
                                             West Australia 6076
Raw, Cooked or Well-done, it's all half baked.

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

Subject: Re: A faster memcpy and bzero for x86
From: Paul Repacholi <[EMAIL PROTECTED]>
Date: 16 Dec 2000 16:07:50 +0800

[EMAIL PROTECTED] (Linus Torvalds) writes:

> It's not just about polluting the caches.
> 
> It's also about polluting a shared bus, where the other CPU's that
> aren't idle may be doing real work that _needs_ that bus. 
> 
> An idle thread should NOT use resources that may be useful for other
> threads that are doing real work.

If your page was private and dirty, you will HAVE to zero it, unless
you never reuse it. So pay now, or pay later. However, if you are
in the idle loop, then there is a higher chance that at least some
other CPUs are as well. When you want a new page, you are by definition,
busy, and if you are, there is a higher chance the others are as well.

Pre cleaning pages is a win if you don't clobber the cache, or lose
current context. ( Linux does do lazy ideling doesn't it? )

-- 
Paul Repacholi                               1 Crescent Rd.,
+61 (08) 9257-1001                           Kalamunda.
                                             West Australia 6076
Raw, Cooked or Well-done, it's all half baked.

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

Subject: Re: Linux Driver Development
From: Paul Repacholi <[EMAIL PROTECTED]>
Date: 16 Dec 2000 16:29:21 +0800

Richard Kolb <[EMAIL PROTECTED]> writes:

> I'm not much of a guru but,
> 
> Best thing is to look at the kernel source and learn,
> The book Linux Device Drivers is also good, ( a bit old )
> 
> A suitable development environment is a simple test editor,
> e.g. vi / vim / emacs / Joe and the list goes on
> and if you like X , code crusader
> 
> When it comes to debuggers, (of sorts anyway )
> ksymoops decodes those lovely oops messages
> 
> Have Fun,
> Richard.
> 
> 
> Crymund wrote:
> 
> > Dear all,
> >
> > I am an absolute newbie to Linux. However, I would like to know how you
> > gurus develop Linux drivers. Any available tools? any suitable development
> > environment? Any debugger?
> >
> > I just would like to start learning Linux development. Please help. Thank
> > you in advance.
> 

There are no Gurus at writing drivers. There are those with the
scars, and those who don't have them. Yet.

A good way is to start by either a) modifying an existing driver,
or, write a 'pseudo kernel' main that calls your driver as a funtion.
Write the 'driver' with the hardware access stubbed. And don't forget
you will need to deal with errors...

When you are doing you 'driver' you may discover that you need to split
the code. Well, more likley, you WILL need to split it.

Don't worry too much about getting every detail done. Get what you do
RIGHT. Remember, every mistake is death. Include LOTS of checking and
gasp of death debug code. One screwed pointer and you can screw over
you disk on a bad day. Get part of it solid, than expand in sections,
bit, by bit. The less you re-boot, the faster and easier it is.

If you can, use an Alpha or other machine that has a sane console so you
can stir the wreckage, or put halts in the code so you can have a look
at things and continue. Also, a few NOPs in the right place are great
for sorting things.

ALWAYS test with several devices when it is running with one...


-- 
Paul Repacholi                               1 Crescent Rd.,
+61 (08) 9257-1001                           Kalamunda.
                                             West Australia 6076
Raw, Cooked or Well-done, it's all half baked.

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

From: jbs <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c++,gnu.misc.discuss
Subject: Re: Compiling C++ programs with GCC --> no GPL license implications
Date: Sat, 16 Dec 2000 03:02:44 -0800

Peter Seebach wrote:
> 
> In article <[EMAIL PROTECTED]>, jbs  <[EMAIL PROTECTED]> wrote:
> >Pete Becker wrote:
> >> There is a difference between "I know what this means" and "There could
> >> be problems here." The former is a legal judgment. The latter is not.
> 
> >The former is a useful statement.  The latter is not.
> 
> No, the latter is also useful.

It is not a useful statement because there could be problems *anywhere*.

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

From: "Gareth Stephens" <[EMAIL PROTECTED]>
Subject: Re: IPC in a module
Crossposted-To: uk.comp.os.linux,uklinux.help.misc
Date: Sat, 16 Dec 2000 11:57:11 +0000

Hi Paul,
        Thanks for the info, unfortunately it isn't quite what I'm after.
Perhaps if I explain a little better.  What I am trying to do is the
following.  There are two character special files one to write into and
the other to read from.  A program writes into one of them and a daemon
reads from the other end.  Basically what I want to do is queue the
messages until such time as something is ready to read them, hence the
reason I thought SYSV message queues looked ideal.

        Yes I do know that this is a somewhat convoluted way to do it (i.e. why
not write directly to a message queue and have the other process read
from that there by cutting out the device driver bit altogether) _but_ I
have to do it this way for an assignment.  All I really need to know is:
        a) Is it possible
        b) If so where should I start looking (I _don't_ expect code ready to slot
in ;) as everywhere I've looked so far just talks about the facilities
provided by the kernel for IPC sys calls.
        c) If it's not possible is there another ready made way, or should I
just use a queue/linked list?

Once again any help much appreciated and I apologise if these seem
ridiculous questions (let me know if they are ;).

Thanks,
        Gareth.

In article <[EMAIL PROTECTED]>, noway@[127.1.1.2] wrote:

> "Gareth Stephens" <[EMAIL PROTECTED]> writes:
> 
>>      Also from various posts ng's it seems that SYSV IPC may not be the
>>      best
>> way to do this but if not then what is?
> 
> What do you want to communicate with? If you want to do module<->user
> process communication, then netlink is probably the best bet.
> 
> http://snafu.freedom.org/linux2.2/docs/netlink-HOWTO.html
> 
> Paul

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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: IPC in a module
Date: Sat, 16 Dec 2000 12:54:30 GMT

In comp.os.linux.development.system Gareth Stephens 
<[EMAIL PROTECTED]> wrote:
>       Yes I do know that this is a somewhat convoluted way to do it (i.e. why
> not write directly to a message queue and have the other process read
> from that there by cutting out the device driver bit altogether) _but_ I
> have to do it this way for an assignment.  All I really need to know is:

Ah, well in that case we can't help you!

>       a) Is it possible

Yes, obviously. But not using "IPC message queues". What you are being
asked to do is implement a simple sort of message queue. So simple, in
fact, that only a few lines of code in the kernel are required.

>       b) If so where should I start looking (I _don't_ expect code ready to slot

You should think about it instead. You just want one character driver
that writes into the end of an internal queue (=circular buffer, probably)
in the kernel, and another that reads from it. SO you should look at
character drivers in rubini's book.

>       c) If it's not possible is there another ready made way, or should I
> just use a queue/linked list?

Obviously! I'd use a circular 4KB buffer and block when it's full (and
empty, on read).

Peter

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

From: "hebre" <[EMAIL PROTECTED]>
Subject: Sockets. Redirect and modify data.
Date: Sat, 16 Dec 2000 15:56:36 +0300

Hi!

Problem:
There is some application, which send  data to remote part via sockets (IP
addresses of remote parts is configurable. And It may be more than one
connection)
I want to encrypt this data, but I can't change this application, because
there is no sources. I want to write some module to modify socket data. But
I don't know how to do it.

Guru, help!

Best regards,
    Paul Tanaskov
    mailto:[EMAIL PROTECTED]



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

Date: Sat, 16 Dec 2000 13:53:27 +0100
From: Arnaud Westenberg <[EMAIL PROTECTED]>
Subject: Re: kernel modules debugger

Massimiliano Caovilla wrote:
> 
>     I'm trying to debug a big pseudo-driver I'm writing:
> what kind of debugger should I use?
> I don't think gdb can debug kernel modules...
> What's the official one?
> Is there any source-level debugger suitable for kernel modules?

>From Rubini's "Linux device drivers":

gdb can be used for the kernel proper and kdebug for modules. I haven't
tried either one so I can't comment on their usefulness in debugging
modules.

Personally I find printk in combination with a serial console very
helpful when debugging.

Hope this helps.

Greetings Arnaud

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

Date: Sat, 16 Dec 2000 13:56:26 +0100
From: Arnaud Westenberg <[EMAIL PROTECTED]>
Subject: Newsgroup faq?

Hi list,

Is there a FAQ list for this newsgroup and if so, where can I find it?
Maybe this is a faq too? :-)

Thanks

Greetings Arnaud

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

From: [EMAIL PROTECTED] (Andy Ford)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: DDD Debugger
Reply-To: [EMAIL PROTECTED]
Date: Sat, 16 Dec 2000 14:06:50 GMT

On Tue, 31 Oct 2000 23:33:36 +0100, Menni <[EMAIL PROTECTED]> wrote:
>Philip Armstrong wrote:
>> 
>> In article <[EMAIL PROTECTED]>, Menni  <[EMAIL PROTECTED]> wrote:
>> >When invoking the Data Display Debugger, I always get the error message
>> >"DDD: No Debugger" (GDB could not be started). Trying to follow the
>> >instructions of the help message does not lead to any change.
>> >On the bottom of the DDD-window a further message appears: "Running GDB
>> >(pid <anynumber>, tty /dev/pts/4)..Exit 1."
>> >What's going wrong there? How to start a debug session properly?
>> 
>> It's telling you that it can't find gdb, which is the text mode
>> debugger that ddd sits on top of. (Actually I think ddd can use one of
>> several debuggers)
>> 
>> Have you installed gdb?
>
>Yes! I can use gdb in stand-alone text mode!
>The same message as above comes with jdb for instance.
>
>> 
>> Phil
>> 
>> --
>> http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt

It's possible that the environment or shell that starts 
DDD doesn't have the same
path as you do when you are on 
the command line so DDD can't find the debugger
executable.

-- 
yours,
Andy


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


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