BarryServer : Git

All the code for all my projects
// BarryServer : Git / Orion / blob / 7ae31b03c38925f5d527e6303765925586731209 / drivers / drivers.h

// Related

Orion

Barry Importing existing Orion kernel d41a53c (2 years, 4 months ago)
#ifndef KERNEL_DRIVERS_H
#define KERNEL_DRIVERS_H

#include <sys/types.h>
#include "../vfs/vfs.h"

#define MKDEV(maj, min) ((dev_t) (((maj & 0xFFFF) << 16) | (min & 0xFFFF)))
#define MAJOR(dev) ((dev >> 16) & 0xFFFF)
#define MINOR(dev) (dev & 0xFFFF)

typedef struct Driver Driver;

/* Structure for a Driver */
struct Driver {
	unsigned short major;
	FileOps *ops;
	Driver *next;
};

extern Driver *drivers;

void init_drivers(void);
void register_driver(Driver *driver);

/* Drivers */
void ide_init(uint8_t bus, uint8_t slot, uint8_t func);
void rtl8139_init(uint8_t bus, uint8_t dev, uint8_t func);
void bga_init(uint8_t bus, uint8_t slot, uint8_t func);

#endif