diff --git a/bochs/cpu/access.cc b/bochs/cpu/access.cc index 3293c9bf5..a5495d324 100644 --- a/bochs/cpu/access.cc +++ b/bochs/cpu/access.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: access.cc,v 1.101 2008-04-27 19:48:57 sshwarts Exp $ +// $Id: access.cc,v 1.102 2008-05-01 05:11:19 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -121,6 +121,11 @@ BX_CPU_C::write_virtual_checks(bx_segment_reg_t *seg, bx_address offset, unsigne return; } else { /* real mode */ + if (seg->cache.valid==0) { + BX_DEBUG(("write_virtual_checks(): segment descriptor not valid (real mode)")); + exception(int_number(seg), 0, 0); + } + if (offset > (seg->cache.u.segment.limit_scaled - length + 1) || (length-1 > seg->cache.u.segment.limit_scaled)) { @@ -211,6 +216,11 @@ BX_CPU_C::read_virtual_checks(bx_segment_reg_t *seg, bx_address offset, unsigned return; } else { /* real mode */ + if (seg->cache.valid==0) { + BX_DEBUG(("read_virtual_checks(): segment descriptor not valid (real mode)")); + exception(int_number(seg), 0, 0); + } + if (offset > (seg->cache.u.segment.limit_scaled - length + 1) || (length-1 > seg->cache.u.segment.limit_scaled)) { @@ -305,6 +315,11 @@ BX_CPU_C::execute_virtual_checks(bx_segment_reg_t *seg, bx_address offset, unsig return; } else { /* real mode */ + if (seg->cache.valid==0) { + BX_DEBUG(("execute_virtual_checks(): segment descriptor not valid (real mode)")); + exception(int_number(seg), 0, 0); + } + if (offset > (seg->cache.u.segment.limit_scaled - length + 1) || (length-1 > seg->cache.u.segment.limit_scaled)) {