Linux-Development-Sys Digest #999, Volume #7      Thu, 6 Jul 00 12:13:16 EDT

Contents:
  Re: What does lock_kernel and unlock_kernel actualy makes ? (Fabrice Peix)
  Re: What does lock_kernel and unlock_kernel actualy makes ? (Fabrice Peix)
  __KERNEL__ (rushi)
  Re: Java on SMP linux. (Juergen Kreileder)
  Re: Java on SMP linux. (Mathias Waack)
  Interrupt handling in Linux ("Nick Lahtinen")
  Re: How to make a module won't autoclean up?
  Re: Interrupt handling in Linux (Fabrice Peix)
  Re: how to implement route (mostly new in network programming!) ("Robichaud, 
Jean-Philippe [BAN:6S33:EXCH]")
  Re: how to implement route (mostly new in network programming!) ("Robichaud, 
Jean-Philippe [BAN:6S33:EXCH]")
  Linux + X:  Change video mode. ([EMAIL PROTECTED])
  Re: IOremap question ("andres")
  Re: how to implement route (mostly new in network programming!) (Kaz Kylheku)
  Re: Java on SMP linux. ("Rex Dieter")
  Re: Is there some way to track page faults without kernel hacking ? (Kaz Kylheku)
  Re: I want make my own system call (Kaz Kylheku)
  Re: SIGIO (Kaz Kylheku)
  Re: What does lock_kernel and unlock_kernel actualy makes ? (Kaz Kylheku)
  Driver for SMC-1211TX EZ Card? (David Ronis)

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

From: Fabrice Peix <[EMAIL PROTECTED]>
Subject: Re: What does lock_kernel and unlock_kernel actualy makes ?
Date: Thu, 06 Jul 2000 15:18:06 +0200

Eugene Shchepetov wrote:
> 
>  Is it performs a full stop of kernel (except some life-parts of course) ?
> What parts are still working ? What can I do (call, implement) and what I
> can't between lock and unlock ?
> By the way I want to prevent process memory access from anyone but my kernel
> process, is a lock_kernel helps ?
> Thanks
> 
> Eugene

        Yop,

        I think is not very important because you must use spinlock.
        
        Bye.

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

From: Fabrice Peix <[EMAIL PROTECTED]>
Subject: Re: What does lock_kernel and unlock_kernel actualy makes ?
Date: Thu, 06 Jul 2000 15:23:49 +0200

Fabrice Peix wrote:
> 
> Eugene Shchepetov wrote:
> >
> >  Is it performs a full stop of kernel (except some life-parts of course) ?
> > What parts are still working ? What can I do (call, implement) and what I
> > can't between lock and unlock ?
> > By the way I want to prevent process memory access from anyone but my kernel
> > process, is a lock_kernel helps ?
> > Thanks
> >
> > Eugene
> 
>         Yop,
> 
>         I think is not very important because you must use spinlock.
> 
>         Bye.
        Sorry....

        Here a list of lock in the kernel , i find it in the kernel ML.

==================================================================================
        Types of Kernel Locks


 Big Kernel Lock
    When to use:     You don't know what fine-grain lock to call,
                                         or a fine-grained lock doesn't
exists.
    Lock:            lock_kernel();
    Unlock:          unlock_kernel();

 spinlock
    When to use:     SMP, # writers == # readers

    Initialize:      spinlock_t my_lock = SPIN_LOCK_UNLOCKED;
    Lock:            spin_lock(&my_lock);
    Unlock:          spin_unlock(&my_lock);

 irq spinlock
    When to use:     SMP, sending signals or in an IRQ back-half

    Initialize:      spinlock_t my_lock = SPIN_LOCK_UNLOCKED;
    Lock:            spin_lock_irq(&my_lock);
    Unlock:          spin_unlock_irq(&my_lock);

 rwlock:
    When to use:     # writers < # readers

    Initialize:      rwlock_t my_lock = RW_LOCK_UNLOCKED;
    Read Lock:       read_lock(&my_lock);
    Read Unlock:     read_unlock(&my_lock);
    Write Lock:      write_lock(&my_lock);
    Write Unlock:    write_unlock(&my_lock);

 bitlocks:
    When to use:     Never? 

    Initialize:      unsigned long my_lock=0;
    Spin Lock:       while (test_and_set_bit(bit,&my_lock))
                schedule();
    Unlock:          clear_bit(bit,&my_lock);

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

Subject: __KERNEL__
From: rushi <[EMAIL PROTECTED]>
Date: Thu, 06 Jul 2000 07:00:24 -0700

Hi all,
This is a kind of newbie question. I have recently begun to go
though the code of Linux kernel. At many places I find something
like this

#ifdef __KERNEL__
 :
 :
 :
#endif

What I could make out is that if a program is compiled with
-D__KERNEL__ option all the code included in between will be
available to the program. This could also help in writing
modules. There could be more to it. Also I find names starting
with underscores and same names without underscores e.g. u32 and
__u32. I can't figure out. Could someone please help?


===========================================================

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com


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

From: Juergen Kreileder <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.java.programmer
Subject: Re: Java on SMP linux.
Date: 06 Jul 2000 16:13:12 +0200

>>>>> "Rex" == Rex Dieter <[EMAIL PROTECTED]> writes:

    Rex> "1$worth" <"1$worth"@costreduction.plseremove.screaming.net>
    Rex> wrote in message
    Rex> news:[EMAIL PROTECTED]...
    >> Ronald Cole wrote:
    >> >
    >> > [EMAIL PROTECTED] (Thaddeus L Olczyk) writes:
    >> > > Sun claims that their Java does not work on linux in SMP (

    Rex> Really?  I thought their JDK (based on a previous blackdown
    Rex> JDK) uses native threads...

Their native threads VM is based on very early and broken snapshot of
our code.  It's not recommended to use native threads with Sun's
release, if you want a stable native threads VM then use our latest
version.


       Juergen

-- 
Juergen Kreileder, Blackdown Java-Linux Team
http://www.blackdown.org/java-linux.html
JVM'01: http://www.usenix.org/events/jvm01/

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

From: Mathias Waack <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.java.programmer
Subject: Re: Java on SMP linux.
Date: 06 Jul 2000 15:54:27 +0200

Juergen Kreileder <[EMAIL PROTECTED]> writes:

[Sun JVM for Linux]
> Their native threads VM is based on very early and broken snapshot of
> our code.  It's not recommended to use native threads with Sun's
> release, if you want a stable native threads VM then use our latest
> version.

This statement together with your email address sounds a bit like 
advertising. Is this message confirmed by Sun? If not, are there any 
studies which proof your statement?

Mathias, just curious

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

From: "Nick Lahtinen" <[EMAIL PROTECTED]>
Subject: Interrupt handling in Linux
Date: Thu, 6 Jul 2000 08:26:36 -0600

I tried to post this message earlier and it didn't seem to get posted (I may
have had some misconfigurations here).  Please excuse the redundancy if this
does get posted twice.

I am kind of a newcomer to Linux development, at least as far as Interrupt
handling is concerned, so here is my question:  Is there a Linux equivalent
to the getvect(...) call?  I had this appear in a program that I was working
on doing a port with from Windows to Linux, but I couldn't  find any header
files on my system (even in windows) that contained this call or the similar
setvect(...) call.  I think this was due to a difference in developer
environments (Borland vs VC++).  I haven't been able to find much
documentation on interrupt handling in general, so if you know of any links
where I could find such info, let me know.  Thanks!!


Nick




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

From: <[EMAIL PROTECTED]>
Subject: Re: How to make a module won't autoclean up?
Date: 6 Jul 2000 14:35:17 GMT

Chan Chi Lung <[EMAIL PROTECTED]> wrote:
> Dears,
>       I have writen a module for my device driver. However, the module
> will be auto clean up after a time interval.
>       What should I do to make the module stay in the kernel forever?

MOD_INC_USE_COUNT; at module initialization... 

BUT: you will never can remove it if you don't MOD_DEC_USE_COUNT prior
calling module removal

> Thx.

> Jason Chan

-- 
                Debian/GNU Linux: a dream come true
=============================================================================
"Computers are useless. They can only give answers."            Pablo Picasso

--->    Visita http://www.valux.org/ para saber acerca de la    <---
--->    Asociaci�n Valenciana de Usuarios de Linux              <---
 

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

From: Fabrice Peix <[EMAIL PROTECTED]>
Subject: Re: Interrupt handling in Linux
Date: Thu, 06 Jul 2000 16:38:59 +0200

Nick Lahtinen wrote:
> 
> I tried to post this message earlier and it didn't seem to get posted (I may
> have had some misconfigurations here).  Please excuse the redundancy if this
> does get posted twice.
> 
> I am kind of a newcomer to Linux development, at least as far as Interrupt
> handling is concerned, so here is my question:  Is there a Linux equivalent
> to the getvect(...) call?  I had this appear in a program that I was working
> on doing a port with from Windows to Linux, but I couldn't  find any header
> files on my system (even in windows) that contained this call or the similar
> setvect(...) call.  I think this was due to a difference in developer
> environments (Borland vs VC++).  I haven't been able to find much
> documentation on interrupt handling in general, so if you know of any links
> where I could find such info, let me know.  Thanks!!
> 
> Nick

        Interrupt handling is part of kernel, so if you to manage
        interupt you must write kernel module.
        But if you explain a bit more what you mean to do we can help you more

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

From: "Robichaud, Jean-Philippe [BAN:6S33:EXCH]" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: how to implement route (mostly new in network programming!)
Date: Thu, 06 Jul 2000 10:57:20 -0400

It is a question of speed and of program spec.  I can't afford all the overhead
doing a system() call and all the blablah route do before really "adding" a route
(like params cheking, family cheking...)  It must be as fast as possible, this is
the reason of living of my program.

Jean-Philippe

Mathias Waack wrote:

> "Robichaud, Jean-Philippe [BAN:6S33:EXCH]" <[EMAIL PROTECTED]> writes:
>
> > Hi, I'm must implement a routing routine.  I've have look at the
> > source of "route" in the nettools package but I can't understand what
> > is happening, even if I follow the program with xxdbg.  Can someone
> > tell me where can I get a simple example or good documentation about
> > implementing routing ?
> >
> > What I have to do is to save the actual routing table and restore it
> > later.  Any suggestion?
>
> Why do you not call /sbin/route to do your work? Capture the output
> from route (or /proc/route) and restore it by calling the route program.
>
> Mathias

--
 Jean-Philippe Robichaud
 [EMAIL PROTECTED]
 (514) 818-7750
 (ESN) 888-7750
 St-Laurent, Quebec, Canada



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

From: "Robichaud, Jean-Philippe [BAN:6S33:EXCH]" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: how to implement route (mostly new in network programming!)
Date: Thu, 06 Jul 2000 10:58:36 -0400

(this is the same response as the one I sent to Mathias)

It is a question of speed and of program spec.  I can't afford all the
overhead
doing a system() call and all the blablah route do before really "adding" a
route
(like params cheking, family cheking...)  It must be as fast as possible, this
is
the reason of living of my program.

Jean-Philippe

Markus Pietrek wrote:

> "Robichaud, Jean-Philippe [BAN:6S33:EXCH]" wrote:
> >
> > Hi, I'm must implement a routing routine.  I've have look at the source
> > of "route" in the nettools package but I can't understand what is
> > happening, even if I follow the program with xxdbg.  Can someone tell me
> > where can I get a simple example or good documentation about
> > implementing routing ?
> >
> > What I have to do is to save the actual routing table and restore it
> > later.  Any suggestion?
>
> Why not use "add" and "delete" of the route program, and call it via
> shell?
>
> --
> Markus Pietrek
>
> Tel: +49-761-47094-13
> Fax: +49-761-47094-29
>
> Web: http://www.concept.de
>
> Concept Engineering GmbH
> Boetzinger Strasse 29
> D-79111 Freiburg/Germany

--
 Jean-Philippe Robichaud
 [EMAIL PROTECTED]
 (514) 818-7750
 (ESN) 888-7750
 St-Laurent, Quebec, Canada



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

From: [EMAIL PROTECTED]
Subject: Linux + X:  Change video mode.
Date: Wed, 05 Jul 2000 19:48:27 -0400

It seems like my requirements are simple and common, but I have had much
trouble finding *any* information on how to do this:

I want to write a program that changes the video mode while in X.  Can
anyone point me to documentation on the X libraries / whatever.  A code
snippet would be even better :)

Thanks,

Steve



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

From: "andres" <[EMAIL PROTECTED]>
Subject: Re: IOremap question
Date: Thu, 6 Jul 2000 08:19:54 -0700

Thanks pete.

Actually I had found the document you referred to. And reading it was the
way how I could finish the driver. But your explanation really helped me
understanding some things that were not clear yet.
Thanks



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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: how to implement route (mostly new in network programming!)
Reply-To: [EMAIL PROTECTED]
Date: Thu, 06 Jul 2000 15:24:38 GMT

On Thu, 06 Jul 2000 10:58:36 -0400, Robichaud, Jean-Philippe [BAN:6S33:EXCH]
<[EMAIL PROTECTED]> wrote:
>(this is the same response as the one I sent to Mathias)
>
>It is a question of speed and of program spec.  I can't afford all the
>overhead
>doing a system() call and all the blablah route do before really "adding" a
>route
>(like params cheking, family cheking...)  It must be as fast as possible, this
>is
>the reason of living of my program.

What you do is create a socket and then execute special ioctl's on it using
special structures as arguments.  These are detailed in the source code of the
routing module.

I'm surprised you haven't simply run strace on the route command to get a high
level view of how it interacts with the kernel in order to do the route
table manipulation. A system call trace reveals a wealth of information, such
as the symbolic names of various constants.

For example, I just ran

        strace route add -host 10.10.10.10 dev eth0

and the trace revealed the system call sequence

        socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
        ioctl(3, SIOCADDRT, 0xbffff954)         = 0
        close(3)                                = 0

SIOCADDRT! Hmm, do you think that might have something to do with adding
routes? Could we maybe grep the code in /usr/src/linux/net/ipv4 for this
constant? :)

-- 
#exclude <windows.h>

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

From: "Rex Dieter" <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.java.programmer
Subject: Re: Java on SMP linux.
Date: Thu, 6 Jul 2000 10:36:28 -0500


"Mathias Waack" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Juergen Kreileder <[EMAIL PROTECTED]> writes:
>
> [Sun JVM for Linux]
> > Their native threads VM is based on very early and broken snapshot of
> > our code.  It's not recommended to use native threads with Sun's
> > release, if you want a stable native threads VM then use our latest
> > version.
>
> This statement together with your email address sounds a bit like
> advertising. Is this message confirmed by Sun? If not, are there any
> studies which proof your statement?

Advertising or not, it's true.

SUN's JDK release for Linux was based on a previous Blackdown release (RC3 I
believe).  In the meantime, blackdown has released RC4, which in our testing
on SMP boxes, works well.

--
Rex Dieter
Computer System Administrator
Mathematics and Statistics
University of Nebraska Lincoln


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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Is there some way to track page faults without kernel hacking ?
Reply-To: [EMAIL PROTECTED]
Date: Thu, 06 Jul 2000 15:30:55 GMT

On Thu, 6 Jul 2000 10:35:51 -0700, Eugene Shchepetov <[EMAIL PROTECTED]> wrote:
> May be there syscall for it, but didn't find it. I can hack fault.c and
>make statistic on faults, but I don't like this way.

The time command reports some page fault statistics about another program's
execution.

It works by collecting the child using wait4() which provides statistics
about the child in a struct rusage.

-- 
#exclude <windows.h>

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: I want make my own system call
Reply-To: [EMAIL PROTECTED]
Date: Thu, 06 Jul 2000 15:32:29 GMT

On Thu, 6 Jul 2000 12:39:37 -0700, Eugene Shchepetov <[EMAIL PROTECTED]> wrote:
>What I must do - please tell, I need full description - thanks

You must study the kernel source code. When you are ready to add new system
calls, you will know how.

-- 
#exclude <windows.h>

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: SIGIO
Reply-To: [EMAIL PROTECTED]
Date: Thu, 06 Jul 2000 15:35:42 GMT

On Thu, 06 Jul 2000 14:16:04 +0200, Benjamin Morin <[EMAIL PROTECTED]>
wrote:
>Hello,
>
>I'd like my process to be informed whenever something is written into a
>given file. I thought this piece of code would be all right, but it
>doesn't work... Could someone help me?

There is no notification mechanism for doing this in the POSIX interface.

The tail program, in tail -f mode, works by attempting to read new data 
at the end of the file in between sleeps. (The retry interval can be configured
with a parameter).

-- 
#exclude <windows.h>

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: What does lock_kernel and unlock_kernel actualy makes ?
Reply-To: [EMAIL PROTECTED]
Date: Thu, 06 Jul 2000 15:40:34 GMT

On Thu, 6 Jul 2000 14:57:30 -0700, Eugene Shchepetov <[EMAIL PROTECTED]> wrote:
> Is it performs a full stop of kernel (except some life-parts of course) ?

No, it acquires a global lock so that only one processor can execute
the code between kernel_lock and kernel_unlock.

>What parts are still working ? What can I do (call, implement) and what I
>can't between lock and unlock ?

Interrupts are still enabled, so you cannot assume that some given code
won't be interrupted. You must still guard data that is shared with
interrupt service routines.

>By the way I want to prevent process memory access from anyone but my kernel
>process, is a lock_kernel helps ?

No; for locking your fine grained-data structures, you should use individual
spinlocks. These also work for mutual exclusion against interrupts. A global
kernel lock is something you should avoid introducing at all costs.

-- 
#exclude <windows.h>

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

From: David Ronis <[EMAIL PROTECTED]>
Subject: Driver for SMC-1211TX EZ Card?
Date: Thu, 06 Jul 2000 15:57:55 GMT

I'm trying to install a SMC-1211TX EZ Card in an i586 running 2.2.16
(it was using a SMC-Elite16 before).  From the information at the SMC
site, it looks like I have to use the rtl8139 driver; is this correct?

Any hints as to how to configure the module or how well it works (I
notice that it's marked 'experimental')?


David

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


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