Subject: Linux-Development Digest #111
From: Digestifier <[email-masked]>
To: [email-masked]
Date: Sat, 3 Sep 94 08:13:08 EDT

Linux-Development Digest #111, Volume #2          Sat, 3 Sep 94 08:13:08 EDT

Contents:
  [PATCH] APM BIOS patch (Stephen F. Rothwell)
  Re: lossage with "tar cz" writing to gzip; easy fix? (Chris Metcalf)
  Re: iopl() and access to CPU register cr0 (Laco Rusnak)
  Re: Aliasing `rm' (Christian Henry)
  Patch to setup.S for Cirrus CLGD54xx adaptors (Christoph Niemann)
  Re: PRIORITY make an undelete command (Kevin Grover)
  Re: scancode terminal support (was:Re: Linux console to SCO comp. prob) (Rob Janssen)
  Re: Any interest for DCF77 clock code? (Rob Janssen)
  Re: Any interest for DCF77 clock code? (Rob Janssen)
  Re: XFree & CDROM slow down transfer rate (Rob Janssen)
  Re: Linux - my first impressions (Rob Janssen)
  Re: DOS BC++/Linux floats (Rene COUGNENC)

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

From: [email-masked] (Stephen F. Rothwell)
Subject: [PATCH] APM BIOS patch
Date: Thu, 01 Sep 1994 09:18:46 GMT

Hi all,

Below are diffs to implement the beginnings of the APM BIOS interface.
(APM = Advanced Power Management)  This patch is relative to 1.1.47
but should work on later kernels.

So far this patch:
        - resets the system clock when suspend mode is exitted.
        - implements a device that can be read to get notification
          of all APM events.

The major number of the device is auotmatically allocated - see
/proc/devices.  You need to mknod the device with the correct
major number.

This device can only be opened by one process at a time and only
by root.  Reads must be at least two bytes (each event is
an unsigned short).

I am just getting these out to let those who want to play have
some fun :-).

Please send me your ideas, comments and/or flames!

Also, If you try this, please send me the boot time output
(starts "APM BIOS ..." followed by some indented lines) as well
as your machine name, model and BIOS revisions.  The latter is
important as some machines have upgradeable BIOS's and it is the
BIOS that we are interacting with.

Cheers,
Stephen
=======
Stephen Rothwell                                 [email-masked]
NEC Information Systems Australia                Phone: +61-6-2508747
Software Development Centre, Canberra, Australia Fax:   +61-6-2508746

===============snip==============snip====================================
===================snip================snip======================

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

From: [email-masked] (Chris Metcalf)
Subject: Re: lossage with "tar cz" writing to gzip; easy fix?
Date: 2 Sep 1994 16:38:25 GMT

I asked the other day about fixes to the "only wrote 4096 of 10240 bytes"
problem with tar creating a compressed archive.  I got one answer, from
Bruno Haible ([email-masked]), confirming that
it's a problem with any POSIX system, since write() is free to return
less than the requested number of bytes on an interrupt.

Here's my solution (hack), which is to replace write() with a function
that loops until it has written all the requested bytes.  Users of tape
drives that require exact blocking of writes should realize that this
patch might mean that a partial write to the tape, which should be an
error, won't be reported as such.  People like me who just use tar for
on-disk archiving don't have to worry about this (possible) problem.

A better solution would be to replace only certain calls to write() with a
wrapper function of the kind shown below.  The maintainer of tar has
been notified of this problem, and will hopefully include a more elegant
solution than mine in the next release.

--- 1.1 1994/09/02 03:40:20
+++ buffer.c    1994/09/02 03:43:13
@@ -1583,2 +1583,33 @@
   return 0;
 }
+
+#ifdef __linux__
+#include <linux/unistd.h>
+#define __NR_sys_write __NR_write
+_syscall3(ssize_t, sys_write, int, fd, const __ptr_t, buf, size_t, s);
+
+ssize_t
+write (int fd, const __ptr_t buf, size_t nbyte)
+{
+  int retval;
+  size_t done = 0;
+  while (nbyte > 0)
+    {
+      retval = sys_write (fd, buf, nbyte);
+      if (retval == 0)
+        break;
+      else if (retval < 0)
+        {
+          if (errno != EINTR)
+            return retval;
+        }
+      else
+        {
+          done += retval;
+          buf = (char *)buf + retval;
+          nbyte -= retval;
+        }
+    }
+  return done;
+}
+#endif /* __linux__ */

-- 
                        Chris Metcalf, MIT Laboratory for Computer Science
                        [email-masked]   //   +1 (617) 253-7766

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

From: [email-masked] (Laco Rusnak)
Subject: Re: iopl() and access to CPU register cr0
Date: Fri, 2 Sep 1994 11:49:08 GMT

N J Andrews ([email-masked]) wrote:
: In article <[email-masked]>, [email-masked] (Gary Paul Gortmaker) writes:

: |>    The problem is that I can't access the 486 config register cr0.
: |> I have used an iopl(3)/iopl(0) pair around the offending routine
: |> (needed anyway, because I put a cli/sti pair around where it writes
: |> to the i/o ports) but it still segfaults when it hits:
: |>
: |> 0x1c7b <cx_i486cachemode+3>:    movl   %cr0,%eax
: |>

: From the manual page I can't see how iopl would enable you to access
: the config register. Without spending time ( which I don't have )
: looking through reference books, I would have thought such a function
: would have to be running in CPU supervisor mode ( note, this should
: be distinct from super-user permissions ), which I would have thought
: would have to be restricted to the kernel.

You must be in kernel mode, i.e. have CPL (current privillege level) 0.
IOPL has no effect to execute instruction move special,reg.
So, if you have any possibility to change CPL to 0 in user program, it is
possible to bring down whole system, if you made error.

Laco.

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

From: [email-masked] (Christian Henry)
Subject: Re: Aliasing `rm'
Date: 1 Sep 1994 10:51:55 -0400
Reply-To: [email-masked]

In article <[email-masked]>,
Yves Arrouye <[email-masked]> wrote:

>       1. Alias rm. What's bad is that when I used it under tcsh I spent my
>       time typing someting like '\rm ...' just to not use the alias (I hate
>       being asked if I really want to do what I said I want to do). I'm sure
>       I'm not the only one which did that...

Why didn't you just pass the `-f' switch to rm (rm -f whatever)?  ;-)

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

From: [email-masked] (Christoph Niemann)
Subject: Patch to setup.S for Cirrus CLGD54xx adaptors
Date: 3 Sep 1994 11:16:11 GMT
Reply-To: [email-masked]

Hi!

I have put a patch for setup.S (the realmode part of the linux kernel)
onto our ftp-server ftp.swt.ruhr-uni-bochum.de in /pub/linux/cirrus.

This patch allows users of Cirrus CLGD54xx adaptors to use the 132x25 and
132x44 video modes.

The patch is against Linux 1.1.49.

Please give it a try and mail any bugs/incompatibilities to me. I'll forward
it to Ross Boswell, the original author of the patch.

Happy hacking,

Christoph

--

=============================================================================
Christoph Niemann                               [email-masked]
Lehrstuhl fuer Software-Technik                 [email-masked]
Ruhr-Universitaet Bochum, Geb. IC3/36           Tel.: 0234/700-7982
D-44780 Bochum                                  Fax.: 0234/700-6914

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

From: [email-masked] (Kevin Grover)
Subject: Re: PRIORITY make an undelete command
Date: Fri, 2 Sep 94 00:35:26 GMT

on 26 Aug 1994 12:13:36 GMT, Glenn Maughan ([email-masked]) wrote:

> Of course this will take up some disk space.  But you could allocate a
> maximum size for the hidden directory and older files are physically
> deleted when the directory gets full.

> Just a thought :-)  Any hackers willing to give it a try?

How about Athena "delete"?  It marks files for delete by appending
".#" to them (which also convientently makes them invisible).

        delete          is the actual program, the man pages gives
                        aliases for rm and rmdir

                        alias rm="/local/athena/bin/delete -F -e"
                        alias rmdir="/local/athena/bin/delete -D -e"

                        to make them behave as expected.

        lsdel           lists all deleted files in current dir
        undelete        used to recover marked files (before they are
                        purged or expunged)
        expunge         will really delete all marked files in the
                        current directory (and possibly sub dirs if
                        the -r option is used)
        purge           cleans your entire account (prints all files
                        and asks for confirmation first)

All in all it works quite well.  I've been using them on a Sun for
quite a while.  However, the require some wierd libraries to build and
I never got them to work on my linux box.  Maybe a more knowledgable
Linux'er will feel like banging on it.

--
- Kevin Grover, [email-masked]

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

From: [email-masked] (Rob Janssen)
Subject: Re: scancode terminal support (was:Re: Linux console to SCO comp. prob)
Reply-To: [email-masked]
Date: Sat, 3 Sep 1994 09:48:50 GMT

In <[email-masked]> [email-masked] (Keith Smith) writes:

>It would be nicer if the scancode support for the keyboard was
>integrated so that it could be used by the dosemu program,

DOSEMU *does* use scancode support for the keyboard!

> and/or
>scancode terminals on serial lines.  Oh, like SCO has <GRIN>.

I'm not sure if it can do it on serial lines, but it would be easy
to add.  No need for support in the kernel for that.

Rob
-- 
=========================================================================
| Rob Janssen                | AMPRnet:   [email-masked]           |
| e-mail: [email-masked]     | AX.25 BBS: PE1CHL@PI8UTR.#UTR.NLD.EU     |
=========================================================================

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

From: [email-masked] (Rob Janssen)
Subject: Re: Any interest for DCF77 clock code?
Reply-To: [email-masked]
Date: Sat, 3 Sep 1994 10:06:00 GMT

In <[email-masked]> [email-masked] (Harald Milz) writes:

>No, Rob, it's been done. There's also a hint how to build a 5V-RS232
>level converter in the xntp-3.3 archive. A better one will be in iX 10/94.

When I want to sync only a single machine from my clock (which already
is interfaced to the RS232), can I configure xntp to leave out all the
network stuff?  I don't need another large daemon in my 16M system...

How difficult is it to configure this?  (I have been on the newsgroup
for a while and I see a lot of problem discussion that extends way beyond
what I want to do...)

Rob
-- 
=========================================================================
| Rob Janssen                | AMPRnet:   [email-masked]           |
| e-mail: [email-masked]     | AX.25 BBS: PE1CHL@PI8UTR.#UTR.NLD.EU     |
=========================================================================

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

From: [email-masked] (Rob Janssen)
Subject: Re: Any interest for DCF77 clock code?
Reply-To: [email-masked]
Date: Sat, 3 Sep 1994 10:08:59 GMT

In <koenig.778509391@nova> [email-masked] (Harald Koenig) writes:

>yes! have a look on my small DCF77 program. since there are not much docs,
>archie won't find it ;-)  but it's available on

>       ftp.informatik.tu-muenchen.de:/tmp/dcf77-koenig.tar.gz

Thanks!  I will have a look at it!

>it uses RX at 50 baud and, if available, DCD with a special kernel patch
>for getting the times stamp in kernel and not in user mode (~12 usec 
>interrupt latency instead of ~10 ms before the user process gets scheuled)
>and of course uses adjtime to correct the clock.

I was considering doing that as well...  too late :-)

>PS: why do you want to use DCD for the DCF77 pulses? 
>the UART (16450/16550) samples the RX input with 16 times baudrate 
>(16*50baud == 800 Hz == 1.25 ms). so you get a jitter of 1.25ms with 
>every second pulse (plus 190ms delay after the leading edge for 1/2 start bit
>plus 8+1 data/stop bits). on DCD you the an exacty interrupt for the 
>signal edges (~12 usec interrupt latency for a 486/DX2-66)

That is why...

Rob
-- 
=========================================================================
| Rob Janssen                | AMPRnet:   [email-masked]           |
| e-mail: [email-masked]     | AX.25 BBS: PE1CHL@PI8UTR.#UTR.NLD.EU     |
=========================================================================

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

From: [email-masked] (Rob Janssen)
Subject: Re: XFree & CDROM slow down transfer rate
Reply-To: [email-masked]
Date: Sat, 3 Sep 1994 10:30:28 GMT

In <[email-masked]> [email-masked] (Robert Stockmann) writes:

>Hello,

>When running XFree and using a cdrom device I notice
>that the transfer rate of my scsi disk slows down.
>When not running XFree no decrease in transferrate can be observed.
>If however XFree (openwin) is started the transfer rate is slowed down.
>normally I get 5.6 Mbyte/sec but under X11 when /dev/sr0 is accessed
>or has been accessed the transfer rate goes down to 500 to 700 kbyte/sec..

5.6 Mbyte/sec on a CDROM??  You must be kidding...

Even 500 to 700 Kbyte/s is top-of-the-bill, and not achievable with the
drive you specify.

Rob
-- 
=========================================================================
| Rob Janssen                | AMPRnet:   [email-masked]           |
| e-mail: [email-masked]     | AX.25 BBS: PE1CHL@PI8UTR.#UTR.NLD.EU     |
=========================================================================

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

From: [email-masked] (Rob Janssen)
Subject: Re: Linux - my first impressions
Reply-To: [email-masked]
Date: Sat, 3 Sep 1994 10:33:35 GMT

In <[email-masked]> [email-masked] (Kees J. Bot) writes:

>Under SunOS the installboot(8) program installs the bootstrap and the
>addresses to /boot into the boot block.  This only needs to be done
>once, because /boot never changes.

>The LILO method is rather crude.

I don't think so...

- LILO does not require the boot image to be on contiguous sectors

- LILO can boot many different kernels and also other operating systems

I think it is a good program, and running its installer after building
the kernel is not a problem at all.  It is even done in the same
"make zlilo" command.

Rob
-- 
=========================================================================
| Rob Janssen                | AMPRnet:   [email-masked]           |
| e-mail: [email-masked]     | AX.25 BBS: PE1CHL@PI8UTR.#UTR.NLD.EU     |
=========================================================================

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

From: [email-masked] (Rene COUGNENC)
Subject: Re: DOS BC++/Linux floats
Date: 2 Sep 1994 19:40:19 GMT
Reply-To: [email-masked] (Rene COUGNENC)

Ce brave Riku Saikkonen ecrit:

> I would like to use the MS-DOS version and the Linux version with the
> same data files. Linux reads the MS-DOS fs well enough, but my files are
> in a binary format. Basically, just a few structs written directly from
> memory using fwrite().

Forget it. (You'll spend too much time with that).

Apart from the internal binary format of your floats in DOS / Linux,
you have to deal with the structure alignment in both systems and
both compilers; you can do it; then you'll want to port your program
to another platform, and have the same problems again...

The best way is to use ASCII data files; (or use your own proprietary
internal format).

--
 linux linux linux linux -[ [email-masked] ]- linux linux linux 

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

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

You can send mail to the entire list (and comp.os.linux.development) via:

    Internet: [email-masked]

Linux may be obtained via one of these FTP sites:
    nic.funet.fi				pub/OS/Linux
    tsx-11.mit.edu				pub/linux
    sunsite.unc.edu				pub/Linux

End of Linux-Development Digest
******************************