Linux-Development-Sys Digest #437, Volume #8     Mon, 22 Jan 01 18:13:11 EST

Contents:
  Re: 2.4.0 on Athlon 1G / VIA KT 133 (bill davidsen)
  Re: How to write an application similar to "ps -aux" ("Alan Po")
  booting CD, ramfs -> / in 2.4, some issues ([EMAIL PROTECTED])
  Re: How to write an application similar to "ps -aux" (Nate Eldredge)
  Re: How to write an application similar to "ps -aux" (Philip Armstrong)
  Re: measuring time (Morten =?ISO-8859-1?Q?B=F8hmer?=)
  Re: double mmap calls (Linus Torvalds)
  Re: double mmap calls (Dragan Cvetkovic)
  no support for routing sockets ??? ("Oliver Kowalke")
  Re: double mmap calls (Linus Torvalds)
  Re: double mmap calls (Dragan Cvetkovic)
  Re: double mmap calls (Pete Zaitcev)
  Re: How to write an application similar to "ps -aux" (Juha Laiho)
  Re: Cluster Idea ([EMAIL PROTECTED])

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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: 2.4.0 on Athlon 1G / VIA KT 133
Date: 22 Jan 2001 17:10:39 GMT

In article <93s0q9$21k$[EMAIL PROTECTED]>,
Philip Armstrong <[EMAIL PROTECTED]> wrote:

| I have a suspicion that you're not actually activating UDMA 66. Given
| that the documentation for how to turn it on is nonexistant, this is
| hardly your fault however!
| 
| nb. The following is my supposition based on experience elsewhere +
| reading the 2.4.0 source. Don't believe a word of it :)
| 
| 1) I don't think the idebus thing is relevant at all. Ignore it.
| 2) Try hdparm -X67 , or 68 or 69.
| 
| The latter is because -X66 sets UDMA mode 2 transfers. AFAIK, UDMA-66
| and UDMA-100 are somewhere in modes 2-5. Quoting the via ide driver
| source:
| 
|  * chipsets. Supports PIO 0-5, MWDMA 0-2, SWDMA 0-2 and
|  * UDMA 0-5 (includes UDMA33, 66 and 100) modes. UDMA100 isn't
|  * possible
|  * on any of the supported chipsets yet.
|  *
|  * UDMA66 and higher modes are autodetected only in case the BIOS has
|  * enabled them.
|  * To force UDMA66, use 'ide0=ata66' or 'ide1=ata66' on the kernel
|  * command line.
|  */
| 
| so UDMA modes 0->5 include UDMA 33,66 and 100. hdparm -X67 sets UDMA
| mode 3, -X68 mode 4 and so on.

  At this point I will drop the dmesg output relevant to IDE, from a
BP6, 2x500MHz Celerons, 2xATA/33, 2xATA/66. The ATA/66 is enabled
without any command line magic, good thing since until your post I
didn't know how and would have had to go play in the driver source
myself.

Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with
idebus=xx
PIIX4: IDE controller on PCI bus 00 dev 39
PIIX4: chipset revision 1
PIIX4: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:pio
    ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:pio
HPT366: onboard version of chipset, pin1=1 pin2=2
HPT366: IDE controller on PCI bus 00 dev 98
PCI: Enabling device 00:13.0 (0005 -> 0007)
HPT366: chipset revision 1
HPT366: not 100% native mode: will probe irqs later
    ide2: BM-DMA at 0xe000-0xe007, BIOS settings: hde:DMA, hdf:pio
HPT366: IDE controller on PCI bus 00 dev 99
HPT366: chipset revision 1
HPT366: not 100% native mode: will probe irqs later
    ide3: BM-DMA at 0xec00-0xec07, BIOS settings: hdg:pio, hdh:pio
hda: WDC AC26400R, ATA DISK drive
hdc: 32X MAX ATAPI CD-ROM, ATAPI CDROM drive
hdd: IOMEGA ZIP 100 ATAPI, ATAPI FLOPPY drive
hde: WDC WD205BA, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
ide2 at 0xd800-0xd807,0xdc02 on irq 11
hda: 12594960 sectors (6449 MB) w/512KiB Cache, CHS=784/255/63, UDMA(33)
hde: 40088160 sectors (20525 MB) w/2048KiB Cache, CHS=39770/16/63,
UDMA(66)
hdc: ATAPI 32X CD-ROM drive, 120kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.12
hdd: 98304kB, 96/64/32 CHS, 4096 kBps, 512 sector size, 2941 rpm

| Reading the source suggests that whilst windows goes ahead and turns
| on UDMA 66 itself, linux may leave the bios to do it unless
| specifically asked otherwise on the kernel command line. See what the
| bios says on the issue too...

  Unless I'm missing something, I don't see any indication that the BIOS
did this. The earlier 2.4 pre-this and test-that turned on the ATA/66 as
well.

  I also have some of these on a Promise expansion card, and I believe
they are recognized as well, although the BIOS may be helping. I had a
box of these 20GB drives, they are only 5400 rpm, but at 5/$400 they are
cost effective!

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
"I am lost. I am out looking for myself. If I should come back before I
return, please ask me to wait."  -seen in a doctor's office

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

From: "Alan Po" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: How to write an application similar to "ps -aux"
Date: Tue, 23 Jan 2001 01:19:19 +0800

Dear all

According to the hints from you, I have written an application which is
similar to "ps". However, two value cannot get from the /proc. One is the
time consuming of a process. Other one is some process cannot get from the
symbolic link of "exe", i.e., [nfsd]. I don't know why and how?

I am now using some useful system functions: glob(), readlink()

Thanks a lot

Alan Po

"Alan Po" <[EMAIL PROTECTED]> wrote in message
news:94h0rt$[EMAIL PROTECTED]...
> Dear all
>
> Alan Po again. This time is the question of a common command "ps". I need
to
> write an application to show all the process id (pid) of the Linux. The
> result is same as "ps -aux". However, I have try to find the source code
of
> "ps" but fail. Please give some advices or suggestion or where can find
the
> source code of "ps".
>
> Really thanks a lot.
>
> Alan Po
>
>



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

From: [EMAIL PROTECTED]
Subject: booting CD, ramfs -> / in 2.4, some issues
Date: Mon, 22 Jan 2001 17:57:05 -0000

Since ramfs does work as / in 2.4, thanks to pivot_root(), I can
now more easily deploy my new CD booting strategy.  What I am
doing is getting around the limitations of having to specify a
size for ramdisk, which ramfs does for me, and being able to
load as little (without waste) or as much (without hitting an
artificial ceiling) filesystem into RAM as designed for whatever
the need happens to be.  There's a limit to just what you can
get into an initial ramdisk image (on Intel architecture) due
to the 2.88 meg limit of the floppy emulation booting.  I've
found about 6 meg seems to be about the limit.  Adding more
then meant using more ramdisk devices and/or specifying larger
sizes for them.

With 64 meg of RAM now considered to be a small machine and
many having 256 meg or more of RAM, being able to make use of
this in special situations (where you know it will be there)
is now easily possible.

What I wrote is a program that runs as the init process launched
by the kernel.  It is statically linked with no library, so the
only things present on the initial ramdisk are /sbin/init which
has this program, and /dev/console which the kernel opens first.

The first stage of this program does:
1.  make a directory /ramfs and mount ramfs there
2.  make a symlink which later will be /usr pointing to the
    subdirectory in the CDROM for /usr for this architecture
3.  make some directories in /ramfs including dev and mnt
4.  run through a list of major,minor for CDROMs:
    4a. mknod special files for that CDROM in both /ramfs/dev and
        in /dev so the mount looks right and a device file is
        present when the system comes up
    4b. try to mount it as /ramfs/cdrom
    4c. if mounted, try to exec the 2nd stage program
    4d. unlink the special files for the next try

The second stage program then does:
5.  setup library links to point to libraries on the CDROM
6.  run tar to read a tarball from CDROM and populate the ramfs
7.  pivot_root("/ramfs","/ramfs/mnt") so the ramfs is now /
8.  close and reopen /dev/console
9.  unmount /mnt (formerly / and transiently /ramfs/mnt)
10. open and ioctl(,BLKFLSBUF) the ramdisk to release it
11. run ldconfig just in case
12. exec the real init program using the same search order
    as the kernel used

Now I can have as little or as much populate the ramfs as I want
and its all in a single tarball on the CDROM, not in the initrd.
It's working and running now.

I'm still having these problems:

1.  The initial ramdisk doesn't actually get released.  I am making
    it quite small (128k at the moment) so it doesn't have a great
    deal of impact, but this bothers me that BLKFLSBUF isn't working.
    It doesn't give an error, but the buffers are still there.

2.  The "df" command shows nothing but "cat /proc/mounts" works.
    Doing "df" on a specific mounted filesystem does work.  Here's
    what I get (I've pulled the actual unmounting of /mnt for now):

This may be a limitation of the simplistic design of ramfs.  Or maybe
it just needs an update to the "df" command.  But it would be nice to
be able to see exactly how much space is used in a ramfs.  It would
also be nice to be sure that space released (e.g. unlink() a file or
rmdir() a directory in ramfs) actually gets rid of ram usage.


=============================================================================
root@CDrescue:/root 1> df
Filesystem           1k-blocks      Used Available Use% Mounted on
root@CDrescue:/root 2> cat /proc/mounts
/dev/root /mnt ext2 rw 0 0
ramfs / ramfs rw 0 0
/dev/bootcd /cdrom iso9660 ro 0 0
none /proc proc rw 0 0
none /dev/pts devpts rw 0 0
root@CDrescue:/root 3> df /cdrom
Filesystem           1k-blocks      Used Available Use% Mounted on
-                       415986    415986         0 100% /cdrom
root@CDrescue:/root 4> df /mnt
Filesystem           1k-blocks      Used Available Use% Mounted on
-                          119        12       107  10% /mnt
root@CDrescue:/root 5> df /
Filesystem           1k-blocks      Used Available Use% Mounted on
ramfs                        0         0         0   -  /
root@CDrescue:/root 6> cd /usr
root@CDrescue:/cdrom/usr-i386 7> df .
Filesystem           1k-blocks      Used Available Use% Mounted on
-                       415986    415986         0 100% /cdrom
root@CDrescue:/cdrom/usr-i386 8>
=============================================================================

Any thoughts on this?


You can download my package (still alpha status) which has the two
stage cdinit program, my CD building script, and a demo file tree
to build a rescue CD ISO, at:

http://phil.ipal.org/freeware/bick/bick-0.4.0-alpha.tar.bz2
[11166858 bytes uncompresses to 31579136 bytes of .tar]

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

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

From: Nate Eldredge <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: How to write an application similar to "ps -aux"
Date: 22 Jan 2001 10:03:03 -0800

"Alan Po" <[EMAIL PROTECTED]> writes:

> Dear all
> 
> According to the hints from you, I have written an application which is
> similar to "ps". However, two value cannot get from the /proc. One is the
> time consuming of a process. 

This is available from /proc/PID/stat.  Read the man page for `proc'
to find the details.

> Other one is some process cannot get from the
> symbolic link of "exe", i.e., [nfsd]. I don't know why and how?

I don't understand what you mean by this.  Can you give an example of
what happens?

-- 

Nate Eldredge
[EMAIL PROTECTED]

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

From: [EMAIL PROTECTED] (Philip Armstrong)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: How to write an application similar to "ps -aux"
Date: 22 Jan 2001 19:18:55 -0000

In article <94hq7e$[EMAIL PROTECTED]>,
Alan Po <[EMAIL PROTECTED]> wrote:
>According to the hints from you, I have written an application which is
>similar to "ps". However, two value cannot get from the /proc. One is the
>time consuming of a process. Other one is some process cannot get from the
>symbolic link of "exe", i.e., [nfsd]. I don't know why and how?

Things in square brackets like [bdflush] and the like are kernel
threads IIRC, and therefore don't have any associated standalone
executable. (The code that they are running is contained within the
kernel)

cheers,

Phil


-- 
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt


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

From: Morten =?ISO-8859-1?Q?B=F8hmer?= <[EMAIL PROTECTED]>
Subject: Re: measuring time
Crossposted-To: comp.os.linux.development.apps
Reply-To: [EMAIL PROTECTED]
Date: Mon, 22 Jan 2001 22:01:19 +0100

frederik wrote:

> Hello,
> 
> Does anyone know how it is possible to measure the execution time of a
> certain part of a program (function, procedure, ....). I tried
> gettimeofday() but this seems to have a rather big overhead and this also
> has a big resolution (1ms).
> Are there any ways to perform a more accurate measurement with little
> overhead?
> I am using SuSe Linux v6.4.
> 
> Thanks,
> 
> Frederik De Backer
> student University of Ghent,
> Belgium.
> 
> 
 There is library called FunctionCheck Version 1.2 over at freshmeat.net, 
it should what you need (without the hassle)

-- 
Best Regards
Morten B�hmer
[EMAIL PROTECTED] - http://home.online.no/~mboehmer

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

From: [EMAIL PROTECTED] (Linus Torvalds)
Subject: Re: double mmap calls
Date: 22 Jan 2001 12:09:55 -0800

In article <[EMAIL PROTECTED]>,
 <[EMAIL PROTECTED]> wrote:
>|
>| Simplicity is a virtue too.
>
>I'd agree.  But I was wondering why not make it even simpler like:
>
>    fd = open("/dev/zero",O_RDWR,0);

/dev/zero won't do what you want it to do - you want to map the _same_
physical page twice, right?

/dev/zero will give you different physical pages: they'll be shared
after a fork(), but they won't be shared across multiple mmap's. Think
of each "mmap()" as opening a separate file, that is "shared" only in
the sense that fork() won't do the copy-on-write thing.

Also, if you actually want just /dev/zero, you might as well forget
about open() altogether, and do

        mmap( ,,, MAP_SHARED | MAP_ANONYMOUS, -1, 0)

because you don't need a file descriptor to get an anonymous mapping.
But I bet you want the tmp-file backing store - it acts as an anchor to
make your mmap's truly shared.

(Alternatively, you can just use SysV shared memory, of course, and use
shmat to map it in multiple places.)

                Linus


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

Subject: Re: double mmap calls
From: Dragan Cvetkovic <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: 22 Jan 2001 15:38:45 -0500

[EMAIL PROTECTED] (Linus Torvalds) writes:
> Also, if you actually want just /dev/zero, you might as well forget
> about open() altogether, and do
> 
>       mmap( ,,, MAP_SHARED | MAP_ANONYMOUS, -1, 0)
> 
> because you don't need a file descriptor to get an anonymous mapping.

Just a word of warning that MAP_ANONYMOUS is not universaly available
(which might be a non-issue if you are just developing for Linux and/or
BSD),. i.e. SVR4 system lack this feature.

        Bye, Dragan

-- 
Dragan Cvetkovic, 

To be or not to be is true. G. Boole

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

From: "Oliver Kowalke" <[EMAIL PROTECTED]>
Subject: no support for routing sockets ???
Date: Mon, 22 Jan 2001 21:40:50 +0100

Hi,

curently I try out the examples from R. Stevens "Unix Network Programmin
Vol.1". As I figured out following is missing (kernel 2.4.0):

 - header <net/if_dl.h> is not found on my system (defines struct
sockaddr_dl)
 - <net/route.h> should be define:
        - RTM_xxx    flags for message exchange across routing sockets
        - structures rt_msghdr, if_msghdr, ifa_msghdr
        - RTA_xxx    constants used for socket address structures in routing
sockets
        - RTAX_xxx   constants used for socket address structures in routing
sockets

Doesn't Linux support routing sockets?
How are rotuing informations handled on Linux?
Do I have to use the sysctl function?

Thanks!

wit regards,
Oliver



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

From: [EMAIL PROTECTED] (Linus Torvalds)
Subject: Re: double mmap calls
Date: 22 Jan 2001 13:59:36 -0800

In article <[EMAIL PROTECTED]>,
Dragan Cvetkovic  <[EMAIL PROTECTED]> wrote:
>
>Just a word of warning that MAP_ANONYMOUS is not universaly available
>(which might be a non-issue if you are just developing for Linux and/or
>BSD),. i.e. SVR4 system lack this feature.

In many cases you can do

        #ifndef MAP_ANONYMOUS
        #define MAP_ANOMYMOUS MAP_ANON
        #endif

which gets you working on a number of systems.

Still not everything, I agree.

                Linus

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

Subject: Re: double mmap calls
From: Dragan Cvetkovic <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: 22 Jan 2001 17:08:21 -0500

[EMAIL PROTECTED] (Linus Torvalds) writes:
> >
> >Just a word of warning that MAP_ANONYMOUS is not universaly available
> >(which might be a non-issue if you are just developing for Linux and/or
> >BSD),. i.e. SVR4 system lack this feature.
> 
> In many cases you can do
> 
>       #ifndef MAP_ANONYMOUS
>       #define MAP_ANOMYMOUS MAP_ANON
>       #endif
> 
> which gets you working on a number of systems.
        Notably exception being Solaris. I wish they implement this
feature, so that I don't have to ifdef my code any more :-(
        
        Dragan

-- 
Dragan Cvetkovic, 

To be or not to be is true. G. Boole

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

From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: double mmap calls
Date: Mon, 22 Jan 2001 22:40:43 GMT

> > >Just a word of warning that MAP_ANONYMOUS is not universaly available
> > >(which might be a non-issue if you are just developing for Linux and/or
> > >BSD),. i.e. SVR4 system lack this feature.
> > 
> > In many cases you can do
> > 
> >     #ifndef MAP_ANONYMOUS
> >     #define MAP_ANOMYMOUS MAP_ANON
> >     #endif
> > 
> > which gets you working on a number of systems.

>         Notably exception being Solaris. I wish they implement this
> feature, so that I don't have to ifdef my code any more :-(
>         
>         Dragan

How long ago have you tried? Solaris has anonymous mmap for
quite some time. Solaris 8 adds a define just like the above
specifically for compatibility with Linux.

-- Pete

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

From: Juha Laiho <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: How to write an application similar to "ps -aux"
Date: 22 Jan 2001 21:51:01 +0200

"Alan Po" <[EMAIL PROTECTED]> said:
>According to the hints from you, I have written an application which is
>similar to "ps". However, two value cannot get from the /proc. One is the
>time consuming of a process. Other one is some process cannot get from the
>symbolic link of "exe", i.e., [nfsd]. I don't know why and how?

I'd think that's because in current kernels nfsd is not a normal process,
but some kind of independent kernel thread (which is just somehow started
from a user process). Sorry, I don't have more accurate details on this.
-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a- C++ UH++++$ UL++++ P+@ L+++ E(-) W+$@ N++ !K w !O
         !M V PS(+) PE Y+ PGP(+) t- 5? !X R tv--- b+ DI? D G e+ h--- r+++ y+
"...cancel my subscription to the resurrection!" (Jim Morrison)

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

From: [EMAIL PROTECTED]
Subject: Re: Cluster Idea
Date: Tue, 23 Jan 2001 11:56:00 +1300

Frank Sweetser wrote:

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

You could try GNU Queue.  Once configured, users would run queue ... soffice,
or
a wrapper script with this in.  Queue would then run soffice on one of the P3s.

MOSIX would be ideal for you, unfortuanately MOSIX will not migrate staroffice
:-(.

I would also recommend more ram in your P3s.

Cheers,
Dave.


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


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