Linux-Development-Sys Digest #774, Volume #8      Wed, 6 Jun 01 05:13:08 EDT

Contents:
  Re: Patching the original RH (7.1) kernel (?) (John Hardin)
  Re: Reboot from driver module
  Re: #include <linux/kernel.h> (Doc)
  Re: #include <linux/kernel.h> (A Guy Called Tyketto)
  Re: #include <linux/kernel.h> ("Norm Dresner")
  Re: problem with compiling as a module (Srinivas Vedula)
  how can I get a change to "official" linux? (Eric Taylor)
  Re: how can I get a change to "official" linux? (John Reiser)
  Re: problem with compiling as a module
  Re: Porting solaris software to Linux ("Norman Black")
  Re: Porting solaris software to Linux (Kjetil Torgrim Homme)
  Re: memory usage info ("Nils O. Selåsdal")
  module doesn't load in kernel 2.2.x SMP (Jeseem)
  Re: how can I get a change to "official" linux? (Philip Armstrong)
  Re: how can I get a change to "official" linux? (Villy Kruse)
  Re: SIGALRM - Please help!! (Villy Kruse)
  Re: #include <linux/kernel.h> (Doc)
  printk within installed device driver's modue in linux kernel 2.4.2/3 (Rony Sarig)

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

From: John Hardin <[EMAIL PROTECTED]>
Crossposted-To: linux.redhat.misc
Subject: Re: Patching the original RH (7.1) kernel (?)
Date: Tue, 05 Jun 2001 17:00:30 GMT

Josef Molnar wrote:
> 
> My question is: is it possible to patch the RedHat kernel source with
> patches downloaded from ftp.kernel.org?
> If not, is it possible to use the latest kernel from for RH without any
> modifications?
> If not, what modifications are necessery?
> 

You can certainly run a newer kernel.  I have been doing so for
months (kernel 2.4.2 on first RH 6.2 and then 7.0).  Be aware
the RH tests it's kernel with other components of the distribution.
The only problem I had was an incompatability between klogd and
the newer kernel which would occasionally cause klogd to go into
a loop and take up 96% of the CPU.  A simple patch to klogd
fixed the problem.  I haven't noticed any other problems.

-John

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

From: [EMAIL PROTECTED] ()
Subject: Re: Reboot from driver module
Date: Tue, 05 Jun 2001 17:08:54 -0000

In article <[EMAIL PROTECTED]>,
Steve Helding  <[EMAIL PROTECTED]> wrote:

>I'm having trouble figuring out how to reboot a RH 6.2 system from a
>driver.  When I get an interrupt from our hardware (telling me something
>is horribly wrong with our system) I want to reboot the system.  I tried
>machine_restart with varying success.  It seemed to work but when the
>system reboots it needs to run fsck because I didn't sync the disk.
>When I tried using sys_reboot I can't seem to get the symbol recognized
>by the compiler or insmod loader.  Same goes for sys_sync.  Does anyone
>know the proper way of performing a system reboot from within a driver
>module?

I'd look at the watch dog driver and see how it does it.  You can also
grep for reboot:

  find /usr/src/linux -type f -name '*.c' | xargs grep -i reboot


>-=-=-=-=-=-
>[Attachment type=text/x-vcard, name=stephen.vcf]
>-=-=-=-=-=-

yuck

--
http://www.spinics.net/linux/

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

From: Doc <[EMAIL PROTECTED]>
Subject: Re: #include <linux/kernel.h>
Date: Tue, 05 Jun 2001 19:09:51 +0200

Il giorno Tue, 05 Jun 2001 10:36:24 -0500, il gatto di root
<[EMAIL PROTECTED]> camminando sulla tastiera ha scritto:

>I've started working on a device driver.  However, all of the constants
>defined in kernel.h (for example KERN_DEBUG) are unresolved by the
>compiler (gcc).   My include statement is:
>
>#include <linux/kernel/h>
>
>
>The compiler does not complain about its location at all.
>

maybe it's a typo.

i dont' know why the compiler does not complain but i think it's better
to include this way:

#include <linux/kernel.h>
                      ^

if it's a typo, do you tell the compiler which directory to look in for
includes?

gcc -I/usr/src/linux/include/ ......


ciao
-- 
maruko.cjb.net - Seti@Home applets
Designed for Windows 
Powered by Linux

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

From: A Guy Called Tyketto <[EMAIL PROTECTED]>
Subject: Re: #include <linux/kernel.h>
Date: Tue, 05 Jun 2001 17:44:45 GMT

Doc <[EMAIL PROTECTED]> wrote:
> Il giorno Tue, 05 Jun 2001 10:36:24 -0500, il gatto di root
> <[EMAIL PROTECTED]> camminando sulla tastiera ha scritto:
> 
>>I've started working on a device driver.  However, all of the constants
>>defined in kernel.h (for example KERN_DEBUG) are unresolved by the
>>compiler (gcc).   My include statement is:
>>
>>#include <linux/kernel/h>
>>
>>
>>The compiler does not complain about its location at all.
>>
> 
> maybe it's a typo.
> 
> i dont' know why the compiler does not complain but i think it's better
> to include this way:
> 
> #include <linux/kernel.h>
>                      ^
> 
> if it's a typo, do you tell the compiler which directory to look in for
> includes?
> 
> gcc -I/usr/src/linux/include/ ......

        Actually, this shouldn't be a typo. during 'make mrproper ; make
config' when you configure your kernel, a link should have been created
from /usr/src/linux/include/linux to /usr/include/linux. So gcc won't
complain about it, as it sees that <linux/kernel.h> is in 
/usr/include/linux. You can specify its location by passing -I to gcc,
but it's really not needed if it is linked.

                                                        BL.
-- 
Brad Littlejohn                         | Email:        [EMAIL PROTECTED]
Unix Systems Administrator,             |           [EMAIL PROTECTED]
Web + NewsMaster, BOFH.. Smeghead! :)   |   http://www.wizard.com/~tyketto
  PGP: 1024D/E319F0BF 6980 AAD6 7329 E9E6 D569  F620 C819 199A E319 F0BF


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

From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: #include <linux/kernel.h>
Date: Tue, 05 Jun 2001 18:15:23 GMT


root <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]...
> I've started working on a device driver.  However, all of the constants
> defined in kernel.h (for example KERN_DEBUG) are unresolved by the
> compiler (gcc).   My include statement is:
>
> #include <linux/kernel/h>
>
>
> The compiler does not complain about its location at all.
>

    First, it may be a typo in your message because it's right in the
subject, but it's not

        /linux/kernel/h
but
        /linux/kernel.h


That said, you don't get most of the symbols and definitions in kernel.h
unless you first

#define        __KERNEL__

before including it.

    Norm




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

From: Srinivas Vedula <[EMAIL PROTECTED]>
Subject: Re: problem with compiling as a module
Date: Tue, 05 Jun 2001 14:02:20 -0500

Thanks for the information. The problem is still there. I am using
Debian potato distribution and the /usr/include/linux is not a symbolic
link, it is a proper directory. Hope someone could give me a lead.

VS

Wil Taphoorn wrote:

> Srinivas Vedula wrote:
>
> > len = sprintf(buffer, "Call %05d %1d %1d \n",count,
> > t.tv_sec, t.tv_usec);
>
> There is a typo here, the "1" (one) in %1d should be "l" (small L)
>
> Wil.


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

From: Eric Taylor <[EMAIL PROTECTED]>
Subject: how can I get a change to "official" linux?
Date: Tue, 05 Jun 2001 20:02:40 GMT

Hi:

I have a small, but useful (to me and probably others) change I
would like to see made to linux. It involves adding a /proc/xxxx
type entry for a value that is now a constant. It would default
as the constant that it is now, but could be changed at run time
if desired.

So, is there in fact an "official" linux and how would I propose
such an enhancement?

Would I have to provide all the code changes for this or is
there someone who oversees these sorts of changes. I know
I have seen other kernel variables that must have migrated
from constants to "tuning" variables. I don't know all the
details, but I would think this is a regular happening in linux.

On other sytems that I have worked on, these sorts of
variables are usually setup with some macros. Is this the
case on linux?

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

The constant I want to be variable is TASK_UNMAPPED_BASE.

I believe that this constant is used in only one place in ff/mmap.c

unsigned long get_unmapped_area(unsigned long addr, unsigned long len)
{
 struct vm_area_struct * vmm;

 if (len > TASK_SIZE)
  return 0;
 if (!addr)
  addr = TASK_UNMAPPED_BASE;
 ....


It would allow for the (re)-positioning of the .so libraries so I
can have a nearly 3 gig  (contiguous) array. Right now (in 2.4)
I am limited because the libraries are located at 1 gig. This means
I can only have a contiguous array of somewhat less than 2 gigs and
a second one of less than 1 gig. But again, not contiguous.

True, I can just build my own custom kernel. But I need to distribute
software worldwide that I want to be able to use this ability w/o the
need for custom kernels.


thanks
eric





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

From: John Reiser <[EMAIL PROTECTED]>
Subject: Re: how can I get a change to "official" linux?
Date: Tue, 05 Jun 2001 14:26:16 -0700

> The constant I want to be variable is TASK_UNMAPPED_BASE.

Technical solution is straightforward.

> But I need to distribute
> software worldwide that I want to be able to use this ability w/o the
> need for custom kernels.

This is a socio-political problem with no technical content at all.
Unless you can dictate the kernel that your [potential] users run,
then there is no hope that a technical change will work for you.
It takes at least one year, usually two years, and sometimes longer,
to change the kernel version of 80% of the existing systems,
even in the face of outright bugs and security exploits.
And you intend to have them change for a mere feature?

-- 
John Reiser, [EMAIL PROTECTED]

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

From: [EMAIL PROTECTED] ()
Subject: Re: problem with compiling as a module
Date: Tue, 05 Jun 2001 21:41:24 -0000

In article <[EMAIL PROTECTED]>,
Srinivas Vedula  <[EMAIL PROTECTED]> wrote:

>the /usr/include/linux is not a symbolic
>link, it is a proper directory.

Then fix it.

--
http://www.spinics.net/linux/

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

From: "Norman Black" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.unix.programmer,comp.unix.solaris
Subject: Re: Porting solaris software to Linux
Date: Tue, 5 Jun 2001 15:12:43 -0700
Reply-To: "Norman Black" <[EMAIL PROTECTED]>

I use pthreads on both systems and I use PTHREAD_SCOPE_SYSTEM to get a
consistent scheduling behavior between the two systems. Seems to work for me
just fine.

--
Norman Black
Stony Brook Software
the reply, fubar => ix.netcom

"jamal" <[EMAIL PROTECTED]> wrote in message
news:9fhrtj$cho$[EMAIL PROTECTED]...
> Hi ,
>
> I am new in linux or unix programming in general.
> My company has an application written for Windows and Solaris.
> We plan to port it to Linux. So the easiest should be porting
> Solaris version into Linux version. I wonder what the main issues that I
> should take care of for doing the porting.
> Is it just compatibility between solaris system library and linux system
> library or is there any specific
> problem?
> As I know that all unix system should have the similar API right? So in
what
> part they differ?
> For your imformation the solaris software is compiled using sun cc
compiler,
> but there are some error when I tried to compile
> using gcc, so obviously the compiler difference is one of the
consideration.
>
>
> regards
>
> Jamal
>
>
>
>


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

From: Kjetil Torgrim Homme <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.unix.programmer,comp.unix.solaris
Subject: Re: Porting solaris software to Linux
Date: 06 Jun 2001 05:26:15 +0200

[jamal]

>   I am new in linux or unix programming in general.  My company has
>   an application written for Windows and Solaris.  We plan to port
>   it to Linux. So the easiest should be porting Solaris version into
>   Linux version. I wonder what the main issues that I should take
>   care of for doing the porting.  Is it just compatibility between
>   solaris system library and linux system library or is there any
>   specific problem?

Run, don't walk, to your closest book shop and buy W. Richard Stevens'
books.  They're all very good, you decide which ones you need (sooner
or later you will probably find use for them all).


Kjetil T.

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

From: "Nils O. Selåsdal" <[EMAIL PROTECTED]>
Subject: Re: memory usage info
Date: Tue, 5 Jun 2001 17:53:17 +0200


"Zhiyong Xu" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi,
>             I  doing some research on linux kernel, I modified some
of
> buffer cache system. But it seems some problem occurs , I want to
know
> how can I get info of current memory usage and display? It seems
> I consumed all memory and no process so how can I know current memory
free
top
/proc/meminfo




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

From: [EMAIL PROTECTED] (Jeseem)
Subject: module doesn't load in kernel 2.2.x SMP
Date: 5 Jun 2001 23:36:58 -0700

Hi
    I am using redhat 6.2.
    My kernel module has versioning disabled. (the kernel has versioning
enabled.)
    My module loads fine on UP version of kernel but doesn't load on SMP
kernel .(have defined __SMP__ while building the driver for SMP.).
    error are unresolved symbols like kmalloc.

    Any ideas on how to solve this.

    Thanks and Warm Regards
    Jeseem
    mailto:[EMAIL PROTECTED]

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

From: [EMAIL PROTECTED] (Philip Armstrong)
Subject: Re: how can I get a change to "official" linux?
Date: 5 Jun 2001 22:37:04 +0100

In article <[EMAIL PROTECTED]>,
Eric Taylor  <[EMAIL PROTECTED]> wrote:
>I have a small, but useful (to me and probably others) change I
>would like to see made to linux. It involves adding a /proc/xxxx
>type entry for a value that is now a constant. It would default
>as the constant that it is now, but could be changed at run time
>if desired.
>
>So, is there in fact an "official" linux and how would I propose
>such an enhancement?

Raise the issue on the linux-kernel mailing list probably. You could
try mailing one or two of the kernel developers with responsibility
for the part you are patching. see linux/MAINTAINERS for contact
details...

>Would I have to provide all the code changes for this or is
>there someone who oversees these sorts of changes. I know
>I have seen other kernel variables that must have migrated
>from constants to "tuning" variables. I don't know all the
>details, but I would think this is a regular happening in linux.

Given that what you want is a fairly small change, it may be enough to
ask nicely. Of course if the kernel developers don't want to, then
you'll have to distribute your own patches or kernels and require your
users to do the necessary installation.

HTH.

Phil

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


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

From: [EMAIL PROTECTED] (Villy Kruse)
Subject: Re: how can I get a change to "official" linux?
Date: 06 Jun 2001 07:22:40 GMT

On Tue, 05 Jun 2001 14:26:16 -0700, John Reiser <[EMAIL PROTECTED]> wrote:
>> The constant I want to be variable is TASK_UNMAPPED_BASE.
>
>Technical solution is straightforward.
>
>> But I need to distribute
>> software worldwide that I want to be able to use this ability w/o the
>> need for custom kernels.
>
>This is a socio-political problem with no technical content at all.
>Unless you can dictate the kernel that your [potential] users run,
>then there is no hope that a technical change will work for you.
>It takes at least one year, usually two years, and sometimes longer,
>to change the kernel version of 80% of the existing systems,
>even in the face of outright bugs and security exploits.
>And you intend to have them change for a mere feature?
>



But it should be possible to distribute kernel modules plus patch files
that would implement this feature.  If public deman and/or Linus thinks
this feature is a nice and usefull feature it might go into the official
kernel.  If you check the various distributions, their kernels often have
extra features and bug fixes added when compared with the standard kernel.

Some features started out that way, and up to at least kernel 2.2 the
pcmcia feature was not included in the official kernel; don't know if
it is included now in kernel 2.4.  Pcmcia is a nice feature, and on some
systems (laptops) even a vital feature.


Villy


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

From: [EMAIL PROTECTED] (Villy Kruse)
Subject: Re: SIGALRM - Please help!!
Date: 06 Jun 2001 07:27:38 GMT

On 28 May 2001 08:36:40 GMT, Joe Leherbauer <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] (^CooL^) wrote:
>> 
>> Anyway, I need to use SIGALRM to implement pre-emptive
>> multi-tasking....
>> Every a pre-stipulated pre-emption interval, a thread is interrupted
>> and is forced to yield.... I am using signal (SIGALRM, sig_handler) so
>> that everytime the interrupt is generated, the function sig_handler
>> calls the thread's yield() function automatically.
>> 
>> Now the problem is that the yield() function performs a longjmp which
>> does not return, and therefore the interrupt handling does not return
>> either! For this reason, it seems that once the interrupt occurs a
>> first time, it does not occur anymore times after that - sort of
>> locks!
>
>man signal
>
>will tell you why the handler is invoked only once.
>

Last time I looked "man signal" is wrong.  Man signal says that signals
are one-shot according to sysV behaviour, but the reality is that with
glibc2 signals behave according to BSD standards, that is, signal handlers
will remain installed.

The real explanation is given in the other answer to this question.

>
>Use sigaction() and companions.
>
>



Villy

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

From: Doc <[EMAIL PROTECTED]>
Subject: Re: #include <linux/kernel.h>
Date: Wed, 06 Jun 2001 10:02:39 +0200

Il giorno Tue, 05 Jun 2001 17:44:45 GMT, il gatto di A Guy Called
Tyketto <[EMAIL PROTECTED]> camminando sulla tastiera ha scritto:


>> if it's a typo, do you tell the compiler which directory to look in for
>> includes?
>> 
>> gcc -I/usr/src/linux/include/ ......
>
>       Actually, this shouldn't be a typo. during 'make mrproper ; make
>config' when you configure your kernel, a link should have been created
>from /usr/src/linux/include/linux to /usr/include/linux. So gcc won't
>complain about it, as it sees that <linux/kernel.h> is in 
>/usr/include/linux. You can specify its location by passing -I to gcc,
>but it's really not needed if it is linked.
>
>                                                       BL.

ok about the symlinks etc. 
the typo i was talking about is this: 
#include <linux/kernel/h>
                     ^^^
if the compiler does not complain probably it's because this is a typo
in the posted message.

ciao
-- 
maruko.cjb.net - Seti@Home applets
Designed for Windows 
Powered by Linux

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

From: [EMAIL PROTECTED] (Rony Sarig)
Subject: printk within installed device driver's modue in linux kernel 2.4.2/3
Date: 6 Jun 2001 01:57:01 -0700

Does anyone has idea why I don't see all 'printk()' messages a any level,
from KERN_DEBUG->KERN_CRIT, when I 'klogd -c 7' and then 'cat /proc/kmsg'
while working with installed module (by insmod).
If I see one printk  message I don't see some others!

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


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