Linux-Development-Sys Digest #13, Volume #8      Tue, 11 Jul 00 21:13:15 EDT

Contents:
  problem of little indian to big indian code ("bruno.patin")
  Re: How to port MSVC++ app to Linux? (Larry Ebbitt)
  Re: Embedded linux problem? (Wolfgang Denk)
  Re: question about /proc file system ("Duke Lee")
  Re: [ANN] Beta testing of CW for Linux on Intel and PowerPC (Rod Smith)
  Re: 2.4.0test2 and pppd ("[EMAIL PROTECTED]")
  Re: Raw disk access on Linux ([EMAIL PROTECTED])
  are PCI drivers char drivers? ("Peter Huang")
  Re: processes with status <defunct> ([EMAIL PROTECTED])
  Re: problem of little indian to big indian code ([EMAIL PROTECTED])
  SOCK_PACKET and datalink layer access from user space program ("P. Eric Chi")
  Re: warning on volatile (John Gluck)
  Re: are PCI drivers char drivers? (Pete Zaitcev)
  Re: [ANN] Beta testing of CW for Linux on Intel and PowerPC ([EMAIL PROTECTED])
  Re: Why Does Linux Arp All The Time? (Pete Zaitcev)

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

From: "bruno.patin" <[EMAIL PROTECTED]>
Subject: problem of little indian to big indian code
Date: Tue, 11 Jul 2000 23:41:42 +0200

I have an application that creates data on another platform than Linux
and when we read these datas on the linux box, we have to work on the
order of the bytes by eight block count. Is there a mean to do the work
automatically by options on the opening of the file ? where can i find
answers on this subject ?

thank you

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

From: Larry Ebbitt <[EMAIL PROTECTED]>
Date: Tue, 11 Jul 2000 22:56:06 GMT
Subject: Re: How to port MSVC++ app to Linux?



>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 7/10/00, 7:40:30 PM, [EMAIL PROTECTED] (Pjtg0707) wrote=20
regarding Re: How to port MSVC++ app to Linux?:



>we will then have all the Microsoft apps we can handle!

Certainly far more than we want.

Larry Ebbitt - Lynx + OS/2





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

Crossposted-To: 
comp.arch.embedded,comp.os.linux.development.apps,comp.os.linux.networking,comp.os.linux.portable,comp.unix.programmer
From: Wolfgang Denk <[EMAIL PROTECTED]>
Subject: Re: Embedded linux problem?
Date: Tue, 11 Jul 2000 20:32:30 GMT

"Mark Langsdorf" <[EMAIL PROTECTED]> writes:

>    I would recommend buying an embedded Linux distribution,
>such as Redhat Emdedded Linux or Lineo's Embedix.  That'll
>hit you for 3, 4, and 5, and possibly 2.  If Linux isn't already

>From what I've seen so far I think that MontaVista  might  be  a  bit
ahead compared to RH and Lineo; at least we should mention HHL, too.

>ported to Arm-7, though, you've got a monster task ahead of
>you.

At least some basic building blocks (for arm_sa110) can be  found  on
the MV FTP server (kernel, binutils, gcc, glibc).

Wolfgang

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88   Web: www.denx.de
Generally speaking, there are other ways to accomplish whatever it is
that you think you need ...                               - Doug Gwyn

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

From: "Duke Lee" <[EMAIL PROTECTED]>
Subject: Re: question about /proc file system
Date: Tue, 11 Jul 2000 15:31:43 -0700

Ah! you helped me the last time.  Thanks for your help.

The problem is that the poll never returnes even though data4user has been
changed to 1, whenever there are data to send.

When I tried the following from the  the user side, it worked okay

if(poll(ufds,1,10))
    n_read = read(udfs->fd, readbuffer, BUFFERSIZE);

whereas the following didn't really work.

if(poll(ufds,1,1000000000))
    n_read = read(udfs->fd<readbuffer,BUFFERESIZE);

10ms is too much delay for me, and I would like to know how to do it right.

duke


Mathias Waack <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> "Duke Lee" <[EMAIL PROTECTED]> writes:
>
> > Hello, I am implmenting a device driver that is composed of both user
> > process and kernel module.  I have to exchange information between the
> > kernel process and the user process.  Someone from this newsgroup
> > kindly told me that /proc file system is written out whenever some
> > process tries to read from it.  I have implemented the folling polling
> > function:
> >
> > struct wait_queue * procfs_wait = NULL; static unsigned int
> > procfs_poll(struct file *file, poll_table *wait) {
> >     poll_wait(file, &procfs_wait, wait);
> >     if (data4user == 1)
> >         return POLLIN | POLLRDNORM
> >     else
> >         return 0; }
> >
> > but the problem is that my user process is never waken up becuase no
> > process tries to read from it.  My question is if it is possible to
> > flush the data from the kernel side so that /proc files are written
> > out?  Or is there some other solution?  Thank you for your help.
>
> I'm afraid I don't understand your problem. Which event toggles your
> data4user switch? The code looks good and should work.
>
> Mathias



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

Reply-To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED] (Rod Smith)
Subject: Re: [ANN] Beta testing of CW for Linux on Intel and PowerPC
Crossposted-To: comp.os.linux.powerpc
Date: Tue, 11 Jul 2000 22:57:04 GMT

In article <[EMAIL PROTECTED]>,
        [EMAIL PROTECTED] (Kaz Kylheku) writes:
> On Mon, 10 Jul 2000 22:33:14 -0400, MWRon <[EMAIL PROTECTED]> wrote:
>>[ANN] Beta testing of CW for Linux on Intel and PowerPC platforms
>>
>>Metrowerks is taking applications for Beta testers for the next version of
>>CodeWarrior for Linux on Intel and PowerPC Platforms.   To qualify you
>>must be familiar with the Linux operating system and are interested in
>>Beta testing CodeWarrior for Linux.  You must be able to download large
>>files and you will be required to file bug reports.
> 
> I consider this spam.

Unless it was posted multiple times that I've not seen, it's not spam.
It was cross-posted to precisely two newsgroups. The definition of spam
is of a post that appears on a large number of newsgroups (some
definitions include a quantification of this) or that are e-mailed,
unrequested, to a large number of people. This is a widely-accepted
definition, and as far as I can tell from this one post, it does NOT
qualify.

Now, whether the message falls within the charter of the groups to
which it was posted is another matter. A post can be off-topic -- and
even potentially net abuse -- and not be spam. I haven't checked the
charters of the relevant newsgroups to see if they allow posts
announcing beta programs. Even if they don't, though, that makes the
posts off-topic, but probably not net abuse. Certainly not spam.

-- 
Rod Smith, [EMAIL PROTECTED]
http://www.rodsbooks.com
Author of books on Linux networking & multi-OS configuration

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

From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Subject: Re: 2.4.0test2 and pppd
Date: Tue, 11 Jul 2000 16:25:34 -0700

Johan Kullstam wrote:
> 
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> 
> > No need to act haughty. I keep that in my email fields because some
> > sites steal the info from your browser and it pisses me off.
> 
> what does a browser have to do with usenet? ;-)

Not much. Relatively. I often use both, but it uses the browsers address
fields.

> no need to insult the world.  just get junkbuster.

Sorry if you are offended. But when it comes to my privacy/rights there
is no polite way to say "back the fuck off" after all "give an inch and
they take a mile".

I do. And a Firewall. And anything else I can get ahold of. I am
paranoid because I am tired of being screwed for money.

> <URL:http://www.junkbusters.com>
> 
> run browser of your choice through junkbuster proxy (works in unix,
> linux *and* windows).  have it strip outgoing info to protect your
> privacy.  have it strip incomming ads to protect your sanity.
> 
> --
> johan kullstam l72t00052

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

From: [EMAIL PROTECTED]
Subject: Re: Raw disk access on Linux
Date: Tue, 11 Jul 2000 23:24:37 GMT

On Fri, 30 Jun 2000 01:53:47 GMT Christopher Browne <[EMAIL PROTECTED]> wrote:

| The problem with expectations will be based on just _how_ raw you want
| your disk accesses to be.
|
| The RDBMS vendors generally want access to be _completely_ raw, with
| _no_ possible involvement of cacheing, so that they can manage their
| own caches.

And for good reason.  The DB engine has a better idea of what it more
likely to be needed soon.  Since the DB isn't inside the kernel, it
would be incompetition with the kernel to utilize resources (RAM).


| On Linux, the access to disk via /dev/hda, /dev/sdc, and so forth, 
| _are_ going to be cached.

In the BSD world, truly raw devices are used for more than just things
that need to do their own caching.  They are used for things such as
initializing a filesystem.  I don't particularly see the point for it
as long the cache is working right.

OTOH, getting the cache working right seems to still be an issue.
When I do something like extra a multi-gigabyte tar file, I end up
flooding my RAM with tons of stuff I don't need.  Worse, it pushes
out active virtual memory to do this.  Having gone from 128meg RAM
to 384meg RAM actually made it worse.  This is in 2.2.16.  So AFAIC,
Linux still has caching maturity to accomplish.  I'll be trying 2.4
in the next couple weeks or so, and see how it behaves in that.  For
now I've dropped the RAM back down to 128meg.

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

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

From: "Peter Huang" <[EMAIL PROTECTED]>
Subject: are PCI drivers char drivers?
Date: Tue, 11 Jul 2000 16:29:33 -0700


Hi

I'm new to the driver development and it seems that PCI drivers are char
driver and I can initialize it with register_chrdev(...) Can any one confirm
that with me?



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

From: [EMAIL PROTECTED]
Subject: Re: processes with status <defunct>
Date: Tue, 11 Jul 2000 23:44:03 GMT

On Tue, 11 Jul 2000 19:44:16 GMT Kaz Kylheku <[EMAIL PROTECTED]> wrote:

| On Tue, 11 Jul 2000 14:33:26 -0400, Travis Hein <[EMAIL PROTECTED]>
| wrote:
|>in both user application threads, forks, and in kernel module threads, when i
|>create the thread, use it, then allow it to exit on its own, or sent it a
|>SIGTERM, as long as the program is still running, when i do a  ps, i see the
|>process (that was terminated there) but with <defunct> after it. Of course, when
|>i exit the program, the defunct ones go away.
|>
|>what does this <defunct> mean, and how could i terminate a thread in my programs
|>and not have these appear.
|
| Read the comp.unix.programmer FAQ. A terminated UNIX process must be collected
| by one of the wait system calls. 

Isn't the only thing being held by the process just the wait code?  Aren't
all the other resources already freed up?  If we could make defunct processes
not count against quotas, I see no major reason not to usually just ignore
them.  Of course way too many of them could fill up a fixed sized process
table.

| POSIX threads are not (supposed to be) processes; in LinuxThreads, when a
| thread terminates, it is collected by the thread manager, possibly after an up
| to two second delay, sinced the thread manager sits in a poll(fd, 2000) at the
| top of its loop. Until that collection happens, you see the thread in a zombie
| state.  However, you have to use pthread_join() to collect the library-level
| resources occupied by the thread. Either that, or create the thread detached or
| have it call pthread_detach().

I guess we still need some sort of unified wait-for-anything-to-happen
system call.  Waiting for multiple different classes of events (file
descriptors becoming ready being one, child process state change being
another, and signals being yet another) is still something that often
has to be done, and is cumbersome with the current mechanisms.

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

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

From: [EMAIL PROTECTED]
Subject: Re: problem of little indian to big indian code
Date: Tue, 11 Jul 2000 23:54:41 GMT

On Tue, 11 Jul 2000 23:41:42 +0200 bruno.patin <[EMAIL PROTECTED]> wrote:

| I have an application that creates data on another platform than Linux
| and when we read these datas on the linux box, we have to work on the
| order of the bytes by eight block count. Is there a mean to do the work
| automatically by options on the opening of the file ? where can i find
| answers on this subject ?

If the application on the Linux box is one you can change the code for
(such as you wrote it yourself) then simply read the data in the byte
order you know it to be.

I don't know what you mean by "the order of the bytes by eight block count".
But if you know when in the input stream you have one of these integers
and how many bytes it is, then just read it one byte at a time and shift
it into an integer variable in the appropriate order.  If you are reading
a number in big endian, then you start by having a variable assigned with
the value 0, and for each byte read in, shift it left by 8 bits and add
in the new one.  If the number is little endian, you pre-shift the byte
by N times 8 bits where N is the byte count sequence starting with 0,
and add that to the accumulation variable.  The resultant code will be
a little slower, but will be portable (e.g. it will read the data in the
fixed byte order regardless of the byte order of the host running it).

There are also some tools around to do this that better optimize cases
where the re-ordering isn't needed.  You could use the network byte
order functions in the socket library if your data fits that scheme.

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

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

From: "P. Eric Chi" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking
Subject: SOCK_PACKET and datalink layer access from user space program
Date: Tue, 11 Jul 2000 17:00:23 -0700

Hi,

I'm trying to write a user space program to send datalink layer packets. I
got the example from Richard Stevens web site. The code opens a SOCK_PACKET
type socket. The socket opens ok. But I kept getting the error message when
running the program:
    [root write-datalink]# ./writepcap -l 171.68.134.88.30000
device = eth0
write error to pcap device, fd=3; status=-1: Transport endpoint is not
connected

Does anyone know where the problem may be? Any pointers?

Thanks,
Eric.




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

From: John Gluck <[EMAIL PROTECTED]>
Subject: Re: warning on volatile
Date: Tue, 11 Jul 2000 19:52:50 -0400

[EMAIL PROTECTED] wrote:

> Hi,
>  i have defined a struct as volatile
>  typedef volatile struct xxx{
>  int i;
> }X, *PX;
>
> now when I use any Os function like memset
> i get a warning
> passing arg 1 of `memset ' discards `volatile' from pointer target type.
> Iam getting tons of these warnings.
> 1. Do i have to be careful about this warning, or can i ignore it?
> 2. If this warning is irrelevant How can i suppress it?
>
> thanks
> jeseem
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

volatile should not be used with a type. A type is not volatile only a
variable of the type can be volatile.

It is also fairly rare that you need to use the volatile. It is used mainly
when an other process or an interrupt can change the variable.

Something like this:

volatile int Something = 1;

void MyFunc()
{
    while(something);  /* wait for someone to make Something = 0 */
    printf("Yippee it got changed\n");
}

Without the volatile, the variable would get put in a register and the
change would never be seen.
Volatile tells the compiler to generate code such that the memory variable
is read at the top of each loop before testing the value.

--
John Gluck  (Passport Kernel Design Group)

(613) 765-8392  ESN 395-8392

Unless otherwise stated, any opinions expressed here are strictly my own
and do not reflect any official position of Nortel Networks.




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

From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: are PCI drivers char drivers?
Date: Wed, 12 Jul 2000 00:11:31 GMT

On Tue, 11 Jul 2000 16:29:33 -0700, Peter Huang <[EMAIL PROTECTED]> wrote:
> I'm new to the driver development and it seems that PCI drivers are char
> driver and I can initialize it with register_chrdev(...) Can any one confirm
> that with me?

Your question does not make sense to me. Please describe in more
details how you see a connection between a "PCI driver" and
a character device. Also what do you think a "PCI driver" is.
Otherwise you cannot receive a meaningful answer.

--Pete

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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.powerpc
Subject: Re: [ANN] Beta testing of CW for Linux on Intel and PowerPC
Date: Tue, 11 Jul 2000 19:23:21 -0500

[EMAIL PROTECTED] (Kaz Kylheku) wrote:
>MWRon <[EMAIL PROTECTED]> wrote:

>> [ANN] Beta testing of CW for Linux on Intel and PowerPC platforms
>>
>> Metrowerks is taking applications for Beta testers for the next 
>> version of CodeWarrior for Linux on Intel and PowerPC Platforms.   
>> To qualify you must be familiar with the Linux operating system and 
>> are interested in Beta testing CodeWarrior for Linux.  You must be 
>> able to download large files and you will be required to file bug 
>> reports.

> I consider this spam.

What don't you consider spam?

Okay, that does come off rather confrontational.  I'll rephrase.

What criteria do you use to make your determinations of spam and 
not-spam?

-- 
__  _____________  __
\ \_\ \__   __/ /_/ /        <http://www.war-of-the-worlds.org/>
.\  __ \ | | / __  /----------------------------------------------------
^ \_\ \_\|_|/_/ /_/             Don't mail me, I'll mail you.

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

From: [EMAIL PROTECTED] (Pete Zaitcev)
Subject: Re: Why Does Linux Arp All The Time?
Date: Wed, 12 Jul 2000 00:32:20 GMT

> I would prefer the ARP logic work a little differently.  Maybe if I get up
> enough motive I might go hack the change.  The way I might try changing it
> would be:
> 
> 1.  Record an expiration flag in each ARP entry.
> 2.  After 60 seconds of inactivity mark the entry expired.
> 3.  After 5 minutes of activity mark the entry expired.
> 4.  When an ARP lookup gets an expired entry, broadcast the ARP request,
>     but go ahead and use the expired entry for now.
> 5.  If the ARP response is received, replace the ARP table entry, and
>     clear the expired flag.
> 6.  If the expired entry is still expired after 20 seconds remove it from
>     the ARP table.

You need to work on your definition of "activity". Suppose a user
(== any layer that is higher than ARP) sent out a packet, which
is resolved through an ARP cache hit. Does that constitute an
"activity"? I think not! If this packet never reaches a station
that is powered down, you'll never know that.

In my opinion an attempt to cache an "active" ARP entry would be
misguided. RFC-826 only states that periodic broadcasts are
undesireable to keep tables up to date at all times. It does not
prohibit timing entries out.

When RFC-826 was written, IP addresses did not travel routinely
from MAC to MAC, but in these days they do. One case would be a
DHCP governed network when an IP address can be reallocated, and
another case is a HA type of environment with standby servers.

--Pete

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


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