Linux-Development-Sys Digest #281, Volume #8 Wed, 15 Nov 00 18:13:14 EST
Contents:
Re: SMP & interrupts (Johan Kullstam)
Re: raw packet socket; how to retransmit ("Vadim Model")
Re: SMP & interrupts (Johan Kullstam)
Accessing a separate process's memory from a syscall ("Kevin Wooten")
Re: injecting keystrokes into virtual console ([EMAIL PROTECTED])
Re: Accessing a separate process's memory from a syscall ([EMAIL PROTECTED])
Re: raw packet socket; how to retransmit (Andi Kleen)
Re: New glibc-2.2 building ("Gene Heskett")
Newbie compile problem ("Jan Thompson")
Re: Get mount point name from VFS (Alexander Viro)
MODVERSIONS (Michael Palme)
Re: linux API (Juergen Heinzl)
Segmentation faults with struct hostent & char ** ("Christoper McClan")
Re: Raw block device interface (Ronald Cole)
Re: linux API (Alexander Viro)
----------------------------------------------------------------------------
Subject: Re: SMP & interrupts
From: Johan Kullstam <[EMAIL PROTECTED]>
Date: 15 Nov 2000 13:17:48 -0500
"Slawek Grajewski" <[EMAIL PROTECTED]> writes:
> OK. I have one more question. In single CPU system, there can be active only
> one instance of interrupt service routine requested with SA_INTERRUPT. How
> it is in SMP architecture? Can two interrupts be handled in two CPUs at the
> same time?
for kernels 2.1.* and up, yes. and if the interrupt is edge rather
than level triggered (like most pci cards will do), i think it can
even do two interrupts on the same irq line simultaneously.
> Thanks in advance,
> Slawek
>
>
> Johan Kullstam wrote in message ...
> >"Slawek Grajewski" <[EMAIL PROTECTED]> writes:
> >
> >> Forgive me my (probably) stupid question. Can someone explain to me, how
> >> interrupts are delivered to the CPUs in the SMP architecture? Which CPU
> in a
> >> dual CPU Pentium system handles an interrupt delivered by e.g. network
> card?
> >> Is it a fixed configuration, random shuting or round-robin? What about
> timer
> >> interrupts? Are they delivered to all CPUs or just to a single one (if so
> to
> >> which one)?
> >
> >in linux, the interrupt is delivered to a single CPU, but it could be
> >any of them. i do not know if it is round-robin or random. it's
> >definitately not fixed.
> >
> >i think this is controlled by your IO-APIC hardware configuration.
> >
> >--
> >J o h a n K u l l s t a m
> >[[EMAIL PROTECTED]]
> >sysengr
>
>
--
J o h a n K u l l s t a m
[[EMAIL PROTECTED]]
sysengr
------------------------------
From: "Vadim Model" <[EMAIL PROTECTED]>
Subject: Re: raw packet socket; how to retransmit
Date: Wed, 15 Nov 2000 21:40:18 +0300
>Well, its a very interresting question . If could check the stats for
>the given interface if you dont have much traffic on the network .
>If the sendto(2) return a value < 0, then the packet has not been sent
>but sometimes sendto return a positive value and the packet is wrong .
As far as I understand from source code write() always completes
successfully if packet is enqueued to network device. But the problem is
that packet sockets are always asynchronous and write() completes when
packet is enqueued and does not wait for corresponding interrupt from
hardware therefore loosing any completion status.
Checking for statistics does not seem very elegant to me.
>if you find an accurate way to check it, i'm interested .
In my understanding there is no accurate solution if people stay with
existing implementation. BTW: I checked 2.2.4, simply because my RH use it.
Could it be any improvement in latest version? I do not think so. It would
require significant amount of work.
I asked just to make sure that I have proper vision of network support in
Linux.
------------------------------
Subject: Re: SMP & interrupts
From: Johan Kullstam <[EMAIL PROTECTED]>
Date: 15 Nov 2000 13:19:24 -0500
"Slawek Grajewski" <[EMAIL PROTECTED]> writes:
> OK. I have one more question. In single CPU system, there can be active only
> one instance of interrupt service routine requested with SA_INTERRUPT. How
> it is in SMP architecture? Can two interrupts be handled in two CPUs at the
> same time?
for kernels 2.1.* and up, yes. and if the interrupt is level rather
than edge triggered, i think it can even handle two interrupts on the
same irq line simultaneously.
> Thanks in advance,
> Slawek
>
>
> Johan Kullstam wrote in message ...
> >"Slawek Grajewski" <[EMAIL PROTECTED]> writes:
> >
> >> Forgive me my (probably) stupid question. Can someone explain to me, how
> >> interrupts are delivered to the CPUs in the SMP architecture? Which CPU
> in a
> >> dual CPU Pentium system handles an interrupt delivered by e.g. network
> card?
> >> Is it a fixed configuration, random shuting or round-robin? What about
> timer
> >> interrupts? Are they delivered to all CPUs or just to a single one (if so
> to
> >> which one)?
> >
> >in linux, the interrupt is delivered to a single CPU, but it could be
> >any of them. i do not know if it is round-robin or random. it's
> >definitately not fixed.
> >
> >i think this is controlled by your IO-APIC hardware configuration.
> >
> >--
> >J o h a n K u l l s t a m
> >[[EMAIL PROTECTED]]
> >sysengr
>
>
--
J o h a n K u l l s t a m
[[EMAIL PROTECTED]]
sysengr
------------------------------
From: "Kevin Wooten" <[EMAIL PROTECTED]>
Subject: Accessing a separate process's memory from a syscall
Date: Wed, 15 Nov 2000 12:11:01 -0700
I need to know if there is a way to acess another process's memory when
calling a syscall from a separate process. The way I envision this is to
call an initialization syscall and save the "current" process structure
(including the FS register) in a static variable. Then any syscalls that
need access to that process's memory can load the correct FS and call the
appropriate functions. Does anyone know if this will work? Also, I am
considering using a loadable module instead, will this change things? The
only thing I can forsee is needing to make sure the process is available
before using the memory, and if anyone has any ideas on solving that I would
love to here them. Any help is much appreciated!
====== Posted via Newsfeeds.Com, Uncensored Usenet News ======
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
======= Over 80,000 Newsgroups = 16 Different Servers! ======
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: injecting keystrokes into virtual console
Date: Wed, 15 Nov 2000 19:54:24 -0000
On Wed, 15 Nov 2000 05:33:46 GMT George MacDonald <[EMAIL PROTECTED]> wrote:
| [EMAIL PROTECTED] wrote:
|>
|> On Tue, 14 Nov 2000 10:17:18 -0000 Mirco Zaggy <[EMAIL PROTECTED]> wrote:
|>
|> Oh, I think I'm carrying this idea a bit too far already.
|>
|
| A hardware solution? -> http://www.vetra.com
A KVM switch? Not even close.
--
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil (at) ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Accessing a separate process's memory from a syscall
Date: Wed, 15 Nov 2000 19:47:20 GMT
In article <3a12df45$[EMAIL PROTECTED]>,
"Kevin Wooten" <[EMAIL PROTECTED]> wrote:
> I need to know if there is a way to acess another process's memory
when
> calling a syscall from a separate process. The way I envision this is
to
> call an initialization syscall and save the "current" process
structure
> (including the FS register) in a static variable. Then any syscalls
that
> need access to that process's memory can load the correct FS and call
the
> appropriate functions. Does anyone know if this will work? Also, I am
> considering using a loadable module instead, will this change things?
The
> only thing I can forsee is needing to make sure the process is
available
> before using the memory, and if anyone has any ideas on solving that
I would
> love to here them. Any help is much appreciated!
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
>
I dont understand very well your method to write/read in a process
memory space from another process, but you can do that simply with
ptrace(2) . As far as i understand your method, you will have many
problems because virtual addresses in your first process will be
different to the second process's virtual addresses . Morever , you
'll need to patch the kernel to add your syscall and its not so nice .
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: raw packet socket; how to retransmit
Date: 15 Nov 2000 20:54:50 +0100
"Vadim Model" <[EMAIL PROTECTED]> writes:
> Sending (and receiving) Ethernet frames via raw packet socket...
>
> Is there any way to force automatic (limited number of times) retransmission
> of frame (packet) when transmit is failed?
Yes. Just use a (PF_INET,SOCK_STREAM) socket.
> Otherwise, is there any way to get to know if the frame is actually
> transmitted or not?
Not possible without a protocol that sends acks, so no.
Watching interface error counters is not sufficient, because it does not
guarantee that the packet reached the application layer at the other end
(remember IP/Ethernet packets are allowed to be dropped when convenient, e.g.
when the host is temporarily out of memory)
-Andi
------------------------------
Date: 15 Nov 2000 7:29:39 -0500
From: "Gene Heskett" <[EMAIL PROTECTED]>
Subject: Re: New glibc-2.2 building
Unrot13 this;
Reply to: <[EMAIL PROTECTED]>
Gene Heskett sends Greetings to Andreas Jaeger;
>>>>>> Gene Heskett writes:
AJ> Gene> Unrot13 this;
AJ> Gene> Reply to: <[EMAIL PROTECTED]>
AJ> Gene> Gene Heskett sends Greetings to Andreas Jaeger;
>>>>>>>> Gene Heskett writes:
AJ>> > Need expert opinions here regarding glibc-2.2 built from the
AJ>> > tar.gz. I've built it, and installed it, but apparently *not*
AJ>> > where a red hat install wants it.
AJ>> You've got to run configure with --prefix=/usr - have a look at
AJ>> the Spec file.
Humm, if it has a Spec file, that should mean I can have rpm build and
install it, something I've not tried, but in this case should do just
for the housekeeping aspects. Thanks for pointing that out. I grabbed
it here at home last night, and I'll seee if I can make that rpm build
work here on this 6.2 system.
AJ> Gene> Ok, I can do that. But see below, what do I do with the
AJ> old install?
[...]
AJ> Gene> Maybe not, but a query/verify operation on 2.1.96-3 reports
AJ> that it is Gene> still perfectly installed on that machine.
AJ> If you configure with --prefix=/usr, libc.so.6 will end in /lib -
AJ> and not in /usr/lib. RTFM.
Which is what I want apparently.
AJ> I can't comment on your RedHat setup and the previous build - I'd
AJ> advise to remove the previous build and start fresh again.
Easy enough done if there had been a make uninstall section in the
makefile, but (sigh) there wasn't such a beast.
[...]
AJ> It seems you didn't read the "Specific advice for Linux systems":
I did in fact read that, but IMO its a bit ambiguous. But I'll re-read
it again.
It also looks as if I need to shorten up the lines in Spruce. :)
Cheers Andreas, Gene
--
Gene Heskett, CET, UHK |Amiga A2k Zeus040, Linux @ 400mhz
email gene underscore heskett at iolinc dot net
#Amiga based X10 home automation program EZHome, see at:#
# <http://www.thirdwave.net/~jimlucia/amigahomeauto> #
ISP's please take note: My spam control policy is explicit!
#Any Class C address# involved in spamming me is added to my killfile
never to be seen again. Message will be summarily deleted without dl.
This messages reply content, but not any previously quoted material, is
� 2000 by Gene Heskett, all rights reserved.
--
------------------------------
From: "Jan Thompson" <[EMAIL PROTECTED]>
Subject: Newbie compile problem
Date: Wed, 15 Nov 2000 22:17:39 +0100
I am trying to compile several programs like Squid, OpenSSL and OpenSSH.
Whatever I try I get fatal errors during compilations.
Error is:
make[1]: .... Illegal instruction (Core dumped)
In the makefile originally was a line like CLAGS= .... -march=pentiumpro
....
I tried to change this in just pentium, I removed the entry, but I still get
the error!
I'm getting desperate!
My CPU is a Pentium 200 MMX, 128Mb mem, SCSI disks
Is this a Pentium bug or any hardware related problem, is it ...
Any suggestions would be appreciated.
Thanks in advance, Jan...
------------------------------
From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: Get mount point name from VFS
Date: 15 Nov 2000 17:32:29 -0500
In article <8uugbp$ere$[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote:
>In article <8utsf5$[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Alexander Viro) wrote:
>
>> No such thing. Filesystem can be mounted at many places
>> simultaneously. Why do you need that?
>
>I was hoping that if one filesystem were mounted twice, I might see two
>entries, one for each mounting. I believe that what I'm after makes
>sense, even if if I haven't explained it well, and even if the VFS
>doesn't actually support it.
>
>If, for example, I have a file system on /dev/xxx, and I mount it at
>/var/tmp/database, then I'd like my xxx_fs kernel module to get the
>"/var/tmp/database" part at mount time. If the same file system is then
>mounted at /opt/database, then I'd like the xxx_fs module to get
>"/opt/database" at mount time.
>
>The reason I want it is so that I can mirror the directory structure for
>the mount point in a tree somewhere under /proc.
D'oh. But why do you want it in the filesystem code? Unless I've seriously
misunderstood you it isn't going to be fs-dependent, is it?
BTW, this stuff is already available in /proc/mounts - mind giving details on
the variant you want to do?
--
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid. Get yourself a better computer" - Dilbert.
------------------------------
From: Michael Palme <[EMAIL PROTECTED]>
Subject: MODVERSIONS
Date: Wed, 15 Nov 2000 22:26:42 GMT
hello....
if i compile a module with MODVERSIONS defined and modversions.h
included how can i display the real names of the symbols (with CRC like
in /proc/ksyms) in the module. I tried to use 'nm' or 'objdump' but
they only show for example 'printk' instead of 'printk_CRC'.
i ve read several books (i.e. rubini) and they all said this CRC is
useful for using complied modules on different kernelversions. ive
compiled a module on 2.2.14 an tried to load it on 2.2.16 but the crc
check fails on one symbol (register_chrdev). can somebody tell me a
combination of kernelversions that match. i need that for creating an
graphic example for my degree dissertation about device driver
programming.
thanks a lot....Michael Palme
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: linux API
Date: 15 Nov 2000 22:42:00 GMT
In article <8uvhu1$1aj$[EMAIL PROTECTED]>, Vikash K Agarwal wrote:
>I am new to Linux, basically coming from DOS/WIN background, so i may sound
>silly ...
[-]
There are no silly questions -- only silly answers.
>Just like there were interrupts in DOS and API in Windows, what is the
>corresponding in the Linux OS??
[-]
Unices commonly don't use interrupts but the syscall() interface
and each available system call has got its own number. Try to think
of it as a table of function pointers that resides in the kernel.
So let's say there's a function that would write a # of bytes to a
given file descriptor. In DOS you need to load some registers and
then you'd call int 9.
In Unix you'd pass all the required parameters to syscall() like
this ...
/*
** SYS_chmod is just a define like #define SYS_chmod 137
*/
syscall( SYS_chmod, "/home/me/somefile", 0666 );
... and similar on the assembler level.
>Where can I find the documentation?
[-]
See the info pages.
>Any good books on the subject??
[-]
Some question -- there're a some good books about Unix in general
but using syscall() is definitely not the most portable way to
write software.
>lets say i want to access a file using a Linux OS call, how do i do it
>using a Linux C compiler like GCC??? How do i program for the linux GUI,
>probably referred to as the X-Windows system??
[-]
See above but try to avoid it and prefer library functions. close(2) for
instance is a system call and it does not just call syscall() but sets
errno for example too, say you don't gain much in speed or so.
If it comes to the GUI then see http://www.ora.com/ for literature and
GUI toolkit (Athena, Motif, GTK, KDE, ...) specific literature.
Cheers,
Juergen
--
\ Real name : J�rgen Heinzl \ no flames /
\ EMail Private : [EMAIL PROTECTED] \ send money instead /
------------------------------
From: "Christoper McClan" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development
Subject: Segmentation faults with struct hostent & char **
Date: Wed, 15 Nov 2000 22:49:38 +0000
Look at the following small piece of code :
===========================
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <unistd.h>
#include <string.h>
#include <netdb.h>
int main()
{
char **alias_list;
struct hostent *host_name;
//host_name->h_name="mymachine.mydomain.net";
alias_list[1]="hello";
}
==================================
This will compile & run fine. If however, you remove the comment from the
"host_name" line, it will compile, but when executed will segmentation fault!?
I've noticed this quie a bit, where you have to frig around working out when
and where you declare variables otherwise sometimes g++ (2.95.3) compiled
programs can die.
Any help would be much appreciated!
Christopher.
------------------------------
From: Ronald Cole <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Raw block device interface
Date: 15 Nov 2000 14:53:17 -0800
[EMAIL PROTECTED] writes:
> Ronald Cole <[EMAIL PROTECTED]> writes:
> > Manoj Patil <[EMAIL PROTECTED]> writes:
> > > Is raw interface available in linux for block devices ?
> >
> > I think you mean: "Is a character device available for hard drives"?
>
> I think the way it was said was reasonably well-put.
Yeah, you figured out what he meant and I figured it out, too, but
your definition of "reasonable" is quite a bit looser than mine (given
that you consider calling a character device a block device
"reasonable").
> > > I have a partition and need to access it through a raw interface.
> > > Basically the aim of my program is to bypass the buffer cache and be
> > > assured that every read/write operation results into disk activity.
> >
> > I fancied a post where it seemed that someone was able to do it with
> > RedHat 7.0. I didn't see it in the docs and I haven't had time to
> > look into it yet, but Stephen Tweedie's raw disk I/O may be there.
>
> Here are some pretty relevant links:
> <http://lwn.net/1999/0729/a/sct-raw.html>
> <ftp://ftp.linux.org.uk/pub/linux/sct/fs/profiling/sard-0.6.tar.gz>
> <http://howto.tucows.com/man/man8/raw.8.html>
Ok, I looked. Raw disk I/O is in RH7.0. That makes your links
relevant.
--
Forte International, P.O. Box 1412, Ridgecrest, CA 93556-1412
Ronald Cole <[EMAIL PROTECTED]> Phone: (760) 499-9142
President, CEO Fax: (760) 499-9152
My GPG fingerprint: C3AF 4BE9 BEA6 F1C2 B084 4A88 8851 E6C8 69E3 B00B
------------------------------
From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: linux API
Date: 15 Nov 2000 17:52:16 -0500
In article <8uuhtm$gcc$[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote:
>On linux, there are syscalls . You need to put the right value in eax
>and call "int $0x80" (the only software interrupt on linux as far as i
>know) . I recommend you :
>- gcc last version (the one including stack protection)
>- gdb (debugger)
>- objdump (disassembler and binary analyzer)
- _NOT_ using the aforementioned interface, since it's Linux- and x86-specific
and there are much simpler portable ways to do the thing. Use libc - functions
you need are there and you don't have to mess with assembler. It's UNIX, so
there is no need to scare sheep - just use standard libraries.
BTW, since when does gcc include "stack protection", whatever it means?
--
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid. Get yourself a better computer" - Dilbert.
------------------------------
** 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
******************************