Linux-Development-Sys Digest #280, Volume #8     Wed, 15 Nov 00 13:13:12 EST

Contents:
  Get mount point name from VFS ([EMAIL PROTECTED])
  Re: Get mount point name from VFS (Alexander Viro)
  SMP & interrupts ("Slawek Grajewski")
  SMP & interrupts ("Slawek Grajewski")
  SMP & interrupts ("Slawek Grajewski")
  SMP & interrupts ("Slawek Grajewski")
  SMP & interrupts ("Slawek Grajewski")
  using sigqueue/sigaction ([EMAIL PROTECTED])
  Re: SMP & interrupts (Johan Kullstam)
  Re: Reading files using kHTTPd method, first byte only? ("Andy Jeffries")
  Re: Message queues: real world applications ([EMAIL PROTECTED])
  Re: using sigqueue/sigaction ([EMAIL PROTECTED])
  raw packet socket; how to retransmit ("Vadim Model")
  Re: CMOS access (Georg Acher)
  linux API ("Vikash K Agarwal")
  Problems (re-)building glibc-2.1.2 ("Arthur H. Gold")
  Re: auto power off (Wouter Verhelst)
  Re: Get mount point name from VFS ([EMAIL PROTECTED])
  Re: SMP & interrupts ("Slawek Grajewski")
  Re: raw packet socket; how to retransmit ([EMAIL PROTECTED])
  Re: linux API ([EMAIL PROTECTED])

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

From: [EMAIL PROTECTED]
Subject: Get mount point name from VFS
Date: Wed, 15 Nov 2000 10:52:11 GMT

I may be being stupid, but is there a quick way to get the full name of
the mount point of a file system at mount-time?

(I'm the file system driver in the kernel, so I have its inode, so I
could probably find it slowly, but I'm hoping that the VFS is
maintaining it somewhere already.)

Thanks in advance,

Dave


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

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

From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: Get mount point name from VFS
Date: 15 Nov 2000 06:36:05 -0500

In article <8utpsq$sap$[EMAIL PROTECTED]>,  <[EMAIL PROTECTED]> wrote:
>I may be being stupid, but is there a quick way to get the full name of
>the mount point of a file system at mount-time?

No such thing. Filesystem can be mounted at many places simultaneously.
Why do you need that?

-- 
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid.  Get yourself a better computer" - Dilbert.

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

From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: SMP & interrupts
Date: Wed, 15 Nov 2000 12:12:58 +0100

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)?
Thanks in advance,
Slawek




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

From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: SMP & interrupts
Date: Wed, 15 Nov 2000 12:12:58 +0100

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)?
Thanks in advance,
Slawek




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

From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: SMP & interrupts
Date: Wed, 15 Nov 2000 12:12:58 +0100

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)?
Thanks in advance,
Slawek




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

From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: SMP & interrupts
Date: Wed, 15 Nov 2000 12:12:58 +0100

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)?
Thanks in advance,
Slawek




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

From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: SMP & interrupts
Date: Wed, 15 Nov 2000 12:12:58 +0100

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)?
Thanks in advance,
Slawek




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

From: [EMAIL PROTECTED]
Subject: using sigqueue/sigaction
Date: Wed, 15 Nov 2000 12:48:08 GMT

Hi,
        I've pored over the documentation I could find on how to use the
POSIX.1b signals under linux. I can't seem to get any of the siginfo_t
information filled in properly. My handler just prints garbage when I
access si_value etc. I understand that the signals must be sent with
sigqueue, and the signals themselves must be SIGRTMIN<signo<SIGRTMAX.
Any pointers on examples on how to do this?

PS. My code works properly on Solaris when I use SIGUSR1, SIGUSR2. I've
tried SIGRTMAX-10 under Linux, the signal handler executes, but as I
said, the siginfo_t information is not filled in.

TIA


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

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

Subject: Re: SMP & interrupts
From: Johan Kullstam <[EMAIL PROTECTED]>
Date: 15 Nov 2000 08:49:24 -0500

"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

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

From: "Andy Jeffries" <[EMAIL PROTECTED]>
Subject: Re: Reading files using kHTTPd method, first byte only?
Date: Wed, 15 Nov 2000 13:56:48 +0000

Did this article arrive on the NG OK - or am I alone in my plight?

Thanks,


AJ

In article <8u9076$sco$[EMAIL PROTECTED]>, "Andy Jeffries"
<[EMAIL PROTECTED]> wrote:

> Hi guys,
> 
> I am writing an on-the-fly-encryption module for Linux (yes, it will be
> GPL'd and yes, I know that there is a Kernel patch and loopback
> interface for this, but it doesn't create container files that are
> compatible with a certain Windoze product) and have come accross a
> problem.
> 
> I am trying to use the same file reading mechanism as kHTTPd, but it
> only seems to read the first byte.  I am running 2.2.16 (at the moment)
> which may be a problem (kHTTPd only seems to come with 2.4...), but it
> is curious that the code seems to partially work (i.e read a byte).
> Attached below is the relevant portions of the code, with some
> (hopefully simple) explanations:
> 
> ----- CODE BEGINS -----
> 
> /* slots is an array of my structures, contains a struct file *, and a
> char * filename */ slots[slotno].filp =
> filp_open(slots[slotno].sd_mount->filename, 00, O_RDWR);
> 
> /* then it calls another function passing in slots[slotno] as sd_slot.
> The code in that function is as follows */
> 
> char *pHeaderBlock; int iNumRead; mm_segment_t oldfs;
> 
> sd_slot->filp->f_pos = 0; oldfs = get_fs(); set_fs(KERNEL_DS);
> 
> /* HEADER_BLOCK_SIZE is 2048, the size of the header block for the
> container */ iNumRead = sd_slot->filp->f_op->read(sd_slot->filp, 
>       pHeaderBlock, HEADER_BLOCK_SIZE, &(sd_slot->filp->f_pos));
> if (iNumRead < HEADER_BLOCK_SIZE) {
>       printk(KERN_ERR "scramdisk: Cannot read the header block\n"); return
>       NULL;
> }
> printk(KERN_ERR "scramdisk: pHeaderBlock = %X, read %d bytes\n", 
>       *pHeaderBlock, iNumRead);
> 
> ----- CODE ENDS -----
> 
> Now, I know I should have used a lower printk priority, but I was having
> difficulty finding where it was logging the damn thing! :-)
> 
> It usually reads the header block OK (iNumRead == HEADER_BLOCK_SIZE) but
> *pHeaderBlock has some strange contents.  For example:
> 
> Running it on a blowfish encrypted container logs:
>> Nov  7 10:44:17 ialtd07 kernel: scramdisk: pHeaderBlock = FFFFFF8F
> While hexdump on the same file gives (notice the 8f):
>> 0000000 f18f bd5c
> 
> Running it on /dev/zero logs:
>> Nov  7 10:44:39 ialtd07 kernel: scramdisk: pHeaderBlock = 0
> While hexdumping /dev/zero gives (duh!!):
>> 0000000 0000 0000
> 
> Running it on a text file gives:
>> Nov  7 10:45:21 ialtd07 kernel: scramdisk: pHeaderBlock = 72
> While hexdump on the same file gives:
>> 0000000 6f72 746f
> 
> Any ideas???
> 
> 


-- 
Andy Jeffries
Lead-developer of Scramdisk for Linux
Developer of original Scramdisk Delphi Component

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

From: [EMAIL PROTECTED]
Subject: Re: Message queues: real world applications
Crossposted-To: comp.os.linux.development.apps
Date: Wed, 15 Nov 2000 14:29:21 GMT

"Bruce Phipps" <[EMAIL PROTECTED]> writes:
> I am learning up on Linux programming and have just finished the
> chapter on Message Queues!
>
> This seems quite a powerful tool, where you can dump messages in the queue
> with an identifying Type. Other people can then read them off them queue.
> 
> Are message queues used mostly for client-server stuff?
> What are typical applications of IPC message queues?

They're not very widely used.

I think the likely problem is that they are not "network-aware;" while
named pipes lend themselves to extending on to sockets that can talk
across networks as easily as on the local host, there is no MQ
equivalent.

A secondary issue may be that if they're not available across many
Unixes, then people will be discouraged from using them in apps that
they intend to be portable.  Note that the BSDs don't offer SysV
Message Queueing...
-- 
(concatenate 'string "cbbrowne" "@hex.net") 
<http://www.ntlug.org/~cbbrowne/>
Rules of the Evil Overlord #123. "If I decide to hold a contest of
skill open to the general public, contestants will be required to
remove their hooded cloaks and shave their beards before entering."
<http://www.eviloverlord.com/>

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

From: [EMAIL PROTECTED]
Subject: Re: using sigqueue/sigaction
Date: Wed, 15 Nov 2000 14:41:55 GMT

In article <8uu0m7$14c$[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] wrote:
> Hi,
>       I've pored over the documentation I could find on how to use the
> POSIX.1b signals under linux. I can't seem to get any of the siginfo_t
> information filled in properly. My handler just prints garbage when I
> access si_value etc. I understand that the signals must be sent with
> sigqueue, and the signals themselves must be SIGRTMIN<signo<SIGRTMAX.
> Any pointers on examples on how to do this?
>
> PS. My code works properly on Solaris when I use SIGUSR1, SIGUSR2.
I've
> tried SIGRTMAX-10 under Linux, the signal handler executes, but as I
> said, the siginfo_t information is not filled in.
>
> TIA
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

In usermode , you can use kill(2) and signal(2) to send and catch
signals .

>From signal(2) manpage :
"Both versions of signal are librairy routines built on top of
sigaction(2)" .

However, signal(2) seems to be a syscall, according
to ./bits/syscall.h . Is there many syscalls to do the same things ?
(i'm using linux 2.2.13) .

ps : hehe, how to answer a question and ask another one ;)




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

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

From: "Vadim Model" <[EMAIL PROTECTED]>
Subject: raw packet socket; how to retransmit
Date: Wed, 15 Nov 2000 18:55:31 +0300

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?

Otherwise, is there any way to get to know if the frame is actually
transmitted or not?

Regards,
    Vadim




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

From: [EMAIL PROTECTED] (Georg Acher)
Subject: Re: CMOS access
Date: 15 Nov 2000 15:56:21 GMT

In article <[EMAIL PROTECTED]>,
 "Ken Wilson" <[EMAIL PROTECTED]> writes:
|> Hi,
|> 
|> Can I access the CMOS of an x86 system on Red Hat 6.2 ?
|> In DOS, I can do IO to port 70h, how do I do in Linux?

Besides the direct I/O, there is also the way via /dev/nvram. You just need the
driver (module), then you can do lseek and read/write on the CMOS memory.

-- 
         Georg Acher, [EMAIL PROTECTED]         
         http://www.in.tum.de/~acher/
          "Oh no, not again !" The bowl of petunias          

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

From: "Vikash K Agarwal" <[EMAIL PROTECTED]>
Subject: linux API
Date: Wed, 15 Nov 2000 22:01:05 +0530

I am new to Linux, basically coming from DOS/WIN background, so i may sound
silly ...
Just like there were interrupts in DOS and API in Windows, what is the
corresponding in the Linux OS??
Where can I find the documentation?
Any good books on the subject??
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??

any help is sincerely appreciated
Vikash







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

Date: Wed, 15 Nov 2000 07:47:38 -0600
From: "Arthur H. Gold" <[EMAIL PROTECTED]>
Subject: Problems (re-)building glibc-2.1.2

Perhaps someone could shed some light on this:

I have a (slightly) patched version of glibc-2.1.2 (the
patches are mainly concerned with exposing some low-level
symbols), which I've built in the past with no problems.

Now, unfortunately, the build is dying on an "undefined
reference to __libc_global_ctors" in the newly-built ld.so
(in the `elf' subdirectory).

Any clues?

Many thanks.
--ag
-- 
Artie Gold, Austin, TX  (finger the cs.utexas.edu account
for more info)
mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED]
--
"Curiousity didn't kill _this_ cat" 
-- Studs Terkel, upon being asked what he thinks his epitaph
should be.

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

From: [EMAIL PROTECTED] (Wouter Verhelst)
Subject: Re: auto power off
Crossposted-To: comp.os.linux.setup
Date: Wed, 15 Nov 2000 17:04:35 GMT

In article <[EMAIL PROTECTED]>,
        [EMAIL PROTECTED] writes:
> In comp.os.linux.development.system [EMAIL PROTECTED] wrote:
> 
>| I just recently had this problem when I upgraded to the 2.2.17 kernel,
>| and found that recompiling with APM (Automatic Power Management) allows
>| the kernel to power off the machine.  Apparently, RedHat automatically
>| compiles this feature into their kernels, but it is not a selected
>| option for the source from kernel.org
> 
> Then how do you select it?  Is there any confining compile symbol?

By selecting the appropriate option in make config, make menuconfig or
make xconfig...

-- 
wouter punt verhelst op advalvas in Belgi�
  6:04pm  up  1:16,  2 users,  load average: 1.03, 1.06, 1.00
Voor een vertaling van Documentation/Configure.help naar het Nederlands:
http://users.pandora.be/wouter.verhelst/configure.html

Some men rob you with a six-gun -- others with a fountain pen.
                -- Woodie Guthrie

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

From: [EMAIL PROTECTED]
Subject: Re: Get mount point name from VFS
Date: Wed, 15 Nov 2000 17:15:45 GMT

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.

Dave


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

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

From: "Slawek Grajewski" <[EMAIL PROTECTED]>
Subject: Re: SMP & interrupts
Date: Wed, 15 Nov 2000 18:18:33 +0100

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?

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



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

From: [EMAIL PROTECTED]
Subject: Re: raw packet socket; how to retransmit
Date: Wed, 15 Nov 2000 17:36:42 GMT

In article <8uuasq$2lru$[EMAIL PROTECTED]>,
  "Vadim Model" <[EMAIL PROTECTED]> wrote:
> 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?
>
> Otherwise, is there any way to get to know if the frame is actually
> transmitted or not?
>
> Regards,
>     Vadim
>
>


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 .

if you find an accurate way to check it, i'm interested .





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

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

From: [EMAIL PROTECTED]
Subject: Re: linux API
Date: Wed, 15 Nov 2000 17:42:17 GMT

In article <8uvhu1$1aj$[EMAIL PROTECTED]>,
  "Vikash K Agarwal" <[EMAIL PROTECTED]> wrote:
> I am new to Linux, basically coming from DOS/WIN background, so i may
sound
> silly ...
> Just like there were interrupts in DOS and API in Windows, what is the
> corresponding in the Linux OS??
> Where can I find the documentation?
> Any good books on the subject??
> 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??
>
> any help is sincerely appreciated
> Vikash
>
>

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)

Good luck .
Julien.




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

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


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