[comp.os.minix] List of bugs and improvements I will post immediately

ast@cs.vu.nl (Andy Tanenbaum) (10/06/87)

In a following series of messages I will post 4 diff files, fs:main.diff,
mined1.diff, mined.h.diff, and tty.diff as well as some full files:
gtty.c, stty.c, perror.c termcap and termcap.c.  Here are the sizes of the
reconstructed files:

-rw-r--r--  1    ast    11637 Oct  4 13:47 /usr/ast/minix/fs/main.c
-rw-r--r--  1    ast       89 Oct  3 18:48 /usr/ast/minix/lib/gtty.c
-rw-rw-rw-  1    ast     1458 Oct  3 19:18 /usr/ast/minix/lib/perror.c
-rw-r--r--  1    ast       89 Oct  3 18:48 /usr/ast/minix/lib/stty.c
-rw-r--r--  1    ast     5543 Oct  4 16:26 /usr/ast/minix/lib/termcap/termcap.c
-rw-r--r--  1   root      132 Oct  5 20:36 /etc/termcap
-rw-r--r--  1    ast    61178 Oct 31 00:00 /usr/ast/minix/commands/mined/mined1.c
-rw-r--r--  1    ast     6817 Oct  4 03:34 /usr/ast/minix/commands/mined/mined.h
-rw-r--r--  1    ast    51641 Oct  5 19:32 /usr/ast/minix/kernel/tty.c

1. fs:main.diff fixes a bug that one of my students, Dick van Veen found.


2. lib/gtty.c and lib/stty.c are new V7 library routines.

3. lib/perror.c is a better version.  It is more V7 like.

The next batch of files relate to the recent discussion about escape sequences.
I have adopted the ANSI output codes recently posted.  I also decided to go
whole hog and change the input sequences as well.  Thus starting now, the
11 numeric pad keys produce the ANSI standards are well, as follows:

Home: ESC [ H
up arrow: ESC [ A
PgUp: ESC [ V
left arrow ESC [ D
numeric-5: ESC [ G
right arrow: ESC [ C
End: ESC [ Y
down arrow: ESC [ B
PgDn: ESC [ U
numeric minus: ESC [ S
numeric plus: ESC [ T

These codes are also used in PC-IX.  Making these changes required changing
kernel/tty.c, mined.h, and mined1.c.  These changes are included.  They also
required changing both termcap.c and /etc/termcap itself.  I have also included
these files.  If you install all these changes, you will have a consistent
version using all the ANSI codes for input and output, a version of mined that
uses them, and termcap routines for them.  

4. termcap.c is the termcap package for MINIX with ANSI codes.

5. termcap is the /etc/termcap file.  set TERM=minix in your profile.

6.  mined1.diff is diff of commands/mined/mined1.c

7. mined.h.diff is diff of commands/mined/mined.h

8. tty.diff is diff of kernel/tty.c

ALL DIFFS ARE RELATIVE TO VERSION 1.2 !!!


On a different note, Andy Valencia just sent me a note saying that if you
apply Bing Bang's recent fix to pipe.c, his RS-232 driver works, except that
it still loses characters.  I think the problem is that phys_copy disables
interrupts too long.  Will some brave souls please back up their disks,
remove the sti and cli from phys_copy, and test the living daylights out
of MINIX (heavy load, lots of forks and execs, let it run for hours).  If
these tests work, and in theory they should but I have never had the nerve
to try, then they can be removed and the RS232 will not lose characters.
Furthermore, the clock will not lose ticks then.    Post your findings.

Andy Tanenbaum (ast@cs.vu.nl)

bing@galbp.LBP.HARRIS.COM (Bing Bang) (10/07/87)

In article <1710@botter.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes:
>On a different note, Andy Valencia just sent me a note saying that if you
>apply Bing Bang's recent fix to pipe.c, his RS-232 driver works, except that
>it still loses characters.  I think the problem is that phys_copy disables
>interrupts too long.  Will some brave souls please back up their disks,

err..... i hate to admit to this, but i have found several serious bugs in
the tty driver i posted since the posting... since doing that i am a bit
paranoid about posting again with out being absolutely sure things work.
i'll re-post the stuff quite soon.

about the interrupts, i have replaced the sequences of

pushf
cli
...
popf

to something like:

pushf
cli
movb al,0xe7
out 0x21,al		| mask off all but the com port interrupts
popf
...
xorb al,al
out 0x21,al		| mask off no interrupts

this is still not quite adaquate. because some of this sequences are in
programms that become re-entrant if the interrupts are on. it looks like we
have to keep track of what state the 8259 was and restore that state instead
of blindly turning on all the interrupts at the end of the sequence.

just simply getting rid of all the cli's has disasterous results. i tried it
and i think something with the keyboard interrupts goes bad, if i hit a key
at just the right time, the system goes haywire. after it stepped on my
hard disk supperblock, i decided not to persue that route.
-- 
Bing H. Bang           +----------------------------------------------------+
Harris/Lanier          |MSDOS and OS/2 (whenever it gets here): just say no.|
Atlanta GA             +----------------------------------------------------+