⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 devtable.c

📁 嵌入式操作系统Nucleus Plus中使用的文件系统
💻 C
字号:
/*
* EBS - RTFS (Real Time File Manager)
*
* Copyright Peter Van Oudenaren , 1993
* All rights reserved.
* This code may not be redistributed in source or linkable object form
* without the consent of its author.
*/
/***************************************************************************
PC_DEVICE - User supplied Device driver. 

        This now contains the PC_BDEVSW table. Routines in RTFS which
        need IO call the device drivers directly through the pc_bdevsw
        table. This model is much cleaner and eliminates a lot of layering.

        When you have your device drivers written plug them into this table.
        
        Call EBS if you haven't written your drivers yet. We may have one 
        available.
*
******************************************************************************/

#include "pcdisk.h"

/* Ramdisk */
#if (RAMDISK)
IMPORT BOOL pc_rd_open(UCOUNT driveno);
IMPORT BOOL pc_rd_raw_open(UCOUNT driveno);
IMPORT BOOL pc_rd_close(UCOUNT driveno);
IMPORT BOOL pc_rd_io(UCOUNT driveno, ULONG block, VOID FAR *buffer, UCOUNT count, BOOL do_read);
IMPORT BOOL pc_rd_ioctl(UCOUNT driveno, UCOUNT command, VOID *buffer);
_PC_BDEVSW pc_bdevsw[] = {
    {0,  pc_rd_open, pc_rd_raw_open, pc_rd_close, pc_rd_io, pc_rd_ioctl},
};
#endif

#if (EBS_IDE)

BOOL nodev_ioctl(UCOUNT driveno, UCOUNT command, VOID *buffer) { return(NO); }
BOOL nodev_init_drive(COUNT driveno) { return(NO); }
BOOL nodev_open(UCOUNT driveno) { return(NO); }
BOOL nodev_raw_open(UCOUNT driveno) { return(NO); }
BOOL nodev_close(UCOUNT driveno) { return(NO); }
BOOL nodev_io(UCOUNT driveno, ULONG sector, VOID FAR *buffer, UCOUNT count, BOOL reading) { return(NO); }

IMPORT BOOL ide_ioctl(UCOUNT driveno, UCOUNT command, VOID *buffer);
IMPORT BOOL ide_init_drive(COUNT driveno);
IMPORT BOOL ide_open(UCOUNT driveno);
IMPORT BOOL ide_raw_open(UCOUNT driveno);
IMPORT BOOL ide_close(UCOUNT driveno);
IMPORT BOOL ide_io(UCOUNT driveno, ULONG sector, VOID FAR *buffer, UCOUNT count, BOOL reading);

_PC_BDEVSW pc_bdevsw[] = {
    {0,  nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl },		/* A: */
    {0,   nodev_open, nodev_raw_open, nodev_close, nodev_io, nodev_ioctl },		/* B: */
    {1,  ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl },				/* C: */
    {1,  ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl },				/* D: */
    {1,  ide_open, ide_raw_open, ide_close, ide_io, ide_ioctl },				/* E: */
};

#endif


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -