资源简介
minix 3 源代码 操作系统 os 教学
代码片段和文件信息
/* This file contains the device dependent part of a driver for the IBM-AT
* winchester controller. Written by Adri Koppes.
*
* The file contains one entry point:
*
* at_winchester_task: main entry when system is brought up
*
* Changes:
* Aug 19 2005 ata pci support supports SATA (Ben Gras)
* Nov 18 2004 moved AT disk driver to user-space (Jorrit N. Herder)
* Aug 20 2004 watchdogs replaced by sync alarms (Jorrit N. Herder)
* Mar 23 2000 added ATAPI CDROM support (Michael Temari)
* May 14 2000 d-d/i rewrite (Kees J. Bot)
* Apr 13 1992 device dependent/independent split (Kees J. Bot)
*/
#include “at_wini.h“
#include “../libpci/pci.h“
#include
#include
#include
#define ATAPI_DEBUG 0 /* To debug ATAPI code. */
/* I/O Ports used by winchester disk controllers. */
/* Read and write registers */
#define REG_CMD_base0 0x1F0 /* command base register of controller 0 */
#define REG_CMD_base1 0x170 /* command base register of controller 1 */
#define REG_CTL_base0 0x3F6 /* control base register of controller 0 */
#define REG_CTL_base1 0x376 /* control base register of controller 1 */
#define REG_DATA 0 /* data register (offset from the base reg.) */
#define REG_PRECOMP 1 /* start of write precompensation */
#define REG_COUNT 2 /* sectors to transfer */
#define REG_SECTOR 3 /* sector number */
#define REG_CYL_LO 4 /* low byte of cylinder number */
#define REG_CYL_HI 5 /* high byte of cylinder number */
#define REG_LDH 6 /* lba drive and head */
#define LDH_DEFAULT 0xA0 /* ECC enable 512 bytes per sector */
#define LDH_LBA 0x40 /* Use LBA addressing */
#define ldh_init(drive) (LDH_DEFAULT | ((drive) << 4))
/* Read only registers */
#define REG_STATUS 7 /* status */
#define STATUS_BSY 0x80 /* controller busy */
#define STATUS_RDY 0x40 /* drive ready */
#define STATUS_WF 0x20 /* write fault */
#define STATUS_SC 0x10 /* seek complete (obsolete) */
#define STATUS_DRQ 0x08 /* data transfer request */
#define STATUS_CRD 0x04 /* corrected data */
#define STATUS_IDX 0x02 /* index pulse */
#define STATUS_ERR 0x01 /* error */
#define STATUS_ADMBSY 0x100 /* administratively busy (software) */
#define REG_ERROR 1 /* error code */
#define ERROR_BB 0x80 /* bad block */
#define ERROR_ECC 0x40 /* bad ecc bytes */
#define ERROR_ID 0x10 /* id not found */
#define ERROR_AC 0x04 /* aborted command */
#define ERROR_TK 0x02 /* track zero error */
#define ERROR_DM 0x01 /* no data address mark */
/* Write only registers */
#define REG_COMMAND 7 /* command */
#define CMD_IDLE 0x00 /* for w_command: drive idle */
#define CMD_RECALIBRATE 0x10 /* recalibrate drive */
#define CMD_READ 0x20 /* read data */
#define CMD_READ_EXT 0x24 /* read data (LBA48 addressed) */
#define CMD_WRITE 0x30 /* write data */
#define CMD_WRITE_EXT 0x34 /* write data (LBA48 addres
- 上一篇:质检机构检验报告管理系统
- 下一篇:中华会计网校会计人员继续教育挂机助手V9.exe
相关资源
- SimplePath 1.11(最新完整版)
- STM32F103ZE编码器脉冲计数值读取
- 城市生长插件的使用方法附插件
- vitess交换芯片开发总结
- md3loader,导入md3模型源程序
- GBT21063-2007政务信息资源目录体系(完
- 百度网盘批量转存工具2.3附详细使用
- Activity间图片传递3种方法
- altium designer cc2530 PCB库原理图文件pc
- socketdemo193608
- STM32F429IGT6开发版原理图及器件封装
- EPPlus 4.5.3.1
- Magic cube.rar
- STM32F10XX参考手册中文版.PDF
- 基于STM32的mp3播放器设计193488
- mtk2503 gps 北斗测试工具
- stm32F30x的ADC采样的傅里叶变换
- 实验9X stm32F407zgt6_PWM控制SG90输出实验
- AES算法实现源代码
- stm32各种应用的论文
- QCA9377-3 QCA1023 QDART User Guide
- LUA 5.1 5.2 5.3 中文文档中文手册
- STM32F411系列数据手册
- msp430电子密码锁
- Kettle 7.1 中文使用手册.docx.zip193183
- 餐饮管理系统源码20140319
- 基于web投票系统(20131112
- QRCode_QR码生成代码库(带范例)源码
- 台球厅管理系统源码20130321
- 商家产品展示网站源码20121013
评论
共有 条评论