Linux-Development-Sys Digest #38, Volume #7      Tue, 10 Aug 99 18:14:45 EDT

Contents:
  Java (imcpy98)
  Re: Linux assembly, etc (Johan Kullstam)
  Re: Which file systems are write stable on Linux? (Randall Parker)
  Re: My first linux program: non-bios boot loader (H. Peter Anvin)
  Help ! Adaptec SCSI 2904CD (Mathieu Lorentz)
  Re: limit ofo processes (Dave Weis)
  Re: processes ("JanW. Roelofs")
  Re: How do I use source RPMs ([EMAIL PROTECTED])
  top of memory ("Hung P. Tran")
  Re: Toshiba DVD-RAM and Linux ("Hartmut W. Malzahn")
  Re: Linux hangs at reboot after recompiling kernel 2.2.10 (Kaz Kylheku)
  Mutexes and conditions for Linux kernel (Kaz Kylheku)
  Sockets, FIOASYNC etc. AAAAAAAGh! (Steven J Haeck)
  Re: Linux hangs at reboot after recompiling kernel 2.2.10 (Kaz Kylheku)
  Re: Linux hangs at reboot after recompiling kernel 2.2.10 (Guilhem Tardy)
  Re: MICROSOFT LINUX DISTRIBUTION ([EMAIL PROTECTED])
  Re: Linux hangs at reboot after recompiling kernel 2.2.10 (Ulrich Weigand)

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

From: imcpy98 <[EMAIL PROTECTED]>
Subject: Java
Date: Tue, 10 Aug 1999 23:06:48 +0800

I've developed a java program on NT, but I can't get it compiled on Linux.
I just thought that java is platform independent. Is this concept right?

Thanks.


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

From: Johan Kullstam <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Linux assembly, etc
Date: 10 Aug 1999 10:56:08 -0400

[EMAIL PROTECTED] (Kaz Kylheku) writes:

> On 09 Aug 1999 19:08:18 -0400, Johan Kullstam <[EMAIL PROTECTED]> wrote:
> >of course it's not *really* a shared library.  however, on the surface
> >it shares a couple of attributes:
> >
> >1) system calls are done by a C subroutine call mechanism.  in x86 you
> >   push args onto the stack and use a `call' instruction.
> 
> Linux system calls are done by executing traps. On x86, this would be the int
> instruction. The C functions in libc are just wrappers, that set up the
> arguments, hit the trap and then fix up the result into a return value and
> errno.
> 
> >2) the kernel is always in memory and all applications share it.
> 
> But you can't see it because it's inaccessible.

sure it is accessible.  you just got done telling me to use an int 80h
trap to access the kernel!  these cause kernel routines to execute,
alter internal kernel structures and usually return with some value(s)
to the caller.

if you mean that i can't just have a stray pointer in a user program
go off and tinker with kernel data then, yes it's inaccessible.  i
wish shared libs were also inaccessible in this way too.  writing to
internal structures that do not belong to you is usually a mistake
(which would be nice to have trapped) or bad style.

-- 
johan kullstam

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

From: [EMAIL PROTECTED] (Randall Parker)
Subject: Re: Which file systems are write stable on Linux?
Date: Tue, 10 Aug 1999 07:52:45 -0700

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> >BTW, has anyone ever considered enhancing ext2 or another file system so 
> >that just the partition and directory tree info is always written to 
> >synchronously? The idea here is to guarantee the integrity of the 
> >directory structure and the readability of the disk even if not all files 
> >have been fully written before a crash. Doing synchronous writes on 
> >everything would slow things down a lot more than just doing synchronous 
> >writes on the directory entries. 
> 
> Have you considered the option "sync" as document in man (8) mount?

Christopher,

I want a finer granularity of control than that.

> 
> The documentation indicates that ext2 does support this option to go
> with synchronous writes, albeit at the cost of slowdown...

That's the thing. From my perspective my greatest risk is that the whole 
file system becomes unreadable on a particular partition (or on multiple 
partitions). The real life example that prompted this inquiry involved an 
unexpected failure of a UPS when power failed. 4 Linux boxes couldn't 
reboot and 3 out of the 4 boxes had to have partitions restored from 
tape.

I'd really like to avoid that sort of thing but not at the cost of making 
all writes of all files synchronous. I figure if one could just make all 
the directory writes synchronous then one might lose part of a file that 
never got written but that is not such a big deal. The RDBMS files are 
probably already being written synchronously and at most we'd lose the 
last few transactions. 

I'd just like to make the file system's own data structures on disk to be 
synchronously written and then leave the question of whether each data 
file gets written synchronously or not to the individual application. 
This seems like a more optimal trade-off.

Barring that I'd like to use a file system that is not as easily 
corruptible when power goes out unexpected while under load (ie while a 
lot of file system activity is going on).

> 
> -- 
> "What's wrong with 3rd party tools? Especially if they are free?  What
> the **** do you think UNIX is anyway? It's a big honkin' party of 3rd
> party free tools." -- Bob Cassidy ([EMAIL PROTECTED])
> [EMAIL PROTECTED] <http://www.hex.net/~cbbrowne/lsf.html>
> 
> 

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

From: [EMAIL PROTECTED] (H. Peter Anvin)
Subject: Re: My first linux program: non-bios boot loader
Date: 9 Aug 1999 18:41:59 GMT
Reply-To: [EMAIL PROTECTED] (H. Peter Anvin)

Followup to:  <[EMAIL PROTECTED]>
By author:    Etienne Lorrain <[EMAIL PROTECTED]>
In newsgroup: comp.os.linux.development.system
> 
>   By the way, IHMO a bootloader should be able to
>  handle BIOS, EBIOS and IDE interface, and do a checksum
>  of its code to not be modified by a virus, whatever the
>  name of the virus.
> 

Sure, and why not make it make coffee too?  Let's get real
here... we're talking about 510 bytes here... less if you want to put
it in the MBR or on an MS-DOS filesystem.

Oh... and where would you store the checksum?  Remember that the virus
can just as well modify the checksum...

        -hpa

-- 
<[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!

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

From: Mathieu Lorentz <[EMAIL PROTECTED]>
Subject: Help ! Adaptec SCSI 2904CD
Date: Tue, 10 Aug 1999 21:05:13 +0200

Does anyone know how and where can I find drivers for my Adaptec SCSI
2904CD
I'm using a Redhat 6.0.
Thanks


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

From: Dave Weis <[EMAIL PROTECTED]>
Subject: Re: limit ofo processes
Date: Tue, 10 Aug 1999 14:45:00 -0500

On Tue, 10 Aug 1999, Sven Heursch wrote:
> Robert Nichols wrote:
> > In article <[EMAIL PROTECTED]>,
> > Sven Heursch  <[EMAIL PROTECTED]> 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?
> > :> --
> > :> 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.
> >
> > In the parent just do:
> >
> >         signal(SIGCHLD,SIG_IGN);
> >
> > That tells the kernel you don't care about your children (so much for
> > "family values") and it will free up the process table slot as soon as
> > each child process terminates.
> I have no idea, but the zombies still exists,

if you check man 2 wait and man 2 signal you'll find that something like
this would be appropriate:


#include <sys/types.h>
#include <sys/wait.h>

void child_died(int)
{
        wait(NULL);
}


int main(int argc, char * argv[])
{
        signal(SIGCHLD, child_died);

}


djweis

-- 
David Weis                | 10520 New York Ave, Des Moines, IA 50322
[EMAIL PROTECTED]      | Voice 515-278-0133 Ext 231

When they took the Fourth Amendment, I was quiet because I didn't deal drugs.
When they took the Sixth Amendment, I was quiet because I was innocent.
When they took the Second Amendment, I was quiet because I didn't own a gun.
Now they've taken the First Amendment and I can't say anything.


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

From: "JanW. Roelofs" <[EMAIL PROTECTED]>
Subject: Re: processes
Date: Tue, 10 Aug 1999 21:34:12 +0200

James Stevenson wrote:
> 
> Hi
> 
> is there a system call under linux to find out what processes are running
> or do i need to parse the proc filesystem to get information on other processes
> 
man top

-- 

Gr.
JW

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

From: [EMAIL PROTECTED]
Subject: Re: How do I use source RPMs
Date: 10 Aug 1999 16:19:29 -0400

But if you grab a source RPM and it doesn't build in your environment, 
because it's different than the author's environment, the it's a pain
in the ass.

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

From: "Hung P. Tran" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.misc
Subject: top of memory
Date: Tue, 10 Aug 1999 16:50:25 GMT

Hi,

Anyone know how to find out the top of physical memory
from a linux device driver ? I need to know where I can
start allocate my PCI resource. Is there any documentation
about all system calls available to device driver in linux ?
Any help is appreciated.

hung





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

From: "Hartmut W. Malzahn" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware
Subject: Re: Toshiba DVD-RAM and Linux
Date: Tue, 10 Aug 1999 22:25:10 +0200

This is a multi-part message in MIME format.

==============1DA071FF148E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Can you give me a hint how I might reproduce the read problem with the
drive? I've written a quick (and very dirty :) fix for the write problem
and the drive appears to work fine now...

I've attached the write patch (patches
/usr/src/linux/drivers/scsi/scsi.c on kernels 2.2.5 or 2.2.6, probably
on later ones too) to this message, maybe it helps someone.

Christoph Martin wrote:
> Christian Mund <[EMAIL PROTECTED]> writes:
> 
> >
> > Hello,
> > I am the proud owner of a TOSHIBA SD-W1101 DVD-RAM Drive and want to know,
> > if there is anyone out there, who is able to use this Drive with Linux.
> >
> > The Drive works in a 2-LUN Mode, LUN0 = CDROM and LUN1 = Optical Device.
> > Reading from a DVD-Media works fine, but when i try to write, the
> > Drive hangs up the SCSI-Bus.
> > I tried to track this problem a little bit, but i am not so familiar with
> > debugging Kernels .
> > dmesg says : "aborting command due to timeout : write(6)
> >               timed out: reset"
> > Using the strace-command i can see, that thwe Device-Hang occurs, when the
> > Kernel does an fsync.
> >
> 
> Similar problems here. Linux hangs after writing some data. Same
> happens when reading large chunks from DVD-Rom.
> 
> Christoph
> --
> ============================================================================
> Christoph Martin, Uni-Mainz, Germany
>  Internet-Mail:  [EMAIL PROTECTED]

==============1DA071FF148E
Content-Type: text/plain; charset=us-ascii; name="ToshibaDVD_patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="ToshibaDVD_patch"

--- scsi.c      Fri Mar 19 00:59:16 1999
+++ scsi.c      Sat Aug  7 17:48:30 1999
@@ -1478,11 +1478,33 @@
     SCpnt->retries = 0;
     SCpnt->allowed = retries;
     SCpnt->done = done;
     SCpnt->timeout_per_command = timeout;
 
-    memcpy ((void *) SCpnt->cmnd , (const void *) cmnd, 12);
+/*  FIXME! -->
+    This is a workaround for the Toshiba SD-W1101 DVD-RAM drive
+    which hangs on WRITE(6) commands.
+    The quick and dirty fix changes any WRITE(6) command for any device
+    on LUN 1 into its WRITE(10) equivalent.
+*/
+    if (((SCpnt->data_cmnd[1] & 0xe0) == 0x20) && (SCpnt->data_cmnd[0] == WRITE_6))
+    {   SCpnt->data_cmnd[9] = SCpnt->data_cmnd[5];  // Control
+        SCpnt->data_cmnd[8] = SCpnt->data_cmnd[4];  // Transfer length (LSB)
+        SCpnt->data_cmnd[7] = 0;                    // Transfer length (MSB)
+        SCpnt->data_cmnd[6] = 0;                    // Reserved
+        SCpnt->data_cmnd[5] = SCpnt->data_cmnd[3];  // Logical block address (LSB)
+        SCpnt->data_cmnd[4] = SCpnt->data_cmnd[2];
+        SCpnt->data_cmnd[3] = SCpnt->data_cmnd[1] & 0x1f;
+        SCpnt->data_cmnd[2] = 0;                    // Logical block address (MSB)
+        SCpnt->data_cmnd[1] = 0x20;                 // Logical unit number etc.
+        SCpnt->data_cmnd[0] = WRITE_10;
+    }
+//  memcpy ((void *) SCpnt->cmnd , (const void *) cmnd, 12);
+    memcpy ((void *) SCpnt->cmnd , (const void *) SCpnt->data_cmnd, 12);
+/*  <-- FIXME!
+*/
+
     /* Zero the sense buffer.  Some host adapters automatically request
      * sense on error.  0 is not a valid sense code.
      */
     memset ((void *) SCpnt->sense_buffer, 0, sizeof SCpnt->sense_buffer);
     SCpnt->request_buffer = buffer;


==============1DA071FF148E==


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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Linux hangs at reboot after recompiling kernel 2.2.10
Date: Tue, 10 Aug 1999 20:51:26 GMT

On Tue, 10 Aug 1999 15:41:29 -0400, Guilhem Tardy <[EMAIL PROTECTED]> wrote:
>Well, the RH 6.0 distribution I was using so far was configured with
>SCSI as a module. Why would it be better to have it fixed in the kernel?
>(sorry for being curious)

See other post. You need a mounted root partition before you can load
modules, and you need your SCSI driver to mount your SCSI root partition.

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Mutexes and conditions for Linux kernel
Date: Tue, 10 Aug 1999 17:34:21 GMT

I released an experimental little library that implements mutexes and condition
variables in the Linux kernel. 

Check out http://users.footprints.net/~kaz/lmc.html

The aim is to eliminate wasteful programming. All through the kernel you see
code along the lines of this pseudo-code.

        struct wait_queue wait = { current, NULL };

        /*...*/

        add_wait_queue(&some_queue, &wait);

        current->state = TASK_INTERRUPTIBLE;


        while (!predicate()) {

                /*... unlock critical region ... */

                schedule();

                /* ... lock critical region ... */

                /* check for wake up due to signals */

        }

        current->state = TASK_RUNNING;

        remove_wait_queue(&some_queue, &wait);


That's a lot of work compared to just waiting on a condition variable, and then
inspecting a simple return value that tells you whether you possibly timed out.
And note how the pattern is very much like a condition variable wait. So
minimal wrapping is required to make this presentable to the world: basically
just a little bath, haircut and a shave. Compare the above to:

        /* mutex is held */

        while (!predicate()) {
            if (cond_wait(&some_condition, &some_mutex)) == COND_WAIT_SIGNAL) {
                /* wait was terminated by receipt of signal */
                break;
            } 
            /* else return value was COND_WAIT_SUCCESS */
        }

The mutexes are based on irq-disabled spinlocks. This means that a mutex can be
acquired in any context. A mutex is owned by a processor, not by a task.  So an
interrupt service routine can lock, as well as a task. Waiting on a condition
may only be done by a task, but an interrupt can signal or broadcast.
(Signalling is equal to broadcasting right now; only wake-up-all  semantics
are supported).  Because a mutex records the CPU flags of its owning processor,
you can acquire a mutex in one function and release it in another. There is no
explicit management of a ``flags'' variable, as when you use the
spin_lock_irqsave() and spin_unlock_irqrestore() functions directly.

The 2.0 kernels are not supported right now; this builds under 2.2 and uses its
features. It is highly experimental stuff. 

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

From: Steven J Haeck <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking
Subject: Sockets, FIOASYNC etc. AAAAAAAGh!
Date: 10 Aug 1999 21:46:04 +0100


Please can anyone offer some assistance.  I require to use the
FIOASYNC ioctl in order to ensure that I get IO signals on a UDP
socket.  While I get no error returned, I also get no signals.

I am aware that this has been a recent issue with the Linux kernel,
but as I understand from linuxhq.com, " FIOASYNC (O_SYNC) IOCTL
support" was fixed in version 2.2.5.  I run redhat 6.0, and
uname -a replies

Linux hagal.dcs.ed.ac.uk 2.2.5-15 #1 Mon Apr 19 23:00:46 EDT 1999 i686 unknown

which is the default kernel from the installation.  Surely I've got
the fixes made in release 2.2.5? Do I need to replace my kernel with a
newer one?  Has anyone got asynchronous IO events working with a Linux
Kernel?  Is there something silly I'm not doing right?  Is there an
easy way to check if my kernel is capable of this?

--
/* Allow receipt of asynchronous I/O signals */
  int on=1;
  if (ioctl(sockfd, FIOASYNC, &on)<0) { perror("Async IO not set"); exit(1); }
  pause();
--


-- 
Steven J Haeck

Tel. : 0131-650-5165         Email : [EMAIL PROTECTED]
Fax. : 0131-667-7209         WWW   : http://www.dcs.ed.ac.uk/home/sjh

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: Linux hangs at reboot after recompiling kernel 2.2.10
Date: Tue, 10 Aug 1999 20:50:14 GMT

On Tue, 10 Aug 1999 14:51:44 -0400, Guilhem Tardy <[EMAIL PROTECTED]> wrote:
>Now I can boot (I previously forgot to update the bootsect.lnx in the
>WinNT partition, which worked fine until some boot file moved within the
>ext2 partition), BUT it hangs with the root fs:
>NTFS version 990411
>request_module[block-major-8]: Root fs is not mounted
>VFS: Cannot open root device 08:07
>Kernel panic: VFS: Unable to mount root fs on 08:07
>
>It is kernel 2.2.11 on a SCSI drive, I moved the SCSI drivers (AHA-7xxx)
>to modules and created an initrd image, as described in the RH 6.0

I don't know whether this is relevant, but the drivers required to mount your
root filesystem cannot be modules.  You can't load modules if you haven't
mounted any filesystem.

If your root partition is on a SCSI drive, the SCSI driver has to be statically
compiled into the kernel. Ditto for the filesystem module that is used over the
root partition (most likely ext2, which is rarely made as a module).

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

From: Guilhem Tardy <[EMAIL PROTECTED]>
Subject: Re: Linux hangs at reboot after recompiling kernel 2.2.10
Date: Tue, 10 Aug 1999 17:46:16 -0400

Thanks for your comments.
Actually, I was fortunate to be able to boot with a floppy. The problem
wasn't with the SCSI, it was the NTFS support (and possibly VFAT) which
blew everything out. As I don't need any of these, I just got rid of
them.
I use the initrd file to put the SCSI module into it, as described in
the RH Installation Guide. For my understanding, it is a loopback block
device, although I don't figure out how the boot loader access it in the
first place. This is how it worked out of the box, therefore I don't
intend to change anything with that (I managed - for a try - to put
everything into the kernel, but it works fine with a module anyway).

Now, I shall focus on my initial problem, which was the NFS daemon, as
explained in another thread a few minutes ago. If you wish to share your
ideas with me, I'll appreciate.

Guilhem Tardy.

Ulrich Weigand wrote:
> 
> Well, you have a chicken-and-egg problem: the module resides in a file
> on the disk, so to be able to load the module, the kernel needs to be
> able to access the disk, but it can only access the disk after the
> module implementing disk access is loaded :-/
> 
> The only way around this is to use an initial ramdisk and place the
> module on the ramdisk.  As you said you had created an ramdisk image,
> maybe the SCSI module is not on it?  Or the conf.modules file on the
> initial ramdisk doesn't point to the SCSI module?  Or you don't have
> module autoloading active on the ramdisk? Or you didn't announce the
> position of the ramdisk image to LILO correctly (as disk access doesn't
> work yet at the time the ramdisk is loaded, the boot loader reads the
> image file sector by sector, where the list of sectors to be loaded was
> created when you ran lilo)?
> 
> (Is there any particular reason why you use the initrd at all, b.t.w.?)
> 
> --
>   Ulrich Weigand,
>   IMMD 1, Universitaet Erlangen-Nuernberg,
>   Martensstr. 3, D-91058 Erlangen, Phone: +49 9131 85-7688

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

From: [EMAIL PROTECTED]
Subject: Re: MICROSOFT LINUX DISTRIBUTION
Date: Tue, 10 Aug 1999 21:03:51 GMT

Since I have novell 4.2 running on top of my linux box I found out that
it doens't use server.exe instead you use the linux version writen but
some german guy called mars_nw... works really slick if you as me and
it actually is supost to outperform that MS-DOS server.exe.. I am still
testing to see if that is true.

In article <[EMAIL PROTECTED]>,
  Greg White <[EMAIL PROTECTED]> wrote:
> SNIP
> > - Novell's Netware product provides its own operating system.  It
does not
> > need MS-DOS or Linux or anything else in order to function.
>
> Huh?? Exactly how do you get server.exe to run??? It's a DOS binary...
> There may be a way I'm not aware of, but every 3.x and 4.x and 5.x
> install I've done starts with "Create a small MS-DOS FAT partition..."
>
> GW
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

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

From: [EMAIL PROTECTED] (Ulrich Weigand)
Subject: Re: Linux hangs at reboot after recompiling kernel 2.2.10
Date: 10 Aug 1999 23:32:55 +0200

Guilhem Tardy <[EMAIL PROTECTED]> writes:

>Well, the RH 6.0 distribution I was using so far was configured with
>SCSI as a module. Why would it be better to have it fixed in the kernel?
>(sorry for being curious)

Well, you have a chicken-and-egg problem: the module resides in a file
on the disk, so to be able to load the module, the kernel needs to be
able to access the disk, but it can only access the disk after the 
module implementing disk access is loaded :-/

The only way around this is to use an initial ramdisk and place the
module on the ramdisk.  As you said you had created an ramdisk image,
maybe the SCSI module is not on it?  Or the conf.modules file on the
initial ramdisk doesn't point to the SCSI module?  Or you don't have
module autoloading active on the ramdisk? Or you didn't announce the 
position of the ramdisk image to LILO correctly (as disk access doesn't 
work yet at the time the ramdisk is loaded, the boot loader reads the 
image file sector by sector, where the list of sectors to be loaded was 
created when you ran lilo)? 

(Is there any particular reason why you use the initrd at all, b.t.w.?)

-- 
  Ulrich Weigand,
  IMMD 1, Universitaet Erlangen-Nuernberg,
  Martensstr. 3, D-91058 Erlangen, Phone: +49 9131 85-7688

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


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