Linux-Development-Sys Digest #232, Volume #8     Mon, 23 Oct 00 23:13:11 EDT

Contents:
  Re: mounted dos partition ("Raymond Mroz")
  -  Major automotive website               - ([EMAIL PROTECTED])
  g++ fd.getline() and msvc fd.getline()?? ("David C. Brown")
  Re: Erors making modules with RedHat7.0 and 2.2.16-22 (Josef Moellers)
  kernel applications ("Ron")
  Re: Which Gcc version to compile Linux Kernel ? (Timothy Murphy)
  How to set MAC addr of outgoing packets? (NortonNg)
  Re: kernel applications (Anders Larsen)
  proc_root ("Ron")
  Re: proc_root (Mathias Waack)
  Re: proc_root ("Ron")
  Re: proc_root (Mathias Waack)
  Re: Which Gcc version to compile Linux Kernel ? (Paul Kimoto)
  ncurses ("Daddymack")
  Device or resource busy (Ed Hudson)
  Re: sockets per process ([EMAIL PROTECTED])
  Re: Device or resource busy (J Wendel)
  ncurses ("Daddymack")
  Re: ncurses (Thomas Dickey)

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

From: "Raymond Mroz" <[EMAIL PROTECTED]>
Subject: Re: mounted dos partition
Date: Mon, 23 Oct 2000 09:36:34 -0300

Thanks for your response Josef.

Yes, it is indeed a "pull the plug" scenario.  We must be able to deal with
power failure and other similar accidents without the need to worry of
corruption to the FAT32 partition.  We do not anticipate a continuing
situation whereby the power is repeatedly shutdown, but in the real world
these things, as I am sure you are aware of, can happen.

Your response has been helpful and I thank you.

Raymond Mroz

"Josef Moellers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
The Ghost In The Machine wrote:
>
> In comp.os.linux.development.system, Raymond Mroz
> <[EMAIL PROTECTED]>
>  wrote
> on Fri, 20 Oct 2000 11:59:45 -0300
> <i6ZH5.74238$[EMAIL PROTECTED]>:
> >Hello,
> >
> >We are running a Linux OS in a product and are required to access a FAT32
> >filesystem.  This is set up to mount in the fstab file.  My question is
> >this:  If the product is repeatedly and ungracefully shutdown, can the
FAT32
> >filesystem which is being mounted (and ungracefully unmounted) become
> >corrupted over time.  Are there any other problems which may arise?
>
> What product are you referring to?
>
> - Linux?
> - Microsoft Windows?
> - An application running under Linux?
> - An application running under Microsoft Windows?

???
"We are running _a_Linux_OS_ ..."

> Proper shutdown of Linux involves the "shutdown" command.
> Note that /etc/inittab in RedHat -- and probably in other
> releases -- contains an entry similar to

"ungracefully shutdown", this sounds more like "pulling-the-plug
shutdown" rather than:
> ca::ctrlaltdel:/sbin/shutdown -t3 -r now

Raymond, as long as you don't modify any data on the FAT32 disk, not
much harm should be done to the mounted filesystem. As soon as you write
to the file system, the buffer cache will store the data in memory prior
to writing it to disk. This data is irrevocably lost when you pull the
plug or hit the reset button. Note that you can't get away with
increasing the rate of calling sync, because Murphy will see to it that
your system is "ungracefully shutdown" just before the next call.

Perhaps modifying the close() systemcall to flush the data to disk when
a file is closed will help, but it will fail if the system goes down
before a file is closed.

--
Josef M�llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)



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

From: [EMAIL PROTECTED]
Subject: -  Major automotive website               -
Date: Sun, 22 Oct 2000 13:38:57 +0000


seriousmonkey.com is set to revolutionise the global automotive 
industry with a wide range of genuinely groundbreaking and innovative 
Internet services benefiting business and consumers alike.

In order to support the hyper-growth expansion of our global operations, 
seriousmonkey.com will shortly be looking for a number of high-calibre, 
professional candidates to join our fast-paced and dedicated teams in 
London and the Republic of Ireland.

To visit seriousmonkey.com or view our online job vacancies, go to 
http://www.seriousmonkey.com

Frank Pottle
Managing Director
seriousmonkey.com


















































Article posted 23/10/2000 13:38:57.600



















































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

From: "David C. Brown" <[EMAIL PROTECTED]>
Subject: g++ fd.getline() and msvc fd.getline()??
Date: Mon, 23 Oct 2000 21:15:50 -0500

Question:  I've written a program that reads records from a text file.

sorta like thsi..

int main() {
ifstream in;

in.open(filename);
while(!in.eof()) {
        in.getline(inbuff, 199);
        cout << inbuff;
return 0;
}

Well it compiles fine, but it doesn't read from the file (300+ lines) I
get eof returned after the first
read attempt.  Is there a bug or something in fd.getline()?  I've never
used this in linux but it works
great in msvc++.  or is there a different syntax in using this
statment?  any help would be great

thanx
David


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

From: Josef Moellers <[EMAIL PROTECTED]>
Crossposted-To: comp.ox.linux.setup
Subject: Re: Erors making modules with RedHat7.0 and 2.2.16-22
Date: Mon, 23 Oct 2000 16:28:37 +0200

root wrote:
> =

> I had to redefine smp_num_cpus, for no reason I could quickly determine=
,
> in '/linux/kernel_stat.h' whilst compiling the kernel. The reported
> error was an undefined symbol, probably some conditional compilation I
> couldn't be arsed to look for.

My (un) educated guess is that it has to do with symbol versioning. I
had to change it into a
static int smp_num_cpus =3D 1;
to get the kernel (and modules) to compile.
I sent kernel/ksyms.c through the preprocessor only and I got some
references of the symbol versioning stuff, so I guess that a #define
won't be affected, but a static int will.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T. Pratchett)

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

From: "Ron" <[EMAIL PROTECTED]>
Subject: kernel applications
Date: Mon, 23 Oct 2000 10:53:56 -0400

I'm trying to understand how an application gets stored in kernel space. I
realize that if you compile something as a kernel module then it will place
the corresponding object in its kernel address space.

However, if you want to create an application that isn't compiled as a
module, how do you make it reside in kernel space

Thanks,
Ron



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

From: [EMAIL PROTECTED] (Timothy Murphy)
Crossposted-To: alt.os.linux,comp.os.linux.misc
Subject: Re: Which Gcc version to compile Linux Kernel ?
Date: 23 Oct 2000 16:41:27 +0100

"O.Petzold" <[EMAIL PROTECTED]> writes:

>> This got rid of the compilation errors,
>> but threw up a lot of assembler warnings about not being able
>> to modify .modinfo ,
>> which seemed to result in no modules being installed
>> by "make modules_install".

>This is not related on the kernel at all. I've compiled a kernel module which
>isn't in the kernel tree with gcc version 2.95.2 19991024 (release)  and
>got the similar warnings:

>/tmp/ccWv6Hv5.s: Assembler messages:
>/tmp/ccWv6Hv5.s:47: Warning: Ignoring changed section attributes for .modinfo

Thanks for the info.
But is there any connection between this
and the fact that no modules seem to be installed,
basically because /usr/src/linux/modules does not contain 
the names of the relevant module units as it used to.


-- 
Timothy Murphy  
e-mail: [EMAIL PROTECTED]
tel: 086-233 6090
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

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

From: NortonNg <[EMAIL PROTECTED]>
Subject: How to set MAC addr of outgoing packets?
Date: Mon, 23 Oct 2000 16:07:08 +0000 (UTC)

hi all,
        
        I am writing a kernel module that resend packets which receive from
ethernet. Instead of using IP redirect mechinism, i use MAC address for
dynamic packet redirection( the remote hosts have the same IP address with the
dispatcher). The dispatcher will redirect some packets to backend servers
with round robin method. For some reasons, i need to do it after ip_defag() 
function in in_input.c, but i don't know where and how to set the
destination and source MAC address of the packets. Who can help me?

jkng.


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

From: Anders Larsen <[EMAIL PROTECTED]>
Subject: Re: kernel applications
Date: Mon, 23 Oct 2000 17:51:04 +0200

Ron wrote:
> 
> I'm trying to understand how an application gets stored in kernel space. I
> realize that if you compile something as a kernel module then it will place
> the corresponding object in its kernel address space.
>
> However, if you want to create an application that isn't compiled as a
> module, how do you make it reside in kernel space

Well, a user-mode application isn't stored in kernel space at all.
Assuming your application is some sort of device driver, you can

1. compile it as a module, as you already know,

 or

2. compile it into the kernel. To do this, you'd find the right place to put it
   (e.g. /usr/src/linux/drivers/char) and modify the Makefile to compile your
   source(s). In the above example, you'd add the name of your object file to
   the macro LX_OBJS.
   Of course, you would need to change some standard source to call your
   driver, otherwise it would be nothing but a piece of dead code.

IMHO, you'd be *much* better off compiling your stuff as a module, since you can
add and remove it on-the-fly in your running system - that'll reduce the
development cycle time considerably.

> Thanks,
> Ron

cheers
-- 
Anders Larsen

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

From: "Ron" <[EMAIL PROTECTED]>
Subject: proc_root
Date: Mon, 23 Oct 2000 13:01:55 -0400

I am trying to register data with the proc fs. I am getting the compiling
error of proc_root_R032360d8 undeclared.

I tried compiling the same files on another machine and things worked fine.
What could be the problem? I tried recompiling the kernel but I got the same
problem.

Ron

COPY of code used for reference

/* procfs.c -  create a "file" in /proc
 */

#include <linux/kernel.h>   /* We're doing kernel work */
#include <linux/module.h>   /* Specifically, a module */

#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif

#include <linux/proc_fs.h>

#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) ((a)*65536+(b)*256+(c))
#endif

int procfile_read(char *buffer,
    char **buffer_location,
    off_t offset,
    int buffer_length,
    int zero)
{
  int len;  /* The number of bytes actually used */

  static char my_buffer[80];

  static int count = 1;

  if (offset > 0)
    return 0;

  len = sprintf(my_buffer,
    "For the %d%s time, go away!\n", count,
    (count % 100 > 10 && count % 100 < 14) ? "th" :
      (count % 10 == 1) ? "st" :
        (count % 10 == 2) ? "nd" :
          (count % 10 == 3) ? "rd" : "th" );
  count++;

*buffer_location = my_buffer;

  return len;
}


struct proc_dir_entry Our_Proc_File =
  {
    0, /* Inode number - ignore, it will be filled by
        * proc_register[_dynamic] */
    4, /* Length of the file name */
    "test", /* The file name */
    S_IFREG | S_IRUGO, /* File mode - this is a regular
                        * file which can be read by its
                        * owner, its group, and everybody
                        * else */
    1, /* Number of links (directories where the
         * file is referenced) */
    0, 0,  /* The uid and gid for the file - we give it
            * to root */
    80, /* The size of the file reported by ls. */
    NULL, /* functions which can be done on the inode
           * (linking, removing, etc.) - we don't
           * support any. */
    procfile_read, /* The read function for this file,
                    * the function called when somebody
                    * tries to read something from it. */
    NULL /* We could have here a function to fill the
          * file's inode, to enable us to play with
          * permissions, ownership, etc. */
  };





/* Initialize the module - register the proc file */
int init_module()
{
  #if LINUX_VERSION_CODE > KERNEL_VERSION(2,2,0)
  return proc_register(&proc_root, &Our_Proc_File);
#else
  return proc_register_dynamic(&proc_root, &Our_Proc_File);
#endif

  /* proc_root is the root directory for the proc
   * fs (/proc). This is where we want our file to be
   * located.
   */
}


void cleanup_module()
{
  proc_unregister(&proc_root, Our_Proc_File.low_ino);
}



============================================================================
----

Next: Using /proc For Input Up: Linux Kernel Module Programming Previous:
Multiple Kernel Versions Source

1999-05-19



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

From: Mathias Waack <[EMAIL PROTECTED]>
Subject: Re: proc_root
Date: 23 Oct 2000 19:08:04 +0200

"Ron" <[EMAIL PROTECTED]> writes:

> I am trying to register data with the proc fs. I am getting the
> compiling error of proc_root_R032360d8 undeclared.
> 
> I tried compiling the same files on another machine and things worked
> fine.  What could be the problem? I tried recompiling the kernel but I
> got the same problem.

Both machines use the same compiler and kernel?

Mathias

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

From: "Ron" <[EMAIL PROTECTED]>
Subject: Re: proc_root
Date: Mon, 23 Oct 2000 13:33:08 -0400

Yes. I have a feeling that the my file is trying to use old kernel includes.
Somehow the proper header files aren't getting accessed. How can I tell
which versions are being linked. (I'm using gcc)

Mathias Waack <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> "Ron" <[EMAIL PROTECTED]> writes:
>
> > I am trying to register data with the proc fs. I am getting the
> > compiling error of proc_root_R032360d8 undeclared.
> >
> > I tried compiling the same files on another machine and things worked
> > fine.  What could be the problem? I tried recompiling the kernel but I
> > got the same problem.
>
> Both machines use the same compiler and kernel?
>
> Mathias



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

From: Mathias Waack <[EMAIL PROTECTED]>
Subject: Re: proc_root
Date: 23 Oct 2000 19:48:45 +0200

"Ron" <[EMAIL PROTECTED]> writes:

> Yes. I have a feeling that the my file is trying to use old kernel
> includes.  Somehow the proper header files aren't getting
> accessed. How can I tell which versions are being linked. (I'm using
> gcc)

You link nothing, the module will be linked against the kernel at load 
time. The compiler looks for the kernel header under /usr/src/linux, 
which is normally a soft link to the current kernel.  

Mathias

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

From: [EMAIL PROTECTED] (Paul Kimoto)
Crossposted-To: alt.os.linux,comp.os.linux.misc
Subject: Re: Which Gcc version to compile Linux Kernel ?
Date: 23 Oct 2000 15:44:01 -0500
Reply-To: [EMAIL PROTECTED]

In article <8svvqa$1kdg$[EMAIL PROTECTED]>, Timothy Murphy wrote:
> I went over to kgcc for compiling kernel-2.4.0-test9 under RedHat-7.0 
> (following advice in this newsgroup).
>
> This got rid of the compilation errors,
> but threw up a lot of assembly warnings about not being able
> to modify .modinfo ,
> which seemed to result in no modules being installed
> by "make modules_install".

Does RH7.0 include a recent modutils?  (My Debian "unstable" system
uses 2.3.16.)

-- 
Paul Kimoto
This message was originally posted on Usenet in plain text.  Any images, 
hyperlinks, or the like shown here have been added without my consent,
and may be a violation of international copyright law.

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

From: "Daddymack" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.help,linux.help
Subject: ncurses
Date: Mon, 23 Oct 2000 17:13:45 -0700

Using ncurses and C++, is there any way to change the text attributes of a
line of text after it has already been output without knowing what that line
actually contains? i.e. the equivalent of FillConsoleOutputAttribute?



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

From: Ed Hudson <[EMAIL PROTECTED]>
Subject: Device or resource busy
Date: Mon, 23 Oct 2000 17:48:40 -0400

I have successfully compiled a driver written for the 2.2 kernel
series under 2.0.34.  When I try to insmod it, I get a message
init_module() Device or resource busy.  The obvious things appear to
be ok.  The card is plugged in, other simple "Hello world" modules
work fine.  Any suggestions?  

Thanks

Ed

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

From: [EMAIL PROTECTED]
Subject: Re: sockets per process
Date: Mon, 23 Oct 2000 22:44:54 GMT

In article <[EMAIL PROTECTED]>, Eclipse mail
<[EMAIL PROTECTED]> wrote:
> i have realized that we can have only 255 file descriptors open per
> process ( including sockets).
> is it possible to have more than 255 file descriptors per process so
> that we can have a lot more tcp/ip connections per process ?

There is no reason to modify the kernel like other posts suggest.

UNIX provides a function called getrlimit().  With that, one of the
things you can specify is the number of file descriptors per process.
See the man page for getrlimit() for more information on how to use it.
As its first argument, it takes the option you would like to set, in
this case RLIMIT_NOFILE.  The second argument takes a struct rlimit.
Look at the man page for more info on how to use that.

FYI, I have gotten well over 10,000 open TCP connections per process.

Ali


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

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

From: [EMAIL PROTECTED] (J Wendel)
Subject: Re: Device or resource busy
Date: Tue, 24 Oct 2000 02:27:49 GMT


In my limited experience, this error usually means that there is a
interrupt assignment problem or an interrupt conflict. Sorry I can't
offer more help.

Regards,

John



On Mon, 23 Oct 2000 17:48:40 -0400, Ed Hudson <[EMAIL PROTECTED]>
wrote:

>I have successfully compiled a driver written for the 2.2 kernel
>series under 2.0.34.  When I try to insmod it, I get a message
>init_module() Device or resource busy.  The obvious things appear to
>be ok.  The card is plugged in, other simple "Hello world" modules
>work fine.  Any suggestions?  
>
>Thanks
>
>Ed


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

From: "Daddymack" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.help,linux.help
Subject: ncurses
Date: Mon, 23 Oct 2000 17:13:45 -0700

Using ncurses and C++, is there any way to change the text attributes of a
line of text after it has already been output without knowing what that line
actually contains? i.e. the equivalent of FillConsoleOutputAttribute?



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

From: Thomas Dickey <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.help,linux.help
Subject: Re: ncurses
Date: 24 Oct 2000 03:01:49 GMT

In comp.os.linux.development.apps Daddymack <[EMAIL PROTECTED]> wrote:
> Using ncurses and C++, is there any way to change the text attributes of a
> line of text after it has already been output without knowing what that line
> actually contains? i.e. the equivalent of FillConsoleOutputAttribute?

yes/no: if you are using the screen optimization (the normal case) you
can read the screen contents with winnstr or related functions, and
write the piece you read with new attributes.

if you are talking about low-level calls - no: those terminals just didn't
work that way.  you need something such as ncurses in between to remember
what you put on the screen.

-- 
Thomas E. Dickey <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
http://dickey.his.com
ftp://dickey.his.com

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


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