Linux-Development-Sys Digest #195, Volume #8      Fri, 6 Oct 00 07:13:08 EDT

Contents:
  Re: CVS- Concurrent Version System (Arturo C)
  Re: newbie questions on kernel level programming and iospace (Mark McDougall)
  Re: ioremap not in namespce...? ([EMAIL PROTECTED])
  Re: Problem with ATHLON processor ("[EMAIL PROTECTED]")
  Re: extract value form the kernel (Josef Moellers)
  unable to determine module loading: 3c90x instead 3c59x ("Dr. Armin Wittmann")
  Re: Problem with ATHLON processor (Michel Talon)
  Re: Text-based user interface development (Neal Tucker)
  cach-optimisation on SMP (Toon Knapen)
  Re: Safe mail (Philip Armstrong)

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

From: [EMAIL PROTECTED] (Arturo C)
Subject: Re: CVS- Concurrent Version System
Date: 6 Oct 2000 04:19:48 GMT
Reply-To: [EMAIL PROTECTED]

On Thu, 05 Oct 2000 15:38:45 -0800, ywk@SuSE <[EMAIL PROTECTED]> wrote:
>Hi guys
>
>any idea how to set up a cvs repository at home running SuSE 6.4
>coz i wanna use it to keep track a java project with a team of 10 students
>where to d/l the rpm?
>suggestions are most welcome
>
>ywk


The CVS RPM is prolly on your CD.

Here is the CVS manual and a free book:
http://cvsbook.red-bean.com/
http://www.cvshome.org/docs/manual/index.html

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

From: Mark McDougall <[EMAIL PROTECTED]>
Subject: Re: newbie questions on kernel level programming and iospace
Date: Fri, 06 Oct 2000 17:40:46 +1100

Josh Willey wrote:

> I posted this message earlier and, as I've come to expect, recieved no
> responses. Could anyone tell me if I'm doing something wrong? Have I
> failed to abide by proper netiquette? Was the length of the message just
> way too long? Am I missing something so obvious that no one will bother
> to answer?

Maybe because it reads like a school assignment?!?

--
|     Mark McDougall    |
|        Engineer       |
| Virtual Logic Pty Ltd |
| http://www.vl.com.au  |

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

From: [EMAIL PROTECTED]
Subject: Re: ioremap not in namespce...?
Date: Fri, 06 Oct 2000 06:50:37 GMT

Gunnar Proppe wrote:

> I am a module newbie as well, using the Rubini book.  Had the same problem, a friend 
>and I did
> some grepping around the kernel source and determined that you need to include 
><asm/io.h> to map
> ioremap() to __ioremap().
>
> Eg:
>
> #include <asm/io.h>   /*for ioremap()*/
>
> This did the trick.  Hope it works for you.  The Rubini book is nice, but very much 
>out of date.
>
> Gunnar
>
> Sean Patrick McNamee wrote:
>
> > Arne Driescher wrote:
> >
> > > > OK>  I added the -a option to my ksyms, and now I'm seeing a symbol
> > > > __ioremap_R9eac042a
> > > >
> > > > This looks almost like mangling to me. I am still having the problem with the 
>unresolved
> > > > symbol when I try to load the driver, so I'm wondering if something weird is 
>up with my
> > > > kernel or what???
> > > I wouldn't say weird. Depending on which options you have used
> > > to compile your kernel, some symbols are exported and others
> > > are not. Lets a look at the Makefile:
> > > vmlinux: $(CONFIGURATION) init/main.o init/version.o linuxsubdirs
> > >         $(LD) $(LINKFLAGS) $(HEAD) init/main.o init/version.o \
> > >                 --start-group \
> > >                 $(CORE_FILES) \
> > >                 $(FILESYSTEMS) \
> > >                 $(NETWORKS) \
> > >                 $(DRIVERS) \
> > >                 $(LIBS) \
> > >                 --end-group \
> > >                 -o vmlinux
> > >         $(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU]
> > > \)\|\(\.\.ng$$
> > > \)\|\(LASH[RL]DI\)' | sort > System.map
> > >
> > > As u can see, the target vmlinux is build by linking all
> > > object files into the kernel. In the next step nm (see man nm)
> > > gets all the symbols from the object file and put the result in
> > > System.map.
> > > Exported symbols defined in you kernel should be in System.map.
> > >
> > > Ok, u have the symbol in you kernel but not in System.map. This means
> > > that your System.map is not from the same build as your kernel.
> > > Have you simply forgotten to copy your System.map to you boot
> > > partition? If u built your own kernel: Have you used make install?
> > > (From the Makefile:)
> > > install: $(CONFIGURE) $(BOOTIMAGE)
> > >         sh -x ./install.sh $(KERNELRELEASE) $(BOOTIMAGE)
> > > "$(INSTALL_PATH)"
> > >         sh -x ./install.sh $(TOPDIR)/System.map
> > > "$(INSTALL_PATH)"/System.map-$(KERNELRELEASE)
> > >
> > > -Arne
> >
> > Well, I have recompiled the kernel, using make install (before I did it manually), 
>and still
> > no luck. One thing I did notice, however is that while my ksyms output shows the 
>symbol
> > ___ioremap_R9eac042a
> > and the System.map shows simply __ioremap, they are both listed as being at the 
>same address.
> >
> > Why the hell does my kernel insist on calling it this?
> > Maybe I should just try referencing this symbol in my driver...

OK> I have rebuilt the kernel WITHOUT the CONFIG_MODVERSIONS, and gotten ksyms to spit 
out
__ioremap - YEAH!
But, I still get the 'unresolved symbol ioremap' error; I have the #include 
<asm/io.h>, and have
looked at this file:
It doesn't #define ioremap into __ioremap, (as some have suggested), but rather 
declares it as an
extern.

I HAVE gotten this to load, though, by inserting my own #define ioremap ... __ioremap 
statement.
I'm pretty sure I shouldn't have to do this, but I still don't understand...

Thanks again!
Sean


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

From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Subject: Re: Problem with ATHLON processor
Date: Fri, 06 Oct 2000 09:32:03 +0200

Hi,

My brother has an Athlon 750 working perfectly with Linux.

I think the early 2.2.x/2.3.x kernels had a problem which cased a hang.
(a mtrr bug , I think)

What kernel are you trying to install?
or what distribution + revision are u trying to install.

Richard.

St�phane CLEMENCEAU wrote:

> I can't install linux on a athlon processor. How i proceed to pass this
> problem ?
>
> Please help me !!
>
> THANKS
>
> [EMAIL PROTECTED]


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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: extract value form the kernel
Date: Fri, 06 Oct 2000 10:28:38 +0200

This is a multi-part message in MIME format.
==============93D835BFF517F24535E9F592
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Frank Contrepois wrote:
> =

> I need to extract the values of diferent variables of the linux kernel
> how can I do that .
> I'm totaly new with kernel hacking
> I've thought of using proc or a device...

If you can somehow produce an executable which has the kernel symbol
table, you can try and go through /proc/kcore, which is supposed to look
much like a core file.

I usually use /dev/kmem and /proc/ksyms. I have appended two source
files which use tcl as a user interface and provide access to kernel
memory. You can built scripts on top of this.
If they provide usefull, I might get around to comment them B-{)

Josef
-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T. Pratchett)
==============93D835BFF517F24535E9F592
Content-Type: text/plain; charset=us-ascii;
 name="memtool.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="memtool.c"

# include       <tcl.h>

/*
 * Forward declarations
 */

/* Tcl initialization routine */
int AppInit(Tcl_Interp *interp);

/*
 * External declarations
 */
/* Application specific functions */
int OpenMemCmd(ClientData, Tcl_Interp *, int, char **);
int ReadMemCmd(ClientData, Tcl_Interp *, int, char **);
int LookupCmd(ClientData, Tcl_Interp *, int, char **);
int CloseMemCmd(ClientData, Tcl_Interp *, int, char **);

int
main(int argc, char *argv[])
{
    Tcl_Main(argc, argv, AppInit);

    exit(0);
}

/*
 * AppInit ist called from Tcl_Main (or somwhere below that).
 * Its task is to initialize the tcl interpreter and create/register all
 * commands that we define.
 * AppInit returns TCL_OK if all goes well, else it returns TCL_ERROR.
 */
int
AppInit(Tcl_Interp *interp)
{
    int result;

    /*
     * Initialize packages
     */
    result = Tcl_Init(interp);
    if (result != TCL_OK)
        return result;

    /*
     * Register application-specific commands
     */
    Tcl_CreateCommand(interp, "openmem", OpenMemCmd, (ClientData) NULL,
                                            (Tcl_CmdDeleteProc *) NULL);
    Tcl_CreateCommand(interp, "readmem", ReadMemCmd, (ClientData) NULL,
                                            (Tcl_CmdDeleteProc *) NULL);
    Tcl_CreateCommand(interp, "lookup", LookupCmd, (ClientData) NULL,
                                            (Tcl_CmdDeleteProc *) NULL);
    Tcl_CreateCommand(interp, "closemem", CloseMemCmd, (ClientData) NULL,
                                            (Tcl_CmdDeleteProc *) NULL);

    return TCL_OK;
}

==============93D835BFF517F24535E9F592
Content-Type: text/plain; charset=us-ascii;
 name="appfuncs.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="appfuncs.c"

# include       <tcl.h>
# include       <fcntl.h>
# include       <string.h>

# if !defined(O_BINARY) /* { */
# define        O_BINARY        0
# endif /* } */

/*
 * Constants
 */
const char devmem[] = "/dev/kmem";
const char ksyms[] = "/proc/ksyms";

/*
 * Global data
 */
int mem_fd = -1;
char *devname = (char *) NULL;

int
OpenMemCmd(ClientData cd, Tcl_Interp *interp, int argc, char **argv)
{
    extern int errno;

    switch (argc)
    {
    case 1:
        devname = Tcl_GetVar(interp, "DevMem", 0);
        if (devname == (char *) NULL)
            devname = (char *) devmem;
        break;
    case 2:
        devname = argv[1];
        break;
    default:
        Tcl_SetResult(interp, "usage: ", TCL_STATIC);
        Tcl_AppendResult(interp, argv[0], " ?dev?", (char *) NULL);

        return TCL_ERROR;
    }

    if ((mem_fd = open(devname, O_RDONLY | O_BINARY)) == -1)
    {
        Tcl_SetResult(interp, devname, TCL_VOLATILE);
        Tcl_AppendResult(interp, ": ", Tcl_PosixError(interp), (char *) NULL);
        return TCL_ERROR;
    }

    return TCL_OK;
}

int
ReadMemCmd(ClientData cd, Tcl_Interp *interp, int argc, char **argv)
{
    static unsigned long last_addr = 0;
    int count = 1;
    int tmp, i;
    int result;
    unsigned char *buffer;
    ssize_t nread;

    if (mem_fd == -1)
    {
        Tcl_SetResult(interp, "must openmem first", TCL_STATIC);
        return TCL_ERROR;
    }

    switch (argc)
    {
    case 1: /* Keep last address and count is 1 */
        break;
    case 3: /* New address, count */
        if ((result = Tcl_GetInt(interp, argv[2], &count)) != TCL_OK)
            return result;
    case 2: /* New address, count is 1 */
        /* We have a problem here ... Tcl doesn't know unsigned longs! */
        if ((result = Tcl_GetInt(interp, argv[1], &tmp)) != TCL_OK)
            return result;
        last_addr = * (unsigned long *) &tmp;
        break;
    default:
        Tcl_SetResult(interp, "usage: ", TCL_STATIC);
        Tcl_AppendResult(interp, argv[0], " ?address ?count??", (char *) NULL);
        return TCL_ERROR;
    }

    buffer = (unsigned char *) Tcl_Alloc(count);
    if (buffer == (unsigned char *) NULL)
        return TCL_ERROR;

    if (lseek(mem_fd, last_addr, SEEK_SET) == -1)
    {
        Tcl_SetResult(interp, devname, TCL_VOLATILE);
        Tcl_AppendResult(interp, "(lseek): ", Tcl_PosixError(interp), (char *) NULL);
        return TCL_ERROR;
    }

    nread = read(mem_fd, buffer, count);
    if (nread == -1)
    {
        Tcl_SetResult(interp, devname, TCL_VOLATILE);
        Tcl_AppendResult(interp, "(read): ", Tcl_PosixError(interp), (char *) NULL);
        return TCL_ERROR;
    }

    for (i = 0; i < nread; i++)
    {
        char s[4];      /* max. 3 digits + '\0' */

        sprintf(s, "%d", buffer[i]);
        if (i == 0)
            Tcl_SetResult(interp, s, TCL_VOLATILE);
        else
            Tcl_AppendElement(interp, s);
    }

    return TCL_OK;
}

int
LookupCmd(ClientData cd, Tcl_Interp *interp, int argc, char **argv)
{
    FILE *fp;
    char line[BUFSIZ];
    size_t namelen;
    unsigned int v = 0;

    if (argc != 2)
    {
        Tcl_SetResult(interp, "usage: ", TCL_STATIC);
        Tcl_AppendResult(interp, argv[0], " name", (char *) NULL);
        return TCL_ERROR;
    }

    namelen = strlen(argv[1]);

    fp = fopen(ksyms, "rt");
    if (fp == (FILE *) NULL)
    {
        Tcl_SetResult(interp, (char *) ksyms, TCL_VOLATILE);
        Tcl_AppendResult(interp, ": ", Tcl_PosixError(interp), (char *) NULL);
        return TCL_ERROR;
    }

    while (fgets(line, sizeof(line), fp) != (char *) NULL)
    {
        char *value, *name;
        size_t l;

        /* Discard any NL character at the end */
        l = strlen(line);
        if (line[l-1] == '\n')
            line[--l] = '\0';

        value = strtok(line, " ");
        name = strtok((char *) NULL, " ");

        if (strncmp(name, argv[1], namelen) != 0)
        {
            continue;
        }

        if (name[l] == '\0' || (name[l] == '_' && name[l+1] == 'R'))
        {
            v = strtoul(value, (char **) NULL, 16);
            break;
        }
    }

    fclose(fp);

    sprintf(line, "%d", v);
    Tcl_SetResult(interp, line, TCL_VOLATILE);

    return TCL_OK;
}

int
CloseMemCmd(ClientData cd, Tcl_Interp *interp, int argc, char **argv)
{
    if (mem_fd == -1)
    {
        Tcl_SetResult(interp, "mem is not open", TCL_STATIC);
        return TCL_ERROR;
    }

    if (argc != 1)
    {
        Tcl_SetResult(interp, "usage: ", TCL_STATIC);
        Tcl_AppendResult(interp, argv[0], (char *) NULL);

        return TCL_ERROR;
    }

    close(mem_fd);
    mem_fd = -1;

    return TCL_OK;
}

==============93D835BFF517F24535E9F592
Content-Type: text/plain; charset=us-ascii;
 name="Makefile"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Makefile"

LIBS = -ltcl8.0 -ldl -lm
OFILES = memtool.o appfuncs.o
CFLAGS = -O3
LDFLAGS = -static

memtool:        $(OFILES)
        $(CC) $(LDFLAGS) $(OFILES) $(LIBS) -o memtool

memtool.o:      memtool.c
        $(CC) $(CFLAGS) -c memtool.c

==============93D835BFF517F24535E9F592==


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

From: "Dr. Armin Wittmann" <[EMAIL PROTECTED]>
Subject: unable to determine module loading: 3c90x instead 3c59x
Date: Fri, 06 Oct 2000 08:42:54 GMT



Hi

I am installing a new webserver with SuSE 6.3
Kernel 2.2.13.

I purchased three 3c905C NICs to be inserted additional
to the onboard eepro100 NIC.

With booting, everything is ok but the wrong
module
        3c95x
is loaded.
This module recognizes the 3Com NICs but the
driver does not support them correctly. No
network connection works (ping to and from
host).
With eepro100 everyting is fine.

The correct module would be
        3c90x

My steps to convince the startup process
to load the module were these:

- remove 3c59x.o from /lib/modules/2.2.1
  generate a new modules.dep with moddep
- work in /etc/modules.conf (formely /etc/conf.modules).
  it looks now like this:
        probe 3c59x 3c90x
        above 3c59x 3c90x

        alias eth0 3c90x
        alias eth1 3c90x
        alias eth2 3c90x
        alias eth3 eepro100

        options eth3 options=32
        options eth0 media_select=100BASE_TX full_duplex=0
        options eth1 media_select=100BASE_TX full_duplex=0
        options eth2 media_select=100BASE_TX full_duplex=0

I tried various combinations but nothing worked during normal
boot up. Manually I can shutdown the interfaces deinstall
the module and install the 3c90x without any problem.

The questions:
Where can I get informations how modules are loaded.
I don't think that I have a kerneld running in this
version of SuSE (this fact is mentioned in the manual).

Where does the system find still this 3c59x.o
even I removed it from the directory and renamed it
to "old.3c59x.o.old" in the /root directory?

Most important: How can I succeed to let the kernel
load reliably only the 3c90x module or how can I switch
off the 3c59x module?

I would like to compile a new kernel but I can't choose
the 3c90x.o module in the 'make menuconfig' procedure.
How can I do this?

Do I really need to install the newest 3Com driver?
There is alreay this module in the SuSE distribution
running fine.

Many questions, are there short answers? :-)
Thanks for helping

Armin Wittmann

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

From: Michel Talon <[EMAIL PROTECTED]>
Subject: Re: Problem with ATHLON processor
Date: Fri, 6 Oct 2000 10:15:37 +0200

[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,

> My brother has an Athlon 750 working perfectly with Linux.

> I think the early 2.2.x/2.3.x kernels had a problem which cased a hang.
> (a mtrr bug , I think)

> What kernel are you trying to install?
> or what distribution + revision are u trying to install.

> Richard.

> St�phane CLEMENCEAU wrote:

>> I can't install linux on a athlon processor. How i proceed to pass this
>> problem ?
>>
>> Please help me !!
>>
>> THANKS
>>
>> [EMAIL PROTECTED]
I have installed recently Mandrake 7.1 on a Duron without any problem
whatsoever. Ata 66 disks where recognized, and working full speed.

-- 
Michel Talon

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

From: [EMAIL PROTECTED] (Neal Tucker)
Crossposted-To: comp.os.linux.development.apps,it.comp.os.linux.development
Subject: Re: Text-based user interface development
Date: 6 Oct 2000 01:57:48 -0700

Lew Pitcher <[EMAIL PROTECTED]> wrote:
>Davide Dozza <[EMAIL PROTECTED]> wrote:
>
>>I am developing applications written in C/C++
>
>There is no such language as C/C++. There are two seperate,
>independant, and sometimes incompatable languages, one called C, and
>the other called C++. 

Thanks for enlightening us, Pedantry Man!  Hey, I think I heard someone
say "centrifugal force" in another newsgroup...

-Neal Tucker

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

From: Toon Knapen <[EMAIL PROTECTED]>
Subject: cach-optimisation on SMP
Date: Fri, 06 Oct 2000 12:30:51 +0200

I'm running a heavy calculation code on my  BI-processor pentium Linux
box.
For optimising the speed of the calculations, I'm using a linear algebra
library
that is optimised for cache-size (www.netlib.org/ATLAS).

But the performance on my machine is very low (compared to an almost
identical
one-processor machine).

I have the impression (seen with xosview) that the process constantly
switches from
processor. Of course, this way, cache optimisation will fail totally. I
guess it will be extra slow
due to the time needed for the cache-coherency.

How can I solve this problem. Is it possible to tell the system to run
the process always on the
same processor, or ... ?

Thanks

Toon


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

From: [EMAIL PROTECTED] (Philip Armstrong)
Subject: Re: Safe mail
Date: 6 Oct 2000 08:53:09 +0100

In article <8rj0nd$vc1$[EMAIL PROTECTED]>,  <[EMAIL PROTECTED]> wrote:
>In article <8risga$43f$[EMAIL PROTECTED]>,
>For some reason Deja won't list that one. I even searched explicitly for
>"comp.os.linux.development.app". Odd.

Find a real newsserver then :)

>> err. invoke the 'mail' program? No suid requirements in your code at
>> all...and you can blame the mailx code for any security holes :)
>
>Actually, I had considered that. However, this is a PAM module and so I
>was trying to see if there was another accepted route to travel on this
>one. Oh well.

I doubt it. You could do to all the hassle of finding out the users
mail spool file, appending to it etc etc. But that's a crawling mass
of horrors which I know that *I'd* get wrong *somewhere*. I don't know
of any other way to do it I'm afraid. 

>Would you, or someone, mind posting or pointing me to an example of
>exec()'ing /bin/mail with a message body. I just want to verify I am not
>exposing myself to too much risk.

no code, but make sure you invoke the path explicitly. And don't pass
any untrusted data that hasn't been checked first. (ie *any* data that
your code reads that comes from a source outside your own code.)

This is pretty standard stuff, but I've yet to see a good reference
anywhere. Anyone got any pointers?

>Again, I'm new to writing applications under Linux so thanks for the
>help.

Mostly Linux == Unix, so a good unix programming text will help. I've
mentioned Stevens' 'Advanced Programming in the Unix Environment'
elsewhere in this group. But that won't cover PAM (IIRC). Any good
references anyone?

cheers,

Phil


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


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


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