Linux-Development-Sys Digest #3, Volume #8        Fri, 7 Jul 00 19:13:14 EDT

Contents:
  Re: A good distribution anybody? (Paul Jackson)
  exceptions (Feng QIAN)
  I/O port programming problem ("Chun Seong Ng")
  Device Driver that accesses Kernel memory (Rob Morris)
  Re: Virtual Segments ("Norm Dresner")
  Problems with modules on 2.2.13 [SMP] (Chris J/#6)
  choosing network interfaces (L Stewart)
  Weird behaviour of "route" ("Robichaud, Jean-Philippe [BAN:6S33:EXCH]")
  Re: HowDoI get info out of ./.config? (Harald Schreiber)
  Re: I/O port programming problem ("Norm Dresner")
  Re: choosing network interfaces ([EMAIL PROTECTED])
  Re: copy_to_user Linux-2.2.12 (Richard Bonomo)
  Lint for Redhat 6.1: (Richard Bonomo)
  Re: LD_LIBRARY_PATH problem (Jerry Peters)
  RedHat 6.1 kernel module oddities (Richard Bonomo)

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

From: [EMAIL PROTECTED] (Paul Jackson)
Subject: Re: A good distribution anybody?
Date: 7 Jul 2000 17:21:16 GMT


Kaz suggested:
|> rules-o-sucks-o-meter

Perhaps he meant:

        sucks-rules-o-meter

and that doesn't seem helpful to me -- I find such
for Editors and Operating Systems, the latter of which
informs me that Windows sucks and Linux rules.  But
doesn't distinguish Linux distributions.

I had better luck searching for some such as:

        linux distribution caldera suse mandrake debian slackware corel storm

(left off "Red Hat", since that biased the results too much)

In particular, checkout out Slackware on

        www.sourcemagazine.com/archive/500/feature2.asp

I don't use Slackware myself (preferring more Mandrake
and Caldera) but Source Magazine seems to describe
Slackware as an excellent fit to your preferences.
-- 
-- 
I won't rest till it's the best ...        Software Production Engineer
Paul Jackson ([EMAIL PROTECTED]; [EMAIL PROTECTED]) 3x1373 http://sam.engr.sgi.com/pj

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

From: Feng QIAN <[EMAIL PROTECTED]>
Subject: exceptions
Date: Fri, 07 Jul 2000 17:44:58 GMT


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

Does anyone know the protected memory address space of Linux. Like
accessing zero memory will trap on OS. I want to know the exact address
range.

Please reply to [EMAIL PROTECTED]

Thanks in advance,
=====================
Feng Qian



==============418EB354B6A46A64D6FDD263
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
Does anyone know the protected memory address space of Linux. Like accessing
zero memory will trap on OS. I want to know the exact address range.
<PRE>Please reply to [EMAIL PROTECTED]</PRE>

<PRE>Thanks in advance,
=====================
Feng Qian</PRE>
&nbsp;</HTML>

==============418EB354B6A46A64D6FDD263==


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

From: "Chun Seong Ng" <[EMAIL PROTECTED]>
Subject: I/O port programming problem
Date: Fri, 7 Jul 2000 16:45:09 +0100

Hey all, I've problem in progrsmming I/O port. My question is:

Is there any other header file for I/O ports programming besides asm/io.h?

Cause I cannot find outb, inb and etc in asm/io.h file but I can find __OUT,
__IN and etc in it.

Thanks

Regards
Chun Seong



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

From: Rob Morris <[EMAIL PROTECTED]>
Subject: Device Driver that accesses Kernel memory
Date: Fri, 07 Jul 2000 11:45:47 -0700
Reply-To: [EMAIL PROTECTED]

Hello,

I would like to create a device driver that allows me to look at kernel
memory.  Specifically, I want to somehow look at an array that is
created and maintained within kernel memory space.  I need to look at it
from shared memory.  Is there any handy C command that allows you to do
this?  If someone has some code example that would be great!! I would
appreciate any help in this area if you could get me some information.

Thanks,
Rob Morris


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

Reply-To: "Norm Dresner" <[EMAIL PROTECTED]>
From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: Virtual Segments
Date: Fri, 07 Jul 2000 18:57:40 GMT

Briefly, I'm trying to give my C-language device-driver the layout of the
dual-ported memory on a certain card.  I wanted to do this by telling the
program exactly where things were located on the card, but not by creating
pointers.  This is "easy" in MS-DOS and I asked how to do it in Linux.

Kaz Kylheku <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Thu, 06 Jul 2000 18:12:38 GMT, Norm Dresner <[EMAIL PROTECTED]> wrote:
> >I think that I can do this with  NASM's ABSOLUTE declaration.  Is this
true?
> >Can I do this in any other assembler which is compatible with gcc?  If
so,
> >which
> >one(s)?
> >
> >(Although I've never found it, does such a capability exist within gcc
> >itself?
>
> Reading the GNU info pages on gcc, particularly the sections that describe
> the language extensions.
>
> The __attribute__ (( section ("section-name" )) extension  is what you
> are looking for. The documentation states that:
>
>     Normally, the compiler places the objects it generates in sections
>     like `data' and `bss'. Sometimes, however, you  need additional
>     sections, or you need certain particular variables to appear in
>     special sections, for example to map to special hardware.
>
> Now the actual sections have to be set up using a linker script. For that,
jump
> to the GNU info about ``ld''.  There is a linker script command called
> SECTIONS in which you can define sections and associate them with
> virtual addresses and give them other attributes.
========================================================


I've tried to do that (as best as I can), but it's not quite working yet.
What I see is that the compiler and linker seem to be doing their jobs (see
output of objdump below) and putting the segment .DPM at 0x000D0000 but
insmod seems to be ignoring the linker's output.  I've checked this by
putting in a few debug-only ioctl() calls that pass back addresses and data.
The loaded module has the segment .DPM right after it's last "normal"
segment, not at 0x000D0000 as I tried to specify.

(I've also tried using the AT () specification as part of the linker-script
and I've tried to omit (NOLOAD).  Neither of these has any positive effect.)

 Here's what I've done and gotten so far:

================================================
CONTENTS OF THE LD-SCRIPT FILE  (ldcmds)
SECTIONS {
   .text    : { *(.text) }
  .data     : { *(.data) }
  .bss     : { *(.bss) }
  .note     : { *(.note) }
  .comment    : { *(.comment) }
  .DPM  0x000D0000  (NOLOAD)  :   { *(.DPM) }
   }
=================================================
CONTENTS OF THE C-MODULE DEFINING DualPortedMemory (dpm.c)

unsigned char  __attribute__ ((section (".DPM" ) ) )
     DualPortedMemory[2]={0x68,0x89};
================================================
COMMANDS (extracted from Makefile)

 cc -c dpm.c

 $(LD) -r -T ldcmds  -o acl.o  ... dpm.o ...
===============================================
THIS IS THE OUTPUT OF  # objdump --header  acl.o
acl.o:     file format elf32-i386

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000b50  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  1 .rodata       0000055f  00000000  00000000  00000b84  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .data         00000500  00000560  00000560  000010e4  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, DATA
  3 .bss          00000014  00000a60  00000a60  000015e4  2**2
                  ALLOC
  4 .note         0000008c  00000a74  00000a74  000015e4  2**0
                  CONTENTS, READONLY
  5 .comment      0000008c  00000b00  00000b00  00001670  2**0
                  CONTENTS, READONLY
  6 .DPM          00000002  000d0000  000d0000  000016fc  2**0
                  ALLOC
=================================================
HERE'S HOW THE ADDRESS OF DualPortedMemory is referenced

extern  byte __attribute__ ((section (".DPM" ) ) )  DualPortedMemory[];

...

// code to pass these addresses back to the ioctl-caller
  ... &DualPortedMemory[0] ...
  ... DualPortedMemory ...


I'd appreciate any and all constructive suggestions.

    Norm



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

From: [EMAIL PROTECTED] (Chris J/#6)
Crossposted-To: comp.os.linux.misc
Subject: Problems with modules on 2.2.13 [SMP]
Reply-To: [EMAIL PROTECTED]
Date: 7 Jul 2000 20:02:14 +0100

[excuse crosspost -- dunno if its technical enough for development.system.
        apols if off-topic].

Hiya,

I have a problem - one that I've been unable to find an answer for in
several hours of on-and-off experimentation and numerous kernel builds.

There is, at work, a Dell Poweredge, Dual PIII 450, Megaraid RAID, bags
of memory and disk etc etc. But I've been unable to get modules to insert
into the kernel, with messages from insmod "unresolved symbol". The system
is a RedHat 6.1 Deluxe installation...and its the supplied Redhat kernel.
Personally, I'd like to blow it away and stick a stock non-vendor-modified
2.2.14 on it, but I've been told not to do that... *sigh*.

Here is, for example, the output of "insmod loop":

/lib/modules/2.2.13-0.13/block/loop.o: unresolved symbol best_memcpy
/lib/modules/2.2.13-0.13/block/loop.o: unresolved symbol best_memset
/lib/modules/2.2.13-0.13/block/loop.o: unresolved symbol best_copy_to_user
/lib/modules/2.2.13-0.13/block/loop.o: unresolved symbol best_copy_from_user

Now, from what I can tell, these are standard kernel functions, and whats
more, "grep best_mem /boot/System.map" reveals ...

c0220384 T best_memcpy
c022040f t best_memcpy_final
c0220437 T best_memset
c02204bf t best_memset_final
c0265fe0 ? __kstrtab_best_memcpy
c0266000 ? __kstrtab_best_memset
c026d7b0 ? __ksymtab_best_memcpy
c026d7b8 ? __ksymtab_best_memset

So its in the kernel...however,  I'm wondering if there is some obfuscation
going on somewhere, as doing ksysms -a and feeding that through grep reveals

c0220384  best_memcpy_R__ver_best_memcpy  
c0220437  best_memset_R__ver_best_memset  

Both at the same offset as the output from System.map ... is this causing
the problem -- same symbol but different name ?

Basically, module loading is broken and I can't figure out whats gone wrong.
Yes, I've done from clean, zapped the modules tree before a make
modules_install.

depmod -a fails everytime (unresolved symbols in every module), so its well
and truely fubar'd.

Suggestions on a postcard?

Thanks,

Chris...


-- 
@}-,'--------------------------------------------------  Chris Johnson --'-{@
    / "(it is) crucial that we learn the difference / [EMAIL PROTECTED]  \
   / between Sex and Gender. Therein lies the key  /                       \ 
  / to our freedom" -- LB                         / www.nccnet.co.uk/~sixie \ 

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

From: L Stewart <[EMAIL PROTECTED]>
Subject: choosing network interfaces
Date: 7 Jul 2000 19:18:38 GMT


Hi all,

I'm working on a TCP/IP traffic generator for multi-homed linux boxen, and
I've come to the point where I need to be able to specify which interface
traffic goes out of. My current attempt, a SIOCGIFINDEX ioctl (code taken
from ping), doesn't seem to be working. I start up a server and have two
clients, both on the same box (not same as server) but each with a
different interface chosen, connect to the server. The output of netstat
shows that the two clients are attached to the same local address. :(

Am I doing the right thing? Any tips on how to choose interfaces would be
greatly appreciated!! Thanks,

Liam

-- 
Liam Stewart
E-Mail: [EMAIL PROTECTED]

"It is not enough to be busy, so are the ants. The question is: what are
we busy about?"
-Henry David Thoreau

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

From: "Robichaud, Jean-Philippe [BAN:6S33:EXCH]" <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development.apps,linux.redhat.development,comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.setup
Subject: Weird behaviour of "route"
Date: Fri, 07 Jul 2000 15:15:48 -0400

        Hi, I have a Redhat 6.1 Linux distribution installed.  My computer have
2 ethernet cards : eth0, eth1.  Normally, my default gateway is defined
for eth0.  I do an ifconfig eth0 down and "route del default".  When I
do "route", it report the correct routes.  If I do "route add default gw
XX.XXX.XX.XX eth1", no error are reported.  

        Then, If I try to ping inside the subnet address, or outside, I get
unreachable host...  If I try "route" it report the correct route except
that the default gateway never apear (it just wait for ever without
doing anything).  If I do a cat /proc/net/route, I see the correct
entries : a default gateway is correctly configure for eth1.  What is
that ???

I have try doing this in every order, leaving time between commands so
the system have time to get "in sync" (if it needs to).  Still, it just
look like I can't use my second interface...

        Please help me !  

        Thanks.


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

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

From: Harald Schreiber <[EMAIL PROTECTED]>
Subject: Re: HowDoI get info out of ./.config?
Date: 07 Jul 2000 22:13:17 +0200

Myint <[EMAIL PROTECTED]> writes:

> I am learning. Menuconfig got a lot of questions to answer to configure.
> I have a distribution installed. Can any one help me how to get or what was 
> configured in that distribution.
> 
> Thanks,
> Myint
> 
 This depends on the distribution you are using. With SuSE 6.4
 you can simply type "zless /proc/config.gz" to see what was
 configured in your kernel. But this won't work with other
 distributions.

 HTH
 Harald

-- 
===================================================================
Dipl.-Math. Harald Schreiber, Nizzaalle 26, D-52072 Aachen, Germany
Phone/Fax: +49-241-9108015/6      mailto:[EMAIL PROTECTED]
===================================================================

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

Reply-To: "Norm Dresner" <[EMAIL PROTECTED]>
From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: I/O port programming problem
Date: Fri, 07 Jul 2000 20:38:45 GMT

What do you mean you can't find outb, etc?  They're #define-ed in asm/io.h.
Are you compiling with -O2 to get inline functions expanded?  What error
messages do you get?

    Norm

Chun Seong Ng <[EMAIL PROTECTED]> wrote in message
news:8k54o2$o1h$[EMAIL PROTECTED]...
> Hey all, I've problem in progrsmming I/O port. My question is:
>
> Is there any other header file for I/O ports programming besides asm/io.h?
>
> Cause I cannot find outb, inb and etc in asm/io.h file but I can find
__OUT,
> __IN and etc in it.
>
> Thanks
>
> Regards
> Chun Seong
>
>


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

From: [EMAIL PROTECTED]
Subject: Re: choosing network interfaces
Date: Fri, 07 Jul 2000 21:26:59 GMT

On 7 Jul 2000 19:18:38 GMT L Stewart <[EMAIL PROTECTED]> wrote:

| I'm working on a TCP/IP traffic generator for multi-homed linux boxen, and
| I've come to the point where I need to be able to specify which interface
| traffic goes out of. My current attempt, a SIOCGIFINDEX ioctl (code taken
| from ping), doesn't seem to be working. I start up a server and have two
| clients, both on the same box (not same as server) but each with a
| different interface chosen, connect to the server. The output of netstat
| shows that the two clients are attached to the same local address. :(
|
| Am I doing the right thing? Any tips on how to choose interfaces would be
| greatly appreciated!! Thanks,

Which interface the traffic goes out depends in the routing.  If you have
two paths to the same address, it's going to choose the best one.  The
route can change even while the source address binding is the same, and
it still works as long as the return route works one way or the other.
If you need to do stuff like testing both paths, you need to identify
each path by means of a different destination address for each.

It would be nice if Linux had an integrated network policy system which
allowed making all network decisions (firewall, routing, bridging, etc)
based on any criteria of any packet or frame.  But such a thing is not
in any kernel I've seen.

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

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

From: Richard Bonomo <[EMAIL PROTECTED]>
Subject: Re: copy_to_user Linux-2.2.12
Date: Fri, 07 Jul 2000 17:25:42 -0500

Rick Ellis wrote:
> 
> In article <[EMAIL PROTECTED]>,
> Richard Bonomo  <[EMAIL PROTECTED]> wrote:
> 
> >I am writing a device driver, and have not
> >yet been able to fathom how the system
> >call copy_to_user is supposed to be called.
> >
> >Is it copy_to_user(pointer to kernel buffer,
> >pointer to user buffer, # of bytes) or is
> >it something else.
> 
> All you need to do is look at a driver source.  It's
> copy_to_user(pointer to user buffer, pointer to kernel buffer, size);
> 
> --
> http://www.fnet.net/~ellis/photo/linux.html

Thanks!
I finally got it.  I found it very helpful not
to get the "to-from" order confused....  :-)

-- 
************************************************
Richard Bonomo
UW Space Astronomy Laboratory
ph: (608) 263-4683 telefacsimile: (608) 263-0361
SAL-related email: [EMAIL PROTECTED]
all other email: [EMAIL PROTECTED]
web page URL: http://www.cae.wisc.edu/~bonomo
************************************************

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

From: Richard Bonomo <[EMAIL PROTECTED]>
Subject: Lint for Redhat 6.1:
Date: Fri, 07 Jul 2000 17:34:13 -0500


As far as I can tell, RedHat 6.1 did not
come with "lint."

If it did, could someone tell me where to find it?
If it did not, could someone tell me where I might
find a download on the net?

Rich B.

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

From: Jerry Peters <[EMAIL PROTECTED]>
Subject: Re: LD_LIBRARY_PATH problem
Date: Fri, 07 Jul 2000 22:42:08 GMT

Gary Knopp <[EMAIL PROTECTED]> wrote:

> I just installed RedHat Linux 6.2 (2.2.14-12).  When I try to
> compile a C++ program, I get an error that it can't find any of the
> X libraries.   The library path '/usr/X11R6/lib' is in the /etc/ld.so.conf.
> If I set the LD_LIBRARY_PATH=/usr/X11R6/lib,  I still get an error.
> If I issue the env command I can see that LD_LIBRARY_PATH has
> been set, however the only way to get my program to compile is to hard
> code the lib path in my makefile.

> What am I doing wrong?

Nothing. AFAIK LD_LIBRARY_PATH is for the _dynamic_ linker, ld.so. For ld
you need to specify the libraries in the command line.






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

From: Richard Bonomo <[EMAIL PROTECTED]>
Subject: RedHat 6.1 kernel module oddities
Date: Fri, 07 Jul 2000 17:39:31 -0500


I am writing a device driver for RehHat 6.1
(kernel version 2.2.12).

I have found, so far that:

"ioremap" is not recognized.  I have to 
call "__ioremap" with an additional parameter.
For some reason the definition is not taking.

While calls to "inb" and "outb" worked just fine
in a privileged user program, and while gcc -c <name>
produces no errors, attempts to load the module
(with insmod) immediately generates messages to the
effect that outb and inb are not recognized symbols (!!).

Can anyone enlighten me?

Rich B.

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


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