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

Contents:
  warning on volatile ([EMAIL PROTECTED])
  Re: file descriptor limitation on linux (Al)
  Re: keyboard with additional function keys ("LY")
  Re: Serial comms in C/C++/probably anything! (Ron)
  Re: sizeof() in gcc ("Norm Dresner")
  Newbie Kernel Upgrade Question (Justo M. Casablanca)
  Re: keyboard with additional function keys (Daniel Graf)
  Re: Embedded linux problem? ("Mark Langsdorf")
  Re: Newbie Kernel Upgrade Question ([EMAIL PROTECTED])
  Re: Possible bug in insmod (RH5.2) ("Norm Dresner")
  processes with status <defunct> (Travis Hein)
  Re: file descriptor limitation on linux (Myke Morgan)
  Re: file descriptor limitation on linux ("Lawrence K. Chen, P.Eng.")
  Re: processes with status <defunct> (Kaz Kylheku)
  Re: warning on volatile (Erik Max Francis)
  Re: keyboard with additional function keys (Ken Walter)
  Re: Newbie Kernel Upgrade Question (Justo M. Casablanca)
  Re: Newbie Kernel Upgrade Question ([EMAIL PROTECTED])

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

From: [EMAIL PROTECTED]
Subject: warning on volatile
Date: Tue, 11 Jul 2000 16:00:35 GMT

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.

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

From: Al <[EMAIL PROTECTED]>
Subject: Re: file descriptor limitation on linux
Date: Tue, 11 Jul 2000 11:14:48 -0500

> We are developping a socket application using the select directive.
> On Red Hat Linux , Anyone knows the max number of file descriptor we can
> open simultaneously.

1024. See limits.h.

> it is possible to increase this number ?

In an app, you can setrlimit above this but only up to 4096, as per fs.h.
Inside there, you see the "absolute limit" but changing these would
require a kernel recompile... See also, the previous thread about
increasing CHILD_MAX.

al



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

From: "LY" <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development.apps,comp.os.linux.development,comp.os.linux.hardware
Subject: Re: keyboard with additional function keys
Date: Tue, 11 Jul 2000 18:42:31 +0200

Hi!

Thanx for answering.

The keyboard is from an unknown european company. Its name is SKIDATA.
And I want to use this keyboard under X.

CU



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

From: Ron <[EMAIL PROTECTED]>
Subject: Re: Serial comms in C/C++/probably anything!
Date: Tue, 11 Jul 2000 12:19:58 -0400

The calls open() and read() should work fine.  When you use read(), you'll
get all the characters.  But don't read into a string, use a character array
or something similar.  A string will terminate on a \0 character, which you
don't want.  I use the following and it works without dropping any
characters in rx or tx:

  int comfd;
  char ch;
  struct termios tio;

  /* open com port */

  comfd = open("/dev/ttyS0",O_RDWR | O_NOCTTY);

  bzero(&tio, sizeof(tio));
  c_cflag = B115200 | CS8 | CLOCAL | HUPCL | CREAD;
  c_iflag = IGNBRK | IGNPAR;
  c_oflag = 0;
  c_lflag = 0;
  c_cc[VTIME] = 10;  /* 1 sec timeout */
  c_cc[VMIN] = 0;    /* return on single char read */
  tcsetattr(comfd, TCSANOW, &tio);

  /* read 1 char from com port --> repeat for all chars, 1 sec timeout */

  if (read(comfd,ch,1) == 1)
    char_ok_code;
  else
    no_char_available_code;


Ron

> Jem wrote:
> 
> > Hi guys,
> >
> > I'm developing an application that takes bytes of a serial port and
> > throws them out of a socket interface onto a LAN. All is well and good
> > BUT how do I make sure that the bytes are "untampered" with, i.e. \r
> > hasn't been removed or changed into \n or \0 and ALL control codes will
> > pass through?
> >
> > There are loads of termios settings I realise but it would appear that
> > \r will be affected all the time by things like, what column is the
> > cursor in, etc... Am I reading the manuals wrong? Is there a nice
> > straightforward way of getting, byte by byte, each /dev/ttyS0 byte?
> >
> > Currently I'm using open() and read() to get the bytes...Maybe I need to
> > go to a lower level somehow? I mean, transferring of binary data over a
> > com port must be possible, it's just the books seem to approach it from
> > the point of view of talking to headless server devices and the like.
> >
> > The options I have come up with so far would be:
> >
> > c_iflag :       IGNBRK
> >                 ~ISTRIP
> >                 ~INLCR
> >                 ~IGNCR
> >                 ~ICRNL
> >
> > c_oflag :       OPOST
> >                 ~ONOCR
> >                 ~OCRNL
> >                 ~ONLRET
> >
> > c_cflag :       CLOCAL
> >                 CS8             8 bit
> >                 ~CSTOPB
> >                 ~HUCPL
> >
> > Do I need ALL of these constants in termios or am I going about it all
> > wrong?
> >
> > Thanks for any help,
> >
> > Jeremy

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

Reply-To: "Norm Dresner" <[EMAIL PROTECTED]>
From: "Norm Dresner" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: sizeof() in gcc
Date: Tue, 11 Jul 2000 17:29:25 GMT


cLIeNUX user <[EMAIL PROTECTED]> wrote in message
news:8kelnj$iu$[EMAIL PROTECTED]...
> [EMAIL PROTECTED]
> >
>
> Also of note, the Plan9 C compiler specifically chooses to not support #if
> at all. Thompson, Ritchie et al now feel that #if is a mis-feature.
>
I have a stand-alone preprocessor that I've used for other projects and I
feel no shame in using it with other "languages".

It may be a mis-feature in an academic environment but in an industrial
setting where we have to move code between compilers on computers with very
different architectures, it's a necessity to maintain source integrity.

    Norm



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

From: Justo M. Casablanca <[EMAIL PROTECTED]>
Subject: Newbie Kernel Upgrade Question
Date: Tue, 11 Jul 2000 17:30:07 GMT

I have RH Linux 6.2 installed, with the 2.2.14-1 kernel I believe (whatever
came in the CD-ROM). I understand that 2.2.16-3 is the latest (or closest
to). I would like to upgrade but don't know if I can do it all at once 
(i.e. 2.2.14-1 ---> 2.2.16-3) or if I must do it incrementally (i.e.
2.2.14-1 ---> later 2.2.14-X versions ---> earlier 2.2.16-X versions --->
2.2.16-3).

I excluded 2.2.15 from the above sequence because I believe 2.2.<odd #>
are development versions - please correct me if I'm wrong.

Thx in advance for your advice !!!

Justo M. Casablanca
[EMAIL PROTECTED]
[EMAIL PROTECTED]

--
Posted via CNET Help.com
http://www.help.com/

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

From: [EMAIL PROTECTED] (Daniel Graf)
Crossposted-To: 
comp.os.linux.development.apps,comp.os.linux.development,comp.os.linux.hardware
Subject: Re: keyboard with additional function keys
Date: Tue, 11 Jul 2000 17:35:28 GMT

On Mon, 10 Jul 2000 20:10:34 -0400, [EMAIL PROTECTED]
(B'ichela) wrote:

>On Mon, 10 Jul 2000 21:47:20 +0200, LY <[EMAIL PROTECTED]> wrote:
>>Thanx for the information, but I still have the problem. I've mentioned that
>>if I press a key that I'll get a sequence of scancodes e.g. scancode for the
>>number "4" is 0x85, after pressing the additional function key I get 0x85
>>0x85. I can't work with this sequence of scancodes, because it's not unique.
>>
>>However, thanx for the information!!!
>       Whoa! whoa! I think you are slightly confused. On the IBM
>keyboard the Fkeys are two digits for the scan codes. (grumble I wish
>I still had my Dos books here). If the preceding digit is a 0 followd
>by a number. press F1 for example. you will see a number like this
>0;32 (its an example ok, I don't have my books anymore as I dumped
>them when I went to linux full time).
>       What you Need to do is... If you can give us the manufactuers
>name and Model Number, One can look on the web for the specs
>reguarding the double byte scan codes sent by your 30 extra keys!
>       Isn't here a program that will show this table? I checked
>dumpkeys and it looks at keytable (when it comes to IBM compat
>keyboards I even get lost). Perhaps these keys are user Programmed
>either via software or by keyboard settings. AGain without the
>instructions one cannot be certain of which it is!
>       Flip up the keyboard, give us the Manufactuer,  and the model
>number (AT LEAST!!!!) and perhaps someone who has a similar keyboard
>will be able to speak up.
>
>-- 
>
>                       B'ichela

        Actualy the keyboard itself sends numbers for those keys in
the range of 0-127 for a key presses and corresponding +128 value
(rang 128-255) for key releases.  IIRC, these are received via port 60
usually in an interrupt service routine tied to the keyboard's irq. 
        Bios translates these into ascii values or 0 + extended
keyboard scan code.  So, this has nothing to do with the keyboard
manufacturer.

        I'm sure Linux handles this via its own ISR rather than the
one provided by bios.





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

From: "Mark Langsdorf" <[EMAIL PROTECTED]>
Crossposted-To: 
comp.arch.embedded,comp.os.linux.development.apps,comp.os.linux.networking,comp.os.linux.portable,comp.unix.programmer
Subject: Re: Embedded linux problem?
Date: Tue, 11 Jul 2000 12:41:29 -0500


"NTUST" <[EMAIL PROTECTED]> wrote in message
news:8k98p9$f4s$[EMAIL PROTECTED]...
> hello everbody
>
>     I have got a project about enbedded Linux recently.
>     It's a thin router which is based on Embedded Linux.
>     I confused to how to do that.
>     Because I don't have any experience to embed Linux.
>     So...I wanna get some help or suggestion.
>     Therefore , I list some objectives.

    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
ported to Arm-7, though, you've got a monster task ahead of
you.

-Mark Langsdorf

> Objectives:
>        1.Based on the evaluation board of VIA-6509 with IDE interface,
>           build thin router software components.
>        2.porting from 80x86 platform to ARM-7 platform.
>        3.porting routing protocols(RIP,OSPF) to embedded Linux.
>        4.porting NAT(network address translator) to embedded.
>        5.protocol software debugging
>
>      As a result,I hope someone can resolve my problem.
>       thanks a lot  ^.^
>
> by daniel
>
>



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

From: [EMAIL PROTECTED]
Subject: Re: Newbie Kernel Upgrade Question
Date: Tue, 11 Jul 2000 17:53:20 GMT

Justo M. Casablanca <[EMAIL PROTECTED]> wrote:
> I have RH Linux 6.2 installed, with the 2.2.14-1 kernel I believe (whatever
> came in the CD-ROM). I understand that 2.2.16-3 is the latest (or closest
> to). I would like to upgrade but don't know if I can do it all at once 
> (i.e. 2.2.14-1 ---> 2.2.16-3) or if I must do it incrementally (i.e.
> 2.2.14-1 ---> later 2.2.14-X versions ---> earlier 2.2.16-X versions --->
> 2.2.16-3).

Yes, unfortunatly, Redhat can make this somewhat tedious. The -X
portion of the version number isn't part of the actual kernel version,
it's a Redhatism. Personally, I've always compiled my own kernel
upgrades and installed them by hand. You could also go the rpm route
and try rpm -F kernel-whatever.rpm. 

As far as I know, 2.2.14 to 2.2.16 doesn't break anything else in RH
6.2, except modules, which you should upgrade at the same time.

> I excluded 2.2.15 from the above sequence because I believe 2.2.<odd #>
> are development versions - please correct me if I'm wrong.

Actually, if the middle number is odd, it's a development
version. (ie, 2.3.x is the current development leading to the
forthcoming 2.4.x)

-- 
Matt Gauthier <[EMAIL PROTECTED]>

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

Reply-To: "Norm Dresner" <[EMAIL PROTECTED]>
From: "Norm Dresner" <[EMAIL PROTECTED]>
Crossposted-To: comp.arch.embedded,linux.redhat.development
Subject: Re: Possible bug in insmod (RH5.2)
Date: Tue, 11 Jul 2000 18:10:13 GMT

I'm afraid you didn't understand the question.  I have full read/write
access to the memory using either hard-coded addresses or pointers.  I was
trying to make a c-module be able to directly access a memory address
without having to dereference a pointer.

For example (if it worked), I could access the Dual Ported Memory as
follows:

    extern    short DPM_Status , DPM_Command;

    DPM_Command = LOAD_PROGRAM;
    while( DPM_STATUS == 0 )
        ...
where (using the segment capability of gcc and ld) I've already specified
that DPM_Status is at 0x000D0000 and DPM_Command is at 0x000D0002.  It's not
an accessibility question because I can use the explicit addresses or
dereference pointers set to these addresses and have the code work.

    Norm


Villy Kruse <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Mon, 10 Jul 2000 14:14:37 GMT, Norm Dresner <[EMAIL PROTECTED]> wrote:
> >I'm having a problem because INSMOD is not loading one module correctly.
> >Here's the system:
> > RH 5.2 w/Real-Time Linux 0.9J extensions to the kernel
> > gcc-2.7.2.3-14
> > binutils (ld) 2.9.1.0.15-1
> > modutils  (insmod) 2.1.85-9
> >
> >An interface board I'm using has its 64K dual-ported segment located in
> >PC-address space at 0x000D0000, so I'm trying to get the module compiled
so
> >that a particular `segment' falls at that address so I can use direct
> >addressing of registers instead of having to dereference pointers for
every
> >access.
>
> If you need to access memory at a specific physical address you need
> to call the appropriate kernel function to give you the equivalent
> kernel virtual address, which may or may not be the same.
>
>
> Read the IO-mapping.txt in the Documentation directory of the linux
> source.
>
>
>
> Villy


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

From: Travis Hein <[EMAIL PROTECTED]>
Subject: processes with status <defunct>
Date: Tue, 11 Jul 2000 14:33:26 -0400

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.

Travis




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

From: [EMAIL PROTECTED] (Myke Morgan)
Subject: Re: file descriptor limitation on linux
Date: 11 Jul 2000 19:06:09 GMT

I found an answer on this web site:

http://www.volano.com/linux.html

You can easily change the limits on-the fly. RedHat 6.1/6.2 for sure that 
I know of.

In article <8kesdd$mi1$[EMAIL PROTECTED]>,
S�bastien Le Fustec <[EMAIL PROTECTED]> wrote:
>We are developping a socket application using the select directive.
>On Red Hat Linux , Anyone knows the max number of file descriptor we can
>open simultaneously.
>
>it is possible to increase this number ?


myke


--
I proclaim you, FOUR!


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

From: "Lawrence K. Chen, P.Eng." <[EMAIL PROTECTED]>
Subject: Re: file descriptor limitation on linux
Date: Tue, 11 Jul 2000 14:41:45 -0400



Al wrote:
> 
> > We are developping a socket application using the select directive.
> > On Red Hat Linux , Anyone knows the max number of file descriptor we can
> > open simultaneously.
> 
> 1024. See limits.h.
> 
> > it is possible to increase this number ?
> 
> In an app, you can setrlimit above this but only up to 4096, as per fs.h.
> Inside there, you see the "absolute limit" but changing these would
> require a kernel recompile... See also, the previous thread about
> increasing CHILD_MAX.
> 
> al

Interesting...only works as root....and getrlimit reports the rlim_max as
1024, but setrlimit allows me to specify rlim_cur to be bigger (2048).

Of course its no use to me, since the process can't run as root.  Plus it
would require a kluge to make it know that it can ignore rlim_max when
deciding on a value for rlim_cur.....

-- 
    Who: Lawrence Chen, P.Eng.          Email: [EMAIL PROTECTED]
   What: Software Developer               URL: http://www.opentext.com/basis
  Where: Open Text, BASIS Division      Phone: 614-761-7449
         5080 Tuttle Crossing Blvd.       Fax: 614-761-7269
         M/S 7&8
         Dublin, OH  43016                ICQ: 12129673
  DISCLAIMER: All opinions expressed are mine and *NOT* my employers

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: processes with status <defunct>
Reply-To: [EMAIL PROTECTED]
Date: Tue, 11 Jul 2000 19:44:16 GMT

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. 

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().

-- 
#exclude <windows.h>

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

From: Erik Max Francis <[EMAIL PROTECTED]>
Subject: Re: warning on volatile
Date: Tue, 11 Jul 2000 13:15:29 -0700

[EMAIL PROTECTED] wrote:
> 
> Hi,
>  i have defined a struct as volatile
>  typedef volatile struct xxx{
>  int i;
> }X, *PX;

I don't believe what you're trying to do has much meaning.  volatile is
a characteristic of variables, not types.  gcc refuses to compile such
calls with all warnings on in ANSI pedantic mode.

What is it that you're trying to do?

-- 
 Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Who'd ever think it / Such a squalid little ending
\__/ The American/Florence, _Chess_
    Interstelen / http://www.interstelen.com/
 A multiplayer, strategic, turn-based Web game on an interstellar scale.

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

From: [EMAIL PROTECTED] (Ken Walter)
Crossposted-To: 
comp.os.linux.development,comp.os.linux.hardware,comp.os.linux.development.apps
Subject: Re: keyboard with additional function keys
Date: Tue, 11 Jul 2000 20:30:54 GMT

On Tue, 11 Jul 2000 18:42:31, "LY" <[EMAIL PROTECTED]> wrote:

#Hi!
#
#Thanx for answering.
#
#The keyboard is from an unknown european company. Its name is SKIDATA.
#And I want to use this keyboard under X.
#
#CU
#
#
It should work normally, unless the keyboard is programmable or you 
have a bug in your code.
The Linux Journal June 1995 (online) has an article on keyboard 
drivers for Linux.




Ken Walter

Remove -zamboni to reply
All the above is hearsay and the opinion of no one in particular




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

From: Justo M. Casablanca <[EMAIL PROTECTED]>
Subject: Re: Newbie Kernel Upgrade Question
Date: Tue, 11 Jul 2000 20:30:05 GMT

Thx so much for your quick response ! Another question, though ....
how do I upgrade the modules ? None of the kernel-*.rpm file names
at redhat.com imply module upgrades.

Also, once I get the upgraded kernel working, shouldn't I install the
kernel source rpms, since any apps I compile may reference the kernel
headers, etc. ?

--
Posted via CNET Help.com
http://www.help.com/

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

From: [EMAIL PROTECTED]
Subject: Re: Newbie Kernel Upgrade Question
Date: Tue, 11 Jul 2000 20:59:23 GMT

Justo M. Casablanca <[EMAIL PROTECTED]> wrote:
> Thx so much for your quick response ! Another question, though ....
> how do I upgrade the modules ? None of the kernel-*.rpm file names
> at redhat.com imply module upgrades.

Ugh, this is what I meant by RH making it hard. The kernel and modules
are in the kernel package. The kernel headers are in the
kernel-headers package.

If you're not using any third-party pieces, the rpms will probably
upgrade reasonably painlessly. I, however, have never attempted it. 

-- 
Matt Gauthier <[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 (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