diff --git a/bochs/.conf.win32-cygwin b/bochs/.conf.win32-cygwin index 138fb7d0b..1d32d34c8 100755 --- a/bochs/.conf.win32-cygwin +++ b/bochs/.conf.win32-cygwin @@ -7,6 +7,7 @@ CC="gcc" CXX="g++" CFLAGS="-O3 -Wall -Wno-format -mno-cygwin" +#CFLAGS="-O3 -Wall -Wno-format -march=pentium -mno-ms-bitfields" # for GCC 4.7+ CXXFLAGS="$CFLAGS" export CC diff --git a/bochs/iodev/hdimage/vmware4.cc b/bochs/iodev/hdimage/vmware4.cc index 44cc7910f..3aca11f5b 100644 --- a/bochs/iodev/hdimage/vmware4.cc +++ b/bochs/iodev/hdimage/vmware4.cc @@ -53,6 +53,9 @@ vmware4_image_t::vmware4_image_t() current_offset(INVALID_OFFSET), is_dirty(0) { + if (sizeof(_VM4_Header) != 72) { + BX_PANIC(("system error: invalid header structure size")); + } } vmware4_image_t::~vmware4_image_t() diff --git a/bochs/iodev/hdimage/vvfat.cc b/bochs/iodev/hdimage/vvfat.cc index a2da8d2ec..1bd213a38 100644 --- a/bochs/iodev/hdimage/vvfat.cc +++ b/bochs/iodev/hdimage/vvfat.cc @@ -343,6 +343,10 @@ infosector_t; vvfat_image_t::vvfat_image_t(Bit64u size, const char* _redolog_name) { + if (sizeof(bootsector_t) != 512) { + BX_PANIC(("system error: invalid bootsector structure size")); + } + first_sectors = new Bit8u[0xc000]; memset(&first_sectors[0], 0, 0xc000);