Linux-Development-Sys Digest #127, Volume #8      Wed, 6 Sep 00 13:13:16 EDT

Contents:
  Re: CPU usage (Kasper Dupont)
  Mounting filesystem on char device (liran)
  cardmgr can't execute insmod or network start (Jerome Corre)
  Re: Reading books or learning sample codes: Which is better? (Hans)
  Re: Threads on Linux (Kaz Kylheku)
  PPP/BRIDGE(?)/ROUTING ? (David Ronis)
  New OS Project ("John Smith")
  Re: Q: SMP question ("Omkar Sathe")
  New OS Project ("Gatien Gillon")
  Re: Qt or gtk+ is better in programming GUI program that can run on both KDE and 
GNOME? ([EMAIL PROTECTED])
  Re: Mounting filesystem on char device ("[EMAIL PROTECTED]")
  Re: New OS Project ("[EMAIL PROTECTED]")
  Curious: compiling test8 series: "warning... token" (Robert Lynch)
  Re: cannot fork on linux mail server (Don Carroll)
  Pascal indenting ?. How with Xemacs ? ("Delia Barra")

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: CPU usage
Date: Wed, 06 Sep 2000 12:20:08 +0200

Pieter Thysebaert wrote:
> 
> Hi all...
> 
> I have some questions concerning the "CPU-usage" of processes as indicated
> (in %) by e.g top ...
> First of all, what does that really mean and how is it calculated ?
> Second : is it possible to write a program that will "use" the CPU for a
> specified percentage...
> Say a program that, when given a parameter (like 10%) really shows up as
> using 10% cpu load in top ?
> (it just needs to do anything th at will make it use the CPU (nothing
> useful))
> 
> What would be a descent approach to write such a (small) program ?
> 
> Pieter

First of all notice that the values are approximations,
they can be far away from reallity. I have seen a
situation where a program used 10% but top showed 0.1%.

The simplest way to calculate the value is that the
kernel at each timer interrupt increases the usage of
the current process before scheduling, and use some
exponential fading average. I don't know the exact
algorithm used, it could be more sofisticated.

The kernel computes some statistics which top extracts
from the /proc filesystem. A program can read
/proc/self/stat and from the information there compute
its own CPU usage.

A program could look something like this:

int main()
{
        int busy;
        busy=1;
        while (1) {
                int i;
                for (i=0;i<busy;++i);
                if (compute_cpu_usage()>10) --busy else ++busy;
                usleep(1000);
        }
}

write the compute_cpu_usage() and compile the program without
optimization. (The for loop would probably be optimized to
nothing if optimization was enabled.)

-- 
Kasper Dupont

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

From: liran <[EMAIL PROTECTED]>
Subject: Mounting filesystem on char device
Date: Wed, 06 Sep 2000 03:21:48 -0700

Hi,
I wonder is it possible to implement a new filesystem that
works over a char device.
If it can be done how can I bypass the system demand for a
block device.

Thanks Liran.



* Sent from AltaVista http://www.altavista.com Where you can also find related Web 
Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful

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

From: Jerome Corre <[EMAIL PROTECTED]>
Subject: cardmgr can't execute insmod or network start
Date: Wed, 06 Sep 2000 12:55:18 GMT

hi,

I am trying to make a small version of linux (for fun and to learn more
about linux) on a small partition of my harddrive i have an root image
which is loaded into a ramdisk. then init is started.

somewhere in the init script i am trying to initialise my wireless
network card (and the ISA to PCMCIA adapter). firstly the three follwing
module are loaded:

pcmcia_core.o, i82365.o and ds.o using insmod

then when i try cardmgr I get high,low bip patern, with the following
output:
cardmgr[20]: starting, version id 3.1.13
cardmgr[20]: watching 2 socket
cs: IO port probe .....
cs: IO port probe .....
cs: IO port probe .....
cardmgr[20]: initializing socket0
cs: memory probe....:clean
cardmgr[20]:socket0:Luccent Technologie WaveLAN/IEEE
cardmgr[20]:executing:'insmod
/lib/modules/2.2.12-20/pcmcia/wavelan2_cs.o port_type=3'
cardmgr[20]:insmod exited with status 127
cardmgr[20]:excuting 'modprobe wavelan2_cs.o port_type=3'
cardmgr[20]:modpeobe exiting with status 127
cardmgr[20]:get dev info on socket0 failed: Resource temporarily
unavailable

now if i try to load the wavelan2_cs module using insmod it works. If i
do it before running cardmgr i get (high,low bip) and a different
output:

cardmgr[20]: starting, version id 3.1.13
cardmgr[20]: watching 2 socket
cs: IO port probe .....
cs: IO port probe .....
cs: IO port probe .....
cardmgr[20]: initializing socket0
cs: memory probe....:clean
cardmgr[20]:socket0:Luccent Technologie WaveLAN/IEEE
eth0: WaveLan/IEEE, io_addr 0x100, irq 3, mac_address ....
cardmgr[20]:executing './network start eth0'
cardmgr[20]:start cmd exited with status 127


at that stage (since cardmgr successfully updated the file
var/state/pcmcis/stab) i can manually run
/etc/pcmcia/network start eth0
which seem to work since i can see the device eth0 when i type ifconfig
and i can ping the computer running this small linux version.

Why does cardmgr does not seem to be able to execute anything? what is
this signal 127? what did i forget on my small linux distribution that
could cause this problem?

thanks in advance for any help

Jerome

--
Jerome Corre


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: Hans <[EMAIL PROTECTED]>
Subject: Re: Reading books or learning sample codes: Which is better?
Date: Wed, 06 Sep 2000 13:13:08 GMT
Reply-To: [EMAIL PROTECTED]



Hello, Richard.

Thanks.

I learned C and C++ when I was a college student by myself in 1993. Since
1995 I started to work for companies, I've used C++ mainly especially Visual
C++ for making Windows application.

Honestly, the experience of using Visual C++ wasn't helpful for me. Most of
time I had to find the function or class to implement specific task. :-( Not
sophistcated brain experience! So, I recently decided to shif my career in
GNU/Linux area for challenging my self out of M$'s shadow.

Definetely, I'm not a genius guy. A few people do program across the
platforms.

In article <[EMAIL PROTECTED]>,
  "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Do both,
> But if you are a newbie programmer start with the documentation
>
> A good start is http://www.linuxdoc.org/ i.e. linux documentation project
> Some of this is real old,
>
> What programming did you do
> (please don't say M$-VB)
> Maybe I can help with specific documentation,
>
> Richard
>
> Hans wrote:
>
> > Hello,
> >
> > I'm a newbie Linux programmer. I used to develop M$ Windows applications,
> > especially GUI part. There are many books about programming in Linux. But, to
> > buy all the books beyond budget. So, I'm considering online resources for
> > learning Linux programming.
> >
> > In addition, if you know a site which has collection of sample codes inform
> > me. To analize Kernel source or good program is next step of beginner. :-)
> >
> > Thanks,
> >
> > --
> > My homepage is 'http://www.geocities.com/flyingdoggle/main.html'
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>

--
My homepage is 'http://www.geocities.com/flyingdoggle/main.html'


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Threads on Linux
Reply-To: [EMAIL PROTECTED]
Date: Wed, 06 Sep 2000 14:06:21 GMT

On Wed, 06 Sep 2000 06:50:17 GMT, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>Karl Heyes <[EMAIL PROTECTED]> wrote:
>> Threads have only made big book of buzz words because of java!!
>
>That's half-true. They're certainly integral to java, but they can
>make C programs easier to grasp as well. Which is what they _should_
>be used for, making code more readable. :)

This readability comes at the cost of introducing the potential for race
conditions and deadlocks, and execution order that differs from run to run even
with identical inputs.

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

From: David Ronis <[EMAIL PROTECTED]>
Subject: PPP/BRIDGE(?)/ROUTING ?
Crossposted-To: comp.os.linux.networking,alt.os.linux.slackware
Date: Wed, 06 Sep 2000 14:19:59 GMT

I have several machines at home, each with it's own modem, that I use
to connect to my work LAN via PPP.  I've got static IP numbers for all
these machines that are on the same subnet (132.206.205.0) as the ppp
host at work (this is necessary since the work machines are heavily
tcp-wrapped, use ssh, etc.).

While all this works well, I'd like to install a LAN at home too, AND
keep the same IP numbers.  If I understand things correctly, this
won't be a problem, as long as none of the machines is connected.
When one of the machines connects to work via PPP I want it to start
acting as a router for my home LAN (e.g., by running things in the
ip-up script), as indicated below; unfortunately, I don't know how to
do this.

..................HOME.....................|..........WORK............
132.206.205.x <- eth0 -> 132.206.205.y <- ppp0 -> 132.206.205.z -> ...

When I start the .y machine, and run netstat -rn, it shows eth0 as the
gateway for the 132.206.205.0 network, and later when I establish the
ppp-link, it shows 132.206.205.z as the default gateway.
Unfortunately, no traffic to any of the machines on the work side of
the link (except for the .z machine) gets through, since the .y
machine probably routes it through eth0 (for what it's worth, I have
ip_forwarding on on all the machines).

The little I've read about the experimental bridging software sounds
like it might answer my problem, however, it only discusses the case
of multiple eth? devices.  Will it work for the configuration I show
above?  If not, is there another way to do this? [e.g., using some
sort of IP number translation]?

Thanks in advance.

David

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

From: "John Smith" <[EMAIL PROTECTED]>
Subject: New OS Project
Date: Wed, 6 Sep 2000 16:28:39 +0200

I was thinking on writing a new Operating System based on Minix 2.0. The OS
would be aimed at Internet Terminals and Network Computers.

Here are the expected specifications :

Full multiprogramming (multiple programs can run at once)
Support for extended memory up to 16M on 286; 4 GB on 386, 486, and Pentium
RS-232 serial line support with terminal emulation, kermit, zmodem, etc.
Up to 3 simultaneous users on one machine
Total POSIX compatibility
Full C source code (OS, utilities, libraries, etc.) supplied
ANSI C compiler
Shell that is functionally identical to the Bourne shell
Networking with TCP/IP
A GUI and a Web Browser
Smallest Possible size
Online manual pages

I'm looking for some help since I not very experienced in OS programming.

Sorry for my English but I'm French ...





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

From: "Omkar Sathe" <[EMAIL PROTECTED]>
Subject: Re: Q: SMP question
Date: Wed, 6 Sep 2000 19:31:37 +0500

Hello,
I hv another question related to process sched in SMP.

I have a program that allocates a lot of memory and just moves data back and
forth in the allocated memory buffers.
When I run multiple instances of this program on a uniprocessor with 64 M
RAM, after
sometime (~10 minutes) kernel starts killing processes and even this memory
hogging process is killed and system is back to normal.

If this program is run on a machine with >1 CPU, will the behaviour be
different ? I am pasting the program here:

#include <stdio.h>
#include <stdlib.h>

#define BUF_SIZE (1024 * 1024)
#define BUFS 100

void main() {

  char *pointers1[BUFS];
  char *pointers2[BUFS];
  int i;

  for(i=0; i<BUFS; i++) {
     pointers1[i] = (char *)malloc(BUF_SIZE);
     pointers2[i] = (char *)malloc(BUF_SIZE);
  }
  printf("Allocated %d buffers of %d bytes", BUFS, BUF_SIZE);

  while(1) {
        for(i=0;i<BUFS;i++) {
           bcopy(pointers1[i],pointers2[i],BUF_SIZE);
        }
  }
}

I will be grateful if someone can run this program on a multiprocessor and
tell
me results.

Thanks in advance.
Omkar Sathe

bill davidsen <[EMAIL PROTECTED]> wrote in message
news:8ohb3u$j22$[EMAIL PROTECTED]...
>
> In article <[EMAIL PROTECTED]>,
> Holger Eitzenberger <[EMAIL PROTECTED]> wrote:
>
> | me and a colleague were discussing how SMP is implemented on Linux.
> | I know that in true SMP you don't have the guarantee on which CPU a
> | process will run the next time the process gets processor time.  Is
> | this different on Linux?  My coleague is pretty sure that a process on
> | Linux always runs on the same CPU.
>
>   Linux has a preference for running a process on the same CPU, which
> means that a task will wait longer for dispatch if it can get the same
> processor. By setting this higher the probability of getting the same
> CPU can be set higher.
>
>   Note that it's a waste of time to set it higher, since you lose more
> real time waiting than you gain by having the same CPU, and because the
> longer the CPU runs in another task the lower the chance that anything
> useful will be in the cache.
>
>   With 2.4 the gains are even smaller I believe, because the FPU
> registers are always saved, instead of saved only when the "next" task
> wanted to use them. Or so the list of changes reads.
>
>   If you really want to ensure running the same CPU build a uniprocessor
> kernel.
>
> --
>   bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
> Make the rules? I don't make the rules. I don't even FOLLOW the rules!



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

From: "Gatien Gillon" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.minix
Subject: New OS Project
Date: Wed, 6 Sep 2000 17:18:58 +0200

I was thinking on writing a new Operating System based on Minix 2.0. The OS
would be aimed at Internet Terminals and Network Computers.

Here are the expected specifications :

Full multiprogramming (multiple programs can run at once)
Support for extended memory up to 16M on 286; 4 GB on 386, 486, and Pentium
RS-232 serial line support with terminal emulation, kermit, zmodem, etc.
Up to 3 simultaneous users on one machine
Total POSIX compatibility
Full C source code (OS, utilities, libraries, etc.) supplied
ANSI C compiler
Shell that is functionally identical to the Bourne shell
Networking with TCP/IP
A GUI and a Web Browser
Smallest Possible size
Online manual pages

I'm looking for some help since I not very experienced in OS programming.

Sorry for my English but I'm French ...







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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.apps,comp.unix.programmer,linux.redhat
Subject: Re: Qt or gtk+ is better in programming GUI program that can run on both KDE 
and GNOME?
Date: Wed, 06 Sep 2000 15:31:29 GMT

In comp.os.linux.development.apps Richard Lim <[EMAIL PROTECTED]> wrote:

| Qt or gtk+ is better in programming GUI program that can run on both KDE and
| GNOME?

If you code in C you might be better off with GTK+.
If you code in C++ you might be better off with Qt.

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

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

From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Subject: Re: Mounting filesystem on char device
Date: Wed, 06 Sep 2000 17:39:24 +0200

Hi,

As far as I know you need a seek in your fops to make it mountable.
The major diff between a char device and a block device is the ablility to seek.

If you can modify the device so that it can seek (in the code), it should work



Richard.


liran wrote:

> Hi,
> I wonder is it possible to implement a new filesystem that
> works over a char device.
> If it can be done how can I bypass the system demand for a
> block device.
>
> Thanks Liran.
>
> * Sent from AltaVista http://www.altavista.com Where you can also find related Web 
>Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


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

From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Subject: Re: New OS Project
Date: Wed, 06 Sep 2000 17:44:15 +0200

Hi,

Why don't you get involved in the Gnu Hurd project,
and it's very much still under development.

Richard.


John Smith wrote:

> I was thinking on writing a new Operating System based on Minix 2.0. The OS
> would be aimed at Internet Terminals and Network Computers.
>
> Here are the expected specifications :
>
> Full multiprogramming (multiple programs can run at once)
> Support for extended memory up to 16M on 286; 4 GB on 386, 486, and Pentium
> RS-232 serial line support with terminal emulation, kermit, zmodem, etc.
> Up to 3 simultaneous users on one machine
> Total POSIX compatibility
> Full C source code (OS, utilities, libraries, etc.) supplied
> ANSI C compiler
> Shell that is functionally identical to the Bourne shell
> Networking with TCP/IP
> A GUI and a Web Browser
> Smallest Possible size
> Online manual pages
>
> I'm looking for some help since I not very experienced in OS programming.
>
> Sorry for my English but I'm French ...


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

From: Robert Lynch <[EMAIL PROTECTED]>
Subject: Curious: compiling test8 series: "warning... token"
Date: Wed, 06 Sep 2000 09:05:12 -0700
Reply-To: [EMAIL PROTECTED]

This is subjective, based on idly watching the output of the
kernel compile of some of the 2.4.0-test8 series (it might have
happened with other, testX series, but maybe I simply wasn't
watching at the time, thus didn't see the message), but it seems
a new sort of warning pops up frequently:

"warning: pasting would not give a valid preprocessing token"

It seems to come from defines including a "##", involving a
paste, for example:

#define BUGMSG2(x,msg,args...) do { BUGLVL(x) printk(msg, ##
args); } while (0)

Any comments on this, is it incorrect, a hi-falutin' C extension,
etc.?

Bob L. 
-- 
Robert Lynch-Berkeley CA [EMAIL PROTECTED]

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

From: Don Carroll <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: cannot fork on linux mail server
Date: Wed, 06 Sep 2000 16:27:48 GMT


thanks ulimit works


[EMAIL PROTECTED] wrote:

> In article <[EMAIL PROTECTED]>,
>   [EMAIL PROTECTED] wrote:
> > running a dual 300mhz pIII 512 meg ram , 500 meg swap
> > Linux 2.2 , Sendmail relay
> >
> > getting cannot fork message sometimes when trying to run other
> software
> > , i.e
> >
> > ps , ls,  joe
> >
> > this is pretty  heavily loaded sendmail system , processes wise
> (100,000
> > users)
> >
> > cpu is not that bad
> >
> > is there a howto on increasing process limits , etc
>
> Yeah sure, try fiddeling with ulimit and cranck up the
> nr-of-processes-limit.
>
> Dirk
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.


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

From: "Delia Barra" <[EMAIL PROTECTED]>
Subject: Pascal indenting ?. How with Xemacs ?
Date: Wed, 6 Sep 2000 11:13:19 +0200

How can I do to have automatic indenting for free pascal files with XEmacs.
Love,
Delia - Venice Italy



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


** 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 (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

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