Subject: Re: Can't boot 1.1
To: David Carrel <carrel@cisco.com>
From: Alasdair Baird <alasdair@wildcat.demon.co.uk>
List: port-i386
Date: 10/24/1995 01:10:36
I mentioned in a previous message that I was seeing similar symptoms
as you were in failing to get the latest -current to boot, i.e. a 
failure with something akin to:

> 	biomask 4040 netmask 400 ttymask 101a
> 	kernel: Protection fault trap.  code = 0
> 	Stopped at _cpu_switch+0xc1	mov %ax,%fs

I think I've figured out what this is, certainly my machine is now
booting fine with a small fix...

It turns out that at the point where process zero is being set up that
the register %fs has some crud value in it (0x7a00?) which then gets
propogated into process one and two when zero forks.  First time round
to context switch this old value is moved back into %fs, or it would be
if it were valid; it throws a wobbler instead.

I've fixed this by ensuring this register (and a compatriot) is firmly
trod upon before any of this happens by the following diff to locore.s.
I don't claim this is the correct or neatest way of doing this, but it
works for me.  The change is:


*** locore.s.ORIG       Sat Oct 14 02:56:52 1995
--- locore.s    Sun Oct 22 15:48:40 1995
***************
*** 477,482 ****
--- 477,487 ----
        call    _init386                # wire 386 chip for unix operation
        addl    $4,%esp
  
+       /* clear segment registers */
+       xorl %eax,%eax
+       movl %ax,%fs
+       movl %ax,%gs
+ 
        call    _main
  
  ENTRY(proc_trampoline)


I'm surprised I haven't seen something like this appearing in the -current
tree in the past couple of days.  Mind you, with the quality of link my ISP
currently has to the States I'm surprised to see anything.


   Alasdair.