Linux-Development-Sys Digest #30, Volume #7       Sat, 7 Aug 99 21:14:11 EDT

Contents:
  fuser not working right? (Bob Berman)
  Re: Device driver programming and C++ ("Andrey Fisunenko")
  Re: limit ofo processes (Torbjorn Tallroth)
  Re: limit ofo processes (Sven Heursch)
  Re: printk ??? ("Andrey Fisunenko")
  Re: Device driver programming and C++ (Eugene Morozov)
  Re: My first linux program: non-bios boot loader (Neil Koozer)
  Re: limit ofo processes (Torbjorn Tallroth)
  Re: My first linux program: non-bios boot loader (Viljo Hakala)
  Re: Looking for a good utility... (Tristan Wibberley)
  Re: printk ??? (NF Stevens)
  Re: Linux assembly, etc (Alexander Viro)
  Re: Linux assembly, etc ([EMAIL PROTECTED])
  Re: My first linux program: non-bios boot loader (Neil Koozer)
  C++ I/O problems ("J. Escalante")
  custom initrd.img (Kevin Waterson)
  Re: Device driver programming and C++ ("Bertrand Lee")
  Re: Linux assembly, etc (brian moore)
  Re: fuser not working right? (Juergen Heinzl)
  Re: does egcs 1.1.2 produce stable kernels? (Juergen Heinzl)

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

From: Bob Berman <[EMAIL PROTECTED]>
Subject: fuser not working right?
Date: Sat, 07 Aug 1999 11:58:41 -0500

I have fuser from psmisc V18 installed and when I run it, I get an error
message:
/proc is empty (not mounted ?)

I put the executable into the debugger, and it looks like it when it checks all
the subdirectories of /proc looking for "numeric" directories - i.e. /proc/1,
/proc/10 etc. that it does not find them. It seems like the problem is with the
line in the source where it does an atoi on each subdirectory.

Breakpoint 1, scan_fd () at fuser.c:325
325             if (pid = atoi(de->d_name)) {
(gdb)  p de->d_name
$44 =
"\0004\000\000\000\000\002\000\n\000\005\001\000\000\024
\000\00010\000�\000@\000\000\000\002\000&\000\006\001\000
\000\024\000\00038\000\203\004\b\000\000\000\002\0005\000
\a\001\000\000\024\000\00053\000�\001@\000\000\000\002\0009
\000\b\001\000\000\024\000\00057\0000\001@\000\000\000\002
\000;\000\t\001\000\000\024\000\00059\000\036\001@\000\000
\000\002\000=\000\n\001\000\000\024\000\00061\000���\000\000
\000\002\000A\000\ ..... blah blah blah

Gives:

(gdb) p pid 
$45 = 0

Shouldn't this give a pid of 4? Or am I misunderstanding atoi? Is this a bug in
fuser.c then? Why has no one else encountered this? I am using gcc V2.8.1.

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

From: "Andrey Fisunenko" <[EMAIL PROTECTED]>
Subject: Re: Device driver programming and C++
Date: Sat, 7 Aug 1999 20:19:32 +0300

Thank you, Sebastien and Bertrand!
It's Ok. :-)
I returned to "man g++ > temp.txt" after reading your advice and tried to
find entry "rtti"  with no success.
Where can I read more detail g++ information like that?

Best regards.
Andrey.





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

Crossposted-To: linux.dev.kernel
Date: Sat, 7 Aug 1999 19:19:08 +0200
From: Torbjorn Tallroth <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: limit ofo processes

On Sat, 7 Aug 1999, Sven Heursch wrote:
> in linux kernel the limits of processes on a i386 machine is defined as
> 999. I need more! How can I make the kernel accept that wish?
> (Or: How can I destroy a Zombie process?)
Kill it's parent?

-- 
tth


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

Date: Sat, 07 Aug 1999 19:29:07 +0200
From: Sven Heursch <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: linux.dev.kernel
Subject: Re: limit ofo processes

Torbjorn Tallroth wrote:

> On Sat, 7 Aug 1999, Sven Heursch wrote:
> > in linux kernel the limits of processes on a i386 machine is defined as
> > 999. I need more! How can I make the kernel accept that wish?
> > (Or: How can I destroy a Zombie process?)
> Kill it's parent?
>
> --
> tth

no, I can't. The parent creates lot's of processes for a measurement of
systemcall fork. Put the zombies increment the count of existing processes.
So I need the parent to create more than 2000 processes in a few seconds.

S. Heursch


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

From: "Andrey Fisunenko" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: Re: printk ???
Date: Sat, 7 Aug 1999 20:26:00 +0300


Hung P. Tran wrote in message <[EMAIL PROTECTED]>...
>I am having trouble getting printk to work in my driver.
>I tried:
>
>printk(KERN_CRIT "start of init_module\n");
>
>It's NOT working. I also get a warning when compiling my driver:
>
>warning: implicit declaration of function printk_R1d7b4074
>
>Any idea what happened ???
>
>Thank you in advance,
>
>hung
>
>
>

Is there
                #include <linux/module.h>
in your module
                and -DMODULE and -D__KERNEL__ in gcc command line?

Andrey










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

From: Eugene Morozov <[EMAIL PROTECTED]>
Subject: Re: Device driver programming and C++
Date: 07 Aug 1999 22:09:35 +0400

"Andrey Fisunenko" <[EMAIL PROTECTED]> writes:

> Thank you, Sebastien and Bertrand!
> It's Ok. :-)
> I returned to "man g++ > temp.txt" after reading your advice and tried to
> find entry "rtti"  with no success.
> Where can I read more detail g++ information like that?
You'd better read `info gcc'.
Eugene

-- 
Email: <jmv @ lucifer dorms spbu ru>  Homepage: http://lucifer.dorms.spbu.ru

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

From: Neil Koozer <[EMAIL PROTECTED]>
Subject: Re: My first linux program: non-bios boot loader
Date: Sat, 07 Aug 1999 11:25:17 +0000

Charles Sullivan wrote:

> Sounds like a great idea.  I assume it is consistant with
> having other operating systems on the system.

I think so, but then I don't know why NT can't handle lilo being in the
MBR.  I would assume that nuni would work in /hda1 (for example) the same as
lilo for NT users.

Neil.



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

Crossposted-To: linux.dev.kernel
Date: Sat, 7 Aug 1999 20:49:53 +0200
From: Torbjorn Tallroth <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: Re: limit ofo processes

On Sat, 7 Aug 1999, Sven Heursch wrote:
> Torbjorn Tallroth wrote:
> > On Sat, 7 Aug 1999, Sven Heursch wrote:
> > > in linux kernel the limits of processes on a i386 machine is defined as
> > > 999. I need more! How can I make the kernel accept that wish?
> > > (Or: How can I destroy a Zombie process?)
> > Kill it's parent?
> no, I can't. The parent creates lot's of processes for a measurement of
> systemcall fork. Put the zombies increment the count of existing processes.
> So I need the parent to create more than 2000 processes in a few seconds.

Then I guess the only way is to change NR_TASKS in include/linux/tasks.h
and recompile your kernel.

-- 
tth


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

From: [EMAIL PROTECTED] (Viljo Hakala)
Subject: Re: My first linux program: non-bios boot loader
Date: 7 Aug 1999 18:31:01 GMT

On Sat, 07 Aug 1999 11:25:17 +0000, Neil Koozer <[EMAIL PROTECTED]> wrote:
>Charles Sullivan wrote:
>
>> Sounds like a great idea.  I assume it is consistant with
>> having other operating systems on the system.
>
>I think so, but then I don't know why NT can't handle lilo being in the
>MBR.  I would assume that nuni would work in /hda1 (for example) the same as
>lilo for NT users.
Does it work with scsi disks ?

-vh

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

From: Tristan Wibberley <[EMAIL PROTECTED]>
Subject: Re: Looking for a good utility...
Date: Fri, 06 Aug 1999 17:34:35 +0100
Reply-To: [EMAIL PROTECTED]

Mason wrote:
> 
> Can anybody point me in the direction of a good "OS spelunking" type
                                                   ^^^^^^^^^^^^^

eh?


> utility that run's under linux?  I'm looking for something like MS-DOS's
> old "debug".  Thanks.

If I remember rightly, debug is used both to disassemble, and assemble
software. gdb will disassemble, and gas will assemble.

It's not advisable to alter a running program, and to disassemble a
running kernel you need SGI's kernel debugger patch (I think).

All IMHO and AFAICR

-- 
Tristan Wibberley

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

From: [EMAIL PROTECTED] (NF Stevens)
Crossposted-To: comp.os.linux.misc
Subject: Re: printk ???
Date: Sat, 07 Aug 1999 20:36:32 GMT

"Hung P. Tran" <[EMAIL PROTECTED]> wrote:

>I am having trouble getting printk to work in my driver.
>I tried:
>
>printk(KERN_CRIT "start of init_module\n");
>
>It's NOT working. I also get a warning when compiling my driver:
>
>warning: implicit declaration of function printk_R1d7b4074
>
>Any idea what happened ???
>
Are you trying to compile it as C++ (the function name
looks a bit mangled to me). If you are you will need
to put extern "C" before the declaration of printk.

Norman

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

From: [EMAIL PROTECTED] (Alexander Viro)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Linux assembly, etc
Date: 7 Aug 1999 09:13:27 -0400

In article <[EMAIL PROTECTED]>, JC  <[EMAIL PROTECTED]> wrote:
>Hello,
>(This is probably for those ex-DOS assembly language programmers.)
>I've been writing programs in linux and I've been wanting to
>port many of DOS programs, mainly graphics-based. 
>In DOS, you use OS calls extensively, for example, in printing
>a character....
>.
>.
>.
>mov ah,02
>mov dl,'J'
>int 21h     ;DOS call to print 'J' using function 2 in ah register
>int 20h     ;DOS call to exit the program
>.
>the equivalent in linux would probably be:
>     asm ("movb $2, %ah");
>     asm ("movb $9, %dl");
>     asm ("int $0x21");
>     asm ("int $0x20");
>(in inline assembly, which I intend to use)
>
>I know that these calls are totally useless in linux and I was
>wondering if these calls have equivalents in linux. I'm not just
>talking about those two calls, I'm talking about OS calls in general.
>Where can I find them? Also, where can I find a decent assembly
>language tutorial for linux?

First of all, syscalls sit on $0x80. Then if we are talking about inline
you don't have to do it by hands - equivalent of the above would be

#include <syscall.h>
#include <sys/types.h>
#include <errno.h>
static inline _syscall3(int, write, int, fd, char *, p, size_t, size)
main() {
        char *s="J";
        write(1, s, 1);
}

gcc -S -O2 will generate the right thing - check it yourself. 3 in _syscall3
is the number of arguments, indeed - there is a family of such macros. Check
what it expands to - gcc -E is your friend. The benefit here being that your
code will not depend on the syscall numbering and will be portable to other
platforms - not only x86 (moreover, it will be easyily portable to other
Unices, just remove the syscall stuff and include <unistd.h> instead).

>I also know that many of you would discourage me from using bios calls
>like int 10h but I do need to access certain bios calls. Any workarounds?
>I need to access mode 'X' you see. (Game developers would know this.)
>Is the svgalib up to the task so I don't need to resort to assembly?

There are *very* good reasons not to use the thing - you would get out
with less PITA using X. You *can* have the direct memory access on local
box if you use MIT_SHM extensions. The main problem with direct access to
hardware being that you (a) conflict with X, (b) can't use the thing
across the telnet (works with X), (c) lose the virtual consoles, (d) must
make your program suid-root, with all security implications of such decision
(suid-root stuff is much harder to write in secure way). Oh, and you lose
all non-x86 machines - also not nice.


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

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

Date: Sat, 07 Aug 1999 21:44:49 +0200
From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Linux assembly, etc

Kaz Kylheku wrote:
> 
> On Sat, 07 Aug 1999 12:30:39 GMT, JC <[EMAIL PROTECTED]> wrote:
> >Hello,
> >(This is probably for those ex-DOS assembly language programmers.)
> 
> Please fix your news posting software so that it does not add carriage
> return characters to the ends of you lines.
> 

Please fix your software, adding CR-LF is mandatory
from rfc 977

2.4.1. Text Responses

      Text is sent only after a numeric status response line has been
sent that indicates that text will follow. Text is sent as a series of
      successive lines of textual matter, each terminated with CR-LF
pair. A single line containing only a period (.) is sent to indicate the
      end of the text (i.e., the server will send a CR-LF pair at the
end of the last line of text, a period, and another CR-LF pair).

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

From: Neil Koozer <[EMAIL PROTECTED]>
Subject: Re: My first linux program: non-bios boot loader
Date: Sat, 07 Aug 1999 14:40:37 +0000

Viljo Hakala wrote:

> On Sat, 07 Aug 1999 11:25:17 +0000, Neil Koozer <[EMAIL PROTECTED]> wrote:
> >Charles Sullivan wrote:
> >
> >> Sounds like a great idea.  I assume it is consistant with
> >> having other operating systems on the system.
> >
> >I think so, but then I don't know why NT can't handle lilo being in the
> >MBR.  I would assume that nuni would work in /hda1 (for example) the same as
> >lilo for NT users.
> Does it work with scsi disks ?
>
> -vh

Not at this time.  Different types of drives or filsystems would require
different low-level boot code.  In principle, the installer-utility could select
the proper routine for each kind of drive and each file system.  The only thing
that matters is that the code for one specific drive fits into the available
space.  If I had a SCSI drive, I would be trying to do that.

My original idea was to use my non-bios code in lilo whenever "linear" was
invoked with IDE drives.  A year ago I sent the code to the lilo maintainer with
the suggestion of doing this, but I don't know if he was interested or not.

Neil



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

Date: Sat, 07 Aug 1999 17:31:11 -0400
From: "J. Escalante" <[EMAIL PROTECTED]>
Subject: C++ I/O problems


#include <fcntl.h>
#include <unistd.h>
#include "cstring.h> // my home-made cstring.h
int main(){
    string FileName fn("TestFile")
    ofstream out_file(FileName, ios::binary, O_WRONLY);
    if(out_file.fail()){cerr << "Error opening file " << FileName <<
endl;}
    string s1("Katarina");
    string s2(" ");
    string s3("Victoria");
    string s4 = s1+s2+s3;
    cout << s4;
    out_file << s4; //Oh, ooh! problems
    out_file.close();

    return =0;
}
Although this program compiles, when I, using vi, to view TestFile,
the file is empty; tha is there is nothing written on it.
Here is a slice of code from my CSTRING.H file that is related to the
file I/O.
class string{
private:
    char* text;
    int tLen;
        .............
public:
    const char* GetString() const {return text;}
    const int  GetLength() const {return tLen;}
    ....................
    friend ofstream& operator<< (ofstream&, string&)
}
ofstream& operator << (ofstream& of, string obj){
    of.write(obj.GetString(), obj.GetLength());
}

If you can spot where the problem is, I would appreciate if you can let
me know by email at  [EMAIL PROTECTED]

Thanks in advance




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

From: Kevin Waterson <[EMAIL PROTECTED]>
Subject: custom initrd.img
Date: Sun, 08 Aug 1999 08:40:06 +1000

I need to create a customized set of disks
I need to access the boot.img and the initrd images

I have looked through the source on the cd in misc/src/install
and have been able to edit these files and do a make which creates
the new install scripts  I need. But, how do I then incorporate these
into the boot process. As far as I can see the booting loads the kernel
and
then loads from initrd.img
I wish to access the message screens during the boot process and
need to customize the ones on the floppy. To do this I need to be
able to access what ever it is that creates the floppies so that the
correct, or in my case altered, messages are given.

Thanks for all advice
Kevin




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

From: "Bertrand Lee" <[EMAIL PROTECTED]>
Subject: Re: Device driver programming and C++
Date: Sun, 8 Aug 1999 00:06:03 +0800

Try "-fno-rtti"

Andrey Fisunenko <[EMAIL PROTECTED]> wrote in message
news:7oggdh$mgl$[EMAIL PROTECTED]...

[snip]



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

From: [EMAIL PROTECTED] (brian moore)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Linux assembly, etc
Date: 7 Aug 1999 22:54:41 GMT

On Sat, 07 Aug 1999 21:44:49 +0200, 
 [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Kaz Kylheku wrote:
> > 
> > On Sat, 07 Aug 1999 12:30:39 GMT, JC <[EMAIL PROTECTED]> wrote:
> > >Hello,
> > >(This is probably for those ex-DOS assembly language programmers.)
> > 
> > Please fix your news posting software so that it does not add carriage
> > return characters to the ends of you lines.
> > 
> 
> Please fix your software, adding CR-LF is mandatory
> from rfc 977

Yes, but the original poster posted with CR-LF-CR... hence, adding a
carriage return to the end of each line.

This is not proper, though certain braindead newsreaders do it,
especially those simulated newsreaders that are merely a CGI interface
to Usenet.

-- 
Brian Moore                       | Of course vi is God's editor.
      Sysadmin, C/Perl Hacker     | If He used Emacs, He'd still be waiting
      Usenet Vandal               |  for it to load on the seventh day.
      Netscum, Bane of Elves.

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

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: fuser not working right?
Date: Sun, 08 Aug 1999 00:09:52 GMT

In article <[EMAIL PROTECTED]>, Bob Berman wrote:
>I have fuser from psmisc V18 installed and when I run it, I get an error
>message:
>/proc is empty (not mounted ?)
>
>I put the executable into the debugger, and it looks like it when it checks all
>the subdirectories of /proc looking for "numeric" directories - i.e. /proc/1,
>/proc/10 etc. that it does not find them. It seems like the problem is with the
>line in the source where it does an atoi on each subdirectory.
>
>Breakpoint 1, scan_fd () at fuser.c:325
>325             if (pid = atoi(de->d_name)) {
>(gdb)  p de->d_name
>$44 =
>"\0004\000\000\000\000\002\000\n\000\005\001\000\000\024
>\000\00010\000�\000@\000\000\000\002\000&\000\006\001\000
>\000\024\000\00038\000\203\004\b\000\000\000\002\0005\000
>\a\001\000\000\024\000\00053\000�\001@\000\000\000\002\0009
>\000\b\001\000\000\024\000\00057\0000\001@\000\000\000\002
>\000;\000\t\001\000\000\024\000\00059\000\036\001@\000\000
>\000\002\000=\000\n\001\000\000\024\000\00061\000���\000\000
>\000\002\000A\000\ ..... blah blah blah
>
>Gives:
>
>(gdb) p pid 
>$45 = 0
>
>Shouldn't this give a pid of 4? Or am I misunderstanding atoi? Is this a bug in
>fuser.c then? Why has no one else encountered this? I am using gcc V2.8.1.

Strange ... I've got fuser (same version) compiled against glibc-2.1.0 on
a 2.1.1 system, no problems. If you've the source do a fresh compile, no
optimisations.

Ta',
Juergen

-- 
\ Real name     : J�rgen Heinzl                 \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

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

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: does egcs 1.1.2 produce stable kernels?
Date: Sun, 08 Aug 1999 00:09:53 GMT

In article <W$[EMAIL PROTECTED]>, Robin Becker wrote:
>In article <[EMAIL PROTECTED]>, Juergen
>Heinzl <[EMAIL PROTECTED]> writes
>>In article <[EMAIL PROTECTED]>, Klamer Schutte wrote:
>>>Erik de Castro Lopo wrote:
>>>> 
>>>> Arnoud de Geus wrote:
>>>> >
>>>> > Hello
>>>> >
>>>> > Does the egcs 1.1.2 compiler produce stable
>>>> > kernels? Just recently, there were problems
>>>> > using egcs for kernel build.
>>>> 
>>>> Only use EGCS for 2.2.0 and later kernels. The problems
>>>> with using EGCS were specific to earlier kernels.
>>>
>>>Is this also true for newer egcs (like gcc 2.95?) I found the wordings
>>>in the announcement (and the FAQ) quite scary -- esp. the aliasing part.
>>>I must say, it was more scary then understandeble because:
>>>- I do not have exact understanding of the ANSI C standard
>>>- I do not have exact knowledge of Linux kernel internals
>>>and the wording made these thing seemingly necessary.
>>>
>>>Any inputs from experts is appreciated. I now use kernel 2.2.9
>>
>>Yes, looks like the latest XFree release requires that too. Let
>>me say it this way ... gcc-2.95 is still hot and crispy ... never
>>trust a compiler that is still hot and crispy 8)
>>
>>I've got gcc-2.7.2.3 installed just for the kernel, nothing else,
>>better safe than sorry. That it runs does not mean all is fine and
>>until there is a sort of an offical okay I will leave it at that for
>>now. Statements of the "it works for me" kind are pretty worthless
>>as 5 minutes later the same one might be busy digging for the
>>backup tape.
[...]
>Juergen is there an rpm for gcc-2.7.2.3 for RH 6.0? I don't mind
>installing by hand, but if there's an easier way I would like to do
>that.

Cannot tell, my systems have been self baked for years now but
I guess so. If it is too much trouble though, egcs-1.1.2 seems to
be mostly fine, using ridiculous optimisations for the kernel
aside ... -O6 -fschedule-insns -fschedule-insns2 ... good luck 8->>
Still to be taken with a grain of salt of course.

But does RH not come with a compatibility package ? I think to
have read something regarding that (RH users please ...) Not on-line
right now but IIRC the URL is http://www.rufus.org/ ... there you'll
find tons of RPM's from different vendors, sorted by date, time,
vendor, name colour and taste.

>Also is there any expertise on patching RH kernels with the standard
>patches. My quick check on 2.2.5 using diff reveals a lot of changes.

See above; I've to hand that question over to RH users but as RH and
other distributions apply their own patches (thank you very much) I
dare say either wait or switch to using of the peg kernels. I'd not
mix them. Let me say though that using standard kernels the number
of panics I've had yet is two since 0.99.8 and one of it was a beta
kernel; all that on several machines, at home and at work (up 24/7).
As none of them brought the machine down but both times it was
still possible to reboot them I shall leave it to you to decide
whether vendor patches are worth the trouble (esp. as one can still
use one if it is worth it).

Ta',
Juergen

-- 
\ Real name     : J�rgen Heinzl                 \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

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


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