diff --git a/libnxdrv/inc/libnxdrv.h b/libnxdrv/inc/libnxdrv.h index 974bb36..153f2fd 100644 --- a/libnxdrv/inc/libnxdrv.h +++ b/libnxdrv/inc/libnxdrv.h @@ -1,8 +1,37 @@ // This file is part of noxos and licensed under the MIT open source license -#ifndef NOXOS_LIBNXDRV_H -#define NOXOS_LIBNXDRV_H +#ifndef LIBNXDRV_LIBNXDRV_H +#define LIBNXDRV_LIBNXDRV_H -void nx_drv_init(); +#include "stdtypes.h" -#endif //NOXOS_LIBNXDRV_H \ No newline at end of file +typedef struct { + uint16_t vendor_id; + uint16_t device_id; +} __attribute__((packed)) nx_drv_device_id_T; + +typedef struct { + bool enable_progif; + uint8_t class; + uint8_t subclass; + uint8_t progif; + uint16_t num_device_ids; + nx_drv_device_id_T device_ids; +} __attribute__((packed)) nx_drv_config_pci_T; + +typedef struct { + uint8_t min_version; + uint16_t num_device_ids; + nx_drv_device_id_T device_ids; +} __attribute__((packed)) nx_drv_config_usb_T; + +typedef struct { + uint8_t gpt_guid[16]; + uint8_t mbr_type; +} __attribute__((packed)) nx_drv_config_fs_T; + +void nx_drv_pci_config(nx_drv_config_pci_T* config); +void nx_drv_usb_config(nx_drv_config_usb_T* config); +void nx_drv_fs_config (nx_drv_config_fs_T* config); + +#endif //LIBNXDRV_LIBNXDRV_H \ No newline at end of file diff --git a/libnxdrv/inc/stdtypes.h b/libnxdrv/inc/stdtypes.h new file mode 100644 index 0000000..d9bcf99 --- /dev/null +++ b/libnxdrv/inc/stdtypes.h @@ -0,0 +1,22 @@ +// This file is part of noxos and licensed under the MIT open source license + +#ifndef LIBNXDRV_STDTYPES_H +#define LIBNXDRV_STDTYPES_H + +typedef unsigned char uint8_t; +typedef signed char int8_t; +typedef unsigned short uint16_t; +typedef signed short int16_t; +typedef unsigned int uint32_t; +typedef signed int int32_t; +typedef unsigned long uint64_t; +typedef signed long int64_t; + +typedef _Bool bool; + +#define true 1 +#define false 0 + +#define NULL (void*)0 + +#endif //LIBNXDRV_STDTYPES_H diff --git a/libnxdrv/src/libnxdrv.c b/libnxdrv/src/libnxdrv.c index 3138f00..8303619 100644 --- a/libnxdrv/src/libnxdrv.c +++ b/libnxdrv/src/libnxdrv.c @@ -1,5 +1,15 @@ // This file is part of noxos and licensed under the MIT open source license -void nx_drv_init() { +#include "libnxdrv.h" + +void nx_drv_pci_config(nx_drv_config_pci_T* config) { + +} + +void nx_drv_usb_config(nx_drv_config_usb_T* config) { + +} + +void nx_drv_fs_config(nx_drv_config_fs_T* config) { } \ No newline at end of file