Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Feb 2009 23:11:15 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/boot/i386/btx/btx btx.S
Message-ID:  <200902242311.n1ONBVIb047417@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
jhb         2009-02-24 23:11:15 UTC

  FreeBSD src repository

  Modified files:
    sys/boot/i386/btx/btx btx.S 
  Log:
  SVN rev 189017 on 2009-02-24 23:11:15Z by jhb
  
  Fix some more issues with the real mode BTX.
  
  The old BTX passed the general purpose registers from the 32-bit client to
  the routines called via virtual 86 mode.  The new BTX did the same thing.
  However, it turns out that some instructions behave differently in virtual 86
  mode and real mode (even though this is under-documented).  For example, the
  LEAVE instruction will cause an exception in real mode if any of the upper
  16-bits of %ebp are non-zero after it executes.  In virtual 8086 mode the
  upper 16-bits are simply ignored.  This could cause faults in hardware
  interrupt handlers that inherited an %ebp larger than 0xffff from the 32-bit
  client (loader, boot2, etc.) while running in real mode.
  
  To fix, when executing hardware interrupt handlers provide an explicit clean
  state where all the general purpose and segment registers are zero upon
  entry to the interrupt handler.  While here, I attempted to simplify the
  control flow in the 'intusr' code that sets up the various stack frames
  and exits protected mode to invoke the requested routine via real mode.
  
  A huge thanks to Tor Egge (tegge@) for debugging this issue.
  
  Submitted by:   tegge
  Reviewed by:    tegge
  Tested by:      bz
  MFC after:      1 week
  
  Revision  Changes    Path
  1.48      +60 -35    src/sys/boot/i386/btx/btx/btx.S



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902242311.n1ONBVIb047417>