Add pci_device_drivers, IDE driver
diff --git a/src/kernel/dri/ide/Jmk b/src/kernel/dri/ide/Jmk
new file mode 100644
index 0000000..675af5a
--- /dev/null
+++ b/src/kernel/dri/ide/Jmk
@@ -0,0 +1,17 @@
+init(ide, ide.a)
+
+preset(freestanding)
+preset(optimize)
+preset(debug)
+preset(32)
+preset(warn)
+
+archetype(c)
+
+CFLAGS += -I$(ROOT)/include/kernel
+
+OBJECTS = ide.o
+
+type(static_lib)
+
+finish
diff --git a/src/kernel/dri/ide/ide.c b/src/kernel/dri/ide/ide.c
new file mode 100644
index 0000000..c5a5241
--- /dev/null
+++ b/src/kernel/dri/ide/ide.c
@@ -0,0 +1,42 @@
+#include <dri/ide/ide.h>
+#include <task.h>
+#include <alloc.h>
+
+struct ide_thread_data
+{
+ struct pci_device dev;
+ uchar bus, slot, func;
+};
+
+bool ide_supports(struct pci_device *dev)
+{
+ return dev->class == 1 && dev->subclass == 1;
+}
+
+void ide_thread(struct ide_thread_data *data)
+{
+ kprintf("IDE driver thread starting: device=0x%x\n", data->dev.device_id);
+}
+
+void ide_init(struct pci_device dev, uchar bus, uchar slot, uchar func)
+{
+ struct ide_thread_data *data = malloc(sizeof(struct ide_thread_data));
+ data->dev = dev;
+ data->bus = bus;
+ data->slot = slot;
+ data->func = func;
+
+ spawn_thread(ide_thread, data);
+}
+
+void ide_register()
+{
+ struct pci_device_driver dri =
+ {
+ .supports = ide_supports,
+ .init = ide_init,
+ .generic_name = "IDE Controller",
+ };
+
+ pci_register_device_driver(dri);
+}