Linux-Development-Sys Digest #128, Volume #8      Thu, 7 Sep 00 05:13:09 EDT

Contents:
  spin lock and signal pending ("Peter Huang")
  Re: spin lock and signal pending (Kaz Kylheku)
  Re: system without graphic HW (Peter Pointner)
  Re: Qt or gtk+ is better in programming GUI program that can run on both KDE and 
GNOME? (Andreas Rottmann)
  Re: Threads on Linux ([EMAIL PROTECTED])
  Re: Threads on Linux (Kaz Kylheku)
  Re: Caching files from CD---problem when playing MP3s on CD (Bruce Stephens)
  Does linux has route socket ? (wolf)
  Re: New OS Project (Christopher Browne)
  negative dentry ("Jay Randall")
  Re: Threads on Linux (Karl Heyes)
  How to debug glibc source ("zheng")
  linux problem ("Wong Kim Lung")
  Re: Curious: compiling test8 series: "warning... token" (Kasper Dupont)
  buffer_dirty  -  what's the @#$%? ("Ian Dichkovsky")
  Re: buffer_dirty  -  what's the @#$%? ([EMAIL PROTECTED])
  Linux/RS6000 (Manoj Patil)
  Re: Mounting filesystem on char device (Josef Moellers)
  Re: linux problem (Josef Moellers)
  Kernel & UDP:can you help me? (Maurizio Piana)
  Question on io.h (Peter Hober)
  Re: Kernel & UDP:can you help me? (Josef Moellers)
  Re: Question on io.h (Josef Moellers)

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

From: "Peter Huang" <[EMAIL PROTECTED]>
Subject: spin lock and signal pending
Date: Wed, 6 Sep 2000 10:45:14 -0700


Hi all

I have the code of a function use by the system calls  to receive signal of
interrupts from the bottom half of ISR. The bottom half would called wake up
interruptible and signal this
function. I have already get it to work with save_flags,cli and
restore_flags and with interruptible_sleep_on. However, I really don't know
how signal pending work with wake_up_interruptible. The problem is that
signal_pending never received any signal from wake_up_interruptible so this
process is never wakes up. Does anyone see the problem with the code and/or
can also explain how signal_pending pertains to wake_up_interruptible and
interruptible_sleep_on? thanks

Peter

wait_int(u32 bit, ...)

{

    struct wait_queue wait = {current, NULL};

   spin_lock_irqsave(&interrupt_lcok,lock_flags);

/* wait has already arrived*/

    if(test_bit(INT_ARRIVED,(void*)&(hdl_ptr->flag)))

    {

       ret=1;

    }

    else

    {

        set_bit(bit,(void*)&(hdl_ptr->int_bits));

        current->state = TASK_INTERRUPTIBLE;

        add_wait_queue(&(hdl_ptr->ebsa_q), &wait);


/* interrupt has arrived */

     }

        spin_unlock_irqrestore(&interrupt_lock,lock_flags);

       if (ret==1)return;

         for(;;)

        {

            if(signal_pending(current))

            break;

            schedule();

         }

         current->state = TASK_RUNNING;

         remove_wait_queue(&(hdl_ptr->ebsa_q), &wait);

         clear_bit(bit,(void*)&(hdl_ptr->int_bits));



}/*end of wait_int*/






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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: spin lock and signal pending
Reply-To: [EMAIL PROTECTED]
Date: Wed, 06 Sep 2000 18:02:52 GMT

On Wed, 6 Sep 2000 10:45:14 -0700, Peter Huang <[EMAIL PROTECTED]> wrote:
>
>Hi all
>
>I have the code of a function use by the system calls  to receive signal of
>interrupts from the bottom half of ISR. The bottom half would called wake up
>interruptible and signal this
>function. I have already get it to work with save_flags,cli and
>restore_flags and with interruptible_sleep_on. However, I really don't know
>how signal pending work with wake_up_interruptible. The problem is that
>signal_pending never received any signal from wake_up_interruptible so this
>process is never wakes up. Does anyone see the problem with the code and/or
>can also explain how signal_pending pertains to wake_up_interruptible and
>interruptible_sleep_on? thanks
>
>Peter
>
>wait_int(u32 bit, ...)
>
>{
>
>    struct wait_queue wait = {current, NULL};
>
>   spin_lock_irqsave(&interrupt_lcok,lock_flags);
>
>/* wait has already arrived*/
>
>    if(test_bit(INT_ARRIVED,(void*)&(hdl_ptr->flag)))
>
>    {
>
>       ret=1;
>
>    }
>
>    else
>
>    {
>
>        set_bit(bit,(void*)&(hdl_ptr->int_bits));
>
>        current->state = TASK_INTERRUPTIBLE;
>
>        add_wait_queue(&(hdl_ptr->ebsa_q), &wait);
>
>
>/* interrupt has arrived */
>
>     }
>
>        spin_unlock_irqrestore(&interrupt_lock,lock_flags);
>
>       if (ret==1)return;
>
>         for(;;)
>
>        {
>
>            if(signal_pending(current))
>
>            break;
>
>            schedule();
>
>         }

This loop is wrong because it cannot be terminated unless a signal is raised
for this task. You should check signal_pending() after calling schedule.
You also should be checking your INT_ARRIVED bit here, e.g.

        schedule();

        if(test_bit(INT_ARRIVED,(void*)&(hdl_ptr->flag))) {
            /* okay got it */
        } else if signal_pending(current) {
            /* oops, woke due to a signal. Return -EINTR? */
        }
                
I wrote a mutex and condition variable mini-library to simplify all this
stuff (to programmers faimilar with POSIX-like mutexes and conditions).
http://users.footprints.net/~kaz/lmc.html

With this library, you can just do this:

        mutex_lock(&mutex);

        while (!test_bit(INT_ARRIVED, ...)) {
                if (cond_wait(&cond, &mutex) == COND_WAIT_SIGNAL)
                        return -EINTR;
        }

        /* Okay, got signal, process it. */

        mutex_unlock(&mutex);

        return 0;

In the ISR, you would just do 

        cond_broadcast(&cond);



-- 
Any hyperlinks appearing in this article were inserted by the unscrupulous
operators of a Usenet-to-web gateway, without obtaining the proper permission
of the author, who does not endorse any of the linked-to products or services.

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

From: Peter Pointner <[EMAIL PROTECTED]>
Subject: Re: system without graphic HW
Date: 6 Sep 2000 20:25:08 +0200

"Christian Hoefer (EED)" <[EMAIL PROTECTED]> wrote:

> Thanks Peter, thanks Tim,

> I have serial/ssh communication configured, that's not the problem. But
> it will work
> not before the getty/sshd is running - no chance to trace any problems
> during bootup.

When I wrote "/usr/src/linux/Documentation/serial-console.txt" I meant
that you should _READ_ this file.

> And I suspect the linux kernel will probe for vga/cga/whatever HW to
> bypass
> the vga bios on a later stage of boot process - and will complain if no
> HW
> is found.

> Not right ? 

No, not right. You can remove these parts from the kernel.
Don't suspect, try.

>> > Most of the interesting boot messages go into the message log.

> not earlier than the logdaemons are up 

>> man dmesg klogd syslogd syslog.conf

Did you really look at these man pages?
I see 3 possibilities: You don't read the information, you don't understand
it, or I don't understand your problems.

Peter



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

From: Andreas Rottmann <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.unix.programmer,linux.redhat
Subject: Re: Qt or gtk+ is better in programming GUI program that can run on both KDE 
and GNOME?
Date: 06 Sep 2000 22:17:38 +0200

[EMAIL PROTECTED] writes:

> If you code in C you might be better off with GTK+.
> If you code in C++ you might be better off with Qt.
>
Or Gtk-- or wxWindows (X-Platform)

g, Andy
-- 
Andreas Rottmann     | Dru@ICQ      | 54523380@ICQ | [EMAIL PROTECTED]
Pfeilgasse 4-6/725   | A-1080 Wien  | Austria      | Europe
http://www.8ung.at/rotty            | GnuPG Key: www.8ung.at/rotty/dru.asc
Fingerprint          | 3E9A C485 49A4 1D17 2EA7  2BA7 22AE C9BF 8173 6279
[one of 78,35% Austrians who didn�t vote for Haider!]

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

From: [EMAIL PROTECTED]
Subject: Re: Threads on Linux
Date: Wed, 06 Sep 2000 20:48:18 GMT

Kaz Kylheku <[EMAIL PROTECTED]> wrote:

> This readability comes at the cost of introducing the potential for
> race conditions and deadlocks, and execution order that differs from
> run to run even with identical inputs.

Now that is patently false. There are large numbers of threaded
programs which have no race conditions or deadlocks in them.

-- 
Matt Gauthier <[EMAIL PROTECTED]>

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Threads on Linux
Reply-To: [EMAIL PROTECTED]
Date: Wed, 06 Sep 2000 20:51:10 GMT

On Wed, 06 Sep 2000 20:48:18 GMT, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>Kaz Kylheku <[EMAIL PROTECTED]> wrote:
>
>> This readability comes at the cost of introducing the potential for
>> race conditions and deadlocks, and execution order that differs from
>> run to run even with identical inputs.
>
>Now that is patently false. There are large numbers of threaded

I only said that the potential exists. There are whole classes of possible
defects that can occur in multithreaded programs that don't exist in single
threaded programs.

>programs which have no race conditions or deadlocks in them.

No race conditions or no *known* race conditions?

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

From: Bruce Stephens <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: Re: Caching files from CD---problem when playing MP3s on CD
Date: 06 Sep 2000 22:22:33 +0100

Nix <$}xinix{[email protected]> writes:

> Bruce Stephens <[EMAIL PROTECTED]> writes:
> 
> > The same sort of idea strikes me as possible for what I want: I just
> > need a user-mode filesystem (and I'm sure I've seen such things
> > around, although I don't recall the name), and it could layer on the
> > CDROM---each time a file is opened, it could copy it to somewhere on
> > the hard disk and operate on that.  Similarly, these temporary copies
> > could be deleted.
> 
> This sounds pretty much exactly like union-mounting, only COW.
> 
> Does Linux-2.4's union mounting support COW like that? (I don't have the
> 2.4 kernel here atm because of a crisis involving `rm -r' and fingers
> typing faster than brain, so I can't easily tell.)

Don't I want copy-on-read?  I'm not intending to try to change the
MP3's (or Ogg files or whatever)---just read them.

However, that's a plausible place to look: if I had a union mounting
system which did COW, then perhaps it would be easy to make one which
did COR instead.

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

From: wolf <[EMAIL PROTECTED]>
Subject: Does linux has route socket ?
Date: Wed, 06 Sep 2000 13:11:01 +0800

when i was reading Richard Stevens' UNIX network programming , i found
there is a chapter specilizing in routing socket. As is described,
routing socket is a eazy way to handle the route table.

Does linux has route socket ?
Does linux has some other pretty way to handle route table except ioctl
?


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

From: [EMAIL PROTECTED] (Christopher Browne)
Subject: Re: New OS Project
Reply-To: [EMAIL PROTECTED]
Date: Thu, 07 Sep 2000 00:01:36 GMT

Centuries ago, Nostradamus foresaw a time when John Smith would say:
>I was thinking on writing a new Operating System based on Minix 2.0. The OS
>would be aimed at Internet Terminals and Network Computers.
>
>Here are the expected specifications :
>
>Full multiprogramming (multiple programs can run at once)
>Support for extended memory up to 16M on 286; 4 GB on 386, 486, and Pentium
>RS-232 serial line support with terminal emulation, kermit, zmodem, etc.
>Up to 3 simultaneous users on one machine
>Total POSIX compatibility
>Full C source code (OS, utilities, libraries, etc.) supplied
>ANSI C compiler
>Shell that is functionally identical to the Bourne shell
>Networking with TCP/IP
>A GUI and a Web Browser
>Smallest Possible size
>Online manual pages
>
>I'm looking for some help since I not very experienced in OS programming.
>
>Sorry for my English but I'm French ...

You might want to explore this on comp.os.research; this newsgroup is
intended mainly for discussions of the Linux kernel.

By the way, what you describe represents quite a grabbag of
functionality.  Usually someone that wants to work on an "operating
system" defines things based on the features of the kernel as opposed
to based on what applications plan to live in user space.
-- 
(concatenate 'string "cbbrowne" "@" "acm.org")
<http://www.ntlug.org/~cbbrowne/oses.html>
Rules of the Evil Overlord #79. "If my doomsday device happens to come
with a reverse switch, as soon as it has been employed it will be
melted down and made into limited-edition commemorative coins."
<http://www.eviloverlord.com/>

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

From: "Jay Randall" <[EMAIL PROTECTED]>
Subject: negative dentry
Date: Wed, 6 Sep 2000 18:22:06 -0700

Hi,

Can somebody please explain to me what a 'negative dentry' is and what it is
used for.

Thanks,
Jay.




====== Posted via Newsfeeds.Com, Uncensored Usenet News ======
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
=======  Over 80,000 Newsgroups = 16 Different Servers! ======

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

From: Karl Heyes <[EMAIL PROTECTED]>
Subject: Re: Threads on Linux
Date: Thu, 07 Sep 2000 03:32:03 +0000

In article <JOlt5.71649$[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> Karl Heyes <[EMAIL PROTECTED]> wrote:
>> Threads have only made big book of buzz words because of java!!
> 
> That's half-true. They're certainly integral to java, but they can make C
> programs easier to grasp as well. Which is what they _should_ be used for,
> making code more readable. :)
> 
> I'll admit there's a certain amount of "flavor of the monthness" to them, but
> it's not all hype.
> 

C doesn't have threads, where Java does. POSIX does but isn't that a not just
unix  standard.  For NT for instance you have to use threads as full processes
don't scale.

>> Each task can be a thread or full process, the kernel doesn't care, so it
>> allocates a separate id for each task. 
> 
> Most uses are bad. (See above) Unfortunatly, what you're suggesting doesn't
> help, because the program he's porting relies on shared pids, which _are_
> required by the standard, and _not_ provided by the kernel. See the long
> diatribe here about a week ago. :)
> 

I wasn't suggesting anything in particular really, just identifying what is. We 
don't know the details of the poster's system, so we don't know the scale of
change.

I'm not sure if shared pids will ever be supported by the kernel, but there has
been talk about thread groups on LKML recently.

karl.



in question.  


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

From: "zheng" <[EMAIL PROTECTED]>
Subject: How to debug glibc source
Date: Thu, 7 Sep 2000 11:34:29 +0800

how to debug into blibc source code??




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

From: "Wong Kim Lung" <[EMAIL PROTECTED]>
Subject: linux problem
Date: Thu, 7 Sep 2000 14:21:30 +0800

Dear all,
    I hv a www server in linux. If i want to know the transmission rate (or
even login/logout time and file downloaded) of a specific client who has
connected to my server, how can i do that? thx alot!





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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Curious: compiling test8 series: "warning... token"
Date: Thu, 07 Sep 2000 09:28:55 +0200

Robert Lynch wrote:
> 
> This is subjective, based on idly watching the output of the
> kernel compile of some of the 2.4.0-test8 series (it might have
> happened with other, testX series, but maybe I simply wasn't
> watching at the time, thus didn't see the message), but it seems
> a new sort of warning pops up frequently:
> 
> "warning: pasting would not give a valid preprocessing token"
> 
> It seems to come from defines including a "##", involving a
> paste, for example:
> 
> #define BUGMSG2(x,msg,args...) do { BUGLVL(x) printk(msg, ##
> args); } while (0)
> 
> Any comments on this, is it incorrect, a hi-falutin' C extension,
> etc.?
> 
> Bob L.
> --
> Robert Lynch-Berkeley CA [EMAIL PROTECTED]

The gcc manual (File: gcc.info, Node: Macro Varargs)
says that you must put a space before the ,. That
might be changed in later versions so the space will
no longer be needed but still allowed.

#define BUGMSG2(x,msg,args...) do { BUGLVL(x) printk(msg , ##
args); } while (0)

-- 
Kasper Dupont

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

From: "Ian Dichkovsky" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,comp.os.linux.misc,comp.os.linux.questions
Subject: buffer_dirty  -  what's the @#$%?
Date: Thu, 7 Sep 2000 10:33:46 +0300

Hi all ! (sorry for bad English)

when I copy file from floppy,
on the console apppear message

.... buffer_dirty .... 512
(don't remember exactly)

I reboot to the win98 and files copyied without messages.
Floppy hasn't bad blocks.

So, what it mean - buffer_dirty ?

Thanks!

Bye!





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

From: [EMAIL PROTECTED]
Subject: Re: buffer_dirty  -  what's the @#$%?
Crossposted-To: comp.os.linux.hardware,comp.os.linux.misc,comp.os.linux.questions
Date: 7 Sep 2000 04:06:00 -0400

In comp.os.linux.misc Ian Dichkovsky <[EMAIL PROTECTED]> wrote:

> So, what it mean - buffer_dirty ?

Caching. It happens in Windows if you speed Windows up (but Windows
defaults to turn off write caching). When you write a file to floppy all
the OS does is note which file you want to write and when it finds time it
will do it in the background (this makes the system more responsive). BUT
if you remove the drive before the write - boom.

Try the "sync" command (which forces the buffer write to the disk) before
umounting or removing the disk

(sync has a manual page)

(of course if you have, say a removable hard drive and the hardware has a
 cache and you remove the drive before the cache is written to disk
 ... the data will have been written to the hard drive's cache but not the
 disk ... sync will get it written that far though)

(by "buffer dirty" - well the buffer is used to hold data to be written to
 disk and it is "dirty" - that is, it hasn't been cleaned out by finishing
 the write - you can wait awhile until the system is done writing the data
 or use the sync command)

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

From: Manoj Patil <[EMAIL PROTECTED]>
Subject: Linux/RS6000
Date: Thu, 07 Sep 2000 14:03:08 +0530

Whats flavours of Linux run well on IBM RS6000
any tips would be helpful

Regard
Manoj



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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Mounting filesystem on char device
Date: Thu, 07 Sep 2000 10:34:32 +0200

"[EMAIL PROTECTED]" wrote:
> =

> Hi,
> =

> As far as I know you need a seek in your fops to make it mountable.
> The major diff between a char device and a block device is the ablility=
 to seek.
> =

> If you can modify the device so that it can seek (in the code), it shou=
ld work

=2E.. where "seek" doesn't necessarily mean that you have to physically
move some read/write pointer. All "seek" does is modify the logical
read/write pointer:
        file->f_pos =3D offset;
Afterwords, when you read/write, this pointer is sent alongside with the
request/data to access the proper data location.

You may want to look at the loop device code. What you need is something
similar.

-- =

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

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: linux problem
Date: Thu, 07 Sep 2000 10:36:30 +0200

Wong Kim Lung wrote:
> =

> Dear all,
>     I hv a www server in linux. If i want to know the transmission rate=
 (or
> even login/logout time and file downloaded) of a specific client who ha=
s
> connected to my server, how can i do that? thx alot!

Some of the data you need can be found in /var/log/httpd.access_log.

-- =

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

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

From: Maurizio Piana <[EMAIL PROTECTED]>
Subject: Kernel & UDP:can you help me?
Date: 7 Sep 2000 08:34:03 GMT

Hello, I'm an italian student and I've got to use udp function
directly without using socket syscall, for study projects. So
I have to call UDP function from udp.c file located in 
/usr/src/linux-2.2.16/net/ipv4/udp.c;I have copied that file in
my directory and because it has many include in net directory
I also have copied the entire directory /usr/src/linux-2.2.16/include/net/
and tried to compile with "gcc my_file.c -I . -o my_exe.x" having in
the directory file udp.c and the net directory. The problem is that
many struct and types aren't recognized (in included files from kernel
header files,not from my file!) and many parse error in the same
groups of include files. Well,I've never programmed nothing for
kernel so I need help. The goal of the project is to make a 
copy of udp, functioning in user mode out of the kernel.Can anyone
help me? I thank you so much and beg your pardon for my hawful
english.

Bye

MAU

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

From: Peter Hober <[EMAIL PROTECTED]>
Subject: Question on io.h
Date: 07 Sep 2000 10:46:33 +0200


Hi,

I try to access an IO-Card (on an x86-system) via inb/outb.
Unfortunately, the linker reports  "unresolved reference to"

Apparently, io.h defines inline assembler code - so probably no
library is missing - what do I do wrong here ?

Thanks

   Peter


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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Kernel & UDP:can you help me?
Date: Thu, 07 Sep 2000 10:55:02 +0200

Maurizio Piana wrote:
> =

> Hello, I'm an italian student and I've got to use udp function
> directly without using socket syscall, for study projects. So
> I have to call UDP function from udp.c file located in
> /usr/src/linux-2.2.16/net/ipv4/udp.c;I have copied that file in
> my directory and because it has many include in net directory
> I also have copied the entire directory /usr/src/linux-2.2.16/include/n=
et/
> and tried to compile with "gcc my_file.c -I . -o my_exe.x" having in
> the directory file udp.c and the net directory. The problem is that
> many struct and types aren't recognized (in included files from kernel
> header files,not from my file!) and many parse error in the same
> groups of include files. Well,I've never programmed nothing for
> kernel so I need help. The goal of the project is to make a
> copy of udp, functioning in user mode out of the kernel.Can anyone
> help me? I thank you so much and beg your pardon for my hawful
> english.

You definitely cannot call any function in the /usr/src/linux
subdirectory from a user program directly. All access to kernel
functions is through system calls.
If you really need to circumvent these, you could write yourself a
module which will then provide some functionality through the /proc
filesystem.

-- =

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

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: Question on io.h
Date: Thu, 07 Sep 2000 10:56:27 +0200

Peter Hober wrote:
> =

> Hi,
> =

> I try to access an IO-Card (on an x86-system) via inb/outb.
> Unfortunately, the linker reports  "unresolved reference to"
> =

> Apparently, io.h defines inline assembler code - so probably no
> library is missing - what do I do wrong here ?

AFAIK, you must optimize using -O2 or the like.
There should be a HOWTO on IO programming somewhere ...

-- =

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

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


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