From:     Digestifier <Linux-Development-Request@senator-bedfellow.mit.edu>
To:       Linux-Development@senator-bedfellow.mit.edu
Reply-To: Linux-Development@senator-bedfellow.mit.edu
Date:     Thu, 23 Sep 93 06:13:07 EDT
Subject:  Linux-Development Digest #119

Linux-Development Digest #119, Volume #1         Thu, 23 Sep 93 06:13:07 EDT

Contents:
  Icmake 6.05 is out (Karel Kubat)
  Re: To all device driver writers; boot-time messages. (Norbert J. Girardi)
  no libipc.a with slackware (Simon Johnston)
  Phigs on Linux (Arjen Stage Sheila)
  0.99pl8-3 msdos fs bug. (Arlie Davis)
  NEW multiple sector transfer PATCH for IDE drives (Jan Richert)

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

From: karel@icce.rug.nl (Karel Kubat)
Subject: Icmake 6.05 is out
Date: Thu, 23 Sep 1993 07:23:50 GMT

Hi Linuxers:

Icmake 6.05 is out. There have been some more built-in functions created and 
some bug repairs since the last release.  Icmake available on the two 
following sites: 
        beatrix.icce.rug.nl, pub/unix
        tsx-11.mit.edu, pub/linux/sources/usr.bin
The files are:
        icmake-6.05.tar.gz      (the archive of sources etc.)
        icmake.doc              (installation notes)

To get an impression of 'what Icmake is', here's the file icmake.doc. 

=============================================================================
                                ICMAKE 
                  the Intelligent C-like MAKEr, or
                        the ICce MAKE utility
                        
            Copyright (c) Frank B. Brokken and Karel Kubat
            
           ICCE, State University of Groningen, Netherlands
=============================================================================


Introduction
============

        Icmake is a hybrid between a 'make' utility and a 'shell script' 
language.  Originally, it was concocted to provide a useful tool for 
automatic program maintenance and system administrative tasks on MS-DOS 
platforms.  As we learned to appreciate its flexibility, Icmake was 
eventually ported to Unix platforms (SCO and Linux). By now Icmake also runs 
on a HP-Unix platform.

        To give an impression of "what Icmake does", take a look at the 
following makefile. It is used for automatic program maintenance, where it 
is assumed that in some directory all files with the extension ".c" (C 
source files) constitute a program "myprog". The automatic maintenance makes 
sure that, once Icmake is invoked, C source files which are more recent 
(newer) than a library file "libmyprog.a" are recompiled and placed in the 
library. A new program is then made and installed in a directory 
"/home/user/bin".

void main ()
{
    list
        cfiles;                                 // list of .c files
    int
        i;                                      // counter variable
    string
        sourcefile;                             // string with name of 
                                                // 1 source file
    
    cfiles = makelist ("*.c", younger,          // cfiles is now a list of
        "libmyprog.a");                         // all files to recompile
    
    if (cfiles)                                 // if there are any files..
        for (i = 0; i < sizeof (cfiles),        // recompile them
             i++)
        {
            sourcefile = element (i, cfiles);   // get the name from the list
            exec ("gcc", "-c -Wall", sourcefile); // recompile
        }
    
    if (makelist ("*.o"))                       // any "*.o" files here?
    {
        exec ("ar", "rvs", "libmyprog.a", "*.o");  // add to library
        exec ("rm", "*.o");                        // remove them
        exec ("gcc", "-o myprog", "libmyprog.a");  // re-link program
        exec ("mv", "myprog", "/home/user/bin");   // and install in bin dir
    }
}

        The source files for Icmake look remarkably like C sourcefiles. The 
resemblance is so close that this cannot be pure chance!  Yes, we have 
implemented Icmake to be a language with a syntax which largely overlaps C.  
Since we know how to program in C, we decided that we didn't want to learn 
some new macro language.  The Icmake language is a "subset" of C in the 
sence that not all operators or functions of C are implemented (but a good 
deal are, e.g., gets(), getch(), printf(), etc.).  The Icmake language has 
its own extensions to make it a handy language for the purpose of 
maintenance: e.g., the operator "younger" compares two files in respect to 
their date of last modification, a type "list" is defined to hold several 
strings.  

        The usage of Icmake is not restricted to program maintenance. The 
setup, which allows for functions, arguments, local or global variables, the 
calling of external programs, etc.  makes Icmake also extremely suitable as 
a shell script language.  E.g., it is easy to accomplish to let Icmake 
figure out which files need to be backupped since the last backup date and 
to start a process to do so, to send mail about it etc.

        This guide provides a short description how Icmake can be ported to 
new platforms.  The documentation for the usage of Icmake, including a 
description of the grammar and of all built-in functions, comes with the 
distribution files.  


Installing Icmake
=================

        The installation files for Icmake come as an archive, e.g., 
"icmake.zip" or "icmake-5.00.tar.z". These archives unpack to several 
directories and files. Please note that the archives unpack to the *current* 
directory. 

        To unpack the archives, create an appropriate directory (e.g., 
"/usr/local/src/icmake" for Unix platforms, or "c:\c\icmake" for DOS) and 
change-dir to that directory. Use an appropriate archiver to unpack. Some 
possibilities are described below:

(a) The archive in the form ".tar.Z" can be unpacked using 
"cat icmake-5.00.tar.Z | uncompress | tar xvf -"

(b) Archives in the form ".tar.gz", ".tar.z" or ".tgz" can be unpacked using
"gzip -c -d icmake-5.00.tar.gz | tar xvf -"

(c) The archives with the extension ".zip" can be unpacked using 
"unzip icmake.zip" or "pkunzip -d icmake.zip".

        The extraction of files from the archive should yield a lot of C 
source files in a number of directories. The default distribution of Icmake 
may or may not contain makefiles for the Unix-utility "make"; but the 
programs can always be created by compiling all files "by hand". 
Furthermore, the directory "dosbin" contains compiled versions of the Icmake 
programs for DOS platforms.

        To compile all files "by hand" in order to make the programs, please 
follow these steps:

(a) Change-dir to the directory "rss". This directory contains sourcefiles 
for the Runtime Support System. These functions are used in all the programs 
of the Icmake family.

Compile all files, using the appropriate compiler flags which cause your 
compiler to compile-only and which cause it to treat "char"s as "unsigned 
char"s.  If your compiler supports memory models, choose the "small" model. 
E.g., these compiler flags are:

        for GNU's gcc:                  gcc -c -funsigned-char
        for Microsoft C 7.00:           cl -c -J -AS
        
While compiling, you may need special definition flags to produce workable 
code for 'exotic' (well.. exotic to me) systems. Please check the section 
below to see if you need any special flags.

Next, place the produced object files into one library. A suggested name is 
"libicrss.a" for Unix systems, or "icrss.lib" for DOS systems.  See the 
documentation of your library manager ("ar" or "lib") for the required 
command line.  E.g., for Unix systems try "ar rsv libicrss.a *.o".  

(b) The following five directories must also be created from the archive: 
"make", "pp", "comp", "exec", "un". The directories hold respectively the 
files needed for the top-level program "icmake", for the preprocessor 
"icm-pp", for the compiler "icm-comp", for the executor "icm-exec" and for 
the unassembler "icmun". These program names are on Unix-based systems 
without extension; supply ".exe" for DOS.

Change-dir to each of these directories, and compile and link all .c files 
into the appropriate program. E.g., for a Unix system you might type:
        cd make
        gcc -funsigned-char -o icmake *.c ../rss/libicrss.a
        cd ../pp
        gcc -funsigned-char -o icm-pp *.c ../rss/libicrss.a
        cd ../comp
        gcc -funsigned-char -o icm-comp *.c ../rss/libicrss.a
        cd ../exec
        gcc -funsigned-char -o icm-exec *.c ../rss/libicrss.a
        cd ../un
        gcc -funsigned-char -o icmun *.c ../rss/libicrss.a
        cd ..
For a DOS platform with the Microsoft compiler, you might type:
        cd make
        cl -AS -J -Feicmake.exe *.c ..\rss\icrss.lib
        cd ..\pp
        cl -AS -J -Feicm-pp.exe *.c ..\rss\icrss.lib
        cd ..\comp
        cl -AS -J -Feicm-comp.exe *.c ..\rss\icrss.lib
        cd ..\exec
        cl -AS -J -Feicm-exec.exe *.c ..\rss\icrss.lib
        cd ..\un
        cl -AS -J -Feicmun.exe *.c ..\rss\icrss.lib
        cd ..
        
Whichever platform you use, please make sure to include the "unsigned chars" 
flag when compiling, and name the resulting program by the appropriate name 
(one of "icmake", "icm-pp", "icm-comp", "icm-exec", "icmun", optionally 
followed by an extension ".exe" for DOS systems). The reason for this is the 
fact that the top-level program "icmake" must be able to call all subsequent 
programs, of which the names therefore must be known. Furthermore, you may 
need special compilation flags for rare systems (see the section below).

During the compilation your compiler may report some warnings. You can 
ignore these.

(c) If all goes well, you've now created all necessary programs. Move the 
executable files to a system directory; e.g., "/usr/local/bin" for Unix 
systems, "c:\sys\bin" for DOS systems, etc.

(d) For all subsequent releases of Icmake which you may wish to install, you 
can use your old programs and the included icmake-files.  E.g., the 
installation includes a file "unix.im" to create Icmake for Unix platforms.  
Prior to using the makefiles, you may wish to edit this file, to define your 
favorite compiler, your system directory, etc. Even when you successfully 
create Icmake by hand, it may be a good idea to re-make it with the makefile 
to check its workings. Just type "icmake unix", or "icmake dos-msc" or whatever 
is appropriate; then follow the instructions which are printed by the 
makefile.


Special flags while compiling
=============================

        A large part of the source code of Icmake should compile on any 
platform. The exceptions we have encountered so far are the following:

(a) On MSDOS platforms, the constant MSDOS must be defined. This symbol is 
by default defined by the Microsoft compiler. For other compilers on DOS 
systems, a flag "-DMSDOS" may be necessary when invoking the compilations. 
Non-DOS systems should, obviously, *not* have a defined symbol MSDOS.

(b) Sparc stations which require double-word alignment, require that the 
constant SPARC be defined. Parts of the code, especially the file 
comp/patchup.c, handle assignments differently when SPARC is defined. On 
such systems, "-DSPARC" should be added to the compiler flags. (Many thanks 
to Wilco Oelen (W.Oelen@el.utwente.nl)).


The Documentation
=================

        Icmake is documented in a GhostScript-file, "icmake.gs", located in 
the directory "doc". If your site lacks the means to process ghostscript, 
you can mail us at the address below to obtain a printed copy of the 
documentation. (However, we will charge you a small amount to cover our 
costs).

        The directory "doc" furthermore contains the file "icmake.1". This 
is a crude "man" page for Unix systems. You can install it by copying it to 
a directory which contains formatted manual pages. To use this feature, your 
"man" command must be able to show an already-formatted manual entry. E.g., 
on Linux systems you can copy this file to "/usr/man/cat1". Typing "man 
icmake" will then show the information. Some man systems also support 
compressed manual pages. On these systems you may achieve a lower disk usage 
by compressing the file "icmake.1", using the Unix program "compress".

        A few makefiles are provided as examples in the directory 
"examples". You may wish to look at these to see how makefiles can be 
organized.


Some Legal Stuff
================

        Icmake is shareware. This means that no fee is charged for it. As 
with everything that's free, there's no pay but also *absolutely no 
warranty*.  Furthermore, you are allowed (and encouraged) to distribute 
Icmake, provided that you include this information with each distribution 
and provided that you do *not* charge any amount for it.  Not even the $5 
for shipping.  

        The source files and the documentation for Icmake are copyrighted by 
us.  The reason for this is (a) that we'd like to have always the last 
version of Icmake, and (b) that we'd like to have the last word in all 
modifications.  If you have requests (or even better, "working code" to 
include in Icmake) please mail us and we'll gladly oblige when we find the 
time.  


Requests, Bug Reports, etc.
===========================

        It is possible, even highly likely, that the version of Icmake which 
you received contains bugs. We are continuously fighting a battle against 
the insects which pop up from time to time to tease us. 

        Therefore, we'd very much appreciate it if you'd let us know if you 
encounter any bugs. Also, if you have requests or comments about the 
programs or the documentation, mail us. We can be reached at:

                Frank Brokken                   Karel Kubat
e-mail:         F.B.Brokken@icce.rug.nl         K.Kubat@icce.rug.nl
phone:          (+31) 50 63 36 88               (+31) 50 63 36 47
address:        Westerhaven 16                  Westerhaven 16
                Groningen                       Groningen
                Netherlands                     Netherlands
-- 
                      The ICCE usenet account
                   providing access to usenet news
                      for the ICCE Experience 
               _WERKEN_AAN_DE_GRENZEN_VAN_HET_KUNNEN_

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

From: girardi@rniil.rni.sub.org (Norbert J. Girardi)
Subject: Re: To all device driver writers; boot-time messages.
Date: Thu, 23 Sep 1993 03:54:00 GMT

Herb Peyerl (hpeyerl@novatel.ca) wrote:
: Russell Nelson (nelson@crynwr.com) wrote:
: : In article <1993Sep17.184413.6604@super.org> becker@super.org writes:
: :    I'm still looking for comments on the main points, especially suggestions on
: :    the content and (loose) format of boot-time messages.
: : I'd like to see a prefix, of say, "I:" for informative messages, "W:"
: : for warnings (something is not standard, e.g. COM1 using IRQ 3), and
: : "E:" for an actual drop-dead error, e.g. trying to mount a MS-DOS
: : partition as root.

: Actually; I think you should take that a little further and change *all*
: system errors to the following format:

: %<subsystem>-<severity>-<symbolic> -- <english explanation>

: So you would see errors that look like:

: %TCPIP-F-EINVAL -- Invalid Argument.
: %EXTFS-E-EDSKTRSH -- Lost track of Inode. Filesystem Trashed.
: %EXTFS-W-ENOINODE -- Couldn't find free inode. You may have trouble later.

: Then you could go a little further and modify all the console logging 
: so that console messages look like:

: %%%%%%%%%%%  OPCOM  22-SEP-1993 09:17:09.24  %%%%%%%%%%%
: Message from user "news" on mynode.my.domain
: Expire: no permission on history.
: %NEWS-F-EPERM -- No Permission.


And we could ask Linus to develop LinOvenVMS for us so that every
LINUX - pardon LinOvenVMS user could clearly see why VMS is superior
to Unix ;-)

- Norbert 

--
SSSSSS            SQUAREDANCE is FRIENDSHIP set to MUSIC.
S  QQSQQQ      Norbert J. Girardi < girardi@rniil.rni.sub.org >
SSSQSS  Q       Voice: +49 621 493417 (h) +49 621 381-3260 (w)
   QQQQQQ  If you know how to REPAIR YOUR SQUARE :-) drop me a line

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

From: skj@oasis.icl.co.uk (Simon Johnston)
Subject: no libipc.a with slackware
Date: Thu, 23 Sep 1993 07:31:53 GMT

My Slackware distribution contains a kernel 0.99.12, and a dosemu 0.49. I
tried to compile the dosemu yesterday but there is no libipc library !
does anyone have the libipc which would match the 0.99.12 kernel, and can
anyone tell me why I don't have one.

Thanks.


MODULE Sig;
FROM ICL IMPORT StdDisclaimer;

BEGIN
(* ------------------------------------------------------------------------.
|Simon K. Johnston - Development Engineer              |ICL Retail Systems |
|------------------------------------------------------|3/4 Willoughby Road|
|Unix Mail : S.K.Johnston.bra0801@oasis.icl.co.uk      |Bracknell, Berks   |
|Telephone : +44 (0)344 476320   Fax: +44 (0)344 476084|United Kingdom     |
|Internal  : 7621 6320    OP Mail: S.K.Johnston@BRA0801|RG12 8TJ           |
`------------------------------------------------------------------------ *)
END Sig.

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

From: stage@ictser.UUCP (Arjen Stage Sheila)
Crossposted-To: comp.os.linux,comp.os.linux.help
Subject: Phigs on Linux
Date: 23 Sep 93 07:47:37 GMT

Has anyone already ported the PHIGS package (comes with X11R5) to Linux?
I have to use it for a graduating project, but I'd like to be able to 
do some work at home to. 
I've noticed that the Linux X-server already supports PEX, but the library
containing the PHIGS-extensions (libphigs.a) isn't on the distribution disks.

There is a version of PHIGS (called UIPEX), that promises a near complete 
version of PHIGS but I can't get the makefile working (I think this has some-
thing to do with the differences between GNU-make and the standard UNIX-make).

Any help, hints, tips etc will be greatly appreciated.

AtDhVaAnNkCsE

Arjen Broeze


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

From: Arlie Davis <aldavi00@mik.uky.edu>
Subject: 0.99pl8-3 msdos fs bug.
Reply-To: Arlie Davis <aldavi00@mik.uky.edu>
Date: Thu, 23 Sep 1993 09:16:23 GMT

Linux kernel 0.99pl8-3 has a bug in the msdos filesystem: it won't
properly recognize and mount type 4 filesystems (<32meg).
I banged my head against the desk for days over this, and finally pinned  
it down to this bug.  It's reproducible, and easily worked around:
Make the DOS partition >32meg.

Happy kernel hacking.

-- Arlie Davis
-- <aldavi00@madonna.mik.uky.edu>       NeXT mail accepted
-- <aldavi00@ukpr.uky.edu>              Mail tolerated here
-- <aldavi00@ukcc.uky.edu>              BITNET tell messages to UKCC

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

From: jrichert@krefcom.GUN.de (Jan Richert)
Subject: NEW multiple sector transfer PATCH for IDE drives
Date: Wed, 22 Sep 1993 14:00:30 GMT
Reply-To: fsommer@fh-krefeld.de

This is one more enhanced multiple sector transfer patch
for hd.c for use with IDE drives.

Comments should be directed to fsommer@fh-krefeld.de (Reply-To is set).


--- hd.c        Wed Jul 28 02:19:32 1993
+++ hd2290.c    Tue Sep 21 17:41:40 1993
@@ -4,6 +4,23 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
+
+/* Multiple Sector Transfer and 32 Bit IO by Frank Sommer      
+                                               fsommer@krefcom.gun.de
+                                               fsommer@fh-krefeld.de
+This Driver supports 32-Bit IO for faster data transfer.
+But I know only about 1 controller who supports this:  DTC2290 EISA-IDE.  
+Maybe VL IDE cards works with 32 bit io, too. To enable this feature add
+-DCONFIG_BLK_DEV_HD_DTC2290 to your Makefile.
+If you don't want multi sector io, but your drive supports it, you should
+add -DCONFIG_BLK_DEV_HD_NOMULTI to your Makefile to override drive information.
+There is no support for the 2nd ide port of the DTC2290, because i don't know
+how to handle the second int in one device driver....
+Currently there is sometimes a problem when the kernel wants to read the
+ partition  table and the drive does not support multiple sector io:
+a timeout errors may occure. I think this is not  dangerous !
+*/
+
 /*
  * This is the low-level hd interrupt support. It traverses the
  * request-list, using interrupts to jump between functions. As
@@ -53,6 +70,24 @@
 #define RECAL_FREQ      4      /* Recalibrate every 4th retry */
 #define MAX_HD         2
 
+#define WIN_MULTIPLE_READ      0xc4
+#define WIN_MULTIPLE_WRITE     0xc5
+#define WIN_SET_MULTIPLE       0xc6
+#define WIN_IDENTIFY_DRIVE     0xec
+
+static struct {
+       int     secspint;
+       char    name[80];
+       int     dwordio;
+       int     readcmd;
+       int     writecmd;
+} new_hd_info[2] = {{0,"\0",0,WIN_READ,WIN_WRITE},{0,"\0",0,WIN_READ,WIN_WRITE}};
+
+static volatile int new_hd_intack = 1;
+
+
+
+static int exec_multiple_write;
 static void recal_intr(void);
 static void bad_rw_intr(void);
 
@@ -86,11 +121,22 @@
 static int hd_sizes[MAX_HD<<6] = {0, };
 static int hd_blocksizes[MAX_HD<<6] = {0, };
 
+#ifdef CONFIG_BLK_DEV_DTC2290
+/* 32 Bit-IO on data transfer */
+
 #define port_read(port,buf,nr) \
+__asm__("cld;rep;insl": :"d" (port),"D" (buf),"c" (nr>>1):"cx","di")
+
+#define port_write(port,buf,nr) \
+__asm__("cld;rep;insl": :"d" (port),"S" (buf),"c" (nr>>1):"cx","si")
+#else
+
+#define port_read(port,buf,nr) \
 __asm__("cld;rep;insw": :"d" (port),"D" (buf),"c" (nr):"cx","di")
 
 #define port_write(port,buf,nr) \
 __asm__("cld;rep;outsw": :"d" (port),"S" (buf),"c" (nr):"cx","si")
+#endif
 
 #if (HD_DELAY > 0)
 unsigned long read_timer(void)
@@ -228,6 +274,7 @@
        printk("HD controller times out, status = 0x%02x\n",c);
        return 1;
 }
+static void init_multiplesector_transfer(int);
 
 static void reset_controller(void)
 {
@@ -241,6 +288,8 @@
                printk("HD-controller still busy\n");
        if ((hd_error = inb(HD_ERROR)) != 1)
                printk("HD-controller reset failed: %02x\n",hd_error);
+       for (i=0;i<2;i++)
+               init_multiplesector_transfer(i);
 }
 
 static void reset_hd(void)
@@ -275,7 +324,9 @@
 void unexpected_hd_interrupt(void)
 {
        sti();
-       printk("Unexpected HD interrupt\n");
+       if (!new_hd_intack)
+               printk("Unexpected HD interrupt\n");
+       new_hd_intack = 0;
        SET_TIMER;
 }
 
@@ -315,10 +366,18 @@
 #define STAT_OK (READY_STAT | SEEK_STAT)
 
 static void read_intr(void)
+/* Supports multiple block io; i think multi io is not selected, the driver
+must be compatible to the original read_intr. Tell me if not (and why ?).
+Frank Sommer (fsommer@fh-krefeld.de)                           */
+
 {
        int i;
        int retries = 100000;
 
+register int multiple_sectrs = 0;
+register int max_multi_secs;
+
+       max_multi_secs = new_hd_info[MINOR(CURRENT->dev)>>6].secspint;
        do {
                i = (unsigned) inb_p(HD_STATUS);
                if (i & BUSY_STAT)
@@ -345,6 +404,7 @@
        CURRENT->sector++;
        i = --CURRENT->nr_sectors;
        --CURRENT->current_nr_sectors;
+       multiple_sectrs++;
 #ifdef DEBUG
        printk("hd%d : sector = %d, %d remaining to buffer = %08x\n",
                MINOR(CURRENT->dev), CURRENT->sector, i, CURRENT-> 
@@ -352,7 +412,11 @@
 #endif
        if (!i || (CURRENT->bh && !SUBSECTOR(i)))
                end_request(1);
-       if (i > 0) {
+       if (i > 0)
+               if (multiple_sectrs < max_multi_secs) {
+                       goto ok_to_read;
+                       }
+               else {
                SET_INTR(&read_intr);
                sti();
                return;
@@ -365,11 +429,21 @@
        return;
 }
 
+static void dummy_write_intr(void);
+
 static void write_intr(void)
 {
        int i;
        int retries = 100000;
 
+register       int multiple_sectrs = 0;
+register       int max_multi_secs ;
+       
+       if (exec_multiple_write){
+               multiple_sectrs++;
+               exec_multiple_write--;
+       }
+       max_multi_secs = new_hd_info[MINOR(CURRENT->dev)>>6].secspint;
        do {
                i = (unsigned) inb_p(HD_STATUS);
                if (i & BUSY_STAT)
@@ -394,18 +468,54 @@
        i = --CURRENT->nr_sectors;
        --CURRENT->current_nr_sectors;
        CURRENT->buffer += 512;
-       if (!i || (CURRENT->bh && !SUBSECTOR(i)))
+       multiple_sectrs++;
+       if (CURRENT->bh && !SUBSECTOR(i))
                end_request(1);
-       if (i > 0) {
-               SET_INTR(&write_intr);
+       if (i > 1) { 
+               if (multiple_sectrs < max_multi_secs) { 
+                       port_write(HD_DATA,CURRENT->buffer,256);
+                       goto ok_to_write;
+               } else  {
+                       SET_INTR(&write_intr);
+                       port_write(HD_DATA,CURRENT->buffer,256);
+                       sti();
+                       return;
+               }
+       }       
+       
+       else { if (i) { /* only possible if multiple io */
+               SET_INTR(&dummy_write_intr);
                port_write(HD_DATA,CURRENT->buffer,256);
                sti();
-       } else {
+               return;
+              } else { 
+                  if (!(CURRENT->bh && !SUBSECTOR(i))) 
+                     end_request(1);
+                  cli(); 
+                  do_hd_request();
+               }
+       }
+       
+       
 #if (HD_DELAY > 0)
                last_req = read_timer();
 #endif
-               do_hd_request();
-       }
+               return;
+}
+
+static void dummy_write_intr(void)
+{
+       int i;
+       CURRENT->sector++;
+       i = --CURRENT->nr_sectors;
+       --CURRENT->current_nr_sectors;
+       CURRENT->buffer += 512;
+       end_request(1);
+       cli();
+       do_hd_request();
+#if (HD_DELAY > 0)
+               last_req = read_timer();
+#endif
        return;
 }
 
@@ -439,6 +549,11 @@
        do_hd_request();
 }
 
+
+
+
+
+
 /*
  * The driver has been modified to enable interrupts a bit more: in order to
  * do this we first (a) disable the timeout-interrupt and (b) clear the
@@ -500,7 +615,7 @@
                return;
        }       
        if (CURRENT->cmd == WRITE) {
-               hd_out(dev,nsect,sec,head,cyl,WIN_WRITE,&write_intr);
+               hd_out(dev,nsect,sec,head,cyl,new_hd_info[dev].writecmd,&write_intr);
                if (reset)
                        goto repeat;
                if (wait_DRQ()) {
@@ -509,11 +624,16 @@
                        goto repeat;
                }
                port_write(HD_DATA,CURRENT->buffer,256);
-               sti();
+               exec_multiple_write =1;
+/* I think this is compatible to the original do_hd_request */
+               if (new_hd_info[dev].secspint>1) 
+                       write_intr();   /* multi sector io */
+               else 
+                       sti();
                return;
        }
        if (CURRENT->cmd == READ) {
-               hd_out(dev,nsect,sec,head,cyl,WIN_READ,&read_intr);
+               hd_out(dev,nsect,sec,head,cyl,new_hd_info[dev].readcmd,&read_intr);
                if (reset)
                        goto repeat;
                sti();
@@ -624,6 +744,62 @@
        sti();
 }
 
+static void init_multiplesector_transfer(int drive)
+
+{
+       if (new_hd_info[drive].secspint>1) {
+/* if secspint is < 2 multi sector io is not possible */
+               sti();
+               new_hd_intack = 1;
+               SET_INTR(unexpected_hd_interrupt);
+               outb(new_hd_info[drive].secspint,0x1f2);
+               outb(0xA0|(drive<<4),0x1f6);
+               outb(WIN_SET_MULTIPLE,0x1f7);
+               new_hd_info[drive].writecmd = WIN_MULTIPLE_WRITE;
+               new_hd_info[drive].readcmd = WIN_MULTIPLE_READ;
+       } else {
+/* no multi sector io */
+               new_hd_info[drive].writecmd = WIN_WRITE;
+               new_hd_info[drive].readcmd = WIN_READ;  
+       }
+}      
+
+
+static void get_drive_info(void)
+{
+static unsigned char   infobuffer[512];
+       unsigned int    i;
+       for(i=0;i<2;i++) { 
+                       new_hd_intack = 1;
+                       sti();
+                       SET_INTR(unexpected_hd_interrupt);
+                       outb(0xA0|(i<<4),0x1f6);
+                       outb(WIN_IDENTIFY_DRIVE,0x1f7);
+                       if (wait_DRQ()==0) {
+                               cli();
+                               port_read(HD_DATA,&infobuffer,256);
+                               sti();
+                               int x;
+                               for (x=0;x<40;x+=2) {
+                                       new_hd_info[i].name[x] = infobuffer[55+x];
+                                       new_hd_info[i].name[x+1] = infobuffer[54+x];
+                               }
+                               new_hd_info[i].name[42] = '\0';
+                               new_hd_info[i].secspint = infobuffer[94]; 
+
+#ifdef CONFIG_BLK_DEV_HD_NOMULTI
+new_hd_info[i].secspint = 0;
+#endif
+
+                               new_hd_info[i].dwordio =  infobuffer[96];
+                       } else {
+                               new_hd_info[i].secspint = 0;
+                       }
+       }
+
+
+}
+
 /*
  * This is the harddisk IRQ description. The SA_INTERRUPT in sa_flags
  * means we run the IRQ-handler with interrupts disabled: this is bad for
@@ -736,11 +912,18 @@
                printk("Unable to get major %d for harddisk\n",MAJOR_NR);
                return mem_start;
        }
+       int i;
+       get_drive_info();
+       reset_controller(); 
        blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
        read_ahead[MAJOR_NR] = 8;               /* 8 sector (4kB) read-ahead */
        hd_gendisk.next = gendisk_head;
        gendisk_head = &hd_gendisk;
        timer_table[HD_TIMER].fn = hd_times_out;
+       printk("Device:  Description:                             MEM   INT DMA  IO          \n");
+       for (i=0;i<2;i++)
+/* TODO: try to print only the hd-info of the first drive, if only one hd is installed */ 
+               printk("hd%-6d %-40s ---    %2d  --  %3x SPI: %1d\n",i,new_hd_info[i].name,HD_IRQ,HD_DATA,new_hd_info[i].secspint);
        return mem_start;
 }
 


-- 
Jan Richert (NIC-ID: JR482)   | Internet:   jrichert@krefcom.GUN.de
Krefeld, FRG                  | Datex-J:    02151399843-0001
Voice: +49 2151 313124        | IRC-Nick:   jrichert
FAX:   +49 2151 396479        | Data:       +49 2151 396479 (12-20h MEDT)

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


** 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: Linux-Development-Request@NEWS-DIGESTS.MIT.EDU

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

    Internet: Linux-Development@NEWS-DIGESTS.MIT.EDU

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