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

📄 device.h

📁 很好的一个微型操作系统源码
💻 H
字号:
#ifndef KERNAL_DEVICE_INCLUDED
#define KERNAL_DEVICE_INCLUDED

#include "types.h"

struct driver_object
{
	int32 (*init)();
	pvoid (*open)(int8*);
	void  (*close)(pvoid);
	int32 (*write)(pvoid, uint8*, uint32);
	int32 (*read)(pvoid, uint8*, uint32);
	int32 (*ioctrl)(pvoid, uint32, uint8 *, uint32, uint8 *, uint32 *);
	int32 (*status)(pvoid);
	int8* drivername;
};

struct device_object
{
	struct driver_object* driver;
	pvoid device_data;
};

int32 keLoadDriver(struct driver_object *driver);
pvoid open(int8 *path);
void close(pvoid device);
int32 read(pvoid device, uint8 *inbuf, uint32 size);
int32 write(pvoid device, uint8 *outbuf, uint32 size);
int32 ioctrl(pvoid device, uint32 command, uint8 *inbuf, uint32 insize, uint8 *outbuf, uint32 *outsize);
int32 status(pvoid device);


extern struct driver_object console_driver_object;
extern struct driver_object keyboard_driver_object;
#endif

⌨️ 快捷键说明

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