Linux-Development-Sys Digest #621, Volume #8      Mon, 9 Apr 01 14:13:12 EDT

Contents:
  Re: setitimer() problem on linux (Kasper Dupont)
  Re: Kernel mode to User Mode (Kasper Dupont)
  Re: usleep() is unreliable when sleeping for less then 10000 micro (Rolf Magnus)
  how to modify dynamic lib ? (Markus Fischer)
  Suppressing Redhat bootup output (Paul Haley)
  ALIGN in entry.S (Mikael Chambon)
  Re: Suppressing Redhat bootup output ("Chris West")
  Re: Suppressing Redhat bootup output (Kasper Dupont)
  Re: ALIGN in entry.S (Kasper Dupont)
  how to modify dynamic lib ? (Markus Fischer)
  Re: process becomes [process] (Kasper Dupont)
  Re: ALIGN in entry.S (Mikael Chambon)
  Re: usleep() is unreliable when sleeping for less then 10000 micro (Pasztor Szilard)
  Re: Need your recommendation for a full-featured text editor (Greg Copeland)
  DEV TCP/IP C++ ("Dirk Riebesell")
  Re: setitimer() problem on linux (Matthew Gatto)

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: setitimer() problem on linux
Date: Mon, 09 Apr 2001 13:26:54 +0000

Matthew Gatto wrote:
> 
> I wrote a simple process scheduling shell for school, that I developed
> on a SUN-OS Unix server. The program works fine there, but on my home
> linux computer, it is hanging during a setitimer() call.
> 
> After selecting a child process to give a timeslice to, it sends it
> the start signal then does the following code (that should pause a
> short time, and then wake up and continue executing the process
> scheduler).
> 
> the struct itimerval was initialized as follows at the begining of the
> program:
>  struct itimerval new;
>  new.it_interval.tv_usec = 0;
>  new.it_interval.tv_sec = 0;
>  new.it_value.tv_usec = 600;
>  new.it_value.tv_sec = 0;
> 
> and the sigaction initialised as follows:
>   struct sigaction action;
>   sigfillset(&(action.sa_mask));
>   action.sa_handler=do_nothing;  /* do_nothing(), is as the name
>                                     indicates, an empty function */
>   sigaction(SIGALRM, &action, NULL);
> 
> and during the scheduling loop the following code gets executed:
> 
> /* start the timer */
> 
>  if (DEBUG ==1)
>  { printf("about to set itimer\n"); }
>  setitimer(ITIMER_REAL, &new, NULL);
> 
>  if (DEBUG == 1)
>  { printf("itimer set, about to pause()!"); }
>  pause();
> 
> it hangs consistently on the first or second time (on linux at least)
> through this code block. it will print out
> 
> $
> about to set itimer
> itimer set, about to pause()!
> about to set itimer
> 
> and then hang indefinately.. not responding to any signals
> (SIGINT,SIGTSTP,SIGCONT,etc). if I do a ps -el on another terminal, it
> shows the program's WCHAN as doing a "pause". does anyone know why
> this could be? or what i could be doing something wrong? i am truly
> clueless.
> 
> I posted the code here:
> http://www.ductape.net/~gatto/scheduler/
> The timer call that hangs is in
> http://www.ductape.net/~gatto/scheduler/main.c

You forgot to initialize the sa_flags.
I added this line and then it worked for me:

  action.sa_flags=0;

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Kernel mode to User Mode
Date: Mon, 09 Apr 2001 13:40:33 +0000

Mikael Chambon wrote:
> 
> Hi,
> 
> Could someone explain me clearly what is the difference between the
> kernel mode and user mode ??
> 
> In the book "Understanding the linux kernel p 252", I road that
> the kernel checks if a signal has arrived when switching from user
> mode to kernel mode.

It is not when switching from user mode to kernel mode,
it is when switching from kernel mode back to user mode.

> 
> Can someone give me the .c file where this is done ?? I would like
> to add something..

It is not done in a .c file, it is done in assembler
code.

arch/i386/kernel/entry.S

The do_signal() function is in

arch/i386/kernel/signal.c

> 
> Thanks for all,
> 
> Mikael Chambon

-- 
Kasper Dupont

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

From: Rolf Magnus <[EMAIL PROTECTED]>
Subject: Re: usleep() is unreliable when sleeping for less then 10000 micro
Date: Mon, 9 Apr 2001 15:46:06 +0200

Pasztor Szilard wrote:

> Norm:
>> Investigate the Real-Time Linux system at
>>         http://www.rtlinux.org
>> 
>> You'll find the answers to all of your questions.
> 
> The applications often must run on any standard linux distribution, and in
> this case, rtlinux is not a viable alternative.

man nanosleep

....
       The current implementation of nanosleep is  based  on  the
       normal  kernel  timer mechanism, which has a resolution of
       1/HZ s (i.e, 10 ms on Linux/i386 and 1 ms on Linux/Alpha).
       Therefore, nanosleep pauses always for at least the speci�
       fied time, however it can take up to  10  ms  longer  than
       specified  until  the  process becomes runnable again. For
       the same reason, the value returned in case of a delivered
       signal  in *rem is usually rounded to the next larger mul�
       tiple of 1/HZ s.
 
       As some applications  require  much  more  precise  pauses
       (e.g.,  in  order to control some time-critical hardware),
       nanosleep is also capable of short high-precision  pauses.
       If  the process is scheduled under a real-time policy like
       SCHED_FIFO or SCHED_RR, then pauses of up to 2 ms will  be
       performed as busy waits with microsecond precision.


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

From: Markus Fischer <[EMAIL PROTECTED]>
Subject: how to modify dynamic lib ?
Date: Mon, 09 Apr 2001 15:54:06 +0200

I would like to replace a function in a dynamic lib.

assumed I have a mylibc.so.6 file and nm
shows me the functions in the library.

how can I compile and add/replace the function in
the original dynamic library ?

pointers welcome

thanks,

robert arctor wrote:
> 
> Hi
> 
> Could somebody please post how to permanently change the PATH environment
> variable.
> 
> Thanks in advance.
> 
> Rob

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

Crossposted-To: comp.os.linux.misc,comp.os.linux.setup
Subject: Suppressing Redhat bootup output
From: [EMAIL PROTECTED] (Paul Haley)
Date: Mon, 09 Apr 2001 14:33:31 GMT

Hello,

I'm running Redhat 6.2 and would like to suppress the output on bootup, such 
as "Loading cron.....  [OK]", etc.  All I want is to have lilo say "loading 
linux" and then give me a login prompt, though of course I still want all 
the programs/processes to run, I just don't want them to output to the 
screen.  I checked out the init scripts and nothing jumped out at me.  

Can somebody help?

Regards,
Paul

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

From: Mikael Chambon <[EMAIL PROTECTED]>
Subject: ALIGN in entry.S
Date: Mon, 09 Apr 2001 16:36:37 +0200

Hello,

I need a advice on a piece of assembly code in arch/i386/kernel/entry.S 

====================
signal_return:
        sti     
        testl $(VM_MASK),EFLAGS(%esp)
        movl %esp,%eax
        jne v86_signal_return
        xorl %edx,%edx
        call SYMBOL_NAME(do_signal)
        jmp restore_all

        ALIGN
======================

What does ALIGN mean ??


Thanks for all
-- 
Mikael Chambon

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

From: "Chris West" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc,comp.os.linux.setup
Subject: Re: Suppressing Redhat bootup output
Date: Mon, 9 Apr 2001 15:40:07 +0100

If you're using lilo try adding

append="quiet"

to the configuration file (usually /etc/lilo.conf) under the image you want
to be quiet.
Remember to run /sbin/lilo before rebooting.


"Paul Haley" <[EMAIL PROTECTED]> wrote in message
news:%KjA6.2341$[EMAIL PROTECTED]...
> Hello,
>
> I'm running Redhat 6.2 and would like to suppress the output on bootup,
such
> as "Loading cron.....  [OK]", etc.  All I want is to have lilo say
"loading
> linux" and then give me a login prompt, though of course I still want all
> the programs/processes to run, I just don't want them to output to the
> screen.  I checked out the init scripts and nothing jumped out at me.
>
> Can somebody help?
>
> Regards,
> Paul



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

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc,comp.os.linux.setup
Subject: Re: Suppressing Redhat bootup output
Date: Mon, 09 Apr 2001 14:48:52 +0000

This is a multi-part message in MIME format.

==============55870E7A2CA7274571662124
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Paul Haley wrote:
> 
> Hello,
> 
> I'm running Redhat 6.2 and would like to suppress the output on bootup, such
> as "Loading cron.....  [OK]", etc.  All I want is to have lilo say "loading
> linux" and then give me a login prompt, though of course I still want all
> the programs/processes to run, I just don't want them to output to the
> screen.  I checked out the init scripts and nothing jumped out at me.
> 
> Can somebody help?
> 
> Regards,
> Paul

Why don't you want the output?

With output to the screen you can see how
far the startup has come, and in case
something goes wrong you will have a chance
to find the problem.

If you really want to do this change the
console to null in the file /etc/lilo.conf
and run /sbin/lilo. Next time you boot you
will get no output.

See my previous posting for details.

-- 
Kasper Dupont

==============55870E7A2CA7274571662124
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Message-ID: <[EMAIL PROTECTED]>
Date: Mon, 02 Apr 2001 07:19:51 +0000
From: Kasper Dupont <[EMAIL PROTECTED]>
Organization: daimi.au.dk
X-Mailer: Mozilla 3.04 (X11; I; Linux 2.2.16-3 i686)
MIME-Version: 1.0
Newsgroups: comp.os.linux.development.system
Subject: Re: Quiet Boot for Linux
References: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Benjamin Scherrey wrote:
> 
> I've got a techno-phobic client who gets concerned when he sees all the
> things going across his screen when linux boots up. This is enough of an
> issue that I'm prepared to go in and build a customer kernel or whatever
> is necessary to make a linux boot appear even simpler than windows. How
> do I get control over what gets to the screen when linux is booting? Is
> there some parameter I can pass while building the kernel to suppress its
> screen output? Perhaps route it to /dev/null or something?
> 
>         thanx & later,
> 
>                 Ben Scherrey

All you have to do is give "console=null" as argument to
the kernel. The kernel argument can be specified in your
loader configuration. If you use lilo the configuration
is in /etc/lilo.conf. Find the default option and make a
copy, then edit the append option. When the new config
is saved run /sbin/lilo.

Example, if the default looks like this:

image=/boot/vmlinuz
        label=linux
        read-only
        root=/dev/hda5
        append="hdc=ide-scsi"

You can change it into this:

image=/boot/vmlinuz
        label=linux
        read-only
        root=/dev/hda5
        append="hdc=ide-scsi console=null"

image=/boot/vmlinuz
        label=linux-old
        read-only
        root=/dev/hda5
        append="hdc=ide-scsi"

In some distributions it can also be specified when you
install the system, but no need to reinstall just to
change this.

-- 
Kasper Dupont


==============55870E7A2CA7274571662124==


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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: ALIGN in entry.S
Date: Mon, 09 Apr 2001 14:56:24 +0000

Mikael Chambon wrote:
> 
> Hello,
> 
> I need a advice on a piece of assembly code in arch/i386/kernel/entry.S
> 
> ====================
> signal_return:
>         sti
>         testl $(VM_MASK),EFLAGS(%esp)
>         movl %esp,%eax
>         jne v86_signal_return
>         xorl %edx,%edx
>         call SYMBOL_NAME(do_signal)
>         jmp restore_all
> 
>         ALIGN
> ======================
> 
> What does ALIGN mean ??
> 
> Thanks for all
> --
> Mikael Chambon

It means that there will be added pad bytes
up to an address divisible by some number.
I don't know the number, but I think it must
be 4, 16 or 256. It is in most cases done to
improve performance.

-- 
Kasper Dupont

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

From: Markus Fischer <[EMAIL PROTECTED]>
Subject: how to modify dynamic lib ?
Date: Mon, 09 Apr 2001 17:06:48 +0200


I would like to replace a function in a dynamic lib.

assumed I have a mylibc.so.6 file and nm
shows me the functions in the library.

how can I compile and add/replace the function in
the original dynamic library ?

pointers welcome

thanks,

Mark

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: Re: process becomes [process]
Date: Mon, 09 Apr 2001 15:09:59 +0000

Chris Lo wrote:
> 
> Hi,
> 
> We run RH6.2 with Oracle. For most Oracle server processes, they all
> look
> alikie
> 
> ora_pmon_SID
> ora_smon_SID
> 
> but sometimes when the server is busy, the ps will only list them as
> [oracle].
> 
> This fails our monitoring scripts. Has anyone come across this and have
> a fix for
> it?
> 
> Thanks & Regards,
> Chris

At least I can tell you, that this happens when
the process is currently swapped out from memory
to disk.

I think the information that ps usually shows
about a process is part of the process memory
being swapped to disk, the system would have to
swap in a part of each process to give full
answers to the requests from ps.

It has nothing to do with the ps command it is
the proc virtual filesystem that does not report
the full info. I don't know if proc has an option
to always read the information from disk when
requested through /proc/<pid>/cmdline.

-- 
Kasper Dupont

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

From: Mikael Chambon <[EMAIL PROTECTED]>
Subject: Re: ALIGN in entry.S
Date: Mon, 09 Apr 2001 17:35:10 +0200

Kasper Dupont wrote:
> 
> Mikael Chambon wrote:
> >
> > Hello,
> >
> > I need a advice on a piece of assembly code in arch/i386/kernel/entry.S
> >
> > ====================
> > signal_return:
> >         sti
> >         testl $(VM_MASK),EFLAGS(%esp)
> >         movl %esp,%eax
> >         jne v86_signal_return
> >         xorl %edx,%edx
> >         call SYMBOL_NAME(do_signal)
> >         jmp restore_all
> >
> >         ALIGN
> > ======================
> >
> > What does ALIGN mean ??
> >
> > Thanks for all
> > --
> > Mikael Chambon
> 
> It means that there will be added pad bytes
> up to an address divisible by some number.
> I don't know the number, but I think it must
> be 4, 16 or 256. It is in most cases done to
> improve performance.
> 
> --
> Kasper Dupont


Thanks Kasper
-- 
Mikael Chambon | Paris France | ICQ 10249913
HOME   => [EMAIL PROTECTED]
WORK   => [EMAIL PROTECTED] or call (651) 415 4299 
SCHOOL => [EMAIL PROTECTED]

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

From: Pasztor Szilard <[EMAIL PROTECTED]>
Subject: Re: usleep() is unreliable when sleeping for less then 10000 micro
Date: 9 Apr 2001 16:13:43 GMT

Rolf:
> man nanosleep
> 
> ....
>        The current implementation of nanosleep is  based  on  the
>        normal  kernel  timer mechanism, which has a resolution of
>        1/HZ s (i.e, 10 ms on Linux/i386 and 1 ms on Linux/Alpha).
>        Therefore, nanosleep pauses always for at least the speci�
>        fied time, however it can take up to  10  ms  longer  than
>        specified  until  the  process becomes runnable again. For
>        the same reason, the value returned in case of a delivered
>        signal  in *rem is usually rounded to the next larger mul�
>        tiple of 1/HZ s.
>  
>        As some applications  require  much  more  precise  pauses
>        (e.g.,  in  order to control some time-critical hardware),
>        nanosleep is also capable of short high-precision  pauses.
>        If  the process is scheduled under a real-time policy like
>        SCHED_FIFO or SCHED_RR, then pauses of up to 2 ms will  be
>        performed as busy waits with microsecond precision.

No matter if it's realtime priority, it won't get the cpu back until the
scheduler has provided the deserved jiffy.

                ------------------------------------------------
                |   If you turn on the light quickly enough,   |
                |     you can see what the dark looks like.    |
                ------------------------------------------------

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

Crossposted-To: 
24hoursupport.helpdesk,alt.comp.shareware.programmer,comp.editors,comp.lang.java.help,comp.lang.java.programmer,comp.lang.java.softwaretools,comp.os.linux.advocacy
Subject: Re: Need your recommendation for a full-featured text editor
From: Greg Copeland <[EMAIL PROTECTED]>
Date: 09 Apr 2001 11:45:18 -0500

Knowledge Seeker <[EMAIL PROTECTED]> writes:

Didn't read all of your requiremnets, but EMACS is THE editor.  Like it
or not, it what all other editors try to be.  Period.  That doesn't mean
that it's for you, as it does have a rather steep learning curve, however,
it is THE programmer's editor.

Greg


> Hi,
> 
> I am looking for a full-featured yet easy to use text editor to
> replace Notepad.  Ideally, I would like a tool that is cross-platform
> or has versions for Win98 and Linux.  The main platform requirement
> would be Win98 and the nice-to-have platform is Linux.
> 
> There seem to be a plethora of choices that might work:
> UltraEdit
> TextPad
> EditPlus
> WinEdit
> Multi-Edit
> Zeus
> CRiSP
[snip]

-- 
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: "Dirk Riebesell" <[EMAIL PROTECTED]>
Subject: DEV TCP/IP C++
Date: Mon, 9 Apr 2001 19:23:20 +0200

Hi,

Are there any URL/HOWTO/Documentation about TCP/IP function for C++ under
Linux.
Under Win it documentet by ..DN, but for Linux I haven't found yet anything.

Thanks for any help

 Dirk





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

From: [EMAIL PROTECTED] (Matthew Gatto)
Subject: Re: setitimer() problem on linux
Date: Mon, 09 Apr 2001 17:28:55 GMT

Kasper Dupont [[EMAIL PROTECTED]] wrote:
>Matthew Gatto wrote:
>> 
>> I wrote a simple process scheduling shell for school, that I developed
>> on a SUN-OS Unix server. The program works fine there, but on my home
>> linux computer, it is hanging during a setitimer() call.
>> 
>> After selecting a child process to give a timeslice to, it sends it
>> the start signal then does the following code (that should pause a
>> short time, and then wake up and continue executing the process
>> scheduler).
>> 
>> the struct itimerval was initialized as follows at the begining of the
>> program:
>>  struct itimerval new;
>>  new.it_interval.tv_usec = 0;
>>  new.it_interval.tv_sec = 0;
>>  new.it_value.tv_usec = 600;
>>  new.it_value.tv_sec = 0;
>> 
>> and the sigaction initialised as follows:
>>   struct sigaction action;
>>   sigfillset(&(action.sa_mask));
>>   action.sa_handler=do_nothing;  /* do_nothing(), is as the name
>>                                     indicates, an empty function */
>>   sigaction(SIGALRM, &action, NULL);
>> 
>> and during the scheduling loop the following code gets executed:
>> 
>> /* start the timer */
>> 
>>  if (DEBUG ==1)
>>  { printf("about to set itimer\n"); }
>>  setitimer(ITIMER_REAL, &new, NULL);
>> 
>>  if (DEBUG == 1)
>>  { printf("itimer set, about to pause()!"); }
>>  pause();
>> 
>> it hangs consistently on the first or second time (on linux at least)
>> through this code block. it will print out
>> 
>> $
>> about to set itimer
>> itimer set, about to pause()!
>> about to set itimer
>> 
>> and then hang indefinately.. not responding to any signals
>> (SIGINT,SIGTSTP,SIGCONT,etc). if I do a ps -el on another terminal, it
>> shows the program's WCHAN as doing a "pause". does anyone know why
>> this could be? or what i could be doing something wrong? i am truly
>> clueless.
>> 
>> I posted the code here:
>> http://www.ductape.net/~gatto/scheduler/
>> The timer call that hangs is in
>> http://www.ductape.net/~gatto/scheduler/main.c
>
>You forgot to initialize the sa_flags.
>I added this line and then it worked for me:
>
>  action.sa_flags=0;
>
>-- 
>Kasper Dupont

That was it! I was trying to figure it out for days.. Thanks very
much.

Matthew Gatto

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


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