Linux-Development-Sys Digest #714, Volume #8     Sat, 12 May 01 14:13:08 EDT

Contents:
  Re: Checking if a pointer is valid (Steve Connet)
  transpareny ("Darren LS")
  Re: RAID problems ("Brad Hubbard")
  Re: transpareny (Daniel Rall)
  Directory Protector (Aminudin Khalid)
  Re: transpareny (Nate Eldredge)
  Crypto File System (Aminudin Khalid)
  Re: Anyone working with IEEE1394 for laptops. CarBus Cards?  cvs ("Cameron Kerr")
  Re: Red Hat Device Driver training ([EMAIL PROTECTED])
  Re: STLport 4.0 & g++ 2.96 (John Beardmore)
  /dev/raw control program ([EMAIL PROTECTED])
  Re: PCI Address from map_user_kiobuf Pages (William Waddington)
  Re: Critical sections (Derek Viljoen)
  Re: segfault in module, how can I remove it ? (Kasper Dupont)
  Re: Checking if a pointer is valid (Santiago Capel)
  Re: transpareny (Kasper Dupont)
  Re: STLport 4.0 & g++ 2.96 (John Beardmore)
  Re: Critical sections (Kaz Kylheku)
  Re: STLport 4.0 & g++ 2.96 (John Beardmore)
  Re: STLport 4.0 & g++ 2.96 (David Konerding)
  Re: Crypto File System ([EMAIL PROTECTED])
  Re: PCI Address from map_user_kiobuf Pages (k)

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

Subject: Re: Checking if a pointer is valid
From: Steve Connet <[EMAIL PROTECTED]>
Date: Sat, 12 May 2001 01:16:31 GMT

Nix <$}xinix{[email protected]> writes:

> ... which bears no resemblance to what was asked about, which was
> how to determine if a *pre-existing* pointer was valid (presumably
> for the best of reasons, i.e. paranoia :) ).

Oh... well that's why everyone should set the pointer to 0 after they
free it. That way the rest of the world will know right away if the
pointer is valid.

-- 
Steve Connet            Remove USENET to reply via email
[EMAIL PROTECTED]

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

From: "Darren LS" <[EMAIL PROTECTED]>
Crossposted-To: 
alt.linux,comp.os.linux.development.apps,linux.redhat.devel,linux.redhat.development
Subject: transpareny
Date: Sat, 12 May 2001 02:19:31 +0100

hi all I have a lovely little socket program that talks to a server
blahdebla
sadly when I run it it steals all the runtime of the tty node, I can run it
in the background with the suffix of the & character but I would rather  it
run in the background automatically. does anyone know if this is possible?
either via the system or programmatically?


Thank you




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

Reply-To: "Brad Hubbard" <[EMAIL PROTECTED]>
From: "Brad Hubbard" <[EMAIL PROTECTED]>
Subject: Re: RAID problems
Date: Sat, 12 May 2001 01:49:35 GMT

> If you look further down in your dmesg output (and your system is behaving
> like mine), you should see a line that says:
>
> raid1 personality registered as nr 3
>
> This is output when RAID-1 support is dynamically loaded as a kernel
> module. Then a bit later, the kernel re-tries the auto-probe for starting
> up your md devices, and this time around it works.

Entirely correct.

> I'm not sure why the first attempt is made. I assume that if you compiled
> RAID-1 support statically into your kernel, the first attempt would
> succeed -- but in any case things seem to be working as they are.

True.... just seemed a bit weird to me. I feel better knowing I'm not the
only one ;-)

thanks,
Brad



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

Crossposted-To: 
alt.linux,comp.os.linux.development.apps,linux.redhat.devel,linux.redhat.development
Subject: Re: transpareny
From: Daniel Rall <[EMAIL PROTECTED]>
Date: Sat, 12 May 2001 05:30:51 GMT

"Darren LS" <[EMAIL PROTECTED]> writes:

> hi all I have a lovely little socket program that talks to a server
> blahdebla
> sadly when I run it it steals all the runtime of the tty node, I can run it
> in the background with the suffix of the & character but I would rather  it
> run in the background automatically. does anyone know if this is possible?
> either via the system or programmatically?

fork() and exec()

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

From: Aminudin Khalid <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development,.apps,comp.unix.programmer
Subject: Directory Protector
Date: Sat, 12 May 2001 14:01:36 +0800
Reply-To: [EMAIL PROTECTED]

Hi ,

I am trying to figure out on how to protect directory under Linux/Unix
environment. Let say we have a dedicated directory and we want to
protect that directory with smart card or other authentication devices.
How can I detect if there is an access to that directory ? How can I
implement this  functionality in programming ? Is it kernel level
programming or just application programming ?

Any idea is apreciated . Thanks.


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

From: Nate Eldredge <[EMAIL PROTECTED]>
Crossposted-To: 
alt.linux,comp.os.linux.development.apps,linux.redhat.devel,linux.redhat.development
Subject: Re: transpareny
Date: 12 May 2001 00:46:56 -0700

"Darren LS" <[EMAIL PROTECTED]> writes:

> hi all I have a lovely little socket program that talks to a server
> blahdebla
> sadly when I run it it steals all the runtime of the tty node, I can run it
> in the background with the suffix of the & character but I would rather  it
> run in the background automatically. does anyone know if this is possible?
> either via the system or programmatically?

Try the `daemon' function.

-- 

Nate Eldredge
[EMAIL PROTECTED]

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

From: Aminudin Khalid <[EMAIL PROTECTED]>
Subject: Crypto File System
Date: Sat, 12 May 2001 17:44:52 +0800
Reply-To: [EMAIL PROTECTED]

Hi ;

Is there any Linux Secure /Crypto File System that I can use for testing
. 

Thanks.


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

From: "Cameron Kerr" <[EMAIL PROTECTED]>
Subject: Re: Anyone working with IEEE1394 for laptops. CarBus Cards?  cvs
Date: Sat, 12 May 2001 22:28:50 +1200

Wouldn't you get a better answer from thier sourceforge newsgroup?

-- 
Cameron Kerr -- cameron.kerr @ paradise.net.nz
Praise Slackware, our baud and saviour!
--

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

From: [EMAIL PROTECTED]
Subject: Re: Red Hat Device Driver training
Date: 12 May 2001 10:04:03 GMT

On 11 May 2001 19:26:53 GMT Steve Millman <[EMAIL PROTECTED]> wrote:

| Has anyone taken the Red Hat Linux Device Driver course (RHD221) and if
| so how would they rate it.  Are there any other training courses given by
| other companies for Linux device drivers?

I get the impression most people here would just read one of the
books out there on Linux device drivers, read source code, and
dive right in and learn by making mistakes.  So what all did this
course cover?

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: John Beardmore <[EMAIL PROTECTED]>
Subject: Re: STLport 4.0 & g++ 2.96
Date: Sat, 12 May 2001 14:38:26 +0100

In message <[EMAIL PROTECTED]>, David Konerding 
<[EMAIL PROTECTED]> writes
>On 9 May 2001 11:14:19 +0100, Philip Armstrong <[EMAIL PROTECTED]> wrote:
>> In article <9dasv6$re2$[EMAIL PROTECTED]>,
>> Philip Armstrong <[EMAIL PROTECTED]> wrote:
>>>gcc -nostdinc -I/usr/local/include -L/usr/local/lib -nodefaultlibs -lc
>>>
>>>probably (I haven't tried the above).
>>>
>>>The gcc documentation isn't *that* hard to read is it?
>>
>> hmm. I probably meant
>>
>> g++ -nostdinc -I/usr/include -I/usr/local/include -L/usr/lib \
>>     -L/usr/local/lib -nodefaultlibs -lc -lstdc++
>>
>> naturally I haven't tried this either (in true usenet fashion...)
>>
>> note that you *probably* actually want something like
>> -I/usr/local/include/STLPort/ (or wherever the STLPort includes
>> are...) rather than just -I/usr/local/include, and likewise for the
>> library paths.
>
>The way to do it is:
>
>g++ -I<path_to_STLport>/stlport -c code.cpp -o code.o
>gcc -L<path_to_STLport>/lib -o code code.o -lstlport_gcc
>
>
>You don't need to use -nostdinc++ when you compile (because
>the -I/<path_to_STLport>/stlport comes before the system search
>path).
>
>You don't want to link using g++ because that links with libstdc++,
>and you don't want that if you're linking against STLport-- it's
>redundant, although possibly harmless.

So why not do the whole thing via gcc or won't that compile .cpp files ?


Cheers, J/.
-- 
John Beardmore

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

From: [EMAIL PROTECTED]
Subject: /dev/raw control program
Date: 12 May 2001 13:53:47 GMT

Maybe I'm not doing the search with the proper (secret?) keyword,
but I am looking for the control program used to bind /dev/rawN
devices (via /dev/raw control device) to specific block devices.
I could write my own, but I shouldn't if there is an "official"
one.  But where would it be hiding?  Inside some other package?
Or maybe I do need to write one?  If so, what would you like to
have for a CLI interface to it?

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: William Waddington <[EMAIL PROTECTED]>
Subject: Re: PCI Address from map_user_kiobuf Pages
Date: Sat, 12 May 2001 15:05:47 GMT

On Fri, 11 May 2001 21:08:19 GMT, k <[EMAIL PROTECTED]> wrote:

Hello,
At a quick glance, a couple of comments: 

>I alloc_kiobuf and mapped it using 'map_user_kiobuf'. I am trying to do a Block
>DMA transfer and I need a PCI address pointing to the first page. I tried using
>virt_to_bus call to get the bus address and use it as my PCI address. But I
>don't see anything happening. Below is a sample code that I am using ( minus
>error checking...)
>
>
>alloc_kiovec(1, &iobuf);
>map_user_kiobuf(0,iobuf,buf,100);

The first 0 == READ, I think.  Do you mean WRITE? I don't know what
the effect would be of getting this wrong.

>
>These two work and I can see the data that i have sent from my User-space
>program in the re-mapped pages....
>
>Now getting the PCI address....
>/* only has a count of 100 values..so, all the data is present on 1 page */

I suppose that you can guarantee this, but in general, it may not be
so.  Also - what about offsets within the page?

>pci_addr = virt_to_bus(page_address(iobuf->maplist[0])); 
>
>Any comments/suggestions...
>
>thanx,
>k

Here is a big, messy driver that works (so far):
http://www.neosoft.com/~ikoncorp/drivers/linux_2.4/pci/x86/files/hardcopy/

Bill
=======================================
Bill Waddington
Bainbridge Island, WA, USA
[EMAIL PROTECTED]
[EMAIL PROTECTED]
=======================================

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

From: Derek Viljoen <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c,gnu.glibc.bug,linux.dev.kernel
Subject: Re: Critical sections
Date: Fri, 11 May 2001 08:13:06 -0400
Reply-To: [EMAIL PROTECTED]

Dean Wakerley wrote:

> Whats the standard way in C of enforcing mutual exclusion on a section of
> code? I'm thinking of semaphores and the equivalent of java's synchronised
> keyword, but can't find any info.

It seems to me like you're asking a very simple question, and everyone 
just wants to split hairs about the way you asked it.

To clarify your question, I assume by "standard" you mean "common".  If 
this is so, then just use a mutex (man the pthreads package for a 
complete description).

-- 
     ___               __  _                  * [EMAIL PROTECTED]
     /  ) _  _  _   /   / / . / . _   _  _    * (609) 734-3061 (W)
  (_/__/ (/_/__(/__/<  (_/ /_/_/_(_)_(/_( )__ * ICBM Addr: 39N 58' 21"
                             _/               *            74W 47' 49"


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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: segfault in module, how can I remove it ?
Date: Sat, 12 May 2001 15:31:50 +0000

Roman Himmes wrote:
> 
> Hello,
> 
> I try to write an driver for a Webcam for USB. During this work the driver
> segfaults during the probe function while initializing. If I want to remove
> the module after this, the system tells me that the device is busy.
>  /proc/module tless me the driver is initializing. After the kernel oops
> the system seems to be ok. is there a way to remove the driver againm or do
> I have to reboot ?
> 
> Thanks,
> 
>  Roman

Probably rebooting is the best you can do.
If you would like the system to reboot a
litle faster try the monte utility:

<URL:http://www.scyld.com/products/beowulf/software/monte.html>

-- 
Kasper Dupont

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

From: Santiago Capel <[EMAIL PROTECTED]>
Subject: Re: Checking if a pointer is valid
Date: Sat, 12 May 2001 15:39:47 GMT

Nix wrote:

> On Fri, 11 May 2001, Steve Connet said:
> 
>> Kasper Dupont <[EMAIL PROTECTED]> writes:
>> 
>> 
>>>>     Does any one know how to check if a pointer is valid in Linux
>>>> C. I am trying to simulate the windows IsBadReadPtr and
>>>> IsBadWritePtr functions.
>>> 
>> If you decide to use C++ you can do this:
>> 
>> char* test = new(nothrow)char[100];
> 
> 
> ... which bears no resemblance to what was asked about, which was how to
> determine if a *pre-existing* pointer was valid (presumably for the best
> of reasons, i.e. paranoia :) ).

You could set a signal handler to catch some signals like bad address, 
segmentation fault, etc.


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

From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To: 
alt.linux,comp.os.linux.development.apps,linux.redhat.devel,linux.redhat.development
Subject: Re: transpareny
Date: Sat, 12 May 2001 15:43:57 +0000

Darren LS wrote:
> 
> hi all I have a lovely little socket program that talks to a server
> blahdebla
> sadly when I run it it steals all the runtime of the tty node, I can run it
> in the background with the suffix of the & character but I would rather  it
> run in the background automatically. does anyone know if this is possible?
> either via the system or programmatically?
> 
> Thank you

If you are writing a C program this is probably
what you want:

if (fork()) exit(0);

Or if you want to check for errors as well:

switch(fork()) {
 case 0: break;
 case -1: perror("fork"); exit(1);
 default: exit(0);
}

-- 
Kasper Dupont

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

From: John Beardmore <[EMAIL PROTECTED]>
Subject: Re: STLport 4.0 & g++ 2.96
Date: Sat, 12 May 2001 17:02:01 +0100

In message <[EMAIL PROTECTED]>, David Konerding
<[EMAIL PROTECTED]> writes
>On 9 May 2001 11:14:19 +0100, Philip Armstrong <[EMAIL PROTECTED]> wrote:
>> In article <9dasv6$re2$[EMAIL PROTECTED]>,
>> Philip Armstrong <[EMAIL PROTECTED]> wrote:
>>>gcc -nostdinc -I/usr/local/include -L/usr/local/lib -nodefaultlibs -lc
>>>
>>>probably (I haven't tried the above).
>>>
>>>The gcc documentation isn't *that* hard to read is it?
>>
>> hmm. I probably meant
>>
>> g++ -nostdinc -I/usr/include -I/usr/local/include -L/usr/lib \
>>     -L/usr/local/lib -nodefaultlibs -lc -lstdc++
>>
>> naturally I haven't tried this either (in true usenet fashion...)
>>
>> note that you *probably* actually want something like
>> -I/usr/local/include/STLPort/ (or wherever the STLPort includes
>> are...) rather than just -I/usr/local/include, and likewise for the
>> library paths.
>
>The way to do it is:
>
>g++ -I<path_to_STLport>/stlport -c code.cpp -o code.o
>gcc -L<path_to_STLport>/lib -o code code.o -lstlport_gcc
>
>
>You don't need to use -nostdinc++ when you compile (because
>the -I/<path_to_STLport>/stlport comes before the system search
>path).
>
>You don't want to link using g++ because that links with libstdc++,
>and you don't want that if you're linking against STLport-- it's
>redundant, although possibly harmless.

OK, I'm still confused...

First I tried linking with gcc as suggested, but there were a bunch of
things it couldn't resolve:

        log     sqrt    cosh    cos     sin
        atan2   sinh    log10   exp     hypot

so there's a problem there.

Taking the hint that g++ is more promiscuous in the libraries it will
search, I tried linking with that and it linked clean.

On running ./RetSim however, it fell over saying:

    "Error in loading shared libraries: libstlport_gcc.so: cannot open
shared
    object file: No such file or directory.

I've got /home2/STLport-4.0/STLport-4.0/lib in $PATH now, and
libstlport_gcc.so is in that directory, but it still doesn't find it at
runtime.

Any idea what my problem might be ?


Cheers, J/.
-- 
John Beardmore

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.lang.c,gnu.glibc.bug,linux.dev.kernel
Subject: Re: Critical sections
Reply-To: [EMAIL PROTECTED]
Date: Sat, 12 May 2001 16:26:42 GMT

On Fri, 11 May 2001 08:13:06 -0400, Derek Viljoen <[EMAIL PROTECTED]> wrote:
>Dean Wakerley wrote:
>
>> Whats the standard way in C of enforcing mutual exclusion on a section of
>> code? I'm thinking of semaphores and the equivalent of java's synchronised
>> keyword, but can't find any info.
>
>It seems to me like you're asking a very simple question, and everyone 
>just wants to split hairs about the way you asked it.
>
>To clarify your question, I assume by "standard" you mean "common".

That doesn't clarify anything; it changes the meaning in a dubious way. Common
and standard are different things.

>this is so, then just use a mutex (man the pthreads package for a 
>complete description).

Perhaps Dean Wakerley's computing platform has neither man pages nor pthreads. 

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

From: John Beardmore <[EMAIL PROTECTED]>
Subject: Re: STLport 4.0 & g++ 2.96
Date: Sat, 12 May 2001 17:37:03 +0100

In message <u6RQkgB55V$[EMAIL PROTECTED]>, John Beardmore 
<[EMAIL PROTECTED]> writes
>In message <[EMAIL PROTECTED]>, David Konerding
><[EMAIL PROTECTED]> writes

>>You don't want to link using g++ because that links with libstdc++,
>>and you don't want that if you're linking against STLport-- it's
>>redundant, although possibly harmless.
>
>OK, I'm still confused...
>
>First I tried linking with gcc as suggested, but there were a bunch of
>things it couldn't resolve:
>
>        log     sqrt    cosh    cos     sin
>        atan2   sinh    log10   exp     hypot
>
>so there's a problem there.
>
>Taking the hint that g++ is more promiscuous in the libraries it will
>search, I tried linking with that and it linked clean.

OK, fixed the above by adding -lm  ( thanks Ed Clarke !! )...


>On running ./RetSim however, it fell over saying:
>
>    "Error in loading shared libraries: libstlport_gcc.so: cannot open
>shared
>    object file: No such file or directory.
>
>I've got /home2/STLport-4.0/STLport-4.0/lib in $PATH now, and
>libstlport_gcc.so is in that directory, but it still doesn't find it at
>runtime.
>
>Any idea what my problem might be ?

But still got this problem !


Cheers, J/.
-- 
John Beardmore

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

From: [EMAIL PROTECTED] (David Konerding)
Subject: Re: STLport 4.0 & g++ 2.96
Date: 12 May 2001 16:26:06 GMT
Reply-To: [EMAIL PROTECTED]

On Sat, 12 May 2001 17:02:01 +0100, John Beardmore <[EMAIL PROTECTED]> wrote:
> In message <[EMAIL PROTECTED]>, David Konerding
><[EMAIL PROTECTED]> writes
>>On 9 May 2001 11:14:19 +0100, Philip Armstrong <[EMAIL PROTECTED]> wrote:
>>You don't want to link using g++ because that links with libstdc++,
>>and you don't want that if you're linking against STLport-- it's
>>redundant, although possibly harmless.
> 
> OK, I'm still confused...
> 
> First I tried linking with gcc as suggested, but there were a bunch of
> things it couldn't resolve:
> 
>         log     sqrt    cosh    cos     sin
>         atan2   sinh    log10   exp     hypot
> 
> so there's a problem there.

Those are all math functions.  Add "-lm" to teh end of your link line.

> 
> Taking the hint that g++ is more promiscuous in the libraries it will
> search, I tried linking with that and it linked clean.

Actually, it just adds -lm for you probably.  You can see exactly
what it is doing using "gcc -v" or "g++ -v".  Both compilers just
run the "collect2" application which does the linking for you.
g++ normally links against libstdc++ and libm for good measure since
libstdc++ needs symbols from the math library.  If you just do "gcc"
it won't do the libm library by default-- but you can add it.

> 
> On running ./RetSim however, it fell over saying:
> 
>     "Error in loading shared libraries: libstlport_gcc.so: cannot open
> shared
>     object file: No such file or directory.
> 
> I've got /home2/STLport-4.0/STLport-4.0/lib in $PATH now, and
> libstlport_gcc.so is in that directory, but it still doesn't find it at
> runtime.

/home2/STLport-4.0/STLport-4.0/lib should b in LD_LIBRARY_PATH, not PATH.
THen the dynamic linker will find that library and load it.

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

From: [EMAIL PROTECTED]
Subject: Re: Crypto File System
Date: 12 May 2001 16:41:41 GMT

On Sat, 12 May 2001 17:44:52 +0800 Aminudin Khalid <[EMAIL PROTECTED]> wrote:

| Is there any Linux Secure /Crypto File System that I can use for testing

How about a crypto block device which you can format and mount
any filesystem type with?

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: k <[EMAIL PROTECTED]>
Subject: Re: PCI Address from map_user_kiobuf Pages
Date: Sat, 12 May 2001 17:31:53 GMT

Thanx for your response...Btw, I finally got my code to do work...It needed an
actual offset on the page where my data starts. Then calling virt_to_bus on this
address gave me the address to program PCI Controller's PCI Address register. 

In article <[EMAIL PROTECTED]>, William Waddington
says...
>
>On Fri, 11 May 2001 21:08:19 GMT, k <[EMAIL PROTECTED]> wrote:
>
>Hello,
>At a quick glance, a couple of comments: 
>
>>I alloc_kiobuf and mapped it using 'map_user_kiobuf'. I am trying to do a Block
>>DMA transfer and I need a PCI address pointing to the first page. I tried using
>>virt_to_bus call to get the bus address and use it as my PCI address. But I
>>don't see anything happening. Below is a sample code that I am using ( minus
>>error checking...)
>>
>>
>>alloc_kiovec(1, &iobuf);
>>map_user_kiobuf(0,iobuf,buf,100);
>
>The first 0 == READ, I think.  Do you mean WRITE? I don't know what
>the effect would be of getting this wrong.
>
>>
>>These two work and I can see the data that i have sent from my User-space
>>program in the re-mapped pages....
>>
>>Now getting the PCI address....
>>/* only has a count of 100 values..so, all the data is present on 1 page */
>
>I suppose that you can guarantee this, but in general, it may not be
>so.  Also - what about offsets within the page?
>
>>pci_addr = virt_to_bus(page_address(iobuf->maplist[0])); 
>>
>>Any comments/suggestions...
>>
>>thanx,
>>k
>
>Here is a big, messy driver that works (so far):
>http://www.neosoft.com/~ikoncorp/drivers/linux_2.4/pci/x86/files/hardcopy/
>
>Bill
>---------------------------------------
>Bill Waddington
>Bainbridge Island, WA, USA
>[EMAIL PROTECTED]
>[EMAIL PROTECTED]
>---------------------------------------



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


** 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 by posting to the
comp.os.linux.development.system newsgroup.

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