BarryServer : Git

All the code for all my projects
// BarryServer : Git / Orion / commit / d41a53cbc7d055b1c00cf0a339dbed6925f4f02c / drivers / drivers.h

// Related

Orion

Barry Importing existing Orion kernel d41a53c (2 years, 4 months ago)
diff --git a/drivers/drivers.h b/drivers/drivers.h
new file mode 100644
index 0000000..47cd243
--- /dev/null
+++ b/drivers/drivers.h
@@ -0,0 +1,30 @@
+#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