[SeaBIOS] [PATCH 0/6] Convert AHCI driver to run entirely in 32bit mode

Kevin O'Connor kevin at koconnor.net
Thu Oct 3 03:38:41 CEST 2013

This series converts the AHCI driver to run entirely in 32bit mode.
Currently, ahci will only jump into 32bit mode when it needs to access
the ahci device's PCI config space.  However, if the code has to run
anything in 32bit mode, it might as well run it all in 32bit mode.
Doing this also shrinks the total SeaBIOS code size by a few KB.

In order for this to work, SeaBIOS needs to be able to transition from
32bit mode back to 16bit mode in order to use yield().  This requires
tracking the stack segment when using call32() and restoring it if
call16() is later called.  It also requires getting off the "extra
stack" if it is in use.

This series is a little bit uglier than I hoped, but I'm sending it
out for further comments.

This series is also at:


Kevin O'Connor (6):
  Rearrange stack_hop_back() call in wait_irq, check_irqs, and
  Minor - move call16 assembler in romlayout.S.
  Make __call16 use C calling convention and support two passed
  Update _farcall16() to pass segment of callregs explicitly.
  Support call16() calls after entering 32bit mode from call32().
  Run ahci code entirely in 32bit mode.

 Makefile          |   4 +-
 src/block.c       |  13 ++++--
 src/hw/ahci.c     |  15 ++-----
 src/hw/blockcmd.c |   5 ++-
 src/romlayout.S   | 132 ++++++++++++++++++++++++++++++++----------------------
 src/stacks.c      |  78 +++++++++++++++++++-------------
 6 files changed, 145 insertions(+), 102 deletions(-)


More information about the SeaBIOS mailing list