Linux-Development-Sys Digest #827, Volume #7      Sat, 6 May 00 17:13:15 EDT

Contents:
  Re: Real Time Programming in Linux (Markus Kossmann)
  Re: compiling with libc5 under a glibc2 system (Allin Cottrell)
  Re: process that uses a module (Yung-Hsiang Lu)
  Re: Linux memory management changes from 2.0.x -> 2.2.x (Ferriere65)
  Not able to send the packet ([EMAIL PROTECTED])
  a doubt about kernel and vm w.r.t device driver ([EMAIL PROTECTED])
  Telnet-like application (Matthias Kempa)
  Re: what is "BSS"? (Larry Blanchard)
  Re: Need to find my IP address ("smylie")
  memory hole (Simone Contini)
  Re: Need to find my IP address (Tobias Anderberg)
  Memory Hole (Simone Contini)
  Re: Memory Hole (Robert Redelmeier)
  LILO Win+Linux on an old system (Paul D. Smith)
  Re: Linux system went dead suddenly (Scott Johnson)
  Re: Need help on a Code Launcher project (John Reiser)
  How can an app place a frame in an interface's rx queue? (Michael Evangelista)
  Re: How can an app place a frame in an interface's rx queue? (Kaz Kylheku)
  Re: Need to find my IP address (Chris)

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

From: Markus Kossmann <[EMAIL PROTECTED]>
Subject: Re: Real Time Programming in Linux
Date: Fri, 05 May 2000 21:02:19 +0200

Simon Wakley wrote:
> 
> I am porting a robotic controller system to linux, and my program has to
> spew out data over the parallel port every 20ms.  It does not have to be
> exactly every 20ms, but it must average exactly that.  I have tried
> starting a high priority thread from my XWindows app, but it does not
> run at very high priority and gets blocked when I do some windows
> intensive activity.
Have a look at RTLinux ( http://rtlinux.com/ ).

--
Markus Kossmann                                    
[EMAIL PROTECTED]

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

From: Allin Cottrell <[EMAIL PROTECTED]>
Subject: Re: compiling with libc5 under a glibc2 system
Date: Fri, 05 May 2000 23:47:21 -0400

Eric GAUDET wrote:
> 
> "H.J. Lu" <[EMAIL PROTECTED]> wrote:

> > gcc-libc5-2.95.3-0.20000413.1.i386.rpm
> > gcc-libc5-c++-2.95.3-0.20000413.1.i386.rpm
> > gcc-libc5-g77-2.95.3-0.20000413.1.i386.rpm
> > gcc-libc5-objc-2.95.3-0.20000413.1.i386.rpm
> 
> Thank you for this non-information ! Have you even read the question ?
> (and why the heck would one install g77 and objc for C programming ?)

Obnoxious twerp.  H. J. Lu provided a link to just what the OP
wanted, namely a C compiler that is set up to generate libc5 code,
on a machine running glibc2 -- and in convenient rpm format.
Of course you don't have to d/l the g77 and objc components if
you're not going to use them.

Allin Cottrell

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

From: Yung-Hsiang Lu <[EMAIL PROTECTED]>
Subject: Re: process that uses a module
Date: 6 May 2000 05:59:08 GMT


Isn't it true that somehow somewhere in the kernel, the reverse (from
device module to the process) mapping exisits?  The kernel has to know
which process is using a module, right?  Otherwise, how can the kernel
send the result back to the right process?  I guess your message is
saying that it is painfully hard to get it.


Kaz Kylheku <[EMAIL PROTECTED]> wrote:
: On 1 May 2000 21:24:10 GMT, Yung-Hsiang Lu <[EMAIL PROTECTED]> wrote:
:>Hi,
:>
:>What is the best way to find out which process is using a particular
:>module? 

: This isn't really a concept in the Linux kernel. It's the kernel as a whole
: that is using a module. This information is condensed into a simple reference
: count, from which it's not possible to map back to the reference holders.

: With a driver that supports filesystem access, you could figure out who is
: using it if you knew all the currently open file descriptors which reference
: it. Or if it is a block device with a fs mounted on it, you can determine which
: processes have their root or current directories in that fs.

:>Suppose I want to get the utilization of a device (network
:>card) on a per process base.  For example, I would like to know how
:>much time the card is sending packets for a web browser vs. telnet
:>vs. idle.

: For network drivers in particular, there is no way to determine a using
: process.  Network drivers are used by network stacks. Stacks are in turn used
: by socket descriptors which are used by processes.  There are several layers of
: abstraction between applications and network drivers.

: Note that a given socket descriptor can be cloned among processes, and that a
: given socket can communicate with different devices over its lifetime: datagram
: sockets can blast each packet to a different network, and the routing layer can
: rewire a live TCP connection to go over an alternate route.

:>Is the "current" pointer the answer to this question?  Thanks!

: The current pointer is an answer to a question, but not that one.

: It's the answer to the question ``In which task's context am I executing now?''.

: -- 
: #exclude <windows.h>

-- 
                                                   Sincerely,
                                                   Yung-Hsiang Lu
                                                   [EMAIL PROTECTED]


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

From: [EMAIL PROTECTED] (Ferriere65)
Subject: Re: Linux memory management changes from 2.0.x -> 2.2.x
Date: 06 May 2000 06:13:40 GMT

>> Another difference that I noticed about the kernel is that code kernel =
>segment
>> and data kernel segment are no longer based at 0xC0000000 but instead l=
>ike
>> user's segments at 0x00000000.
>> This could lead to security problems ... on x86 architectures
>




Well, I was thinking about possibles IDT and GDT-LDT attacks : 
The two conditions to do this are :
1- access to GDT-LDT or IDT to install a gate .(not directly possible GDT and
IDT are in kernel segments)
2- the segments concerned by the gate (kernel and user segments) must have a
common address space.
The second condition is now effective on kernel 2.2x.

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

From: [EMAIL PROTECTED]
Subject: Not able to send the packet
Date: Sat, 06 May 2000 07:05:51 GMT

Hello,

This is a char driver..in which i need send the pkts to the particular
host and chk the response...for recv dev_add_pack is there..
this is at ICMP level..in send routine I have formed the ICMP hearder,
IP header now I am not able to find the routine which will send this
packet out..Can any one please help me..

Regards,
Bhagyashree


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: [EMAIL PROTECTED]
Subject: a doubt about kernel and vm w.r.t device driver
Date: Sat, 06 May 2000 08:11:40 GMT

respected sir(s),
                   i am trying to develop a new driver for intellimouse
under
linux(caldera ,kde,kernel ver 2.2.5). i read from the online manual
'the linux kernel' that kernel does not run from virtual memory,it runs
from real memory i.e no address tranlation takes place. i have two
problems
 (1). i could not get proper intellimouse protocol specification with a
brief
        explanation.
  (2). i would like to map the wheel movements to up or down arrow keys
         so i need to access the keyboard buffer (a 32 byte memory area
         starting around 0x410 or near).i tried this in the
initialisation part
         of a kernel module, char *p=(char *)0x412. and when i
         dereference it i get segmentation fault (i tried this because
kernel
          runs in real memory). how can i fix this.
          any other logic for achieving the mapping of wheel with up or
          down arrow keys at the driver level is highly appriciated.

i think the keyboard buffer lies in BIOS area of primary memory so it is
os independent.
 i use a PII machine.this mapping can easily be done in MS-DOS.
   i need your help.pleeeeeeease.
mailto:: [EMAIL PROTECTED]


Sent via Deja.com http://www.deja.com/
Before you buy.

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

From: Matthias Kempa <[EMAIL PROTECTED]>
Subject: Telnet-like application
Date: Sat, 06 May 2000 10:27:52 +0200

Hi,

I made an application with the help of Qt 1.44 library.
Now I want to add some functions to connect to another
server via telnet. Is there somewhere a good documentation
so that I can find out, how to get connected?

Thanks

Matthias

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

From: Larry Blanchard <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: what is "BSS"?
Date: Fri, 05 May 2000 08:30:06 -0700

Josef Moellers wrote:
> 
> JKFang wrote:
> >
> > What does it mean by "Cleaning BSS" ?
> > This question comes when reading some document about linux kernal.
> 
> AFAIK "BSS" is an acronym for "block starting segment",
> whateverthatmeans.
> 

Actually, it started out as an assembler pseudo-op and meant "block
started by symbol."  Thus "ABC   BSS   100"  got you a block of a
hundred storage units which could be addressed as ABC, ABC+1, etc..

-- 
Larry Blanchard
"Anyone who wants to be elected shouldn't be" - Will Rogers

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

From: "smylie" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Need to find my IP address
Date: Sat, 6 May 2000 22:39:31 +1200

The only way i've been able to do it so far is by calling system("ifconfig
ppp0"), and then parsing the result to get the ip. This however strikes me
as a particularly inelegant and round-about solution.
there must be a better way.
any ideas anyone?

smylie
"G. Roderick Singleton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Doug Schulz wrote:
> >
> > I have a sockets program an need to find the IP address of the machine
> > the program is being run from so I can bind the socket to the correct
> > address/port.  I have tried using gethostname coupled with gethostbyname
> > and I can only get 127.0.0.1 (localhost address).  I want to find the
> > actual IP address of the machine.  Is there a way of doing this.  Any
> > help would be great.
> >
> > FYI this is a UDP app.
> >
> > Thanks,
> >
> > Doug
>
>
> man -k inet
> --
>
____________________________________________________________________________
____
> G. Roderick Singleton, <[EMAIL PROTECTED]> PATH tech,
> 71 Underhill Drive, Unit 159, Toronto, ON  M3A 2J8
> Voice : 416-452-4583 Fax: 416-452-0036 Toll Free: 1-888-354-PATH
>
____________________________________________________________________________
____
>
> *** Notice To Bulk Emailers: Attention!  Pursuant to US Code, Title 47,
> Chapter 5, Subchapter II, 227, any & all unsolicited commercial e-mail
> sent to this address is subject to a download and archival fee in the
> amount of the $1500 US and copies will be forwarded to domain
> administrators.  Emailing denotes acceptance of said terms!



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

From: Simone Contini <[EMAIL PROTECTED]>
Subject: memory hole
Date: Sat, 06 May 2000 16:40:09 +0200

Can I enable memory hole at 15-16Mb (from BIOS) and use the remaining
memory with kernel 2.2.14?

now if I enable memory hole I can use only first 15Mb...

Thanks

Simone Contini
Game & Tool Programmer
Florence - Italy

Email: [EMAIL PROTECTED]
WWW: http://gpi.eden.it/3dfx4ever/
     http://scontini.monrif.net/

ICQ # : 25879128


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

From: [EMAIL PROTECTED] (Tobias Anderberg)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux,comp.os.linux.misc
Subject: Re: Need to find my IP address
Reply-To: [EMAIL PROTECTED]
Date: Sat, 6 May 2000 17:51:38 +0200

Doug Schulz <[EMAIL PROTECTED]> wrote:
>I have a sockets program an need to find the IP address of the machine
>the program is being run from so I can bind the socket to the correct

This function fetches the IP associated with eth0:

static char *
get_ip(void)
{
        int fd;
        struct ifreq i;
        
        fd = socket(AF_INET, SOCK_DGRAM, 0);
        strncpy(i.ifr_name, "eth0", 5);
        ioctl(fd, SIOCGIFADDR, (int) &i);
        close(fd);
        
        return (char *)inet_ntoa(((struct sockaddr_in *)
                &i.ifr_addr)->sin_addr);
}        

/tobias
-- 
"There's no trick to it, it's just a simple trick!"
                        - Goodman, The Simpsons

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

From: Simone Contini <[EMAIL PROTECTED]>
Subject: Memory Hole
Date: Sat, 06 May 2000 18:29:58 +0200

Hello!

Can I enable memory hole at 15Mb - 16 Mb (in BIOS) to map a ISA card and
use all the remaining memory for the S.O.?

at the moment with the kernel 2.2.14 I can only use the first 15Mb of
RAM.

Simone Contini
Game & Tool Programmer
Florence - Italy

Email: [EMAIL PROTECTED]
WWW: http://gpi.eden.it/3dfx4ever/
     http://scontini.monrif.net/

ICQ # : 25879128

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

From: Robert Redelmeier <[EMAIL PROTECTED]>
Subject: Re: Memory Hole
Date: Sat, 06 May 2000 13:17:22 -0500

Simone Contini wrote:
> Can I enable memory hole at 15Mb - 16 Mb (in BIOS) to map a ISA card and
> use all the remaining memory for the S.O.?
> 
> at the moment with the kernel 2.2.14 I can only use the first 15Mb of
> RAM.

This is due to  relying on memory autodetection.  You could
give `mem=64M` [or whatever] at the bootprompt.  Linux will use 
whatever you tell it.  However, operation will be unstable if 
there isn't unique working RAM over the whole address space.

If your ISA card covers the entire memory hole with it's RAM,
then there shouldn't be any problem.  Or if your device driver
requests and blocks the entire hole, but only uses the RAM areas,
then you should be fine.  

But if there are "holes" or echoed RAM, sooner or later, Linux
will try to use them, and some process is going to go haywire.

-- Robert

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

From: [EMAIL PROTECTED] (Paul D. Smith)
Subject: LILO Win+Linux on an old system
Date: 06 May 2000 15:11:06 -0400
Reply-To: [EMAIL PROTECTED]

I'm about to get a cablemodem, and I want to set up an old P100 I have
in my basement as a firewall/gateway.  The thing is an old Gateway circa
1995, with 32M RAM, 4 PCI slots, and 3 ISA slots.  It has a 1G drive and
some crusty old IDE CDROM.  I also have an old 2G drive in my "spare
parts" bin.

I put W98SE on the 1G drive as the master on IDE1 (I need both at least
initially, since I need Windows so the cablemodem guys are happy).

When I first installed it I had the cdrom as the master on IDE2 and the
2G Linux disk as the slave on IDE2 (the cabling wouldn't reach to put
both disks on IDE1).

That didn't work; I installed LILO in the MBR and when I tried to boot
it just printed "01 01 01 01 01" forever.  So, I read the LILO docs and
mini-howto, found a longer IDE cable, and moved the 2G drive to be the
slave on IDE1, since it said older BIOS doesn't allow booting off of
anything but the first two drives.

I reconfigured LILO to boot from /dev/hdb1 instead of /dev/hdd1 and
re-reran lilo to install it in the MBR.

Now when I try to boot, it prints one "LI" per line, over and over
forever and still doesn't boot.  I'm using a floppy to boot for now, and
that works, but I really want to boot from HD.

My C: drive is the whole 1G drive, and that works OK.  My root partition
(/dev/hdb1) is 200M.

Anyone have any thoughts on this?  Do both boot partitions have to be on
hda?  Do I have to remove my Windows partition and make a small 80-100M
Linux root partition at the beginning of /dev/hda?  From my reading it
seems I won't be able to boot off of a partition at the _end_ of a 1G
drive, so I can't just use fips to shorten the Windows partition?

Any other thoughts or help?

-- 
===============================================================================
 Paul D. Smith <[EMAIL PROTECTED]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
===============================================================================
   These are my opinions---Nortel Networks takes no responsibility for them.

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

From: Scott Johnson <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: Linux system went dead suddenly
Date: Sat, 06 May 2000 12:42:05 -0700

M Sweger wrote:
> 
> Your system just did a kernel Oops (similar to GFP in Msoft windows).
> Use ksymoops, this file with all the blah blah, and the System.map file
> to decode the namess to addresses. Based on the symbol names it should
> give you a clue as to what area of the kernel is bombing out. Then
> send the output of ksymoops to the kernel mailing list.

Not to be picky...but an "oops" (as well as a kernel panic)
is the Linux equivalent of the Blue Screen of Death.  Not a GPF.
Oopses, panics, and the BSOD all mean the entire system has crashed.

The Linux equivalent of a GPF would be a segmentation violation.
In both cases, the offending process dies, but the kernel continues
working.


> Also state what redhat version and what you were doing or any particular
> tools/setups so that it can be reproduced.
> 
> Good luck.
> 
> yh ([EMAIL PROTECTED]) wrote:
> : i've encountered this strange "phenomenon" recently on my 2-way linux (with
> : redhat distri) box. 2-way, coz it's a gateway connected to 2 networks,
> : with some ipchains rules running. i usually left the box running overnite.
> : seldom reboot unless i made changes to the sys conf that req'd rebooting.
> 
> : the strange thing was that the linux system just crashed for unknown reason
> : to me. it's just posted a screen dump of this messages:
> :   CPU:0
> :   EIP:0010:[<c358fc20>]
> :   EFLAGS: 00010a86
> :   eax: 00000240 ebx: 00000240 ecx: 00000000 edx: b8660cf8
> :   esi: 000005a6 edi: c20d8db8 ebp: c20d8812 esp: c0217d28
> :   ds: 0018 es: 0018 ss: 0018
> :   Process swapper ...blah blah blah
> :   stack: ...blah blah blah...
> :   Call trace: [<c014b2f9>] .... blah blah blah
> 
> : This system failure occurred to me a few times, i could do anything
> : besides resetting the system. everytime, the string of nos. are different.
> : except for the first few set of "Call trace" nos. which have some
> : similarity pattern in the few occasions.
> 
> : i tried ping (from another system) to see if there's response, nope, it
> : just went dead. Have anyone encountered this before? Please enlighten me
> : if u've encountered anything like that. If u've some ideas or tots to help
> : me rectify this strange phenomenon, pls pitch feel free to pitch in.
> 
> : thanks!
> 
> : --
> : Posted via CNET Help.com
> : http://www.help.com/
> 
> --
>         Mike,
>         [EMAIL PROTECTED]

-- 
========================================================================
Scott Johnson          Patriot, Beer-Drinker, Geek            GO BLAZERS
Don't take yourself too seriously.  Nobody else does.........
========================================================================

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

From: John Reiser <[EMAIL PROTECTED]>
Subject: Re: Need help on a Code Launcher project
Date: Sat, 06 May 2000 13:18:52 -0700

How much do you really need to be in kernel mode?  Why not just attach
to the process as a debugger ("gdb a.exe pid", or perhaps use
/proc/<pid>/exe and /proc/<pid>/mem, and maybe /proc/<pid>/maps, etc.),
use ptrace() and/or /proc/<pid>/mem to force the process to execute a few
mmap() calls, and then invoke the mapped code.  Then you instruct the process
to do to itself, anything you wish.
 
-- 
John Reiser, [EMAIL PROTECTED]

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

From: Michael Evangelista <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: How can an app place a frame in an interface's rx queue?
Date: Sat, 06 May 2000 15:22:50 -0500

Hello,

For the purpose of building a simple bridge, I am looking for a way for
an application to place a frame in the incoming queue for a particular
interface, making it appear as if it came off that interface's wire.
Writing a frame to the interface using SOCK_PACKET does not accomplish
this. Is there any nice way for an app to get a datagram to an
interface's in-queue (i.e., get a frame to dev_loopback_xmit)?

I've examinged the briding code in Linux. Presumably, it too must pass a
frame destined for the local machine up to to the correct interface
regardless of the physical interface over which it arrived (e.g., a
machine on segment B ARPs your interface that is connected to segment
A). However, the code in br.c only calls dev_queue_xmit() -- the same
call invoked by packet_sendmsg_spkt() which doesn't seem to solve my
problem.

Does anyone have any suggestions?
Thanks,
mhe

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.networking
Subject: Re: How can an app place a frame in an interface's rx queue?
Reply-To: [EMAIL PROTECTED]
Date: Sat, 06 May 2000 20:52:10 GMT

On Sat, 06 May 2000 15:22:50 -0500, Michael Evangelista <[EMAIL PROTECTED]>
wrote:
>Hello,
>
>For the purpose of building a simple bridge, I am looking for a way for
>an application to place a frame in the incoming queue for a particular
>interface, making it appear as if it came off that interface's wire.
>Writing a frame to the interface using SOCK_PACKET does not accomplish
>this. Is there any nice way for an app to get a datagram to an
>interface's in-queue (i.e., get a frame to dev_loopback_xmit)?
>
>I've examinged the briding code in Linux. Presumably, it too must pass a
>frame destined for the local machine up to to the correct interface
>regardless of the physical interface over which it arrived (e.g., a

I don't see why. A bridge copies frames from one interface to another.
Why would it have to fake input?

>machine on segment B ARPs your interface that is connected to segment
>A).

In this case the bridge simply has to answer the ARP request and shove
it down the appropriate interface. Logic similar to Proxy ARP can
take care of this.

-- 
#exclude <windows.h>

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

From: [EMAIL PROTECTED] (Chris)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux,comp.os.linux.misc
Subject: Re: Need to find my IP address
Date: Sat, 06 May 2000 21:06:50 GMT

On Sat, 6 May 2000 17:51:38 +0200, [EMAIL PROTECTED] (Tobias Anderberg)
wrote in comp.os.linux.development.apps:

>       int fd;
>       struct ifreq i;
>       fd = socket(AF_INET, SOCK_DGRAM, 0);
>       strncpy(i.ifr_name, "eth0", 5);
>       ioctl(fd, SIOCGIFADDR, (int) &i);
>       close(fd);
>       return (char *)inet_ntoa(((struct sockaddr_in *)
>               &i.ifr_addr)->sin_addr);

Herein lies one of my biggest complaints about the Linux development
environment: there should be no reason why an application programmer must
rely on undocumented "catch-all" calls to accomplish simple tasks.  The
"man ioctl_list" page is a complete waste of time-- it's hopelessly out of
date and only contains the argument type for each command without any
explaination of where, why or how each should be used.  Application
programmers shouldn't have to resort to sifting through the kernel source
code to figure out how to perform simple and common tasks.

People who write device drivers or kernel modules should provide a proper
man(2) or man(3) page.  Ideally, we should kill off the ioctl() function
and place all accessible driver variables in /proc.


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


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