📄 hybios.h
字号:
/*
**************************************************************
*
* hyperstone MS-DOS FAT File System Drivers
*
* ATA Hard Disk and PC Bios related definitions
*
* Christoph Baumhof 2000-03-21
* Reinhard K乭ne 2000-03-21
* Mihajlo Varga 2000-03-21
*
* Copyright (C) 1997-2000 hyperstone electronics GmbH Konstanz
*
* 2000-03-21 initial release
*
* $Id$
*
* $Log$
*
**************************************************************
*
* Changes:
*
**************************************************************
*/
#ifndef __HYBIOS_H
#define __HYBIOS_H
#include "part.h"
#include "ata.h"
#include "boot.h"
#define MAX_CHANNEL_NUM 2
#define READ_SEC 1
#define WRITE_SEC 0
struct hd_geometry {
void* bootptr[4]; /* points to the 0..3 boot sectors */
unsigned long start;
struct part_tabelle part_tab[4];
unsigned short activ_part; /* active partition */
unsigned short cylinders;
unsigned char heads; /* count of heads */
unsigned char sectors; /* sectors per track */
unsigned char initialized; /* hard disk initialized ? */
unsigned char lba ; /* Bits: 0 DMA, 1 LBA, 2 IORDYsw, 3 IORDYsup */
unsigned long tot_sectors;
};
extern struct hd_geometry _hd_ident[MAX_CHANNEL_NUM*2];
int _install_ATA_sys(int channel, int drive, struct hd_driveid *id,
struct PART_SECT *p_sect,
struct BOOT_SECT *boot_sect);
int r_w_Disk(int drive, unsigned long LogNumber,
unsigned long sect_cnt, unsigned short *buffer, int rw);
/* diskinfo_t structure for _bios_disk() */
struct diskinfo_t {
unsigned int drive, head, track, sector, nsectors;
void *buffer;
};
/* cmd values for _bios_disk() */
#define _DISK_RESET 0 /* controller hard reset */
#define _DISK_STATUS 1 /* status of last operation */
#define _DISK_READ 2 /* read sectors */
#define _DISK_WRITE 3 /* write sectors */
#define _DISK_VERIFY 4 /* verify sectors */
#define _DISK_FORMAT 5 /* format track */
/* cmd values for _bios_keybrd() */
#define _KEYBRD_READ 0 /* read key */
#define _NKEYBRD_READ 0x10 /* read key - enhanced */
#define _KEYBRD_READY 1 /* check key ready */
#define _NKEYBRD_READY 0x11 /* check key ready - enhanced */
#define _KEYBRD_SHIFTSTATUS 2 /* get shift status */
#define _NKEYBRD_SHIFTSTATUS 0x12 /* get shift status - enhanced */
/* cmd values for _bios_printer() */
#define _PRINTER_WRITE 0 /* send a byte to printer */
#define _PRINTER_INIT 1 /* initialize printer */
#define _PRINTER_STATUS 2 /* read printer status */
/* cmd values for _bios_serialcom() */
#define _COM_INIT 0 /* set communication parms to a byte */
#define _COM_SEND 1 /* send a byte to port */
#define _COM_RECEIVE 2 /* read character from port */
#define _COM_STATUS 3 /* get status of port */
/* byte values for _COM_INIT cmd of _bios_serialcom() */
#define _COM_CHR7 0x02 /* 7 data bits */
#define _COM_CHR8 0x03 /* 8 data bits */
#define _COM_STOP1 0x00 /* 1 stop bit */
#define _COM_STOP2 0x04 /* 2 stop bits */
#define _COM_NOPARITY 0x00 /* no parity */
#define _COM_EVENPARITY 0x18 /* even parity */
#define _COM_ODDPARITY 0x08 /* odd parity */
#define _COM_110 0x00 /* 110 baud */
#define _COM_150 0x20 /* 150 baud */
#define _COM_300 0x40 /* 300 baud */
#define _COM_600 0x60 /* 600 baud */
#define _COM_1200 0x80 /* 1200 baud */
#define _COM_2400 0xa0 /* 2400 baud */
#define _COM_4800 0xc0 /* 4800 baud */
#define _COM_9600 0xe0 /* 9600 baud */
/* cmd values for _bios_timeofday() */
#define _TIME_GETCLOCK 0 /* get clock count */
#define _TIME_SETCLOCK 1 /* set clock count */
unsigned _bios_equiplist(void);
unsigned _bios_disk(unsigned __cmd, struct diskinfo_t *__dinfo);
unsigned _bios_keybrd(unsigned __cmd);
unsigned _bios_memsize(void);
unsigned _bios_printer(unsigned __cmd, unsigned __port, unsigned __abyte);
unsigned _bios_serialcom(unsigned __cmd, unsigned __port, unsigned __abyte);
unsigned _bios_timeofday(unsigned __cmd, long *__timeval);
#endif /* __HYBIOS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -