[comp.os.minix] MINIX 1.2 on a 386-based machine?

mbeck@amsaa-seer.arpa (SECAD-guest) (03/16/88)

[ Forgive me if this is a double-posting.. I used the wrong method of ]
[ posting it and figured this was the "right" way..  Mark.            ]

Hello All -

     Was thinking of purchasing a 386-based machine and wanted to see if
MINIX 1.2 would run on one.

     Last Monday I went over to a local dealer who had a bare-bones 386
(Mylex motherboard, 16 MHzok, 1 MByte 100 nsec RAM, 64K static cache, WD
WA2 controller, monochrome monitor + display card to match, and a 360K
floppy drive; he wanted $1,800 for it) and tried booting MINIX.

     This test was done with the stock 1.2 PC-style 360K distribution
boot disk set.

     The boot software started with no problems.  However, a few seconds
after inserting the root file system disk and pressing "=", MINIX
displayed a "trap <16" message, a second message telling me that block 0
on this disk is unreadable, and a third message telling me to press any
key for a re-boot.

     Three cycles of this and I thought the root file system disk was
bad.  Took it over to a machine with a 286-based motherboard (DTK) and
MINIX booted with no problems.

     Question: Has anyone gotten MINIX to run on a 386-based machine?

     Please e-mail direct.. if sufficient interest, I'll summarize.

Regards,
Mark Becker
mbeck@amsaa-seer.arpa

brucee@runx.ips.oz (Bruce Evans) (03/19/88)

Minix runs normally on my 386. It took only a small modification to the floppy
driver.  The AT hard disk driver was no problem. fdisk and fsck gave minor
problems.

My machine is a Micronics motherboard in an AT clone case with AT compatible
I/O. My software is a much hacked V1.2+ kernel, originally on a 360K disk.
This shouldn't have helped but I'm not sure. I use faster routines to write
to the I/O ports, but this hurts because the 386 is sometimes too fast.
Perhaps there are less bugs.

Floppy disk problems
--------------------

The floppy root file system was initially unreadable. A long session with my
debugger gave the following patch.

Line approx 485 in floppy.c fdc_results(), just before the line
   port_in(FDC_STATUS, &status)
add a delay loop
   {
      int k;
      for ( k = 0; k < 256; ++k )
         ;
   }
Here 256 is far to many. I think 4 works but am still running with 256. I
don't know exactly why this works! Obviously the 386 is hitting the status
port too fast, but a disassembly of the BIOS showed shorter (programmed)
delays than the slow C code was doing naturally.

No doubt other machines will have other problems. The "trap < 16" message
could be a BIOS problem, but more likely an uninitialized interrupt.

Another thing worth trying is to reduce the machine's speed to avoid timing
problems. If there is no hardware switch, this involves finding how to in
software and doing it in kernel/main().

Hard disk problems
------------------

These have nothing to do with the 386, just with DOS 3.3 and disks > 32 MB.

fdisk has a hard-coded head count of 4, my new drive has 6. People have
reported problems with 5 heads instead of 4 but they must have been in
the XT driver. (My driver is the latest official one that I know of).

fdisk doesn't completely understand all the codes DOS fdisk uses. I previously
had problems with DOS 3.2 fdisk. It gave division by zero crashes on bad
partition tables. The 3.3 version just hangs with what fdisk naturally writes.
I ended up creating a 2nd DOS partition (new ability for 3.3) and zapping it
by hand so DOS does not see it (I hope).

The standalone fsck can't handle block numbers > 64K. It is supposed to give
an error message to that effect, but instead tried to access some unknown
unreadable block. I used a posted Minix version which worked fine.

Bruce Evans
Internet: brucee@runx.ips.oz.au    UUCP: uunet!runx.ips.oz.au!brucee

cs002@unocss.UUCP (Stan Wileman) (03/22/88)

In article <1437@runx.ips.oz>, brucee@runx.ips.oz (Bruce Evans) writes:
> Minix runs normally on my 386. It took only a small modification to the floppy
> driver.  The AT hard disk driver was no problem. fdisk and fsck gave minor
> problems.
> 
> My machine is a Micronics motherboard in an AT clone case with AT compatible
> I/O. My software is a much hacked V1.2+ kernel, originally on a 360K disk.

With no apparent problems whatever (other than already noted difficulties)
MINIX 1.2 works very well on my Z-386.  I haven't allocated a partition of
more than 10Meg to MINIX, but I made no changes whatever to the floppy or
hard disk drivers, and the 80MB winchester, 360K and 1.2M floppies all work.
Now how about a true '386 version?

Stan Wileman, Math/CS Dept., U. of Nebraska at Omaha
UUCP: ..!ihnp4!unocss!cs002     INTERNET: cs002%zeus@crcvms.unl.edu