Linux-Development-Sys Digest #790, Volume #8     Fri, 15 Jun 01 10:13:13 EDT

Contents:
  Re: lilo.conf append syntax (John in SD)
  display driver hack to improve LCD image quality (topquark)
  links in /etc/init.d changes magically ! ("Lars Guesmar")
  Re: links in /etc/init.d changes magically ! ("Peet Grobler")
  changed section attributes for .modinfo (Massimiliano Caovilla)
  Re: links in /etc/init.d changes magically ! (Anonymous)
  Re: display driver hack to improve LCD image quality (Kasper Dupont)
  Novit� - News ("Daniel")
  Re: flushing the buffer during bootup (Kasper Dupont)
  Re: Newbie on drivers (Kasper Dupont)
  Re: Multiple driver images ? (Kasper Dupont)
  Re: How many CPUs can linux support? (Kasper Dupont)
  Re: Stack size of kernel_thread (Kasper Dupont)
  Re: lilo.conf append syntax (Kasper Dupont)
  Re: VFS and mount (Kasper Dupont)
  Re: "Locked Directory" for floppy & CDROM (Kasper Dupont)
  Re: i386 or i586 (Kasper Dupont)
  Re: problem with adding a system call (Kasper Dupont)

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

From: John in SD <[EMAIL PROTECTED]>
Subject: Re: lilo.conf append syntax
Reply-To: [EMAIL PROTECTED]
Date: Fri, 15 Jun 2001 06:54:56 GMT

On Tue, 12 Jun 2001 17:48:55 -0600, "D. Stimits" <[EMAIL PROTECTED]> wrote:

>I'm trying to figure out the correct means to append two things to the
>kernel boot parameters. For a while I have been using:
>append="noapic"
>
>(due to i840 chipset design flaws of APIC)
>
>Now I'm converting some items (XFS filesystem) over to use as module, in
>order to make a bootable floppy (it is too large without making it a
>module), and I need to bring up the default ramdisk size, so I am using
>this:
>  append="ramdisk_size=25000 noapic"
>
>Is the space between "ramdisk_size=25000" and "noapic" the correct
>syntax (this works without error running lilo, but fails when it comes
>time to use the module)? I have seen commas, but these were always used
>for multiple arguments to a single parameter, not multiple parameters. I
>need to verify that I can enter two kernel boot options in the way I
>have, or else find the correct syntax.

The full command line, as passed to the kernel, will appear in /proc/cmdline
after the system boots.

Space is the separator used by arguments to kernel modules.

--John


LILO version 21.7 (24-Feb-2001) source at
http://www.ibiblio.org/pub/Linux/system/boot/lilo
patches to -2 at ftp://brun.dyndns.org/pub/linux/lilo

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

From: [EMAIL PROTECTED] (topquark)
Subject: display driver hack to improve LCD image quality
Date: 15 Jun 2001 00:23:50 -0700

I'm curious what others think about the following proposal for a
modification to the display driver to compensate for the lack of
uniform brightness on many LCD screens.  In particular, the bottom of
the screen on most laptops looks brighter (and often considerably
washed out) relative to the top of the screen, where dark blues and
greens can be indistinguishable from black.

Presumably this has more to do with an imperfect backlighting system
that is brighter near the lamp source(s) than with the user's viewing
angle, since I placed my laptop screen flat on the floor in a dark
room and verified by looking directly over the middle of the screen
that the bottom edge was still brighter and washed out relative to the
top.

My proposal is to try to correct the hardware limitation in software,
by applying a simple gradient filter to the image to scale back the
brightness near the bottom of the screen and increase the brightness
near the top.

I did some preliminary tests in GIMP which seem to suggest a linear
gradient will do just fine.

My question is how hard would this be to implement in linux, at what
level should it be implemented (kernel, xfree-server, high-level
library like GTK or Qt), and what code (if any) already exists that
might easily be modified for these purposes.

Any thoughts, suggestions are welcome.

Thanks.

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

From: "Lars Guesmar" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: links in /etc/init.d changes magically !
Date: Fri, 15 Jun 2001 09:22:56 +0200

Hello all,

I wrote a script which starts my daemon in
the runlevel 3 and 5. After 3 days the links in the
runlevel changed magically!

I made the following links:

  /etc/init.d/rc3.d/S80mydaemon -> /etc/init.d/mydaemon
  /etc/init.d/rc3.d/K01mydaemon -> /etc/init.d/mydaemon

  /etc/init.d/rc5.d/S80mydaemon -> /etc/init.d/mydaemon
  /etc/init.d/rc5.d/K01mydaemon -> /etc/init.d/mydaemon

After three days it looks like this:

  /etc/init.d/rc3.d/S01mydaemon -> /etc/init.d/mydaemon
  /etc/init.d/rc3.d/K21mydaemon -> /etc/init.d/mydaemon

  /etc/init.d/rc5.d/S01mydaemon -> /etc/init.d/mydaemon
  /etc/init.d/rc5.d/K21mydaemon -> /etc/init.d/mydaemon


I'm using SuSE/Linux 7.1. In the script is the following section:

    ### BEGIN INIT INFO
    # Provides: mydaemon
    # Required-Start:
    # Required-Stop:
    # Default-Start:    3 5
    # Default-Stop:    0 1 2 6
    # Description:   mydaemon
    ### END INIT INFO

    # Source SuSE Conf
    . /etc/rc.config


Any Answer for the above problem? Is there a script which
changes the order of services ?

Thanks in advance,
Lars







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

From: "Peet Grobler" <peetgr at absa.co.za>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: links in /etc/init.d changes magically !
Date: Fri, 15 Jun 2001 10:03:58 +0200

Did you by any chance run anything like linuxconf, or anything else that
modifies your init files?

Lars Guesmar wrote in message <9gcd9m$89nak$[EMAIL PROTECTED]>...
>Hello all,
>
>I wrote a script which starts my daemon in
>the runlevel 3 and 5. After 3 days the links in the
>runlevel changed magically!
>
>I made the following links:
>
>  /etc/init.d/rc3.d/S80mydaemon -> /etc/init.d/mydaemon
>  /etc/init.d/rc3.d/K01mydaemon -> /etc/init.d/mydaemon
>
>  /etc/init.d/rc5.d/S80mydaemon -> /etc/init.d/mydaemon
>  /etc/init.d/rc5.d/K01mydaemon -> /etc/init.d/mydaemon
>
>After three days it looks like this:
>
>  /etc/init.d/rc3.d/S01mydaemon -> /etc/init.d/mydaemon
>  /etc/init.d/rc3.d/K21mydaemon -> /etc/init.d/mydaemon
>
>  /etc/init.d/rc5.d/S01mydaemon -> /etc/init.d/mydaemon
>  /etc/init.d/rc5.d/K21mydaemon -> /etc/init.d/mydaemon
>
>
>I'm using SuSE/Linux 7.1. In the script is the following section:
>
>    ### BEGIN INIT INFO
>    # Provides: mydaemon
>    # Required-Start:
>    # Required-Stop:
>    # Default-Start:    3 5
>    # Default-Stop:    0 1 2 6
>    # Description:   mydaemon
>    ### END INIT INFO
>
>    # Source SuSE Conf
>    . /etc/rc.config
>
>
>Any Answer for the above problem? Is there a script which
>changes the order of services ?
>
>Thanks in advance,
>Lars
>
>
>
>
>
>



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

From: Massimiliano Caovilla <[EMAIL PROTECTED]>
Subject: changed section attributes for .modinfo
Date: Fri, 15 Jun 2001 10:20:57 GMT

        Hi,
as I stepped from kernel 2.14 to 2.16 (RedHat 6.2 to 7.0)
When I compile some modules that I'm developing I get a weird warning,

Assembler message:
Ignoring changed section attributes for .modinfo

Has anyone any hint where to look to get rid of this?
It only happens to files that include module.h

Ciao & thanks

Massimiliano

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

Date: Fri, 15 Jun 2001 06:34:18 -0400
Crossposted-To: comp.os.linux.development.apps
Subject: Re: links in /etc/init.d changes magically !
From: Anonymous <[EMAIL PROTECTED]>

If you're using RedHat 7.1,
the proper way to add an init.d
type of script is to put it in
/etc/rc.d/init.d and then run

 /sbin/chkconfig --add mydaemon

and then you may have to run

 /sbin/chkconfig mydaemon on

there is a line in the script
which should be of the form:

# chkconfig: 2345 11 89

The "2345" indicates the script
should be started in runlevels 2,3,4,5
with a start priority of 11 and stop priority
of 89.

See "man chkconfig" for details.


Lars Guesmar wrote:
> 
> Hello all,
> 
> I wrote a script which starts my daemon in
> the runlevel 3 and 5. After 3 days the links in the
> runlevel changed magically!
> 
> I made the following links:
> 
>   /etc/init.d/rc3.d/S80mydaemon -> /etc/init.d/mydaemon
>   /etc/init.d/rc3.d/K01mydaemon -> /etc/init.d/mydaemon
> 
>   /etc/init.d/rc5.d/S80mydaemon -> /etc/init.d/mydaemon
>   /etc/init.d/rc5.d/K01mydaemon -> /etc/init.d/mydaemon
> 
> After three days it looks like this:
> 
>   /etc/init.d/rc3.d/S01mydaemon -> /etc/init.d/mydaemon
>   /etc/init.d/rc3.d/K21mydaemon -> /etc/init.d/mydaemon
> 
>   /etc/init.d/rc5.d/S01mydaemon -> /etc/init.d/mydaemon
>   /etc/init.d/rc5.d/K21mydaemon -> /etc/init.d/mydaemon
> 
> I'm using SuSE/Linux 7.1. In the script is the following section:
> 
>     ### BEGIN INIT INFO
>     # Provides: mydaemon
>     # Required-Start:
>     # Required-Stop:
>     # Default-Start:    3 5
>     # Default-Stop:    0 1 2 6
>     # Description:   mydaemon
>     ### END INIT INFO
> 
>     # Source SuSE Conf
>     . /etc/rc.config
> 
> Any Answer for the above problem? Is there a script which
> changes the order of services ?
> 
> Thanks in advance,
> Lars

  --------== Posted Anonymously via Newsfeeds.Com ==-------
     Featuring the worlds only Anonymous Usenet Server
    -----------== http://www.newsfeeds.com ==----------

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: display driver hack to improve LCD image quality
Date: Fri, 15 Jun 2001 12:30:49 +0000

topquark wrote:
> 
> I'm curious what others think about the following proposal for a
> modification to the display driver to compensate for the lack of
> uniform brightness on many LCD screens.  In particular, the bottom of
> the screen on most laptops looks brighter (and often considerably
> washed out) relative to the top of the screen, where dark blues and
> greens can be indistinguishable from black.
> 
> Presumably this has more to do with an imperfect backlighting system
> that is brighter near the lamp source(s) than with the user's viewing
> angle, since I placed my laptop screen flat on the floor in a dark
> room and verified by looking directly over the middle of the screen
> that the bottom edge was still brighter and washed out relative to the
> top.
> 
> My proposal is to try to correct the hardware limitation in software,
> by applying a simple gradient filter to the image to scale back the
> brightness near the bottom of the screen and increase the brightness
> near the top.
> 
> I did some preliminary tests in GIMP which seem to suggest a linear
> gradient will do just fine.
> 
> My question is how hard would this be to implement in linux, at what
> level should it be implemented (kernel, xfree-server, high-level
> library like GTK or Qt), and what code (if any) already exists that
> might easily be modified for these purposes.
> 
> Any thoughts, suggestions are welcome.
> 
> Thanks.

I think the X-server would probably be the most appropriate
place to implement this feature. You will probably get the
best looking result on a truecolor display. If the hardware
does not support more than 15/16 bit colours, I suggest that
you present the display to the software as 24/32 bits to the
clients. That way you might be able to reduce the bad
influence from rounding errors.

Whatever solution you try to use you will probably see a
decrease performance, to do this without any loss of
performance it would have to be implemented in hardware.

I don't know if there exist any software or hardware doing
any of this.

-- 
Kasper Dupont

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

From: "Daniel" <[EMAIL PROTECTED]>
Subject: Novit� - News
Date: Fri, 15 Jun 2001 12:42:20 GMT

Ciao a tutti

Tante novit� sul mio sito: www.danielcity.com

- GOSSIP
- INCONTRARSI IN RETE
- RISORSE PER WEB MASTER

E tanto altro.

Vi aspetto numerosi

Daniel



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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: flushing the buffer during bootup
Date: Fri, 15 Jun 2001 12:44:04 +0000

Aravindh wrote:
> 
> hi,
> 
> i am working on a proprietery hardware system running linux. some of
> the errors during bootup are getting lost in the buffer before it hits
> the screen.
> 
> i want to change the code of the output statements used to display
> messages during bootup of the kernel and then recompile the kernel.
> 
> i just want to do a fflush at the end of every write. i thought the
> easiest way to do this was in the source of commands like printk, puts
> etc. but is there an easier way to do so?
> 
> i also tried to use the standard fflush in printk.c and it did not
> work. any other ways to flush the buffer?
> 
> thanks
> aravindh

You seem to have misunderstood the problem.

Calling fflush() in the kernel simply doesn't make any
sense. The fflush() call flushes the buffer implemented
in glibc used by userspace programs, the data can be
passed to the OS at any time, the buffer exist only to
improve performance.

The buffer used by the syslog exist for a completely
different reason. The kernel starts producing output
before the system is ready to send the output to screen
or a file. Until the system is ready to send the output
where it is wanted it will have to be kept in a buffer.
If the buffer gets full before this can happen the
first messages will get lost, anything similar to
fflush is not posible.

If you need all of the output there are some different
options, the easiest is to increase the size of the
buffer. The size is defined in the start of
kernel/printk.c, it must be a power of 2. In 2.4.1 the
size by default is 16KB which should be enough for
most people.

The other options is to produce less output during
boot or reorder some of the steps during bootup to get
output to screen and file working at an earlier time.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Newbie on drivers
Date: Fri, 15 Jun 2001 13:00:47 +0000

Rutger Luitzen van Dijk wrote:
> 
> Hi there,
> 
> I'm quite a newbie to linux and its drivers, so i have a question. I'm trying
> to setup SuSe 7.1 from the Internet. When starting the setup i have to add an
> networkmodule for my network card. I've downloaded the source code for my nic
> (a Davicom 9102). But what's next ? I do have a disk with the modules2 file
> from SuSe but how do put my driver on it. How do i compile it and is this done
> in Windows or in Linux.... (ok i  have a lot of questions....)
> 
> Any suggestions ?
> 
> Greetings,
> 
> Rutger van Dijk
> The Netherlands

Did you try all the drivers already supported by
the Suse installer, even if it doesn't have the
correct name there might be one that works good
enough for an install. Then you can install the
correct driver afterwards.

Normally compiling is done under Linux, so if you
only have the driver as source code you do have a
small problem.

It will be posible to compile the driver on another
computer already runing Linux, and then moving the
driver to your computer afterwards. I don't know if
it is posible to do a crosscompilation under Windows.

When the driver is compiled the install program
might be able to load it from a floppy, but it
might also be the case that you have to place it
in the install image used by the Suse installer.

I don't know in details how the Suse installer
works, do you have an URL, an image file, or
something else I can look a litle more on.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Multiple driver images ?
Date: Fri, 15 Jun 2001 13:08:55 +0000

benny wrote:
> 
> Is it possible to write a module that may be loaded multiple times.
> 
> I want to provide a service that will support multiple remote target peers
> and this may be an option if it is possible.

You can use the -o option to insmod to load a module
under a different name. But I only think you should
use this option during development, not in the final
version of the module. (It is usefull if some bug in
the module prevents you from removing the module.)

If you only want to do this to give different
arguments to different instances of the module, you
should consider some other way to pass the arguments.
What kind of driver is this? Filesystem, Blockdevice
Chardevice, Networkinterface, or something else?

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: How many CPUs can linux support?
Date: Fri, 15 Jun 2001 13:14:58 +0000

Ted Specht wrote:
> 
> I am writing an application that performs parallel processing and I
> would like to know if Linux supports multiple CPUs per server and how
> stable is the threads implementation?  Also is there a "Hardware
> Compatibility List" that lists hardware that has been proven to work in
> the Linux environment?
> 
> My goal is to determine the advantage of using Linux versus Solaris x86.
> 
> Any opinons?
> 
> No death threats please!
> 
> PS
> 
> I am aware of Beowulf and other cheap clusters but for various reasons
> we have chosen to use the multiple CPU approach for now.
> 
> TIA!!!
> 
> --
> Ted Specht,  Jet Propulsion Lab
> Mission Execution & Automation Section (368)
> Office number:(818)354-9645

I don't know the exact limit, but on 32bit systems
it is somewhere in the range from 16 to 32 CPUs.

Some parts of the kernel uses bitmasks with one bit
pr. cpu. This means that a 32bit Linux system cannot
use more than 32 CPUs.

A 64bit Linux system can use twice as many CPUs.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Stack size of kernel_thread
Date: Fri, 15 Jun 2001 13:24:56 +0000

Ricardo da Silva wrote:
> 
> Hanspeter Halle wrote:
> >
> > Hi,
> > does anybody know how to increase the memory avaliable for the stack of a
> > kernel_thread (kerbnel 2.2 and 2.4)?
> >
> > Thanks, Hanspeter
> 
> you can use ulimit or limit (depend of the shell you're using) to set
> this.
> 
> limit stacksize unlimited
> 
> you can use also
> 
> setenv MPSTKZ 8M
> export MPSTKZ=8M

That sets the limits of the userspace stack.
But the system would crash if a kernel thread
tried to use the userspace stack.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: lilo.conf append syntax
Date: Fri, 15 Jun 2001 13:28:28 +0000

D. Stimits wrote:
> 
> I'm trying to figure out the correct means to append two things to the
> kernel boot parameters. For a while I have been using:
> append="noapic"
> 
> (due to i840 chipset design flaws of APIC)
> 
> Now I'm converting some items (XFS filesystem) over to use as module, in
> order to make a bootable floppy (it is too large without making it a
> module), and I need to bring up the default ramdisk size, so I am using
> this:
>   append="ramdisk_size=25000 noapic"
> 
> Is the space between "ramdisk_size=25000" and "noapic" the correct
> syntax (this works without error running lilo, but fails when it comes
> time to use the module)? I have seen commas, but these were always used
> for multiple arguments to a single parameter, not multiple parameters. I
> need to verify that I can enter two kernel boot options in the way I
> have, or else find the correct syntax.
> 
> D. Stimits, [EMAIL PROTECTED]

I have experienced problems when trying to use an
initial ramdisk larger than 4MB. I don't know if
this problem is related to the loader or the kernel.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: VFS and mount
Date: Fri, 15 Jun 2001 13:32:24 +0000

Alexander Viro wrote:
> 
> In article <[EMAIL PROTECTED]>, Petric Frank  <[EMAIL PROTECTED]> wrote:
> >Hello,
> >
> >i am writing a filesystem driver (vfs).
> 
> as in "not on a block device"?
> 
> >I am getting it working with hardcoded values.
> >
> >i can do a
> >  mount -t <filesystem type> anything <mountpoint>
> >
> >The problem i have actually is where this <anything> is going to.
> 
> Currently - nowhere. IOW, you can't use it. It will change in 2.5.early,
> but that requires API change.
> 

Since it does show up in /proc/mounts it must
exist somewhere.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: "Locked Directory" for floppy & CDROM
Date: Fri, 15 Jun 2001 13:50:21 +0000

Jose W. Shermanson wrote:
> 
> Kasper Dupont wrote:
> >
> > Jose W. Shermanson wrote:
> > >
> > > I'm not sure this is a kernal question or a file system one but I
> cannot
> > > access my CDROM nor my floppy.  I recently loaded Mandrake Linux v8.0.
> All
> > > went well for about 2 weeks and then, for some reason unknown to me,
> when I
> > > attempt to access my CDROM or floppy, I get an error message "You do
> not
> > > have enough permissions to read file:/mnt/floppy."  The "file type"
> column
> > > displayed by konqueror says "locked directory."  I suspect I somehow
> shut
> > > down LINUX while these devices were busy and the condition hasn't been
> > > cleared.  Any suggestions short of re-installing would be appreciated.
> I
> > > am a total novice to LINUX but have 30+ years experience with mainframe
> > > OSs.  Thanks.  Jose
> > >
> > > --
> > > Posted via CNET Help.com
> > > http://www.help.com/
> >
> > What do you get when you type the
> > following commands in a shell?
> >    cat /etc/fstab
> >    ls -l /mnt
> >    mount /mnt/floppy
> >    mount /mnt/cdrom
> >    ls -l /mnt
> >
> > Have you tried with different
> > floppies and CDROMs?
> >
> > --
> > Kasper Dupont
> Kasper,  Looks like the CDROM & the floppy are supermounted.
> 
> $cat /etc/fstab
> /dev/hdb5/ ext2 defaults 1 1
> none /dev/pts devpts mode=0620 0 0
> /mnt/cdrom /mnt cdrom supermount fs=iso9660,dev=/dev/cdrom 0 0
> /mnt/floppy     /mnt/floppy     supermount       exec,dev,suid,rw,fs=vfat 0
> 0
> <deleted>
> $ls -1 /mnt
> cdrom/
> disk/
> floppy/
> win_c/
> win_c2/
> win_d/
> $mount /mnt/floppy
> mount: according to mtab, /mnt/floppy is already mounted on /mnt/floppy
> mount failed
> 
> Sorry but I'm too new to linux to know how to unmount the devices and
> re-mount them.  I tried the unmount command but bash says it can't fine the
> command.
> 
> Any more suggestions?
> 
> Jose
> 
> --
> Posted via CNET Help.com
> http://www.help.com/

Hmm, I don't know how this supermount filesystem works.
Without supermount the lines would have looked like this:
  /dev/cdrom /mnt/cdrom iso9660 defaults 0 0
  /dev/fd0 /mnt/floppy vfat exec,suid,rw 0 0
But I don't know if this is in any way related to your
problem.

The output from "ls -1 /mnt" doesn't help much, I asked
you to type "ls -l /mnt". Notice the difference.

There is no command named "unmount", it is named "umount".
But maybe you are not suposed to use that with
supermounted devices.

I suggest you try these commands right after a boot:
cat /proc/mounts
ls -l /mnt
ls -l /mnt/floppy
ls -l /mnt/cdrom
ls -l /mnt
cat /proc/mounts


BTW, Does anybody know what this supermount filesystem
does, and what is the correct way to use it?

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: i386 or i586
Date: Fri, 15 Jun 2001 13:54:26 +0000

dl wrote:
> 
> what is the difference between i386 and i586?

An i586 CPU has some features that the i386
doesn't have. E.g. an i586 CPU has a TSC
register that can be used for very precise
timings which does not exist on an i386 CPU.
There are also some features, that can be
used to measure or improve the performance of
the system.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: problem with adding a system call
Date: Fri, 15 Jun 2001 14:08:17 +0000

Thomas wrote:
> 
> I tried to add a system call to my kernel.
> 
> This is what I did :
> 
> In /usr/src/linux/include/asm/unistd.h :
>         I add   "  #define __NR_show_mult   222   "
> 
> In /usr/include/asm/unistd.h I did the same.
> 
> In /usr/src/linux/arch/i386/kernel/entry.S :
>         I add   "  .long SYMBOL_NAME(sys_show_mult)   "
> 
> In /usr/src/linux/kernel/sys.c :  I add the code of the new system call
> 
>         asmlinkage int sys_show_mult(int x,int y, int *res)
>         {
>                 int error;
>                 int compute;
>                 error=verify_area(VERIFY_WRITE,res,sizeof(*res));
>                 if(error)
>                 return error;
>                 compute= x*y;
>                 put_user(compute,res);
>                 printk("Value computed : %d x %d = %d \n, x,y, compute");
>                 return 0;
>         }
> 
> And this is the test programm which use the system call :
> 
>         #include <stdio.h>
>         #include <stdlib.h>
>         #include <linux/unistd.h>
> 
>         _syscall3(int, show_mult,int, x, int , y, int *, resul);
> 
>         main()
>         {
>                 int ret = 0;
>                 show_mult(2,3,&ret);
>                 printf("Resultat %d %d = %d \n",2,3,ret);
>         }
> 
> Everything seems to be OK but when I try to use the system call it does
> nothing and the return code is '18'.
> 
> Could anyone help me ? I think the problem is in entry.S.
> 
> Thanks a lot
>                                 Thomas (France)

Are you sure the line you added really is number 222?
Try adding a printk() statement before you call
verify_area just to ensure that your function is
actually called.

In your particular case the verify_area() probably
isn't even needed. I think doing this would be just
as good:
    if (put_user(compute,res)) return -EFAULT;

In the userspace program I suggest you do the
following to get some help to find the problem:
if (show_mult(2,3,&ret)) perror("show_mult");

And it might also help to strace your userspace
program and see what happens to the system call.

Hope some of these hints will help you.

-- 
Kasper Dupont

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


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