<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">

From: Klaus Espenlaub <<a href="mailto:klaus.espenlaub@oracle.com" target="_blank">klaus.espenlaub@oracle.com</a>><br>
Subject: Re: [vbox-dev] Patch to PC BIOS file:<br>
        \src\VBox\Devices\PC\BIOS\floppy.c<br>
To: <a href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a><br>
Message-ID: <<a href="mailto:54E1F3D1.1060501@oracle.com" target="_blank">54E1F3D1.1060501@oracle.com</a>><br>
Content-Type: text/plain; charset=windows-1252; format=flowed<br>
<br>
On 16.02.2015 12:18, Michal Necasek wrote:<br>
><br>
>     Hi Dave,<br>
><br>
>   Thanks for the patch! I'll take a look at it in detail soon (at first<br>
> glance it looks very reasonable). However, I'm not going to commit<br>
> anything unless I can run at least the most basic verification that the<br>
> code does something useful. So what can I use as a testcase so check<br>
> that the modified code does what it's supposed to?<br>
<br>
It seems to do some additional 0x40:0x90 and 0x40:0x91 updating only<br>
(the 0x18 one doesn't update the DPT which I assume a real BIOS would),<br>
and for that it's surprisingly much code. Proper handling of these calls<br>
should also include telling the floppy controller about the density etc.<br>
- of course I know that it doesn't have an influence on a software<br>
floppy controller implementation behavior, as it doesn't care about<br>
precompensation and so on. Some even smarter software out there might<br>
check the floppy controller registers and get confused.<br>
<br>
In any case there's significant functionality overlap with function<br>
floppy_media_sense, and as the BIOS code size has hard limits any code<br>
redundancy should be eliminated.<br>
<br>
Also I wonder if 0x40:0x92 and 0x40:0x93 should be updated by the BIOS,<br>
too. They aren't as well documented as the others.<br>
<br>
Klaus<br></blockquote><div> </div><div><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font face="Calibri"><font size="3"><font color="#000000">Hi Klaus,</font></font></font></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font color="#000000" face="Calibri" size="3"> </font></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font face="Calibri"><font size="3"><font color="#000000">My understanding is that 17h/18h are most often used when a
format is required of a diskette at something other than the maximum capacity
of the drive. For example a format of a 720k disk in a 1.44MB drive (eg: dos
command FORMAT a: /F:720). In this scenario, one of these entry points would be called prior
to the first int13 5h format call. My reading <span> </span>indicates that the 17h/18h calls only 'setup'
the media status for the specified parameters (although 18h also points to a
DPT entry). I suspect normally the DPT would contain an entry for each possible
combination of media/drive, so there would be an entry for a 1.44MB dive, and
also one for 720k media in a 1.44 drive. VirtualBox ‘sort of’ does this (there
seems to be an entry for a 360k disk in a 1.2mb drive – but not for a 720k disk
in a 1.44mb drive).</font></font></font></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font face="Calibri"><font size="3"><font color="#000000">This really means that the 18h call could possibly be somewhat
smaller if it could just iterate over the DPT looking for the matching entry
to return. While I considered this, I thought that - particularly as a first
time contributor - changes of this magnitude (splitting out the DPT structures
into a header file, adding new entries to the DPT ..etc) would not help my
cause (larger changes to the BIOS code I suspect would be resisted). So, I tried
to introduce these new functions using code with the same ‘look & feel’ (I
hope) as the existing code.</font></font></font></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font face="Calibri"><font size="3"><font color="#000000">As for these entry points needing to tell the floppy
controller 'what has changed', I'm not sure this is required, as I suspect this
this is one of the first tasks done by the format (5h) call – I suspect via a
call to 'floppy_prepare_controller'. However I suspect your knowledge of this
area exceeds mine.</font></font></font></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font color="#000000" face="Calibri" size="3"> </font></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font face="Calibri"><font size="3"><font color="#000000">Regards,</font></font></font></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font size="3"><font color="#000000"><font face="Calibri">dave</font></font></font></p><font color="#000000" face="Times New Roman" size="3">

</font></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
>     Regards,<br>
>        Michal<br>
><br>
> ----- Original Message -----<br>
> From: <a href="mailto:stope19@gmail.com" target="_blank">stope19@gmail.com</a><br>
> To: <a href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a><br>
> Sent: Sunday, February 15, 2015 10:07:41 AM GMT +01:00 Amsterdam /<br>
> Berlin / Bern / Rome / Stockholm / Vienna<br>
> Subject: [vbox-dev] Patch to PC BIOS file:<br>
> \src\VBox\Devices\PC\BIOS\floppy.c<br>
><br>
> Hi,<br>
> I'd like to contribute a patch to the file:<br>
> '\src\VBox\Devices\PC\BIOS\floppy.c'. This patch is submitted under the<br>
> MIT License.<br>
> The patch provides an implementation for 2 BIOS entry points that are -<br>
> in the current source tree - stubbed out as 'not available'. The 2 entry<br>
> points are:<br>
> Int 13/AH=17h - FLOPPY DISK - SET DISK TYPE FOR FORMAT (AT,PS)<br>
> Int 13/AH=18h - FLOPPY DISK - SET MEDIA TYPE FOR FORMAT (AT model<br>
> 3x9,XT2,XT286,PS)<br>
> As mentioned, these are not currently implemented - so I see little risk<br>
> to existing software. The patch was developed on a Win32 XP platform,<br>
> the usual dev tools and Open Watcom 1.9<br>
> The motivation for this patch is a requirement to get an old (early<br>
> 90's) database system to load in VirtualBox. It uses these entry points<br>
> not to perform format operations, but to setup the floppy for subsequent<br>
> IO operations. Why it does this I cannot say...<br>
> The patch is in the attached text file, and was created against the<br>
> current file image from the source repository.<br>
> Regards,<br>
> Dave<br>
><br>
<br>

------------------------------<br>
<br>
</blockquote></div><br></div></div>