Re: laptop + 2.1.57 resetting before printing "Uncompressing Linux"

Hubert Mantel (mantel@suse.de)
Fri, 17 Oct 1997 09:50:56 +0200 (MEST)


On Thu, 16 Oct 1997, Alan Cox wrote:

> > > Yup, "bzimage" kernels don't work with the Dell Xpi laptops. They
> > > reboot just as you describe (even with the 2.0.x kernels). This makes
> > > installing Debian Linux a pain. (I'm recompiling a 2.0.30 kernel as I
> > > write this, so I can install Debian on my Xpi.)
> > >
> > > I remember reading that at some point in the 2.1.x series bzimage
> > > became the default. BTW, I have P75 Dell XPi.
> > >
> >
> > I had the same problem with an IBM ThinkPad 380.
>
> I can't speak for the thinkpad but the problem with some craptops is that
> they are using chipsets that aren't designed to handle A20 properly. The
> A20 line switch doesnt flush the cache and the machine dies horribly.

These problems show up not only on laptops. We observed it on some (very
few) desktop machines as well. Interestingly, on most machines (not all)
you can boot without problems when using loadlin instead of LILO. In some
cases, disabling the caches (first and second level) does help, too. The
author of loadlin, Hans Lermen, has spent quite some time into looking
into this problem, but couldn't find a solution.

Additionally, there is a patch from Jens Maurer (appended below) which
fixes the problem on quite a number of machines. We're using this patch
for more than a year now without any problem. It is against 2.0.xx.
Didn't try it with 2.1.xx yet.

> The only real way to fix this is probably to teach lilo to flush the
> caches at the right moment.

Hubert

-----------------------------------------------------------------------
--- linux/arch/i386/boot/setup.S.old Sat Mar 30 19:58:57 1996
+++ linux/arch/i386/boot/setup.S Thu Aug 8 11:50:32 1996
@@ -446,10 +449,7 @@
! now we are at the right place
end_move_self:

- lidt idt_48 ! load idt with 0,0
- lgdt gdt_48 ! load gdt with whatever appropriate
-
-! that was painless, now we enable A20
+! now we enable A20

call empty_8042
mov al,#0xD1 ! command write
@@ -458,6 +458,32 @@
mov al,#0xDF ! A20 on
out #0x60,al
call empty_8042
+
+! On some machines, there are cache coherency problems with
+! addresses above 0x100000 after enabling the A20 gate.
+! ( observed on a Toshiba Tecra 710CDT )
+! The cache still contains invalid data for the new situation,
+! because 0x100000 is no longer an alias for 0x000000.
+! To deal with this we just read some bytes silently and hope that
+! the cache is reloaded afterwards. (Jens Maurer)
+ seg cs
+ test byte ptr loadflags,#LOADED_HIGH
+ jz end_cache_kludge
+ mov ax,#0xffff ! ds:si = 0x100000
+ mov ds,ax
+ mov si,#0x10
+ cld
+ mov cx,#0x2000 ! 16 KB
+ rep
+ lodsw
+ mov ax,cs
+ mov ds,ax ! restore DS
+end_cache_kludge:
+
+! setup descriptor tables
+
+ lidt idt_48 ! load idt with 0,0
+ lgdt gdt_48 ! load gdt with whatever appropriate

! make sure any possible coprocessor is properly reset..
-----------------------------------------------------------------------