<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Ubixos: fdc.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.3.3 --> <h1>fdc.h</h1><div class="fragment"><pre>00001 <span class="comment">/**************************************************************************************</span> 00002 <span class="comment"> Copyright (c) 2002 The UbixOS Project</span> 00003 <span class="comment"> All rights reserved.</span> 00004 <span class="comment"></span> 00005 <span class="comment">Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</span> 00006 <span class="comment"></span> 00007 <span class="comment">Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.</span> 00008 <span class="comment">Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors</span> 00009 <span class="comment">in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its</span> 00010 <span class="comment">contributors may be used to endorse or promote products derived from this software without specific prior written permission.</span> 00011 <span class="comment"></span> 00012 <span class="comment">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span> 00013 <span class="comment">WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR</span> 00014 <span class="comment">PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,</span> 00015 <span class="comment">INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE</span> 00016 <span class="comment">GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY</span> 00017 <span class="comment">OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span> 00018 <span class="comment">OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span> 00019 <span class="comment"></span> 00020 <span class="comment"> $Id$</span> 00021 <span class="comment"></span> 00022 <span class="comment">**************************************************************************************/</span> 00023 00024 <span class="preprocessor">#ifndef _FDC_H</span> 00025 <span class="preprocessor"></span><span class="preprocessor">#define _FDC_H</span> 00026 <span class="preprocessor"></span> 00027 <span class="preprocessor">#include <ubixos/types.h></span> 00028 00029 <span class="keyword">typedef</span> <span class="keyword">struct </span>DrvGeom { 00030 byte heads; 00031 byte tracks; 00032 byte spt; 00033 } drvGeom; 00034 00035 00036 <span class="preprocessor">#define fdcMsr (0x3f4)</span> 00037 <span class="preprocessor"></span><span class="preprocessor">#define fdcData (0x3f5)</span> 00038 <span class="preprocessor"></span><span class="preprocessor">#define fdcDir (0x3f7)</span> 00039 <span class="preprocessor"></span><span class="preprocessor">#define fdcCcr (0x3f7)</span> 00040 <span class="preprocessor"></span><span class="preprocessor">#define fdcDor (0x3f2)</span> 00041 <span class="preprocessor"></span><span class="preprocessor">#define fdcDrs (0x3f4)</span> 00042 <span class="preprocessor"></span> 00043 <span class="preprocessor">#define cmdWrite (0xc5)</span> 00044 <span class="preprocessor"></span><span class="preprocessor">#define cmdRead (0xe6)</span> 00045 <span class="preprocessor"></span><span class="preprocessor">#define cmdSeek (0x0f)</span> 00046 <span class="preprocessor"></span><span class="preprocessor">#define cmdSensei (0x08)</span> 00047 <span class="preprocessor"></span><span class="preprocessor">#define cmdRecal (0x07)</span> 00048 <span class="preprocessor"></span><span class="preprocessor">#define cmdSpecify (0x03)</span> 00049 <span class="preprocessor"></span> 00050 <span class="preprocessor">#define dg144Heads 2 </span><span class="comment">/* heads per drive (1.44M) */</span> 00051 <span class="preprocessor">#define dg144Tracks 80</span> 00052 <span class="preprocessor"></span><span class="preprocessor">#define dg144Spt 18</span> 00053 <span class="preprocessor"></span><span class="preprocessor">#define dg144Gap3rw 0x1b</span> 00054 <span class="preprocessor"></span><span class="preprocessor">#define dg168Gap3rw 0x1c</span> 00055 <span class="preprocessor"></span> 00056 00057 00058 <span class="keywordtype">void</span> fdcInit(); 00059 <span class="keywordtype">void</span> floppyIsr(); 00060 <span class="keywordtype">void</span> floppyIsrhndlr(); 00061 <span class="keywordtype">void</span> sendByte(<span class="keywordtype">int</span> byte); 00062 <span class="keywordtype">int</span> getByte(); 00063 <span class="keywordtype">bool</span> fdcRw(<span class="keywordtype">int</span> block,byte *blockBuffer,<span class="keywordtype">bool</span> read,<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> numSectors); 00064 <span class="keywordtype">void</span> block2Hts(<span class="keywordtype">int</span> block,<span class="keywordtype">int</span> *head,<span class="keywordtype">int</span> *track,<span class="keywordtype">int</span> *sector); 00065 <span class="keywordtype">void</span> motorOn(<span class="keywordtype">void</span>); 00066 <span class="keywordtype">void</span> motorOff(<span class="keywordtype">void</span>); 00067 <span class="keywordtype">bool</span> seek(<span class="keywordtype">int</span> track); 00068 <span class="keywordtype">bool</span> waitFdc(<span class="keywordtype">bool</span> sensei); 00069 <span class="keywordtype">int</span> getByte(); 00070 <span class="keywordtype">void</span> sendByte(<span class="keywordtype">int</span> byte); 00071 <span class="keywordtype">void</span> recalibrate(<span class="keywordtype">void</span>); 00072 <span class="keywordtype">void</span> reset(<span class="keywordtype">void</span>); 00073 <span class="keywordtype">bool</span> writeBlock(<span class="keywordtype">int</span> block,byte *blockBuffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> numSectors); 00074 <span class="keywordtype">bool</span> readBlock(<span class="keywordtype">int</span> block,byte *blockBuffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> numSectors); 00075 <span class="keywordtype">void</span> fdcWrite(<span class="keywordtype">void</span> *info,<span class="keywordtype">void</span> *,uInt32 startSector,uInt32 sectorCount); 00076 <span class="keywordtype">void</span> fdcRead(<span class="keywordtype">void</span> *info,<span class="keywordtype">void</span> *,uInt32 startSector,uInt32 sectorCount); 00077 00078 <span class="preprocessor">#endif</span> 00079 <span class="preprocessor"></span> </pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Apr 28 17:49:34 2004 for Ubixos by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.3 </small></address> </body> </html>