<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Ok, firstly I will admit openly that I’m most definitely
not the best C/C++ programmer on the planet, and I know next to bu@@er all
about the Microsoft C runtime.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>However, after compiling a debug version of SIMH 3.7-2 under
Visual C++ 2005 (thanks to </span></font>Jason Stevens <font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>for his project file) I thought I’d
try and suss out what is occurring with the excessive paging/disk access issue
when running VMS on XP.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Well, it seems that the _flag member of the FILE structure<i><span
style='font-style:italic'> </span></i>(_iobuf structure in stdio.h) used in the
stream operations for the disk units is becoming corrupted (I don’t know
where yet).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>As far as I’m aware (please correct me if I’m wrong),
the _flag member should only ever hold an 8 bit value (even though the member
is an int in size) as defined by the _IO definitions in stdio.h<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>On the occasions that the excessive paging/disk accesses
occur I have seen the _flag member hold 0x80XX, where the XX is one of the
normal stream states, to my way of thinking it looks like something might be
trying to reset the _flag member to _IORW but somehow is writing to the upper 8
bits of the member???!<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The above state seems to occur when sim_fseek is called to
seek to near the end of the disk file… as a result of the _flag member
being ‘corrupted’ the C runtime calls _flush which then flushes the
whole disk file!! And hence the huge amount of disk activity.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>What is bizarre is that the problem/symptoms are
inconsistent… if you want it to fail.. it wont!... once it’s worked
ok.. it continues to work ok.. its almost like some undeclared memory is being
used.. and the behaviour just depends on what is lurking in that memory
location at the time.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Anyone else got any ideas?<o:p></o:p></span></font></p>

</div>

</body>

</html>