资源简介
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
相关资源
- STM32F103RC+ADC+DMA多通道采样LCD显示
- OSG 72集视频教程和资料140620
- 51 单片机 红外避障小车 大集合136
- ENVI 5.0 sp3 - 64 Bit 破解
- EPSON XP225 xp235 xp245打印机清零软件+教
- I2C读写AT24C02 基于STM32F103 cube116540
- IAR FOR 430 破解工具
- radmin3.5.2.1完美破解版(支持win10)8
- S7-300全套模块接线图
- bp神经网络源代码,可直接运行
- 基于stm32f103ve的程序——跑马灯实验
- PNG加密解密工具73383
- 西门坡论坛pb框架 普通版 2.0 非常漂
- 基于STM32RCT6的步进电机驱动程序
- 三菱fx3u解密软件
- vspd7.2.308.zip
- pthreads-w32-2-9-1-release.zip
- SpringBoot+H2+mybatis-plus59130
- flash3.0小游戏
- Navicat Premium 15汉化包.zip55438
- res10_300x300_ssd_iter_140000.caffemodel与dep
- stm32f407上的两个can发送和接收例程
- 04741计算机网络原理知识点整理.docx(
- scratch3.0 源程序(说相声)
- STM32 led 时钟
- STM32 2.4G通信例程
- GBT 15532-2008 计算机软件测试规范
- Scratch 飞机大战.sb3
- 秒杀360加壳.rar
- Scratch 吃豆人追踪者.sb3
评论
共有 条评论