diff --git a/bochs/cpu/descriptor.h b/bochs/cpu/descriptor.h index 0ef480dc2..dc3494c82 100755 --- a/bochs/cpu/descriptor.h +++ b/bochs/cpu/descriptor.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: descriptor.h,v 1.23 2008-05-13 05:12:11 sshwarts Exp $ +// $Id: descriptor.h,v 1.24 2008-05-26 18:02:07 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2007 Stanislav Shwartsman @@ -23,6 +23,21 @@ #ifndef BX_DESCRIPTOR_H #define BX_DESCRIPTOR_H +// +// |---------------------------------------------| +// | Segment Descriptor | +// |---------------------------------------------| +// |33222222|2|2|2|2| 11 11 |1|11|1|11 | | +// |10987654|3|2|1|0| 98 76 |5|43|2|1098|76543210| +// |--------|-|-|-|-|-------|-|--|-|----|--------| +// |Base |G|D|L|A|Limit |P|D |S|Type|Base | +// |[31-24] | |/| |V|[19-16]| |P | | |[23-16] | +// | | |B| |L| | |L | | | | +// |------------------------|--------------------| +// | Base [15-0] | Limit [15-0] | +// |------------------------|--------------------| +// + typedef struct { /* bx_selector_t */ Bit16u value; /* the 16bit value of the selector */ #if BX_CPU_LEVEL >= 2 diff --git a/bochs/cpu/io_pro.cc b/bochs/cpu/io_pro.cc index 554d01794..9e1f78819 100644 --- a/bochs/cpu/io_pro.cc +++ b/bochs/cpu/io_pro.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: io_pro.cc,v 1.32 2008-05-19 20:01:23 sshwarts Exp $ +// $Id: io_pro.cc,v 1.33 2008-05-26 18:02:07 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -133,7 +133,7 @@ bx_bool BX_CPU_C::allow_io(Bit16u addr, unsigned len) return(0); } */ - if ((Bit32s) (addr/8) >= (Bit32s) (BX_CPU_THIS_PTR tr.cache.u.system.limit_scaled - io_base)) { + if ((io_base + addr/8) >= BX_CPU_THIS_PTR tr.cache.u.system.limit_scaled) { BX_ERROR(("allow_io(): IO addr %x (len %d) outside TSS IO permission map (base=%x, limit=%x) #GP(0)", addr, len, io_base, BX_CPU_THIS_PTR tr.cache.u.system.limit_scaled)); return(0);