Linux-Development-Sys Digest #643, Volume #8     Fri, 13 Apr 01 15:13:15 EDT

Contents:
  Re: Need your recommendation for a full-featured text editor (Thore B. Karlsen)
  Re: Kernel 2.2 and device driver/modules ("Peter T. Breuer")
  ioctl return value ("Daniele Ziglioli")
  Re: Need your recommendation for a full-featured text editor (Duane Bozarth)
  Re: New directions for kernel development (ChromeDome)
  howto properly access serial devices in Perl or C (Ingo Ciechowski)
  Re: howto properly access serial devices in Perl or C (Michael Meissner)
  Re: usbutils
  Re: Development of Server in RedHat

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

From: Thore B. Karlsen <[EMAIL PROTECTED]>
Crossposted-To: 
24hoursupport.helpdesk,alt.comp.shareware.programmer,comp.editors,comp.lang.java.help,comp.lang.java.programmer,comp.lang.java.softwaretools,comp.os.linux.advocacy
Subject: Re: Need your recommendation for a full-featured text editor
Date: Fri, 13 Apr 2001 10:10:12 -0500

On 13 Apr 2001 14:16:32 +0100, Nix <$}xinix{[email protected]> wrote:

>> Emacs should stick to being a text editor, not an application environment.

>Sorry, but the Emacs developers and Emacs users disagree. It's been an
>application environment for a damned long time (decades).

I know, but I don't have to like it.

-- 
"By the time we've finished with him, he won't know whether
he's Number Six or the cube root of infinity!"

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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: Kernel 2.2 and device driver/modules
Date: Fri, 13 Apr 2001 15:09:21 GMT

david <[EMAIL PROTECTED]> wrote:
> Was there a big change in the kernel from 2.0 to 2.2 that would cause

Yes.

> all of the unresolved variables and functions or I am doing something
> really stupid here.

Yes.

>     3. Either the kernel has been radically changed from 2.0 to 2.2 or
> the symbols were not being exported.

That's the answer. 2.2. is a major new release number. It's incompatible
with 2.0.

> here's a list of unresolved references.

> bh_active
> boot_cpu_data
> check_region
> del_timer
> disable_irq
> enable_irq
> free_dma
> free_irq
> interruptible_sleep_on
> interruptible_sleep_on_timeout
> jiffies
> printk
 ^^^^^^^

Impossible. Printk is in the kernel! So you are doing something else
stupid. Possibly not compiling with -O? Or compiling for a kernel
without module support (oh, module support has chanegd radically)?
You do have flags -O2 -D__KERNEL__ -DMODULE ?

Peter

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

From: "Daniele Ziglioli" <[EMAIL PROTECTED]>
Subject: ioctl return value
Date: Fri, 13 Apr 2001 15:01:34 GMT

If wish return the error code directly,
not in the errno var.

I verified that, for example, the value -10000
is passed directly to the caller.
A value of -2, -3, etc. are all coverted in -1.

I suppose that a filter translate any error code in -1
and than store the user error code in the errno.

There is a way the starting point of user definable
error code ?

What is the rigtht way to return an user defined error code in
a iocl device routine ?

Where can I found in the kernel tree the ioctl syscall ?


_______________________________
Daniele Ziglioli
Signal s.r.l.
[EMAIL PROTECTED]
_______________________________




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

From: Duane Bozarth <[EMAIL PROTECTED]>
Crossposted-To: 
alt.comp.shareware.programmer,comp.editors,comp.lang.java.help,comp.lang.java.programmer,comp.lang.java.softwaretools,comp.os.linux.advocacy
Subject: Re: Need your recommendation for a full-featured text editor
Date: Fri, 13 Apr 2001 10:13:04 -0500



Michael Vester wrote:
> 
> Dan Miller wrote:
> >
snip some other stuff....

> > > >So, you're recommending Brief??  It hasn't been available for awhile...
> > >
> > > Brief's the best programmer's editor I ever used. Despite
> > > compatability claims I've never found another editor that duplicates
> > > Brief's intuitiveness. Too bad Borland bought it up and then forgot
> > > about it.
> > >
> > I agree... I used Brief for over a decade, and *loved* it... it's still the
> > prototype for many of the capabilities that people expect to see in a
> > Dos/Windows editor.  <...snip minor anti-Borland rant....>
> I was a big fan of Brief too. Wrote many lines of code with it. Still use
> it when editing a big file in losedos. Unfortunately, it can't deal with
> the > 8.3 filenames. When Boreland bought Brief, I had great
> expectations.  I was disappointed.

As were many others, me among them...

As for the 8.3 filenames w/Brief, I use a batch file which creates the
sfn version of the file names passed and invokes Brief with them.  If
also set path with same trick, the internal compile sequence also works
just fine.  I use the JP Software 4xx command processors which have
built-in functions to return the short filename from the lfn, but
wouldn't be too hard to emulate.

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

From: ChromeDome <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.advocacy,comp.os.linux.development
Subject: Re: New directions for kernel development
Date: Fri, 13 Apr 2001 16:28:16 GMT

Brent R wrote:
> 
> Linus Torvalds wrote:
> >
> > Hi all,
> >
> >         Recently, I've been thinking a lot about where Linux development 

<snip,snip,snip>

> > Thank you,
> > --Linus Torvalds
> 
> ROFL.
> 
> It's sad but true.
> 
> --
> - Brent

And you felt compelled to quote the entire @!#$% message for that one
little inane comment?  See signature below.

-- 
Homo Sapiens is a goal, not a description.

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

From: Ingo Ciechowski <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.hardware,comp.os.linux.development.apps,de.alt.comm.isdn4linux
Subject: howto properly access serial devices in Perl or C
Date: Fri, 13 Apr 2001 19:28:14 +0200

I'd like to access some serial device on my linux box bidirectionally, but 
for some reason don't get connected to the device. Seems as if special 
precautions are required...


For now the program should simply output a couple of commands to /dev/modem 
(shall later become /dev/ttyI0) and print out all replies on that line.



open (OUT, ">/dev/modem");
open (IN, "</dev/modem");

print OUT "AT+FCLASS=8\n";

### for some reason it already stucks here :-((

print OUT "AT&L*\n";
print OUT "AT&E37*\n";

while(<IN>) {
        print $_;
        if(/RING/) {
                print OUT "ATA\n";
                print OUT "AT+VRX\n";
                $start = 1;
        }
        print FILE $_ if($start == 1);
}



Hopefully someone can point me into the right direction?


-- 

Ingo
[EMAIL PROTECTED]



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

Crossposted-To: 
comp.os.linux.hardware,comp.os.linux.development.apps,de.alt.comm.isdn4linux
Subject: Re: howto properly access serial devices in Perl or C
From: Michael Meissner <[EMAIL PROTECTED]>
Date: 13 Apr 2001 14:33:17 -0400

Ingo Ciechowski <[EMAIL PROTECTED]> writes:

> I'd like to access some serial device on my linux box bidirectionally, but 
> for some reason don't get connected to the device. Seems as if special 
> precautions are required...
> 
> 
> For now the program should simply output a couple of commands to /dev/modem 
> (shall later become /dev/ttyI0) and print out all replies on that line.
> 
> 
> 
> open (OUT, ">/dev/modem");
> open (IN, "</dev/modem");
> 
> print OUT "AT+FCLASS=8\n";
> 
> ### for some reason it already stucks here :-((
> 
> print OUT "AT&L*\n";
> print OUT "AT&E37*\n";
> 
> while(<IN>) {
>         print $_;
>         if(/RING/) {
>                 print OUT "ATA\n";
>                 print OUT "AT+VRX\n";
>                 $start = 1;
>         }
>         print FILE $_ if($start == 1);
> }
> 
> 
> 
> Hopefully someone can point me into the right direction?

The quick answer is open (FILE, "+</dev/modem").  Quoting from the fine
perlfunc man page which details the open function:

open FILEHANDLE,MODE,LIST
open FILEHANDLE,EXPR
open FILEHANDLE

        Opens the file whose filename is given by EXPR, and associates it with
        FILEHANDLE.  If FILEHANDLE is an expression, its value is used as the
        name of the real filehandle wanted.  (This is considered a symbolic
        reference, so `use strict 'refs'' should not be in effect.)

        If EXPR is omitted, the scalar variable of the same name as the
        FILEHANDLE contains the filename.  (Note that lexical variables--those
        declared with `my'--will not work for this purpose; so if you're using
        `my', specify EXPR in your call to open.) See the perlopentut manpage
        for a kinder, gentler explanation of opening files.

        If MODE is `'<'' or nothing, the file is opened for input.  If MODE is
        `'>'', the file is truncated and opened for output, being created if
        necessary.  If MODE is `'>>'', the file is opened for appending, again
        being created if necessary.  You can put a `'+'' in front of the `'>''
        or `'<'' to indicate that you want both read and write access to the
        file; thus `'+<'' is almost always preferred for read/write
        updates--the `'+>'' mode would clobber the file first.  You can't
        usually use either read-write mode for updating textfiles, since they
        have variable length records.  See the -i switch in the perlrun manpage
        for a better approach.  The file is created with permissions of `0666'
        modified by the process' `umask' value.

        These various prefixes correspond to the fopen(3) modes of `'r'',
        `'r+'', `'w'', `'w+'', `'a'', and `'a+''.

        In the 2-arguments (and 1-argument) form of the call the mode and
        filename should be concatenated (in this order), possibly separated by
        spaces.  It is possible to omit the mode if the mode is `'<''.

        If the filename begins with `'|'', the filename is interpreted as a
        command to which output is to be piped, and if the filename ends with a
        `'|'', the filename is interpreted as a command which pipes output to
        us.  See the Using open() for IPC entry in the perlipc manpage for more
        examples of this.  (You are not allowed to `open' to a command that
        pipes both in and out, but see the IPC::Open2 manpage, the IPC::Open3
        manpage, and the Bidirectional Communication with Another Process entry
        in the perlipc manpage for alternatives.)

        If MODE is `'|-'', the filename is interpreted as a command to which
        output is to be piped, and if MODE is `'-|'', the filename is
        interpreted as a command which pipes output to us.  In the 2-arguments
        (and 1-argument) form one should replace dash (`'-'') with the command.
        See the Using open() for IPC entry in the perlipc manpage for more
        examples of this.  (You are not allowed to `open' to a command that
        pipes both in and out, but see the IPC::Open2 manpage, the IPC::Open3
        manpage, and the Bidirectional Communication entry in the perlipc
        manpage for alternatives.)

        In the 2-arguments (and 1-argument) form opening `'-'' opens STDIN and
        opening `'>-'' opens STDOUT.

        Open returns nonzero upon success, the undefined value otherwise.  If
        the `open' involved a pipe, the return value happens to be the pid of
        the subprocess.

        If you're unfortunate enough to be running Perl on a system that
        distinguishes between text files and binary files (modern operating
        systems don't care), then you should check out the binmode entry
        elsewhere in this document for tips for dealing with this.  The key
        distinction between systems that need `binmode' and those that don't is
        their text file formats. Systems like Unix, MacOS, and Plan9, which
        delimit lines with a single character, and which encode that character
        in C as `"\n"', do not need `binmode'. The rest need it.

        When opening a file, it's usually a bad idea to continue normal
        execution if the request failed, so `open' is frequently used in
        connection with `die'.  Even if `die' won't do what you want (say, in a
        CGI script, where you want to make a nicely formatted error message
        (but there are modules that can help with that problem)) you should
        always check the return value from opening a file.  The infrequent
        exception is when working with an unopened filehandle is actually what
        you want to do.

By the way, if you are doing this, you probably want to check out the perl CPAN
function of Expect (from http://www.cpan.org/ and many other sites).  To give
you an example of Expect, here is a function that I wrote that I wrote to
control running a benchmark suite on a embedded processor connected via a
serial line.

sub runprog {
        my ($pathname)  = @_;
        my ($exp);
        my ($timeout);

        if (! open (TTY, "+<$opt_t")) {
                print "Could not open $opt_t: $!\n";
                return 0;
        }

        print ":::::::::: ", &short_timestamp (), " Running ", $pathname, "\n";

        $exp = Expect->exp_init (\*TTY);
        $exp->exp_stty ("raw -echo");
        $exp->match_max ($opt_c);

        if (defined $opt_l) {
                if ($opt_l eq "-") {
                        $exp->log_user (1);
                } else {
                        $exp->log_file ($opt_l);
                }
        }

        print $exp "\n";
        $exp->expect (5, '-re' => 'PMON[>]\s*$')                || die "Could not find 
monitor\n";

        print $exp "g\n";
        $exp->expect (5, '-re' => 'TH [+][>]\s*$')              || die "$pathname: did 
not start\n";

        if (defined ($opt_i)) {
                open (INPUT, "<$opt_i")                         || die "$pathname: 
$opt_i: $!\n";
                while (<INPUT>) {
                        print $exp $_;
                        $exp->expect (5, '-re' => 'TH [+][>]\s*$');
                }

                close (INPUT);
        }

        print $exp "g\n";

        $exp->expect ($opt_s, '-re' => 'TH [+][>]\s*$')         || die "$pathname: No 
end prompt\n";
        print $exp "exit\n";

        if ($exp->exp_before () =~ m!Iterations/Sec\s+=\s+([0-9.]+)!) {
                print ":::::::::: ", &short_timestamp (), " ", &tbl_commas (sprintf 
("%.2f", $1)), " Iterations/second\n";
        }
                        
        $exp->expect (5, '-re' => 'PMON[>]\s*$')                || die "Program did 
not finish\n";
        close ($exp);
        return 1;
}


-- 
Michael Meissner, Red Hat, Inc.  (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:     [EMAIL PROTECTED]           phone: +1 978-486-9304
Non-work: [EMAIL PROTECTED]   fax:   +1 978-692-4482

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

From: <[EMAIL PROTECTED]>
Subject: Re: usbutils
Date: Fri, 13 Apr 2001 11:38:29 -0700

Thanks to Phil and others for helping me get usbutils working. The magic was
'mount -t usbdevfs none /proc/bus/usb' after compiling the usb file system
into the 2.4.1 or 2.4.2 kernel. Now for my next question. lsusb is neat for
printing out descriptors, but what I really need next is a way to spy on
packets (SETUP, IN, OUT) during enumeration. I am working thru usb.c and
uhci.c now to create a mini-usb spy. Is there a program available somewhere
that I can spawn or install as a daemon to spy on packets on my own host
while getting a non-functional driver to a functional state. I.e., my major
problem is a piece of hardware that almost works and I suspect that its
initialization is not complete and my view of the usb stack is incomplete as
well. I am thinking that if I could have a way of viewing packets (sort of
like a usb version of tcpdump with filtering capability), that would help a
great deal.



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

From: <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Development of Server in RedHat
Date: Fri, 13 Apr 2001 11:39:58 -0700

To amplify Philip's comment, I think that 'Beginning linux programming' is a
misnomer for the books title, I found it has useful advanced information as
well.

"Philip Van Hoof" <[EMAIL PROTECTED]> wrote in message
news:lgOA6.30663$[EMAIL PROTECTED]...
> > 1.) How to develope an internet server tool, that means I want to create
> > a program that receives data from a client through the internet.
>
> Check the subdir 'chapter14' of this tarbal
> ftp://ftp.wrox.com/beginning/2971.tar.gz
> And/or buy the book "beginning linux programming"
>
> > 2.) The
> > data from the client I have to put in an mySQL Database.
>
> Then maybe it's not even nessesairy to build a server application
> at all. With MySQL you can connect with the clients to any
> online server. Just make sure that the Host permission of the
> user who is going to connect to the MySQL server is set to %
> and port 3306 or 3307 (not sure) on the server is open (udp/tcp).
>
> You can use Kylix or Delphi using mysql.pas (search with google)
> and for kylix there are build in possibilities for working
> with mysql. Both are for rapid application development ofcourse.
> If you have more time :) and you want to build good applications
> you should start learning C and learn how to use the mysql
> API for C or .. C++ . You van find loads of information on
> API's for programming MySQL clients on mysql.com. If you are
> going to build a server application between the mysql server
> and the client then the server program will have to be
> programmed as client of the mysql server and as server for
> the actual client. Only difference is that the server must
> connect to the localhost mysqld ..
>
> So
>
> or you use :
>
> client -internet-> your server app -localhost-> mysqld
>
> or
>
> client -internet-> mysqld
>
>
> > 3.) How can I
> > make the server run all the time, when the linux-server starts.
>
> This depends on your distro ..
> for Redhat you have a dir called
> /etc/rc.d/rc$RUNLEVEL.d/
> where $RUNLEVEL is a number from 0 to 6. If your redhat
> starts in X mode then this runlevel is 5. Else it's
> probably runlevel 2. Runlevel 1 is single mode (when you
> run LILO: linux single) and 6 is reboot and shutdown
> runlevel. Redhat will start all scripts that start with
> the letter S in that directory.
>
> in pseudo code this happens at bootup :
>
> a) get the runlevel from /etc/inittab and put it in #RUNLEVEL
> b)
> $MYLIST = `ls /etc/rc.d/rc$RUNLEVEL.d/S*`
> for each item in $MYLIST
> do
>   exev $item start
> fi
>
> Now .. it's a bit more complicated ..
>
> In linux you have symlinks so the redhat folks made another dir
> called /etc/rc.d/init.d where all the possible scripts resist..
> Redhat has some tools that allow you to manage the startup
> scripts using some gfx-gui/text-gui tools.. and to make this
> possible they use symlinks (well most distro's use it) this way :
>
> They symlink
> /etc/rc.d/rc2.d/S01something to /etc/rc.d/init.d/something
> if the script must be executed at startup ... and
> /etc/rc.d/rc2.d/K01something to /etc/rc.d/init.d/something
> if the script must not be executed but only showed in these
> tools..
>
> A symlink is NOT like a shortcut in Windows.. well actually
> it is.. but its much more powerfull. It's a link to a file..
> Know what.. Read the man page of ln :)  "man ln"
>
> > That means where can I find some samples or other information on these
> > two problems. In fact I am also really interested, if this is a complex
> > problem in linux and which libarys ( in C++ ) I could use to simplify my
>
> So I suggest that you checkout mysql.com for API's to use with MySQL
> and programming languages like C and C++ 'or' kylix and Delphi depending
> how much time you get for this job. Kylix and Delphi == not much
> time to learn and to develop your application. And you can port
> Kylix and Delphi applications to and from windows/linux.. Also kylix
> is VERY new .. http://www.borland.com/kylix and still pretty
> expensive. ($1500). Or if you care more about the quality of the
> application.. I suggest that you learn C/C++ and the API's which you
> can fetch from mysql.com...
>
> > work. I know that I can search with some searchengines, but I am a
> > really newbie in linux and so have no detailed idea for what to search
> > exactly.
>
>
>
> > P.S. Sorry for my bad english
>
> P.S. Sorry for "my" bad english to :-)
>
>
> --
> Philip van Hoof aka freax (http://www.freax.eu.org)
> irc: irc.openprojects.net mailto:freax @ pandora.be



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


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