From: Info-IBMPC@BRL.MIL (Info-IBMPC Digest)
Newsgroups: comp.sys.ibm.pc.digest
Subject: Info-IBMPC Digest V92 #133
Date: 10 Aug 92 18:52:23 GMT
Reply-To: Info-IBMPC@BRL.MIL
Distribution: world
Organization: The Internet

Info-IBMPC Digest           Mon, 10 Aug 92       Volume 92 : Issue 133 

Today's Editor:
         Gregory Hicks - Rota Spain <GHICKS@brl.mil>

Today's Topics:
    AT&T vs. BSDI --> 4.3BSD-NET2 distribution requires AT&T license
                         Borland mktime() bugs
   Help: What is the difference between 386 assembly and the old 286
                  Hmm.  Random numbers again (2 msgs)
                 HOW CAN I SET PARENT ENV VARS WITH C ?
 How easy is file I/O from device drivers in CONFIG.SYS at boot time ?
                      moved my ibmdos.com (6 msgs)
                       Polygon Question (2 msgs)
                      problems with new hard disk
                       Reboot from protected mode
                REQUEST FOR INFO: DISABLING ^C (3 msgs)

Send Replies or notes for publication to: <INFO-IBMPC@brl.mil>

Send requests of an administrative nature (addition to, deletion from
the distribution list, et al) to: <INFO-IBMPC-REQUEST@brl.mil>

Addition and Deletion requests for UK readers should be sent to:
<INFO-IBMPC-REQUEST@DARESBURY.AC.UK>

Archives of past issues of the Info-IBMPC Digest are available by FTP
ONLY from WSMR-SIMTEL20.ARMY.MIL in directory PD2:<ARCHIVES.IBMPC>.

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

Date: 21 Jul 92 19:31:48 GMT
From: merlin <merlin@neuro.usc.edu>
Subject: AT&T vs. BSDI --> 4.3BSD-NET2 distribution requires AT&T license
Keywords: AT&T 'Death Star' rises over BSDI's horizon [Tel. 1-800-800-4BSD

[For people in comp.unix.sysv386 -- two products were recently released
in field test versions with a production version intended in the near
future.  Berkeley Software Design, Inc [Tel. 1-800-800-4BSD] has
offered full source code for a product called 'BSD/386' based on the
publically available code made available via numerous archive sites
from the UC Regents 4.3BSD-NET2 UNIX software distribution.  Willian
and Lynne Jolitz have offered the full sources for an alternative
product called '386BSD' which is also based on the publically available
UC Regents 4.3BSD-NET2 UNIX software distribution.  'BSD/386' sells for
$1,000 for the full source and $200 for a binary right to copy.
'386BSD' is available from numerous public archive sites without any
charge of any kind.]

[The UC Regents 4.3BSD-NET2 software was claimed not to contain any
AT&T derived source code -- as a consequence it was believed by many
people to be an appropriate base for development of extremely
inexpensive versions of 'Berkeley UNIX' compatible operating systems.
This claim is disputed by AT&T as described below.]

[This note is not an advertisement of any kind.  I am not connected
with AT&T, ATTIS, USG, USDL, USL (or whatever AT&T would like to be
called in the near future), Bell Laboratories, UC Regents, CSRG, BSDI,
or the Jolitz Development Team.  This is simply an expression of
concern about litigation which will have a dramatic effect on whether
or not AT&T is allowed to have monopoly interest in operating systems
derived from publically available source codes.  Frankly, I am curious
about the ultimate judge's decision.]

Two days ago I told a colleague in Psychology that the world had
changed -- we spent several hours talking about the possibilities for
good which arose from the free or at least very low cost release of
386BSD & BSD/386.

However, AT&T [and it's massive army of high paid staff attorneys] have
fired the first shot in a legal action which may doom such
possibilities.

Tomorrow I'm going to have to tell him the forces of darkness and greed
have decended to crush hope of using UNIX in extremely low cost
systems.

The bottom line is that AT&T claims NET2 is contaminated with
intellectual property misappropriated from AT&T -- perhaps not direct
copies of source code -- but at least ways of doing things (trade
secrets) -- and therefore any system derived from NET2 requires an AT&T
source code license [it used to be about $10,000 to get an AT&T source
license].  The threat is twofold

o  AT&T can sue anyone who has any assets or any prospect of assets for
each and every copy of an operating system maintained or allowed to be
copied by any individual without payment of the AT&T license fee

o  AT&T can withdraw it's contribution from any organization which
would permit the maintenance or copying of systems derived from
4.3BSD-NET2

AT&T's complaint 92-1667 filed in US District Court--New Jersey claims:

o  AT&T authorized the UC Regents to distribute certain works derived
from their UNIX software to third parties ... subject to restrictions

   o  Those restrictions include a requirement limiting such
distribution to persons who have also acquired licenses from AT&T or
USL

o  'Networking Release 2' contains software code that was copied from,
based upon, or derived from, code licensed to the Regents by AT&T

o  Any operating system derived from 'Networking Release 2' requires a
license from AT&T or its successor, USL

AT&T's entire complaint is contained in a false advertising and unfair
competition claim based on BSDI's brochure which states BSDI sources
are not derived from AT&T code --and-- do not require an AT&T source
license.

AT&T's 1-MAY-92 interrogatory (a series of questions to an adversary)
asks:

o  Whether anyone related to BSDI has ever had access to AT&T UNIX
sources

o  How much employee time was spent to develop BSDI's source code
product

BSDI's motion to dismiss and subsequent press releases argue that AT&T
has not made out an adequate case of copyright infringement -- and --
therefore cannot maintain their claim of false advertising or unfair
competition until they prove what BSDI would like to say is a simple
copyright claim.

However, the AT&T claim is not a copyright claim -- it is a claim that
BSDI incorporated intellectual property belonging to AT&T into the BSDI
product.  The intellectual property may be in the form of copyright,
patent, or trade secret protected material.  While NET2 may not
literally contain any direct copies of AT&T source code -- it is very
possible it contains a translation or adaptation of copyrighted
material -- or it may contain a patented means of performing some task
-- or it may be based on knowledge of the original techniques [trade
secrets] embodied in the AT&T source code.  Hence, AT&T only has to
prove that someone involved in CSRG's NET2 release or in BSDI's BSD/386
development had access to AT&T licensed materials at some time in
his/her lifetime to trigger the spectre of contamination of BSDI's
product.

BSDI's position is in stark contrast the Phoenix BIOS project where two
teams of engineers worked in parallel -- one team developing a
functional specification by studying the original IBM BIOS ROM chip
codes -- and a second completely independent and compartmentalized team
developing code.  There is no suggestion either CSRG or BSDI made any
effort to institute similar means to prevent the incorporation of AT&T
technology in BSD/386.

Further, AT&T's question about the time investment of BSDI in bringing
out their product [compared with their own cost over many years] will
likely go a long way toward supporting their unfair competition claim.
If it took a small company like BSDI only a couple of years with a
small team of people to produce BSD/386 vs the multi year investment of
a corporate giant - then it is very possible AT&T may prevail on the
unfair competition claim.

On a final note, BSDI's own press release states that:

  Although USL has not sued the University of California, we expect that
  USL (or its parent, ATT) will threaten to review or withdraw research
  grants made to any university or research institution using or
  distributing software based on NET2 ...

All in all, this filing by a corporate giant with virtually unlimited
funds for legal expenses would seem to spell the doom of 'free' UNIX
projects as they are presently conceived.  There is simply too much
risk someone with a prior exposure to AT&T source codes could manage to
contaminate the product.

Sigh, AJ

Alexander-James Annala
Principal Investigator
Neuroscience Image Analysis Network
HEDCO Neuroscience Building, Fifth Floor
University of Southern California
University Park
Los Angeles, CA 90089-2520

[mod- as discussed here previously, UNIX does not have any patent
protection. The only patent relating to it that I am aware of was the
SUID patent which was donated to the public some time ago]

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

Date: 19 Jul 92 02:08:00 GMT
From: Vanzandt <jrv@truth.uucp>
Subject: Borland mktime() bugs

Borland seems to have bugs in their implementations of mktime(), which
converts a broken down time to a time_t (seconds since 0000 UCT 1 Jan
1900).  It is supposed to adjust invalid parameters (like 93 seconds or
the 43rd day of the month) to be within their proper range.  However,
Borland's mktime() sometimes increments or decrements the hour even if
it's valid.  (It's not a one time adjustment, either -- if called again
with the same structure, it keeps changing the hour.)

The version in the Turbo C++ 1.0 library shows the error for several
days near each daylight savings time transition, for example:
 mktime error 11 -> 10 on Apr 03 10:15:54 1989
 mktime error 11 -> 10 on Apr 04 10:15:54 1989
 mktime error 11 -> 10 on Apr 05 10:15:54 1989
 mktime error 11 -> 10 on Oct 26 10:15:54 1989
 mktime error 11 -> 10 on Oct 27 10:15:54 1989
 mktime error 11 -> 10 on Oct 28 10:15:54 1989
 mktime error 11 -> 10 on Oct 29 10:15:54 1989
 mktime error 11 -> 10 on Apr 02 10:15:54 1990
 mktime error 11 -> 10 on Apr 03 10:15:54 1990
 mktime error 11 -> 10 on Apr 04 10:15:54 1990
 mktime error 11 -> 12 on Oct 29 12:15:54 1990
 mktime error 11 -> 12 on Oct 30 12:15:54 1990
 mktime error 11 -> 12 on Oct 31 12:15:54 1990
The version with Borland C++ 3.00 shows it only exactly on the day of the 
transition, always incrementing in the spring and decrementing in the fall:
 mktime error 10 -> 11 on Sun Apr 02 11:24 1989
 mktime error 10 ->  9 on Sun Oct 29 09:24 1989
 mktime error 10 -> 11 on Sun Apr 01 11:24 1990
 mktime error 10 ->  9 on Sun Oct 28 09:24 1990
 mktime error 10 -> 11 on Sun Apr 07 11:24 1991
 mktime error 10 ->  9 on Sun Oct 27 09:24 1991
 mktime error 10 -> 11 on Sun Apr 05 11:24 1992
 mktime error 10 ->  9 on Sun Oct 25 09:24 1992
 mktime error 10 -> 11 on Sun Apr 04 11:24 1993
 mktime error 10 ->  9 on Sun Oct 31 09:24 1993

I believe the hour should be incremented only between 0200 and 0259 on
the spring Sunday when daylight savings time starts, and that it should
never be decremented.  A demo program follows.  Does the new Borland
C++ 3.1 have bug?

                            - Jim Van Zandt <jrv@mbunix.mitre.org>

/*    demonstrate a bug in the Borland implementation of mktime() */
#include <stdio.h>
#include <time.h>    /* relevant declarations */
main()
{    char buf[200];
    int yr, mo, da, hr = 10; /* NOT near 2:00 AM */
    time_t now = time(0);
    struct tm bdt = *localtime(&now); /* fill structure with legal values */
    for (yr = 89; yr < 94; yr++)     /* test all days in a five year span */
        for (mo = 0; mo < 12; mo++)
            for (da = 1; da < 32; da++) {
                bdt.tm_year = yr;
                bdt.tm_mon = mo;
                bdt.tm_mday = da;
                bdt.tm_hour = hr;
                mktime(&bdt);
                if(bdt.tm_hour != hr) {
                    strftime(buf, 199, "%a %b %d %H:%M %Y", &bdt);
                    printf(" mktime error %2d -> %2d on %s\n", 
                                            hr, bdt.tm_hour, buf);
                }
            }
}

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

Date: 18 Jul 92 04:37:33 GMT
From: Mark William Hopkins <markh@csd4.csd.uwm.edu>
Subject: Help : What is the difference between 386 assembly and the old 286

882028s@dragon.acadiau.ca (Ghazali Shafie) writes:
>
>I'm wondering what kind of differences between 386 assembly llang and 286
>( I know there should be a difference since 386 is 32bit ) but what are
>the differences and are any new instruction is used or introduced into
>a 386 .
>
>Thanks in advance
>.

80386 EXTENSIONS
Segment registers FS, GS
Stack operations: pop FS, pop GS, push FS, push GS

16-bit Registers now contained inside 32-bit registers:
   EAX, EBX, ECX, EDX, ESI, EBI, ESP, EBP

Extra addressing modes for 32 bit operands.
   Indirect addressing:     [I]
   Scaled-index addressing: [I + S*B].
   I: Any 32-bit register.
   B: Any 32 bit register, except ESP.
   S: The SCALE: 1, 2, 4, or 8.

Size Altering Prefixes to toggle between 16/32 bit addressing mode and
16/32 bit operand size.
   opsiz:
   adrsiz:

So most 16-bit operations can now be used on 32-bit objects, and
operations involving indirect addressing can now used the extended
32-bit addressing modes.

Test and debug registers (CR0-CR7, DR0-DR7, TR0-TR7, not all defined).
Test register operationd (Rd = 32-bit register).

   mov CRn, Rd
   mov DRn, Rd
   mov Rd, CRn
   mov Rd, DRn
   mov TRn, Rd
   mov Rd, TRn

16/32 bit offset jumps (Dv = 16/32 bit offset)
   j* Dv

Set byte on condition (byte = condition? 1: 0), (Eb = byte operand).
   set* Eb

Bit test operations (Ev = 16/32 bit effective address, Rv = 16/32 bit
register, b = 8-bit constant).  First operand is the address, second
operand is the bit index.

CF = bit(Dest, Index);
   bt Ev, Rv
   bt Ev, b
CF = bit(Dest, Index); bit(Dest, Index) = 1;
   bts Ev, Rv
   bts Ev, b
CF = bit(Dest, Index); bit(Dest, Index) = 0;
   btr Ev, Rv
   btr Ev, b
CF = bit(Dest, Index); bit(Dest, Index) ^= 1;
   btc Ev, Rv
   btc Ev, b

Double shift left: shld D, S, C ...  D = D:S << max(C, 31);
   shld Ev, Rv, b
   shld Ev, Rv, CL
Double shift right: shrd D, S, C ... D = D:S >> max(C, 31);
   shrd Ev, Rv, b
   shrd Ev, Rv, CL

Byte/Word to Word/Long conversions (Eb = 8 bit operand, Ew = 16 bit
operand).  Move with Zero Extension

   movzx Rv, Eb
   movzx Rv, Ew
Move with Sign Extension
   movsx Rv, Eb
   movsx Rv, Ew
Convert Double to Quad (EDX:EAX = sign-extend(EAX))
   cdq
Convert Word to Double Extended (EAX = sign-extend(AX))
   cwde

Bit scan operations
Bit Scan Forward
   bsf Rv, Ev
Bit Scan Reverse
   bsr Rv, Ev

More stack operations
Push 32-bit General Registers
   pushad
Pop All General Registers
   popad
Pop Stack into EFLAGS
   popfd
Push EFLAGS Register
   pushfd

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

Date: 18 Jul 92 21:19:48 GMT
From: Philip Smolen <phil@cs.utexas.edu>
Subject: Hmm.  Random numbers again.
Keywords: random knuth
Summary: Everything you ever wanted to know about random numbers

tck@netlink.cts.com (Kevin Marcus) writes:
>Basically, what I need to do is get random numbers, without using the system 
>clock, or, if it does use the clock, if I were to take two random numbers 
>rigth next to each other (this is all in ASM!!!) that I would not get the 
>same number.

You need to read _The Art of Computer Programming, volume 2:
Semi-numerical Algorithms_ by Donald E. Knuth.  Half of this book
discusses good algorithms for generating random numbers.  Knuth uses
assembly to express his algorithms.  You'll probably also want volume
one of this series, since it explains Knuth's unique way of expressing
algorithms.

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

Date: 20 Jul 92 14:26:46 GMT
From: Alan Modra <amodra@ucs.adelaide.edu.au>
Subject: Hmm.  Random numbers again.

>tck@netlink.cts.com (Kevin Marcus):
> Basically, what I need to do is get random numbers, without using the system
> clock, or, if it does use the clock, if I were to take two random numbers
> rigth next to each other (this is all in ASM!!!) that I would not get the
> same number.

Get the "improved random number generator" random.c from
gatekeeper.dec.com in /.0/bsd-sources/src/lib/libc/gen (or from many
other places in netland)

This files has LOTS of comments, and is fairly easy to understand, even
if you're not a C programmer.  It will give you an idea how to create
the most efficient assembly routines I know that return reasonably
random (in a statistical sense) numbers.

For instance, a 32 bit RNG in TASM ideal mode for 386

proc Rand uses si
public  Rand
; Nifty shift register feedback style of random number generator
; Think of it as 32 shift registers in parallel, with polymonial x^63 + x + 1
; There's also carries from one register to the next
; Period is approximately 63*(2^63-1)
        cld
        mov     si,[rptr]
        lodsd
        rol     eax,1
        cmp     si,offset EndRandDat
        jb      short Ok1
        mov     si,offset StartRandDat
Ok1:
        add     [si],eax
        mov     [rptr],si
        ret
endp

rptr is an index into an array of 63 dwords - the shift register.  See
random.c for initial values to plug into the array.

The line 'rol eax,1' is a slight modification I made to the algorithm,
an attempt to give bit 0 the same propagated carries that the other
bits have.

It seems to work OK but I haven't done exhaustive tests, nor done any
analysis of the resultant period (any pure mathematicians out there
like a problem?).

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

Date: 20 Jul 92 12:30:06 GMT
From: hdtodd@eagle.wesleyan.edu
Subject: HOW CAN I SET PARENT ENV VARS WITH C ?

rlmeyering@beckman.com writes:
> I am writing an application in BORLAND C within which I need to be able
> to SET environment variables that will remain once the program completes.

	I wrote two C programs that manipulate the parent (in fact, root)
environment.  One trims environment variables (we use it on our Novell
servers) and the other manipulates paths.  Either one would show how to
manipulate the environment to add a new variable, for example.

	Here is the code for mp.c, which manipulates the path.  

/* mp.c
   Program to modify the path environment for MS-DOS.
   Written by H. D. Todd, Wesleyan University, 12/26/90 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h>
#define MAXSTRS 100		/* increase this if you have more env strings */
#define MAXPATH 500		/* max size of path string */
#define PATHSEP ";"		/* separates node names in path */

void main(int argc, char *argv[])

{
  int i, num, envsize, len, nstrs=0, nextra, pathindex;
  char dowhat, varstg[MAXPATH], tmpstr[MAXPATH],
        *strptr[MAXSTRS], far *envp, far *envptr, *subloc;
  unsigned far *p_psp, far *p_env;
  struct {
         char link;
         unsigned int owner_psp;
         unsigned int blk_len;
         } far *envmcb;

  if (argc < 2) {
    fprintf(stderr, "Usage: mp [ -{p|a} newnodename | -r oldnodename newnodename]*\n");
    exit(1); }

/* Construct the PSP pointers */
  p_psp = MK_FP(_psp,0x16);    /*pointer to parent's PSP*/
  p_env = MK_FP(*p_psp,0x2c);  /*pointer to parent's environment ptr*/
  envptr = MK_FP(*p_env,0x00); /*pointer to parent's environment */
  envmcb = MK_FP(*p_env-1,0x00); /* pointer to parent env MCB */
  envsize = (*envmcb).blk_len<<4;

/* copy strings from parent's environment (FAR) to local strings */
   envp = envptr;
   while (*envp) {      /* env strings terminated by second null */
         int len;
         char far *fp;
         char *lp;
         for (len=0, fp=envp; *fp; fp++) len++;
         lp = strptr[nstrs++] = malloc(len+1);
         for ( ; (*lp++=*envp++); );
         }


/*  find the PATH= string among the env vars */
   for (pathindex=0; pathindex<nstrs; pathindex++) if (strnicmp(strptr[pathindex],"PATH=",5) ==0 ) break;
   if (pathindex>=nstrs) {
       fprintf(stderr, "MP: Can't find path var!\n");
       exit(1);
   }
   strcpy(varstg,strptr[pathindex]);

/*  now do what the switches tell us to do */
   while (--argc > 0 ) {
	if ( ( (dowhat=(*++argv)[0])) != '-') {
		fprintf(stderr, "MP: begin switches with '-', as in '-%c'\n", dowhat);
	     	exit(1);
	}
	dowhat = tolower(*++argv[0]);
	if (dowhat!='p' && dowhat!='a' && dowhat!='r') {
	   fprintf(stderr, "MP: invalid switch -%c\n", dowhat);
	   exit(1);
	};
	if (--argc <=0) {
		fprintf(stderr, "MP: switch -%c missing node name\n", dowhat);
		exit(1);
	}
	switch (dowhat) {
		case 'a':	strcat(varstg,PATHSEP);
				strcat(varstg,*++argv);
				break;
		case 'p':	strcpy(tmpstr,"PATH=");
				strcat(tmpstr,*++argv);
				strcat(tmpstr,PATHSEP);
				strcat(tmpstr,strpbrk(varstg,"=")+1);
				strcpy(varstg,tmpstr);
				break;
		case 'r':	if ( (subloc=strstr(varstg,*++argv)) == NULL) {
					fprintf(stderr,"MP: pathnode %s not found in current path\n", *argv);
					fprintf(stderr,"    replacement ignored");
					while ( *(argv+1)[0] != '-') {
						++argv;
						argc--;
					}
					break;
					};
				strcpy(tmpstr,subloc+strlen(*argv));
				if (*(argv+1)[0] != '-') {
					strcpy(subloc,*++argv);
					--argc;
				    }
                  else subloc = '\0';
				strcat(varstg,tmpstr);
				break;
	};
   }

/*  make sure we can copy it all back into the parent's env block */	
    strptr[pathindex] = &varstg;
    for (i=0, len=0; i<nstrs; i++) len += strlen(strptr[i]) + 1;
    if (len+1>envsize)  {
        fprintf(stderr,"MP: Env block too small to store updated PATH string\n");
        exit(1);
        }
      else {
/*  OK, do it */
        for (i=0; i<nstrs; i++) {
            for ( ; (*envptr++ = *strptr[i]++) ; ) ;
            *envptr = '\0';
        }
      }
}


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

Date: 22 Jul 92 08:22:08 GMT
From: Len Chisholm <L.Chisholm@massey.ac.nz>
Subject: How easy is file I/O from device drivers in CONFIG.SYS at boot time ?
Keywords: CONFIG.SYS device drivers file I/O
Summary: I want to do file I/O at boot time from a device driver in CONFIG.SYS

Hi there,

I am interested in doing file operations from a CONFIG.SYS loaded
device driver at BOOT time to load configuration information.

It is obviously possible as QEMM'S LOADHI.SYS must read other device
drivers and the OPTIMISE command causes LOADHI to write statistics to a
file.

What contortions are required to do this safely , and what limitations
are involved ( if any ) ?

Thanks in advance,

-------------------------------------------------------------------------
|  LEN CHISHOLM , Systems programmer  | EMail: L.Chisholm@massey.ac.nz  |
| Department of Production Technology | Phone: +64 6 3505262            |
|         Massey University           | FAX:   +64 6 3505604            |
|   Palmerston North, New Zealand     |                                 |
-------------------------------------------------------------------------


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

Date: 20 Jul 92 09:29:08 GMT
From: Volkmar Grote <vg@sup.stollmann.de>
Subject: moved my ibmdos.com ....

jcmorris@mwunix.mitre.org (Joe Morris) writes:

>Several other posters have recommended the Norton Disk Doctor's "Make disk
>bootable" function.  They're right, and I don't know of any other common
>program to do this (other than the FORMAT command  ...  ah, THAT'S A JOKE!)

The other common program is DR DOS' "sys", which is much more sensible
than the MS variant; when updating, the latter first destroys your
system and then tells you, that there is not enough space ...  Volkmar

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

Date: 19 Jul 92 03:32:40 GMT
From: Jen Kilmer <jenk@microsoft.com>
Subject: moved my ibmdos.com ....

Ralf.Brown@B.GP.CS.CMU.EDU writes:
>parry@yoyo.cc.monash.edu.au (Tom J Parry) wrote:
>}As of DOS 5.00, this problem no longer exists. Well it does but DOS 5.00
>}can handle it. The SYS command of DOS 5.00 is able to install DOS on a

>For DOS 4.0+, only the first three sectors of IO.SYS have to be
>contiguous.  

actually, for 3.30+, only the first three sectors of IO.SYS have to be
contiguous. but 4.0+, SYS is able to move any file occupying those
first three sectors elsewhere. SYS is also able to move any file(s) in
the first two directory entries elsewhere.

>5.0, even the requirement that those three sectors be the first three on
>the disk has been lifted by storing the actual starting location in the
>boot sector.

also 5.0's SYS copies COMMAND.COM over as a matter of course...which
for the majority of DOS users, makes a normal boot floppy.

>Internet: RALF+@CS.CMU.EDU   |The University would disclaim this if it knew...
>FIDO: Ralf Brown 1:129/26.1  |"Wisdom is the quality that keeps you from
>BIT: RALF%CS.CMU.EDU@CARNEGIE| getting into situations where you need it."
>AT&Tnet: (412)268-3053 school|		-- Doug Larson

(gee, I'm correcting Ralf Brown...maybe one of these days I'll get to
meet BillG. :-)

-jen

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

Date: 19 Jul 92 16:20:10 GMT
From: Leonard Erickson <leonard@qiclab.scn.rain.com>
Subject: moved my ibmdos.com ....

jenk@microsoft.com (Jen Kilmer) writes:

>also 5.0's SYS copies COMMAND.COM over as a matter of course...which for
>the majority of DOS users, makes a normal boot floppy.   

No it does *not*! 

As many users of 4dos (and other shels that take the place of
COMMAND.COM could tell you, DOS 5.0's SYS takes *whatever* program is
pointed to by the COMSPEC environment variable and copies it to the
disk under the *name* COMMAND.COM!

Arguably, the copying could be considered the "correct" behavior, and
in that case, to boot without a CONFIG.SYS the renaming is necessary.
But as some of these shells require overlay files and the like, this is
*not* a good idea.

I'd suggest that in the next version or revision, SYS should check and
if the command processor *isn't* COMMAND.COM, it should prompt the user
and ask if he wants <filename> copied to the disk. If not, then have it
ask him for the path to COMMAND.COM and copy that.

Trust me, this *has* resulted in very puzzled users with non-bootable
disks!

Leonard Erickson		      leonard@qiclab.scn.rain.com
CIS: [70465,203]			 70465.203@compuserve.com
FIDO:   1:105/56	 Leonard.Erickson@f56.n105.z1.fidonet.org
(The CIS address is checked daily. The others infrequently)

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

Date: 19 Jul 92 18:17:42 GMT
From: Ralf.Brown@b.gp.cs.cmu.edu
Subject: moved my ibmdos.com ....

jenk@microsoft.com (Jen Kilmer) wrote:
}Ralf.Brown@B.GP.CS.CMU.EDU writes:
}>For DOS 4.0+, only the first three sectors of IO.SYS have to be
}>contiguous.  
}
}actually, for 3.30+, only the first three sectors of IO.SYS have to be
}contiguous. but 4.0+, SYS is able to move any file occupying those first 
}three sectors elsewhere. SYS is also able to move any file(s) in the first 
}two directory entries elsewhere.

I thought it was 3.3+, but was only sure for 4.0+.  I remember 3.3
being able to deal with fragmented system files, but I wasn't sure
whether that only applied to MSDOS.SYS or both IO.SYS and MSDOS.SYS.

}(gee, I'm correcting Ralf Brown...maybe one of these days I'll get to
}meet BillG. :-)

I've never claimed to be perfect, only that I make fewer than average
mistakes....

Internet: RALF+@CS.CMU.EDU   |The University would disclaim this if it knew...
FIDO: Ralf Brown 1:129/26.1  |"Wisdom is the quality that keeps you from
BIT: RALF%CS.CMU.EDU@CARNEGIE| getting into situations where you need it."
AT&Tnet: (412)268-3053 school|		-- Doug Larson

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

Date: 21 Jul 92 00:14:08 GMT
From: Tom J Parry <parry@yoyo.cc.monash.edu.au>
Subject: moved my ibmdos.com ....

vg@sup.stollmann.de (Volkmar Grote) writes:
> jcmorris@mwunix.mitre.org (Joe Morris) writes:
> 
> >Several other posters have recommended the Norton Disk Doctor's "Make disk
> >bootable" function.  They're right, and I don't know of any other common
> >program to do this (other than the FORMAT command  ...  ah, THAT'S A JOKE!)
> 
> The other common program is DR DOS' "sys", which is much more sensible
> than the MS variant; when updating, the latter first destroys your system and
> then tells you, that there is not enough space ...

That's right! MSDOS sys just destroys your system and then gives an
error message. Done that to me at least 57 times this morning already!
Come on, let's not drop down to this level. Sure you prefer the DRDOS
version of the program, sure you probably don't know that the DOS 5
version will install the system on any disk where there is enough free
space by moving things around if necessary. Sure MSDOS sys might have
harmed you once (although I have never ever seen it do any harm myself)
but this is no reason to announce that the program destorys every disk
it is run on. IT DOES NOT, well not for me anyway.

BTW Somebody told me on the weekend that there is an undocumented
argument to FDISK which will fix the boot record of a disk that is
faulty. I have never tried it nor do I know what kind of disks it works
on (presumably only hard disks) but the option is FDISK /MBR (for
master boot record). Anyone come across this one?

Tom J Parry.
Your reality is a figment of my imagination.

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

Date: 26 Jul 92 03:21:34 GMT
From: Jon Freivald <jaf@jaflrn.uucp>
Subject: moved my ibmdos.com ....

parry@yoyo.cc.monash.edu.au (Tom J Parry) writes:

> BTW Somebody told me on the weekend that there is an undocumented
> argument to FDISK which will fix the boot record of a disk that is
> faulty. I have never tried it nor do I know what kind of disks it works
> on (presumably only hard disks) but the option is FDISK /MBR
> (for master boot record). Anyone come across this one?

Yes indeed - in fact, have used it many times...  It's new with DOS
5.0, but you can use it on any disk (assuming you booted 5.0 from a
floppy) with any DOS version on it.

Why do I use it? - Instant erradication of BSI viruses!  It's been
quite a handy tool for me - re-writing a clean Master Boot Record on an
infected hard disk.  Of course, you have to be booting from a clean
(preferably write protected - helps prevent accidents) floppy - also do
a hard-boot, as you are then *SURE* that memory is virus free when you
boot.

Jon
		   Jon Freivald ( jaflrn!jaf@uunet.UU.NET )

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

Date: 21 Jul 92 22:10:38 GMT
From: Glenn Clapp <gclapp@javelin.sim.es.com>
Subject: Polygon Question...

morley@camins.camosun.bc.ca writes:
>
>Ok, this should be an easy one...  Given 3 X,Y points that form a triangle,
>what is the simplest (fastest) way to determine if they are clock-wise or
>counter-clock-wise?  I'm not interested in general polygons of N points,
>just plain old triangles.  Yes, this is for use in a graphics app.
>

Traverse the polygon, calculating 3 cross products (v1->v2 X v2->v3,
v2->v3 X v3->v1), and (v3->v1 X v1->v2), and if the cross products are
positive, the polygon is counterclockwise, otherwise they will be
negetive.  Also, if you have a sign flip between the different cross
products, then the polygon is not convex.

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

Date: 25 Jul 92 22:37:19 GMT
From: Larry Jones <scjones@thor.sdrc.com>
Subject: Polygon Question...

gclapp@javelin.sim.es.com (Glenn Clapp) writes:
> Traverse the polygon, calculating 3 cross products (v1->v2 X v2->v3,
> v2->v3 X v3->v1), and (v3->v1 X v1->v2), and if the cross products are
> positive, the polygon is counterclockwise, otherwise they will be negetive.
> Also, if you have a sign flip between the different cross products, then
> the polygon is not convex.

One is sufficient - a triangle is always convex.

Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
Domain: lawrence.jones@sdrc.com               IBMMAIL: USSDR7DR at IBMMAIL
I thought my life would seem more interesting with a musical
score and a laugh track. -- Calvin

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

Date: 18 Jul 92 07:06:54 GMT
From: "Ira H. Nydick" <hinydick@curtiss.seas.ucla.edu>
Subject: problems with new hard disk

Hi, I am new to this newsgroup and do not know if it is the appropriate
one to post this question to.  I apologize in advance if it is not.

I recently acquired a Hyundai 386sx (it was free) which I am giving to
my father.  I have my own computer, a 25 mhz 386 clone.  I took this as
an oportunity to upgrade my hard drive to a larger unit, and purchased
a Maxtor 7120 120 MB IDE drive and cheapo IDE card.  I installed my old
drive, a 66 MB Toshiba w/RLL card in the Hyundai and the new Maxtor and
IDE card in my computer.  The Hyundai works fine.  My computer,
unfortunately, is not cooperating as nicely as its neighbor.  I
partitioned the disk with MSDOS 4.01 FDISK to one partition, installed
the MSDOS 4.01 os that came with the Hyundai (recall, the Hyundai has
my old Toshiba drive which contains MSDOS 3.3 so no need to use the
included DOS 4.01 on it, so why not on my new drive?), copied all
directories and files from the old Toshiba with FASTBACK and restored
them on the Maxtor, and, oh yeah, changed the CMOS settings in my AMI
BIOS to reflect the new drive.  Everything seemed fine for a bit, until
various problems startedoccuring.  These are the ones I have noticed so
far:

Computer hangs when
1. I try to use FASTBACK to back up files on it
2. I try to save a worksheet in Lotus 123
3. I simply try to run Wordperfect 5.1 from the C prompt.  This is weird
   because it initially ran WP fine, but now it locks up if I try.  ???
4. I try to save setup changes in my faxboard software.  This is the 
   first problem I noticed.
5. Xtree gives a weird 'unknown disk error' message when first run but
otherwise   seems to run ok.

Could it be any of the following reasons?
a. My new IDE card is bad

b. my new Maxtor drive is bad

c. I hooked something up incorrectly (can't imagine what, installation
was easy)d. drive is not configured properly in CMOS (store I bought
the drive at said to   use user-defined drive type, 1024 cyl.,heads:14,
sector: 17 and not worry about Write Pcomp and Landing zone. I put zero
for them;don't know what they are)

e. operating system I installed is one that came with Hyundai (MSDOS
4.01).  Could it be a version specifically for Hyundai computers?  not
likely, rt?

f. some sort of interrupt conflict (this area is fuzzy to me)

Note: the DOS 4.01 install program put some strange stuff in the
config.sys and autoexec.bat files.  I tried rebooting with this stuff
deleted and Xtree error message dissapeared but rest of problems still
present.  I plan to upgrade to DOS 5.0 but want to figure out the
reason for these problems first.

If anyone out there thinks he/she know what is wrong, I would REALLY
REALLY appreciate hearing from you.  My computer ignorance is surely
shining through but I am trying to learn as fast as I can.  If it is
not a problem pleas email me; if it is, then post and I will try to
check the group reasonably often.  Thanks, Thanks, Thanks in advance

Ira Nydick
UCLA MANE Department

P.S. sorry for the length of the post, but I don't know what is
important to include and what isn't so I may have gone overboard.


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

Date: 30 Jul 92 03:13:22 GMT
From: bill parquet <billp@jupiter.cse.utoledo.edu>
Subject: Reboot from protected mode

sankey@unixg.ubc.ca (Todd Sankey) writes:
:  Does anyone have a description or code snippet or anything to
: describe how to reboot the PC from protected mode?

Rebooting and kicking the computer out of protected mode are pretty similar.

To reboot just do:  mov   al,0feh
		    out   64h, al

(It seems to be 100% effective on my 286, but it sometimes causes my
486 to crash).  To get out of protected mode, there's a few outs to the
CMOS before the big fe->64 to kind of give the bios a resume command.
I don't know what they are off the top of my head.  (BTW  You might
want to HLT, jump back to the halt after that... It seems like
overkill, but the BIOS does it!)

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

Date: 21 Jul 92 09:54:50 GMT
From: Lee Hollingworth <s1110238@giaeb.cc.monash.edu.au>
Subject: REQUEST FOR INFO: DISABLING ^C

fredc@ibmpcug.co.uk (Fred Curtis) writes:

>I want to disable the ^C interrupt.  I can trap it and ignore it
>by reseting the DOS interrupt vector, but it still prints "^C" on
>the screen.

Use the bios functions that use Interrupt 16h function 00h, if you are
using MSC use _bios_keybrd(K_READ), if Borland TC++ or C++ use
bioskey(0) to wait and read user input.

Or below is a simple asm listing which can be compiled and included in
a C program...

Lee Hollingworth
s1110238@giaeb.cc.monash.edu.au

# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by Lee Hollingworth <s1110238@giaeb> on Tue Jul 21 20:07:03 1992
#
# This archive contains:
#	biosibm.h	biosibm.asm	
#

LANG=""; export LANG
PATH=/bin:/usr/bin:$PATH; export PATH

echo x - biosibm.h
cat >biosibm.h <<'@EOF'
/****
 * file:   biosibm.h
 * purpose: defines for biosibm.asm
 ****/

#ifndef BIOSKEYS
#define BIOSKEYS

/* bioskeybrd services */
#define K_READ      0x10
#define K_READY     0x11
#define K_STATUS    0x12

/* enhanced keyboard status bits */
#define K_RSHIFT    0x0000         /* right shift is down   */
#define K_LSHIFT    0x0002         /* left shift is down    */
#define K_CTRL      0x0004         /* both Ctrl keys down   */
#define K_ALT       0x0008         /* both Alt keys down    */
#define K_SCROLL    0x0010         /* scroll lock toggle on */
#define K_NUM       0x0020         /* num lock toggle on    */
#define K_CAP       0x0040         /* cap lock toggle on    */
#define K_INS       0x0080         /* insert toggle is on   */
#define K_LCTRL     0x0100         /* left Ctrl key down    */
#define K_LALT      0x0200         /* left Alt key down     */
#define K_RCTRL     0x0400         /* right Ctrl key down   */
#define K_RALT      0x0800         /* right Alt key down    */
#define K_PSCROLL   0x1000         /* scroll key is down    */
#define K_PNUM      0x2000         /* num key is down       */
#define K_PCAP      0x4000         /* cap key is down       */
#define K_SYSRQ     0x8000         /* sys rq key is down    */

#endif

extern unsigned bioskeybrd(unsigned int service);
@EOF

chmod 600 biosibm.h

echo x - biosibm.asm
cat >biosibm.asm <<'@EOF'
;
; file:     biosibm.asm
; purpose:  int 16h keyboard status functions
; author:   Lee Hollingworth
; header:   biosibm.h
;

key_ready   equ     01h             ; function K_READY

            .model small
            .code
public      _bioskeybrd
;----------------------- bioskeybrd
;   call    unsigned int bioskeybrd(service);
;           unsigned int service;
;   services
;           K_READ      read character and scan code, wait if none ready
;           K_READY     check if a key is waiting to be read
;           K_STATUS    get the current keyboard status
;               refer to biosibm.h for defines
;
_bioskeybrd proc
            push    bp
            mov     bp, sp              ; mov stack pointer to base pointer
            push    si
            push    di

            mov     ah, [bp+4]          ; get service argument
            cmp     ah, key_ready       ; special case for key_ready service
            jne     key_read_status     ; jump if not key_ready
            int     16h
            jnz     alldone             ; jmp if character waiting to be read
            xor     ax, ax              ; otherwise return 0
            jmp     alldone

key_read_status:
            int     16h                 ; simple call for read or status

alldone:
            pop     di
            pop     si
            pop     bp
            ret
_bioskeybrd endp
            end
@EOF

chmod 600 biosibm.asm

exit 0

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

Date: 23 Jul 92 13:13:44 GMT
From: "Scott C. Sadow" <scott@mycro.uucp>
Subject: REQUEST FOR INFO: DISABLING ^C
Summary: How do you disable the ^C handling?

fredc@ibmpcug.co.uk (Fred Curtis) writes:
>I want to disable the ^C interrupt.  I can trap it and ignore it
>by reseting the DOS interrupt vector, but it still prints "^C" on
>the screen.

The best way I have found of doing this is to create a small interrupt
handler that just sets a flag. Then set interrupt vector 1BH to this
routine. (1BH is the BIOS ctrl-break handler) I also set interrupt
vector 23H to this same routine, or slightly different. (23H is the DOS
ctrl-c/ctrl-break handler)

Oh yes - make sure you save both vectors before changing them and
restore them before your programs ends.

(By the way, I have done this also for interrupt vector 5, which is
print screen. Then I can check the global variable and, if set, print
the graphics screen.)

   Scott C. Sadow
   scott@mycro.UUCP
   ...gatech!nanovx!mycro!scott

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

Date: 26 Jul 92 05:55:41 GMT
From: mark jose <speednut@csource.oz.au>
Subject: REQUEST FOR INFO: DISABLING ^C

s110238@giaeb.cc.monash.edu.au (Lee Hollingworth)
 
> fredc@ibmpcug.co.uk (Fred Curtis) writes:
>
> >I want to disable the ^C interrupt.  I can trap it and ignore it
> >by reseting the DOS interrupt vector, but it still prints "^C" on
> >the screen.
 
Sorry for this late post, but I just read this group. Below is the code
I use to catch the ^C interrupt (directly).
 
The code below actually sets a flag "abortflag" to trigger other parts
of the program that it's time to quite. If you want to disable the
Ctrl-Break altogether then just make "FatalAbort()" do nothing.
 
Hope this helps.
 
/*---------------------------------------------------------------------------*/
/* Handles the capturing of Control-C and Control-Break to allow for normal  */
/* exitting during program execution.                                        */
/*                                                                           */
/* Donated to the Public Domain. USE IT AT ***YOUR*** PERIL!!!!!!!!!!!!!!!!  */
/*---------------------------------------------------------------------------*/
#include <dos.h>             /* Required for getvect/setvect  - Turbo C      */
 
 
#ifdefined MSOFT        /* Using a Microsoft C compiler (QUICK-C?) */
   #define  enable   _enable
   #define  disable  _disable
   #define  setvect  _dos_setvect
   #define  getvect  _dos_getvect
#endif
 
/*---------------------------------------------------------------------------*/
/* Local function prototypes and variables.                                  */
/*---------------------------------------------------------------------------*/
static void interrupt far FatalAbort(void);   /* The abort interrupt routine */
static void (interrupt far *OldBreak)(void);  /* The old abort interrupt     */
 
/*---------------------------------------------------------------------------*/
/* Global variables.                                                         */
/*---------------------------------------------------------------------------*/
int localabort;                           /* The abort flag.                 */
 
/*---------------------------------------------------------------------------*/
/* Set up the new interrupt routines for Ctrl-C and Ctrl-Break.              */
/*---------------------------------------------------------------------------*/
void cdecl SetBreakOut(void)
  {
   disable();                             /* Turn off interrupts (for now)   */
   localabort = 0;                        /* Set the abort flag.             */
   OldBreak = getvect(0x1B);              /* Save the old interrupt control. */
   setvect(0x1B, FatalAbort);             /* Set fatal abort vector (1)      */
   setvect(0x23, FatalAbort);             /* Set fatal abort vector (2)      */
   enable();                              /* Turn interrupts back on - flush!*/
  }
 
/*---------------------------------------------------------------------------*/
/* Restore the old interrupt back in its old vector.                         */
/*---------------------------------------------------------------------------*/
void cdecl RestoreBreak(void)
  {
   setvect(0x1B, OldBreak);              /* Restore old interrupt.           */
  }
 
/*---------------------------------------------------------------------------*/
/* Interrupt will trap Ctrl-C and Ctrl-Break. Just change abortflag to 1 &   */
/* the program will pick it up and deal with it.                             */
/*---------------------------------------------------------------------------*/
static void interrupt far FatalAbort(void)
   {
    localabort = 1;                      /* Just set the flag and that's it! */
   }
 
Above done in Turbo C 2.0

mark jose
speednut@csource.oz.au  Unique Computing Pty Ltd, Melbourne, Australia
The opinions expressed above are that of the author only.

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

End of Info-IBMPC Digest V92 #133
*********************************
-------