Linux-Development-Sys Digest #432, Volume #8     Sat, 20 Jan 01 09:13:12 EST

Contents:
  Portinf from IRIX to Linux ("Saji R")
  Re: Accessing Kernel Process Structs from a Module (Andi Kleen)
  Re: How to get the source of the file utilities? ("Blind")
  Cluster Idea ("rova")
  Re: Accessing Kernel Process Structs from a Module (Dilworth)
  Re: double mmap calls ([EMAIL PROTECTED])
  Re: Cluster Idea (Frank Sweetser)
  Re: double mmap calls (John Reiser)
  Re: double mmap calls (John Reiser)
  Re: Cluster Idea (Mike McDonald)
  Re: Kernel-Programming (Marcus)
  Re: Accessing Kernel Process Structs from a Module (Andi Kleen)
  Re: What causes these parse errors when compiling kernel module? ("Peter T. Breuer")
  Re: Two (easy?) 2.4 VFS questions. (David Wragg)
  Re: double mmap calls (Kasper Dupont)
  Re: measuring time (Kasper Dupont)
  Re: kernel headers, SMP and glibc (Andreas Jaeger)
  Why does my e2fs always fsck bad? ([EMAIL PROTECTED])
  Re: Cluster Idea (Frank Sweetser)

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

From: "Saji R" <[EMAIL PROTECTED]>
Subject: Portinf from IRIX to Linux
Date: Sat, 20 Jan 2001 10:40:30 +0900

Hi all,
    I am new to linux. Even i know a bit. can any one tell me what are the
things we should take care while we are porting a System side application to
Linux? It contains Open GL part also. Some URLs which points to Linux
porting also welcome. There are some byte swaping difference also there, i
think. like little endian and bigendian. Any help regarding this will be
very useful.
Thank you in advance,
Saji R
www.sajir.com



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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: Accessing Kernel Process Structs from a Module
Date: 20 Jan 2001 02:45:50 +0100

Bob Dilworth <[EMAIL PROTECTED]> writes:
> 
> xtime is one of the exported symbols available to modules and I can see
> it (the symbol) in /proc/ksyms.  So far so good.  What I'd like to do
> next is walk down the process list and perhaps display the name of a
> file that a process on the list has open.  I can see how to reach the
> d_name field in the dentry object from the process descriptor structure
> but I can't figure out how to find the head of the process list to start
> grabbing the process descriptors for the processes on the list.
> /proc/ksyms doesn't seem to have a symbol corresponding to the head of
> the process list - at least I can't seem to find such a symbol. Does
> this mean that the pointer to the head of the process list is
> unavailable from a kernel module?  So ... how does one obtain the head
> of the process list from a kernel module?

init_task_union.task contains init which is a member of the task ring 
(it's a ring,not a list). You can then walk it via ->next_task in 2.2 until 
you reach init_task again. The for_each_task() macro will also do that for
you.


-Andi

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

From: "Blind" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.questions,linux.dev.kernel
Subject: Re: How to get the source of the file utilities?
Date: Sat, 20 Jan 2001 03:17:13 GMT

This is the fileutils package right answer for cp, mv , ls, ln and so on,
but for shell commands like mkdir, cd ... he will need source
code for shell he use.

"Sid Boyce" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> http://freshmeat.net and search keyword "fileutils".
> Regards
> Sid.
>
> Alan Po 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]
>
> --
> Sid Boyce ... hamradio G3VBV ... Cessna/Warrior Pilot
> Linux only shop



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

From: "rova" <[EMAIL PROTECTED]>
Subject: Cluster Idea
Date: Sat, 13 Jan 2001 14:53:40 +0800

I want to implement a linux cluster with the following setup:

1.    A base implementation of 6 node
        (all Pentium 3 650mhz, 64 mb RAM, 10GB HD IDE)
 2.  To  be expanded incrementally with our old 486 workstations.

My idea is to configure all our workstations as a node of the cluster with
the purpose of standardising on SUN StarOffice for all our desktop users in
the our office.

My understanding is that a cluster is like a supercomputer so that
StarOffice will run on a 486 node using the resources of the whole cluster.

Will this work?

Thanks,

ROmeo V. Alvarez
Data and Network Management










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

Date: Fri, 19 Jan 2001 22:16:19 -0500
From: Dilworth <[EMAIL PROTECTED]>
Subject: Re: Accessing Kernel Process Structs from a Module



Andi Kleen wrote:

> init_task_union.task contains init which is a member of the task ring
> (it's a ring,not a list). You can then walk it via ->next_task in 2.2 until
> you reach init_task again. The for_each_task() macro will also do that for
> you.

Andi:

Are you saying that I can use the for_each_task() macro from the kernel module?

Bob D.


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

From: [EMAIL PROTECTED]
Subject: Re: double mmap calls
Date: Sat, 20 Jan 2001 04:47:28 -0000

On Thu, 18 Jan 2001 23:32:17 -0600 Arthur H. Gold <[EMAIL PROTECTED]> wrote:

| [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()?

No.

I'm trying to make 2 virtual addresses point to the same real address
and do so on adjacent pages.

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

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

From: [EMAIL PROTECTED] (Frank Sweetser)
Subject: Re: Cluster Idea
Date: 20 Jan 2001 05:54:18 GMT

rova <[EMAIL PROTECTED]> wrote:
>I want to implement a linux cluster with the following setup:
>
>1.    A base implementation of 6 node
>        (all Pentium 3 650mhz, 64 mb RAM, 10GB HD IDE)
> 2.  To  be expanded incrementally with our old 486 workstations.
>
>My idea is to configure all our workstations as a node of the cluster with
>the purpose of standardising on SUN StarOffice for all our desktop users in
>the our office.
>
>My understanding is that a cluster is like a supercomputer so that
>StarOffice will run on a 486 node using the resources of the whole cluster.

Nope, I'm afraid not.  Sounds like you need to do some research on
distributed processing.  www.scyld.comf might be a good place to start.

Using the 486s essentially as X terminals, having people log into and
run apps such as star office off of the P3s, however, would probably
be much simpler to set up, and work a whole lot better.

-- 
Frank Sweetser rasmusin at wpi.edu, fs at suave.net  | $ x 14
Full-time WPI Network Tech, Part time Linux/Perl guy |
   I have a switch in my apartment... it doesn't do anything.... Every
   once in a while, I turn it on and off.... One day I got a call... it
   was from a woman in France.... She said "Cut it out"....
                                                        -- Stephen Wright

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

From: John Reiser <[EMAIL PROTECTED]>
Subject: Re: double mmap calls
Date: Fri, 19 Jan 2001 22:40:00 -0800

> |> 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()?
> 
> No.
> 
> I'm trying to make 2 virtual addresses point to the same real address
> and do so on adjacent pages.


#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/user.h>
#include <unistd.h>

main()
{
        /* needs error checking, of course! */
        char const filename[] = "/tmp/DoubleMapXXXXXX";
        char *const fn = (char *)malloc(1+ sizeof(filename));
        char *const junk = strcpy(fn, filename);
        int const fd = mkstemp(fn);
        int const result = lseek(fd, PAGE_SIZE, SEEK_CUR);
        char *const addr1 = mmap(0, PAGE_SIZE,      
                PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
        char *const addr2 = mmap(addr1 + PAGE_SIZE, PAGE_SIZE,
                PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
}

-- 
John Reiser, [EMAIL PROTECTED]

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

From: John Reiser <[EMAIL PROTECTED]>
Subject: Re: double mmap calls
Date: Fri, 19 Jan 2001 22:43:24 -0800

Also use MAP_FIXED in the second call of mmap,
although the posted version seems to work.

-- 
John Reiser, [EMAIL PROTECTED]

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

Reply-To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED] (Mike McDonald)
Subject: Re: Cluster Idea
Date: Sat, 20 Jan 2001 07:31:56 GMT

In article <[EMAIL PROTECTED]>,
        [EMAIL PROTECTED] (Frank Sweetser) writes:
> rova <[EMAIL PROTECTED]> wrote:
>>I want to implement a linux cluster with the following setup:
>>
>>1.    A base implementation of 6 node
>>        (all Pentium 3 650mhz, 64 mb RAM, 10GB HD IDE)
>> 2.  To  be expanded incrementally with our old 486 workstations.
>>
>>My idea is to configure all our workstations as a node of the cluster with
>>the purpose of standardising on SUN StarOffice for all our desktop users in
>>the our office.
>>
>>My understanding is that a cluster is like a supercomputer so that
>>StarOffice will run on a 486 node using the resources of the whole cluster.
> 
> Nope, I'm afraid not.  Sounds like you need to do some research on
> distributed processing.  www.scyld.comf might be a good place to start.
> 
> Using the 486s essentially as X terminals, having people log into and
> run apps such as star office off of the P3s, however, would probably
> be much simpler to set up, and work a whole lot better.
> 

  But in some sense, that's what a beowulf cluster givers you. A nice
centralized collection of fast processors all interconnected with equal access
to all of the filesystems. So you can run staroffice or what ever app on any
node and have it displayed back to a 486 desktop and it always behaves the
same. Granted, a lot of the specialized distributed software of a beowulf
wouldn't be used. But some of it like high speed interconnect to NFS
partitions would be useful. 

  We should make clear to Rova though that even though a cluster has an
agregae performance of a "supercomputer", it won't run staroffice any faster
than the individual nodes would. It would give you some redundancy though.

  Mike McDonald
  [EMAIL PROTECTED]

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

From: Marcus <[EMAIL PROTECTED]>
Crossposted-To: linux.dev.c-programming,linux.dev.kernel
Subject: Re: Kernel-Programming
Date: Sat, 20 Jan 2001 09:10:29 +0100

Aschenbrenner Klaus wrote:
> 
> Hello!
> 
> I want to learn the Linux-Kernel-Programming. Which books should I read?
> Which books covers the Kernel-Programming in detail?
> I have good experience in C and C++.
> 
> Best regards
> 
> Aschenbrenner Klaus

Linux device drivers is a good book.

-- 

                        /*
                           talos / AINT
                           www:   http://www.algonet.se/~talos
                           email: [EMAIL PROTECTED]
                        */

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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: Accessing Kernel Process Structs from a Module
Date: 20 Jan 2001 10:10:41 +0100

Dilworth <[EMAIL PROTECTED]> writes:

> Andi Kleen wrote:
> 
> > init_task_union.task contains init which is a member of the task ring
> > (it's a ring,not a list). You can then walk it via ->next_task in 2.2 until
> > you reach init_task again. The for_each_task() macro will also do that for
> > you.
> 
> Andi:
> 
> Are you saying that I can use the for_each_task() macro from the kernel module?

Yes.

-Andi

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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: What causes these parse errors when compiling kernel module?
Date: Sat, 20 Jan 2001 10:27:57 +0100

Brian Wagener <[EMAIL PROTECTED]> wrote:
> I fixed it by adding -I/usr/include, why isn't /usr/include a default place

It IS a default place to look, in a default installation. Run with -v
to see how your machines compiler is set up.

> to look?  How do I make it one?

Peter

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

From: David Wragg <[EMAIL PROTECTED]>
Subject: Re: Two (easy?) 2.4 VFS questions.
Date: 20 Jan 2001 00:39:04 +0000

[EMAIL PROTECTED] (Jay Miller) writes:
> How strange that these 'labeled initializer elements' would be new to
> the linux kernel (they didn't exist in 2.2.x) even while they have
> been obsolete since GCC 2.5! (I did as you suggested and looked them
> up.  I found the reference here:
> 
> http://www.gnu.org/software/gcc/onlinedocs/gcc_toc.html#TOC91
> 
> ).  Why would the kernel developers do this?  Why not in fact use the
> C99 standard?  It would still be just as clean - and current..

Good question.  Search an archive of the linux-kernel archive mailing
list -- the use of labelled initializers was discussed at length on
about a year ago, just before the then-current 2.3.x kernel was
converted to use them.

I'm pretty sure that the "obsolete since GCC 2.5" clauses in the
document you refer to are fairly recent additions.  In the
linux-kernel discussions, it took a while to establish that every
gcc-2.7.x subversion supported the C99 syntax, let alone gcc-2.5.

The recommended minimum version of gcc was upped to 2.91.66
(egcs-1.1.2) for 2.4, so perhaps the 2.5 kick off will be a good time
to convert the kernel to use the C99 labelled initializers syntax.


David Wragg

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: double mmap calls
Date: Sat, 20 Jan 2001 13:38:51 +0100

John Reiser 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()?
> >
> > No.
> >
> > I'm trying to make 2 virtual addresses point to the same real address
> > and do so on adjacent pages.
> 
> #include <stdlib.h>
> #include <string.h>
> #include <sys/mman.h>
> #include <sys/user.h>
> #include <unistd.h>
> 
> main()
> {
>         /* needs error checking, of course! */
>         char const filename[] = "/tmp/DoubleMapXXXXXX";
>         char *const fn = (char *)malloc(1+ sizeof(filename));
>         char *const junk = strcpy(fn, filename);
>         int const fd = mkstemp(fn);
>         int const result = lseek(fd, PAGE_SIZE, SEEK_CUR);
>         char *const addr1 = mmap(0, PAGE_SIZE,
>                 PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
>         char *const addr2 = mmap(addr1 + PAGE_SIZE, PAGE_SIZE,
>                 PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
> }
> 
> --
> John Reiser, [EMAIL PROTECTED]

The file may be removed with unlink as soon as it has been
opened, and it may be closed as soon as it has been maped.
If you don't want to use a file at all you can use a shared
memory segment. See man pages for shmget, shmat and shmctl.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: measuring time
Date: Sat, 20 Jan 2001 13:42:55 +0100

Mark Hahn wrote:
> 
> > 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.

You don't even have to do that, the kernel can do it for
you. Gettimeofday uses the TSC to give microsecond precision.
On my computer I have meassured the overhead of gettimeofday
to be 320 clock cycles. The overhead of reading the TSC is
on the other hand only 9 clock cycles.

-- 
Kasper Dupont

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

From: Andreas Jaeger <[EMAIL PROTECTED]>
Subject: Re: kernel headers, SMP and glibc
Date: 20 Jan 2001 14:21:32 +0100

[EMAIL PROTECTED] writes:

> I'm trying to build the 2.4.0 kernel and glibc along with various other
> packages that will make up my own Linux "distribution".  I know that
> glibc uses some of the kernel headers during when being built.  What
> I'm trying to find out is, what changes in the kernel configuration
> will cause me to have to rebuild glibc?
Nothing.  Read the glibc FAQ (part of the glibc sources) and use the
kernel headers from 2.4.0 and everything is fine.

> The most important change to me right now is SMP vs. non-SMP kernels.
> Is glibc affected by this change to the kernel configuration, or any
> other change for that matter?
No.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs [EMAIL PROTECTED]
   private [EMAIL PROTECTED]
    http://www.suse.de/~aj

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

From: [EMAIL PROTECTED]
Subject: Why does my e2fs always fsck bad?
Date: Sat, 20 Jan 2001 13:46:49 GMT

Hi, I have a server (BTW: RH 62 w/ latest patches) which is up quite 
constantly, but I do manually reboot it for various reasons every 2-3-4 
weeks or so.  When I reboot it, I do a 

        shutdown -t10 -rF now

In order to force a fsck upon reboot.  Then I check the /var/log/messages,
and I almost always see error messages of the type:

fsck: /dev/hda1: Setting filetype for entry '31665' 
                                        in /tmp/.ICE-unix (16216) to 6.

Now, I see perhaps 10 of these messages for files various 'entries' in
/tmp/.ICE-unix and also a dozen or so for various filetypes 'orb***' in
/tmp/orbit-user.  Also some of my dhcp state files get the same treatment.

Now I know that the fs is getting unmounted, etc, because upon reboot the
dirty flag is not set (if I do not specify the -F to shutdown, there is no
fsck).

Does anybody know what gives?

Thanks,
John T.

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

From: [EMAIL PROTECTED] (Frank Sweetser)
Subject: Re: Cluster Idea
Date: 20 Jan 2001 13:27:55 GMT

Mike McDonald <[EMAIL PROTECTED]> wrote:
>  But in some sense, that's what a beowulf cluster givers you. A nice
>centralized collection of fast processors all interconnected with equal access
>to all of the filesystems. So you can run staroffice or what ever app on any

That's only half of it.  The critical difference is that you get multiple
machines all working on a *single* task - all of them searching for primes
or computing a simulation.  The Seti project is a lot closer to a bewoulf
project than a simple client server setup.

>node and have it displayed back to a 486 desktop and it always behaves the
>same. Granted, a lot of the specialized distributed software of a beowulf
>wouldn't be used. But some of it like high speed interconnect to NFS
>partitions would be useful. 
>
>  We should make clear to Rova though that even though a cluster has an
>agregae performance of a "supercomputer", it won't run staroffice any faster
>than the individual nodes would. It would give you some redundancy though.

Indeed.  Round robin DNS would probably work well here.

-- 
Frank Sweetser rasmusin at wpi.edu, fs at suave.net  | $ x 14
Full-time WPI Network Tech, Part time Linux/Perl guy |
   Why waste time learning, when ignorance is instantaneous?
                  -- Calvin

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


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