Newer
Older
ubix2 / doc / html / fdc_8h-source.html
@reddawg reddawg on 15 Dec 2006 16 KB Changes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>UbixOS V2: src/sys/include/isa/fdc.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="dirs.html"><span>Directories</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    <li><a href="globals.html"><span>Globals</span></a></li>
  </ul></div>
<div class="nav">
<a class="el" href="dir_897b6a2d7bab147dd1db58381aad3984.html">src</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_832905b1f7f5feaf61a306b40c0ac817.html">sys</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_caf4200c438ae9601464168e21e8e4d8.html">include</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_531e61b8e9b8982548f8f8f296b3206c.html">isa</a></div>
<h1>fdc.h</h1><a href="fdc_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> Copyright (c) 2002-2004 The UbixOS Project</span>
<a name="l00003"></a>00003 <span class="comment"> All rights reserved.</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment"> Redistribution and use in source and binary forms, with or without modification, are</span>
<a name="l00006"></a>00006 <span class="comment"> permitted provided that the following conditions are met:</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment"> Redistributions of source code must retain the above copyright notice, this list of</span>
<a name="l00009"></a>00009 <span class="comment"> conditions, the following disclaimer and the list of authors.  Redistributions in binary</span>
<a name="l00010"></a>00010 <span class="comment"> form must reproduce the above copyright notice, this list of conditions, the following</span>
<a name="l00011"></a>00011 <span class="comment"> disclaimer and the list of authors in the documentation and/or other materials provided</span>
<a name="l00012"></a>00012 <span class="comment"> with the distribution. Neither the name of the UbixOS Project nor the names of its</span>
<a name="l00013"></a>00013 <span class="comment"> contributors may be used to endorse or promote products derived from this software</span>
<a name="l00014"></a>00014 <span class="comment"> without specific prior written permission.</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY</span>
<a name="l00017"></a>00017 <span class="comment"> EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF</span>
<a name="l00018"></a>00018 <span class="comment"> MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL</span>
<a name="l00019"></a>00019 <span class="comment"> THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span>
<a name="l00020"></a>00020 <span class="comment"> SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT</span>
<a name="l00021"></a>00021 <span class="comment"> OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
<a name="l00022"></a>00022 <span class="comment"> HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR</span>
<a name="l00023"></a>00023 <span class="comment"> TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
<a name="l00024"></a>00024 <span class="comment"> SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00025"></a>00025 <span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment"> $Id$</span>
<a name="l00027"></a>00027 <span class="comment"></span>
<a name="l00028"></a>00028 <span class="comment">*****************************************************************************************/</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#ifndef _FDC_H</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define _FDC_H</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="types_8h.html">ubixos/types.h</a>&gt;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a><a class="code" href="structDrvGeom.html">00035</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structDrvGeom.html">DrvGeom</a> {
<a name="l00036"></a><a class="code" href="structDrvGeom.html#edb24f8c9f3ae872be1cb104854dee1b">00036</a>    <a class="code" href="types_8h.html#3832cc814f0e7129add9a1cf7201c7ca">Int8</a> <a class="code" href="structDrvGeom.html#edb24f8c9f3ae872be1cb104854dee1b">heads</a>;
<a name="l00037"></a><a class="code" href="structDrvGeom.html#a2752e58d5f53c17ce6331d3ee4e9cbf">00037</a>    <a class="code" href="types_8h.html#3832cc814f0e7129add9a1cf7201c7ca">Int8</a> <a class="code" href="structDrvGeom.html#a2752e58d5f53c17ce6331d3ee4e9cbf">tracks</a>;
<a name="l00038"></a><a class="code" href="structDrvGeom.html#a8dd21b2e6459ec0fabd9fe49835646a">00038</a>    <a class="code" href="types_8h.html#3832cc814f0e7129add9a1cf7201c7ca">Int8</a> <a class="code" href="structDrvGeom.html#a8dd21b2e6459ec0fabd9fe49835646a">spt</a>;
<a name="l00039"></a>00039 } <a class="code" href="structDrvGeom.html">drvGeom</a>;
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 
<a name="l00042"></a><a class="code" href="fdc_8h.html#8ede3d2b611c5ae0d74bac02a68f998a">00042</a> <span class="preprocessor">#define fdcMsr  (0x3f4)</span>
<a name="l00043"></a><a class="code" href="fdc_8h.html#298d327024dc99847e9064de3aa4388a">00043</a> <span class="preprocessor"></span><span class="preprocessor">#define fdcData (0x3f5)</span>
<a name="l00044"></a><a class="code" href="fdc_8h.html#93ff9547b61a14618c87c5639a1252c5">00044</a> <span class="preprocessor"></span><span class="preprocessor">#define fdcDir  (0x3f7)</span>
<a name="l00045"></a><a class="code" href="fdc_8h.html#bcb9230a76b72528226c49a520db19f0">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define fdcCcr  (0x3f7)</span>
<a name="l00046"></a><a class="code" href="fdc_8h.html#e3bc9df62f197b42804259efb8ba44ec">00046</a> <span class="preprocessor"></span><span class="preprocessor">#define fdcDor  (0x3f2)</span>
<a name="l00047"></a><a class="code" href="fdc_8h.html#00cfb48baa9e5c82b55842f2fdb5794c">00047</a> <span class="preprocessor"></span><span class="preprocessor">#define fdcDrs  (0x3f4)</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span>
<a name="l00049"></a><a class="code" href="fdc_8h.html#fcfbcbee1143a2a689afc3a656646bad">00049</a> <span class="preprocessor">#define cmdWrite   (0xc5)</span>
<a name="l00050"></a><a class="code" href="fdc_8h.html#6f35816c0b01ac39832de24459d82e27">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define cmdRead    (0xe6)</span>
<a name="l00051"></a><a class="code" href="fdc_8h.html#e2d2411a8ccdc868ab718da2b15348a9">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define cmdSeek    (0x0f)</span>
<a name="l00052"></a><a class="code" href="fdc_8h.html#6afd950ba65e51d77abf2158216f0284">00052</a> <span class="preprocessor"></span><span class="preprocessor">#define cmdSensei  (0x08)</span>
<a name="l00053"></a><a class="code" href="fdc_8h.html#8a2fef7d1ed07757e099b8c7b29bfb09">00053</a> <span class="preprocessor"></span><span class="preprocessor">#define cmdRecal   (0x07)</span>
<a name="l00054"></a><a class="code" href="fdc_8h.html#6003c8e12dd1e4f765279854f016c0ae">00054</a> <span class="preprocessor"></span><span class="preprocessor">#define cmdSpecify (0x03)</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span>
<a name="l00056"></a><a class="code" href="fdc_8h.html#603e1e0a278c07c7338444e750ab35f3">00056</a> <span class="preprocessor">#define dg144Heads  2     </span><span class="comment">/* heads per drive (1.44M) */</span>
<a name="l00057"></a><a class="code" href="fdc_8h.html#e502999ac4dc1f4ef9e0a9db76b11a9a">00057</a> <span class="preprocessor">#define dg144Tracks 80</span>
<a name="l00058"></a><a class="code" href="fdc_8h.html#874c835339ecb6a4a5fdd7aab7bfbe02">00058</a> <span class="preprocessor"></span><span class="preprocessor">#define dg144Spt    18</span>
<a name="l00059"></a><a class="code" href="fdc_8h.html#95339d9d677a8ac74a7a7459ad130739">00059</a> <span class="preprocessor"></span><span class="preprocessor">#define dg144Gap3rw 0x1b</span>
<a name="l00060"></a><a class="code" href="fdc_8h.html#51916e330bac103bdf860461ae359e1e">00060</a> <span class="preprocessor"></span><span class="preprocessor">#define dg168Gap3rw 0x1c</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span>
<a name="l00062"></a>00062 
<a name="l00063"></a>00063 
<a name="l00064"></a>00064 <span class="keywordtype">int</span> <a class="code" href="fdc_8h.html#2fad92b12d9ff56bf300b7e53875c75d">fdc_init</a>();
<a name="l00065"></a>00065 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#2c2196dd9229105994bb3840347e6f05">floppyIsr</a>();
<a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#5042dfaf2327990b6d1e1a7d3e01751c">floppyIsrhndlr</a>();
<a name="l00067"></a>00067 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#e708fa84d19a72e77185b3a214e81573">sendByte</a>(<span class="keywordtype">int</span> <a class="code" href="types_8h.html#3832cc814f0e7129add9a1cf7201c7ca">Int8</a>);
<a name="l00068"></a>00068 <span class="keywordtype">int</span> <a class="code" href="fdc_8h.html#e266cdb34b69c65cfc108bbc72a4e3ff">getByte</a>();
<a name="l00069"></a>00069 <span class="keywordtype">bool</span> <a class="code" href="fdc_8h.html#9d92103f483df5da1a07402347739e44">fdcRw</a>(<span class="keywordtype">int</span> block,<a class="code" href="types_8h.html#3832cc814f0e7129add9a1cf7201c7ca">Int8</a> *blockBuffer,<span class="keywordtype">bool</span> <a class="code" href="gen__calls_8h.html#5eff3a25d417fafce7c4f211db219ca2">read</a>,<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> numSectors);
<a name="l00070"></a>00070 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#a0f8325f93de9409e403e620f914e69f">block2Hts</a>(<span class="keywordtype">int</span> block,<span class="keywordtype">int</span> *head,<span class="keywordtype">int</span> *track,<span class="keywordtype">int</span> *sector);
<a name="l00071"></a>00071 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#94483feb4903fca9643813faae8a76ee">motorOn</a>(<span class="keywordtype">void</span>);
<a name="l00072"></a>00072 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#044fc0dea0fb35e6fab7f3c0badea2c9">motorOff</a>(<span class="keywordtype">void</span>);
<a name="l00073"></a>00073 <span class="keywordtype">bool</span> <a class="code" href="fdc_8h.html#5886a896e5f0361f36b40d007db6e683">seek</a>(<span class="keywordtype">int</span> track);
<a name="l00074"></a>00074 <span class="keywordtype">bool</span> <a class="code" href="fdc_8h.html#f5b6e5123d27381ca120b7b4fea7b242">waitFdc</a>(<span class="keywordtype">bool</span> sensei);
<a name="l00075"></a>00075 <span class="keywordtype">int</span> <a class="code" href="fdc_8h.html#e266cdb34b69c65cfc108bbc72a4e3ff">getByte</a>();
<a name="l00076"></a>00076 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#e708fa84d19a72e77185b3a214e81573">sendByte</a>(<span class="keywordtype">int</span> <a class="code" href="types_8h.html#3832cc814f0e7129add9a1cf7201c7ca">Int8</a>);
<a name="l00077"></a>00077 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#2a16ea9e09b5f3dc2a559351afdc75f3">recalibrate</a>(<span class="keywordtype">void</span>);
<a name="l00078"></a>00078 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#3aea9deb2a0bfea9ff05a898f4822e31">reset</a>(<span class="keywordtype">void</span>);
<a name="l00079"></a>00079 <span class="keywordtype">bool</span> <a class="code" href="fdc_8h.html#ebbcd7bc8695e888491b97b5bf27bd9c">writeBlock</a>(<span class="keywordtype">int</span> block,<a class="code" href="types_8h.html#3832cc814f0e7129add9a1cf7201c7ca">Int8</a> *blockBuffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> numSectors);
<a name="l00080"></a>00080 <span class="keywordtype">bool</span> <a class="code" href="fdc_8h.html#a03242a5e44c4f2d10e15d296aca8c6b">readBlock</a>(<span class="keywordtype">int</span> block,<a class="code" href="types_8h.html#3832cc814f0e7129add9a1cf7201c7ca">Int8</a> *blockBuffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> numSectors);
<a name="l00081"></a>00081 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#53a979dbcd632f57a4b004f66332f981">fdcWrite</a>(<span class="keywordtype">void</span> *info,<span class="keywordtype">void</span> *,<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a> startSector,<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a> sectorCount);
<a name="l00082"></a>00082 <span class="keywordtype">void</span> <a class="code" href="fdc_8h.html#fbac0e2409458a8fda9ff689ecd31de9">fdcRead</a>(<span class="keywordtype">void</span> *info,<span class="keywordtype">void</span> *,<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a> startSector,<a class="code" href="types_8h.html#5847ea0262a5aa61eee48cbe95544a78">uInt32</a> sectorCount);
<a name="l00083"></a>00083 
<a name="l00084"></a>00084 <span class="preprocessor">#endif</span>
<a name="l00085"></a>00085 <span class="preprocessor"></span>
<a name="l00086"></a>00086 <span class="comment">/***</span>
<a name="l00087"></a>00087 <span class="comment"> $Log$</span>
<a name="l00088"></a>00088 <span class="comment"> Revision 1.1.1.1  2006/06/01 12:46:14  reddawg</span>
<a name="l00089"></a>00089 <span class="comment"> ubix2</span>
<a name="l00090"></a>00090 <span class="comment"></span>
<a name="l00091"></a>00091 <span class="comment"> Revision 1.2  2005/10/12 00:13:36  reddawg</span>
<a name="l00092"></a>00092 <span class="comment"> Removed</span>
<a name="l00093"></a>00093 <span class="comment"></span>
<a name="l00094"></a>00094 <span class="comment"> Revision 1.1.1.1  2005/09/26 17:23:39  reddawg</span>
<a name="l00095"></a>00095 <span class="comment"> no message</span>
<a name="l00096"></a>00096 <span class="comment"></span>
<a name="l00097"></a>00097 <span class="comment"> Revision 1.6  2004/07/17 02:38:31  reddawg</span>
<a name="l00098"></a>00098 <span class="comment"> Fixed a few problems</span>
<a name="l00099"></a>00099 <span class="comment"></span>
<a name="l00100"></a>00100 <span class="comment"> Revision 1.5  2004/07/14 12:42:46  reddawg</span>
<a name="l00101"></a>00101 <span class="comment"> fdc: fdcInit to fdc_init</span>
<a name="l00102"></a>00102 <span class="comment"> Changed Startup Routines</span>
<a name="l00103"></a>00103 <span class="comment"></span>
<a name="l00104"></a>00104 <span class="comment"> Revision 1.4  2004/05/21 14:57:16  reddawg</span>
<a name="l00105"></a>00105 <span class="comment"> Cleaned up</span>
<a name="l00106"></a>00106 <span class="comment"></span>
<a name="l00107"></a>00107 <span class="comment"> END</span>
<a name="l00108"></a>00108 <span class="comment"> ***/</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue Dec 12 09:59:41 2006 for UbixOS V2 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>