#include "define.h"
#include <dos.h>
#include <stdio.h>
#include "ide.h"
#include "rtxapi.h"
#include "rtos.h"
#include "hwapi.h"
Go to the source code of this file.
Defines | |
#define | IDE_IDENTIFY (uchar)0xEC |
#define | IDE_READ_SECTOR (uchar)0x20 |
#define | IDE_WRITE_SECTOR (uchar)0x30 |
#define | IDE_VERIFY_SECTOR (uchar)0x40 |
#define | IDE_SEEK (uchar)0x70 |
#define | IDE_SET_FEATURES (uchar)0xEF |
#define | IDE_STANDBY (uchar)0xE2 |
#define | IDE_IDLE_MODE (uchar)0xE3 |
#define | IDE_SET_DRV_PARAM (uchar)0x91 |
#define | IDE_RECALIBRATE (uchar)0x10 |
#define | IDE_DATA (IDE_PORT0 + 0) |
#define | IDE_FEATURE (IDE_PORT0 + 1) |
#define | IDE_ERROR (IDE_PORT0 + 1) |
#define | IDE_COUNT (IDE_PORT0 + 2) |
#define | IDE_SECTOR (IDE_PORT0 + 3) |
#define | IDE_CYL_LO (IDE_PORT0 + 4) |
#define | IDE_CYL_HI (IDE_PORT0 + 5) |
#define | IDE_HEAD (IDE_PORT0 + 6) |
#define | IDE_COMMAND (IDE_PORT0 + 7) |
#define | IDE_STATUS (IDE_PORT0 + 7) |
#define | IDE_CONTROL (IDE_PORT1 + 6) |
#define | IDE_ALT_STS (IDE_PORT1 + 6) |
#define | IDE_ADDRESS (IDE_PORT1 + 7) |
#define | IDE_STS_BSY (uchar)0x80 |
#define | IDE_STS_DRDY (uchar)0x40 |
#define | IDE_STS_DWF (uchar)0x20 |
#define | IDE_STS_DSC (uchar)0x10 |
#define | IDE_STS_DRQ (uchar)0x08 |
#define | IDE_STS_CORR (uchar)0x04 |
#define | IDE_STS_ERR (uchar)0x01 |
#define | IDE_ERR_BBK (uchar)0x80 |
#define | IDE_ERR_UNC (uchar)0x40 |
#define | IDE_ERR_TMOUT (uchar)0x20 |
#define | IDE_ERR_IDNF (uchar)0x10 |
#define | IDE_ERR_ABRT (uchar)0x04 |
#define | IDE_ERR_TK0NF (uchar)0x02 |
#define | IDE_ERR_AMNF (uchar)0x01 |
#define | ID_CYL 1 |
#define | ID_HEADS 3 |
#define | ID_SECT 6 |
Typedefs | |
typedef unsigned char | uchar |
typedef unsigned int | uint |
Functions | |
uchar near | IDE_waitirq (void) |
uchar near | IDE_waitdrq (void) |
uchar near | IDE_datarequest (void) |
uchar near | IDE_error (void) |
uchar near | IDE_status (void) |
uchar near | IDE_command (uchar feat, uint cyl, uchar head, uchar sect, uchar cnt, uchar cmd) |
uchar near | IDE_LBA_command (uchar feat, unsigned long sector, uchar cnt, uchar cmd) |
void | IDE_bit_mode (void) |
void | IDE_reset (void) |
int | IDE_LBA_read (unsigned long sector, int cnt, unsigned char *buf) |
int | IDE_LBA_write (unsigned long sector, int cnt, unsigned char *buf) |
int | IDE_read (int cyl, int head, int sect, int cnt, unsigned char *buf) |
int | IDE_write (int cyl, int head, int sect, int cnt, unsigned char *buf) |
int | IDE_ReadSRAM (unsigned char *bfr) |
int | IDE_WriteSRAM (unsigned char *bfr) |
int | IDE_identify (void) |
Variables | |
uchar | err |
uchar | sts |
T_DRIVE_PARAM | drive = {0} |
|
Definition at line 519 of file ide.c. Referenced by IDE_identify(). |
|
Definition at line 520 of file ide.c. Referenced by IDE_identify(). |
|
Definition at line 521 of file ide.c. Referenced by IDE_identify(). |
|
|
|
|
|
Definition at line 52 of file ide.c. Referenced by IDE_command(), IDE_identify(), IDE_LBA_command(), IDE_ReadSRAM(), and IDE_WriteSRAM(). |
|
Definition at line 55 of file ide.c. Referenced by IDE_command(), IDE_LBA_command(), and IDE_reset(). |
|
Definition at line 47 of file ide.c. Referenced by IDE_command(), and IDE_LBA_command(). |
|
Definition at line 50 of file ide.c. Referenced by IDE_command(), and IDE_LBA_command(). |
|
Definition at line 49 of file ide.c. Referenced by IDE_command(), and IDE_LBA_command(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 77 of file ide.c. Referenced by IDE_waitirq(). |
|
|
|
Definition at line 46 of file ide.c. Referenced by IDE_error(). |
|
Definition at line 45 of file ide.c. Referenced by IDE_command(), IDE_LBA_command(), and IDE_waitirq(). |
|
Definition at line 51 of file ide.c. Referenced by IDE_command(), IDE_identify(), IDE_LBA_command(), IDE_ReadSRAM(), and IDE_WriteSRAM(). |
|
Definition at line 33 of file ide.c. Referenced by IDE_identify(). |
|
|
|
Definition at line 34 of file ide.c. Referenced by IDE_LBA_read(), and IDE_read(). |
|
|
|
Definition at line 48 of file ide.c. Referenced by IDE_command(), and IDE_LBA_command(). |
|
|
|
|
|
Definition at line 38 of file ide.c. Referenced by IDE_bit_mode(). |
|
|
|
Definition at line 53 of file ide.c. Referenced by IDE_status(). |
|
Definition at line 63 of file ide.c. Referenced by IDE_reset(), and IDE_waitirq(). |
|
|
|
Definition at line 64 of file ide.c. Referenced by IDE_waitirq(). |
|
Definition at line 67 of file ide.c. Referenced by IDE_datarequest(). |
|
Definition at line 66 of file ide.c. Referenced by IDE_waitirq(). |
|
Definition at line 65 of file ide.c. Referenced by IDE_error(). |
|
Definition at line 69 of file ide.c. Referenced by IDE_error(). |
|
|
|
Definition at line 35 of file ide.c. Referenced by IDE_LBA_write(), and IDE_write(). |
|
Definition at line 87 of file ide.c. Referenced by IDE_command(), and IDE_LBA_command(). |
|
Definition at line 88 of file ide.c. Referenced by IDE_identify(). |
|
Definition at line 290 of file ide.c. References IDE_command(), IDE_SET_FEATURES, and IDE_waitirq(). Referenced by IDE_identify(), and IDE_reset(). |
|
Definition at line 163 of file ide.c. References hal_outportb, IDE_COMMAND, IDE_CONTROL, IDE_COUNT, IDE_CYL_HI, IDE_CYL_LO, IDE_FEATURE, IDE_HEAD, IDE_SECTOR, IDE_waitdrq(), and uchar. Referenced by IDE_bit_mode(), IDE_read(), and IDE_write(). |
|
Definition at line 130 of file ide.c. References IDE_status(), and IDE_STS_DRQ. Referenced by IDE_identify(), and IDE_waitdrq(). |
|
Definition at line 274 of file ide.c. References err, hal_inportb, IDE_ERROR, IDE_status(), IDE_STS_DWF, IDE_STS_ERR, and sts. Referenced by IDE_identify(), IDE_LBA_read(), IDE_LBA_write(), IDE_read(), and IDE_write(). |
|
Definition at line 527 of file ide.c. References T_DRIVE_PARAM::cylinders, hal_outportb, T_DRIVE_PARAM::heads, T_DRIVE_PARAM::id, ID_CYL, ID_HEADS, ID_SECT, IDE_bit_mode(), IDE_COMMAND, IDE_datarequest(), IDE_error(), IDE_HEAD, IDE_IDENTIFY, IDE_reset(), IDE_waitdrq(), T_DRIVE_PARAM::sector_size, T_DRIVE_PARAM::sectors, and uint. |
|
Definition at line 182 of file ide.c. References hal_outportb, IDE_COMMAND, IDE_CONTROL, IDE_COUNT, IDE_CYL_HI, IDE_CYL_LO, IDE_FEATURE, IDE_HEAD, IDE_SECTOR, IDE_waitdrq(), and uchar. Referenced by IDE_LBA_read(), and IDE_LBA_write(). |
|
Definition at line 340 of file ide.c. References IDE_error(), IDE_LBA_command(), IDE_READ_SECTOR, and IDE_waitdrq(). |
|
Definition at line 377 of file ide.c. References IDE_error(), IDE_LBA_command(), IDE_waitdrq(), IDE_waitirq(), and IDE_WRITE_SECTOR. |
|
Definition at line 419 of file ide.c. References IDE_command(), IDE_error(), IDE_READ_SECTOR, and IDE_waitdrq(). |
|
Definition at line 483 of file ide.c. References hal_outportb, IDE_COMMAND, IDE_HEAD, and IDE_waitdrq(). |
|
Definition at line 300 of file ide.c. References hal_outportb, IDE_bit_mode(), IDE_CONTROL, IDE_status(), IDE_STS_BSY, IDE_waitirq(), and RTX_Sleep_Time(). Referenced by IDE_identify(). |
|
Definition at line 206 of file ide.c. References hal_inportb, IDE_STATUS, and sts. Referenced by IDE_datarequest(), IDE_error(), IDE_reset(), and IDE_waitirq(). |
|
Definition at line 120 of file ide.c. References IDE_datarequest(), and IDE_waitirq(). Referenced by IDE_command(), IDE_identify(), IDE_LBA_command(), IDE_LBA_read(), IDE_LBA_write(), IDE_read(), IDE_ReadSRAM(), IDE_write(), and IDE_WriteSRAM(). |
|
Definition at line 139 of file ide.c. References hal_outportb, IDE_ERR_TMOUT, IDE_FEATURE, IDE_status(), IDE_STS_BSY, IDE_STS_DRDY, IDE_STS_DSC, and RTX_Get_System_Ticks(). Referenced by IDE_bit_mode(), IDE_LBA_write(), IDE_reset(), IDE_waitdrq(), and IDE_write(). |
|
Definition at line 450 of file ide.c. References IDE_command(), IDE_error(), IDE_waitdrq(), IDE_waitirq(), and IDE_WRITE_SECTOR. |
|
Definition at line 502 of file ide.c. References hal_outportb, IDE_COMMAND, IDE_HEAD, and IDE_waitdrq(). |
|
|
|
Definition at line 100 of file ide.c. Referenced by IDE_error(). |
|
Definition at line 100 of file ide.c. Referenced by IDE_error(), and IDE_status(). |