diff --git a/src/include/hlib.h b/src/include/hlib.h index c75670a..c5efc24 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -88,6 +88,7 @@ static uint32_t serviceId, functionId, initialized = false; \ if (!initialized) { \ while (!serviceId) { \ + loadFromInitrd(service); \ serviceId = getService(service); \ serviceId = getService(service); \ } \ diff --git a/src/include/hlib.h b/src/include/hlib.h index c75670a..c5efc24 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -88,6 +88,7 @@ static uint32_t serviceId, functionId, initialized = false; \ if (!initialized) { \ while (!serviceId) { \ + loadFromInitrd(service); \ serviceId = getService(service); \ serviceId = getService(service); \ } \ diff --git a/src/userland/scisi/main.c b/src/userland/scisi/main.c new file mode 100644 index 0000000..f2e8ee8 --- /dev/null +++ b/src/userland/scisi/main.c @@ -0,0 +1,10 @@ +#include + +int32_t registerDevice(uint32_t in, uint32_t out, uint32_t serviceName, uint32_t serviceId) { + printf("registering a new SCISI device...\n"); +} + +int32_t main() { + createFunction("register", (void *)registerDevice); + return 0; +} \ No newline at end of file diff --git a/src/include/hlib.h b/src/include/hlib.h index c75670a..c5efc24 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -88,6 +88,7 @@ static uint32_t serviceId, functionId, initialized = false; \ if (!initialized) { \ while (!serviceId) { \ + loadFromInitrd(service); \ serviceId = getService(service); \ serviceId = getService(service); \ } \ diff --git a/src/userland/scisi/main.c b/src/userland/scisi/main.c new file mode 100644 index 0000000..f2e8ee8 --- /dev/null +++ b/src/userland/scisi/main.c @@ -0,0 +1,10 @@ +#include + +int32_t registerDevice(uint32_t in, uint32_t out, uint32_t serviceName, uint32_t serviceId) { + printf("registering a new SCISI device...\n"); +} + +int32_t main() { + createFunction("register", (void *)registerDevice); + return 0; +} \ No newline at end of file diff --git a/src/userland/usbStorage/include/storage.h b/src/userland/usbStorage/include/storage.h index da2e7a8..4049225 100644 --- a/src/userland/usbStorage/include/storage.h +++ b/src/userland/usbStorage/include/storage.h @@ -6,6 +6,7 @@ typedef struct { uint32_t serviceId; uint32_t deviceId; + uint32_t id; } StorageDevice; typedef enum UsbStorageSubClass { diff --git a/src/include/hlib.h b/src/include/hlib.h index c75670a..c5efc24 100644 --- a/src/include/hlib.h +++ b/src/include/hlib.h @@ -88,6 +88,7 @@ static uint32_t serviceId, functionId, initialized = false; \ if (!initialized) { \ while (!serviceId) { \ + loadFromInitrd(service); \ serviceId = getService(service); \ serviceId = getService(service); \ } \ diff --git a/src/userland/scisi/main.c b/src/userland/scisi/main.c new file mode 100644 index 0000000..f2e8ee8 --- /dev/null +++ b/src/userland/scisi/main.c @@ -0,0 +1,10 @@ +#include + +int32_t registerDevice(uint32_t in, uint32_t out, uint32_t serviceName, uint32_t serviceId) { + printf("registering a new SCISI device...\n"); +} + +int32_t main() { + createFunction("register", (void *)registerDevice); + return 0; +} \ No newline at end of file diff --git a/src/userland/usbStorage/include/storage.h b/src/userland/usbStorage/include/storage.h index da2e7a8..4049225 100644 --- a/src/userland/usbStorage/include/storage.h +++ b/src/userland/usbStorage/include/storage.h @@ -6,6 +6,7 @@ typedef struct { uint32_t serviceId; uint32_t deviceId; + uint32_t id; } StorageDevice; typedef enum UsbStorageSubClass { diff --git a/src/userland/usbStorage/main.c b/src/userland/usbStorage/main.c index ce9d5e5..19b6e3a 100644 --- a/src/userland/usbStorage/main.c +++ b/src/userland/usbStorage/main.c @@ -30,6 +30,9 @@ "Unknown" }; +REQUEST(registerScisi, "scisi", "register"); +ListElement *devices; + void setup(uint32_t in, uint32_t out, uint32_t serviceName, uint32_t serviceId) { uint32_t getType = getFunction(serviceId, "get_type"); UsbInterfaceType typeIn = { .value = request(serviceId, getType, in, 0) }; @@ -71,6 +74,11 @@ } StorageDevice *device = malloc(sizeof(StorageDevice)); device->serviceId = serviceId; + device->id = listCount(devices); + listAdd(&devices, device); + if (subClass == SCISI_Transparent && protocol == BulkOnly) { + registerScisi(device->id, 0); + } } int32_t main() {