FWMIC - FreeWorld Management Instrumentation and Control
Overview
FWMIC (FreeWorld Management Instrumentation and Control) is a WMI-like system that provides a consistent model for accessing management data from the operating system, hardware, and applications. It enables:
- Hardware Inventory: Computer system, processor, memory, disk information
- Software Inventory: OS version, BIOS information, installed software
- Event Notification: System events and notifications
- Security Configuration: Security settings and auditing
- Health and Status Reporting: System health monitoring
- Remote Management: Remote system management capabilities
- Scripting and Automation: WQL-like query language
- Third-Party Integration: Extensible provider architecture
Status: FWMIC core engine and basic providers are complete. Extensible architecture allows adding new providers.
Architecture
Core Components
- FWMIC Engine: Query engine and provider management
- Providers: Data source implementations (ComputerSystem, Processor, Memory, etc.)
- Objects: Data instances with properties
- Query Language: WQL-like query syntax
Data Structures
// FWMIC Object Types
typedef enum {
FWMIC_OBJECT_COMPUTERSYSTEM,
FWMIC_OBJECT_PROCESSOR,
FWMIC_OBJECT_MEMORY,
FWMIC_OBJECT_DISK,
FWMIC_OBJECT_NETWORK,
FWMIC_OBJECT_SERVICE,
FWMIC_OBJECT_PROCESS,
FWMIC_OBJECT_OS,
FWMIC_OBJECT_BIOS,
FWMIC_OBJECT_SOFTWARE
} fwmic_object_type_t;
// FWMIC Property
typedef struct fwmic_property {
char* name;
char* value;
struct fwmic_property* next;
} fwmic_property_t;
// FWMIC Object Instance
typedef struct fwmic_object {
fwmic_object_type_t type;
fwmic_property_t* properties;
struct fwmic_object* next;
} fwmic_object_t;
// FWMIC Provider Interface
typedef struct fwmic_provider {
const char* name;
fwmic_object_type_t object_type;
int (*enumerate)(fwmic_object_t** objects);
int (*get_property)(fwmic_object_t* obj, const char* prop_name, char* value, size_t value_size);
int (*set_property)(fwmic_object_t* obj, const char* prop_name, const char* value);
struct fwmic_provider* next;
} fwmic_provider_t;
Built-in Providers
ComputerSystem Provider
Provides computer system information:
Name: Computer name/hostnameNumberOfProcessors: Number of processors
Processor Provider
Provides processor information:
NumberOfCores: Number of CPU coresProcessorType: Processor typeArchitecture: CPU architecture (x86_64, etc.)
Memory Provider
Provides memory information:
TotalPhysicalMemory: Total physical memoryAvailablePhysicalMemory: Available physical memory
OS Provider
Provides operating system information:
Name: OS nameVersion: OS versionManufacturer: OS manufacturerHostOSVersion: Host OS version (if running in compatibility mode)
BIOS Provider
Provides BIOS information:
Manufacturer: BIOS manufacturerVersion: BIOS versionReleaseDate: BIOS release date
Disk Provider
Provides disk information (stub implementation):
- Disk enumeration and properties (to be implemented)
API Functions
Engine Management
| Function | Description | Returns |
|---|---|---|
fwmic_init() |
Initialize FWMIC engine and register built-in providers | fwmic_engine_t* |
fwmic_shutdown(engine) |
Shutdown FWMIC engine and cleanup | void |
fwmic_register_provider(engine, provider) |
Register a custom provider | int (0 on success) |
Query Functions
| Function | Description | Returns |
|---|---|---|
fwmic_query(engine, query, results) |
Execute WQL-like query | int (0 on success) |
fwmic_free_objects(objects) |
Free query results | void |
Provider Creation
| Function | Description | Returns |
|---|---|---|
fwmic_create_computersystem_provider() |
Create ComputerSystem provider | fwmic_provider_t* |
fwmic_create_processor_provider() |
Create Processor provider | fwmic_provider_t* |
fwmic_create_memory_provider() |
Create Memory provider | fwmic_provider_t* |
fwmic_create_disk_provider() |
Create Disk provider | fwmic_provider_t* |
fwmic_create_os_provider() |
Create OS provider | fwmic_provider_t* |
fwmic_create_bios_provider() |
Create BIOS provider | fwmic_provider_t* |
Command-Line Interface
FWMIC can be used from the shell via the FWMIC command:
Usage
fwmic [options] <command> Options: /query <query> Execute WQL-like query Examples: fwmic /query "SELECT * FROM OS" fwmic /query "SELECT Name FROM ComputerSystem" fwmic /query "SELECT * FROM Processor"
Query Syntax
FWMIC supports WQL-like query syntax:
SELECT * FROM <ObjectType>- Get all propertiesSELECT <Property> FROM <ObjectType>- Get specific property
Usage Examples
C API Usage
// Initialize FWMIC
fwmic_engine_t* engine = fwmic_init();
// Query OS information
fwmic_object_t* results = NULL;
fwmic_query(engine, "SELECT * FROM OS", &results);
// Process results
fwmic_object_t* obj = results;
while (obj) {
fwmic_property_t* prop = obj->properties;
while (prop) {
printf("%s: %s\n", prop->name, prop->value);
prop = prop->next;
}
obj = obj->next;
}
// Cleanup
fwmic_free_objects(results);
fwmic_shutdown(engine);
Shell Usage
FREE WORLD> fwmic /query "SELECT * FROM OS" Name: FreeWorld Operating System Version: 0.1.0 Manufacturer: FreeWorld Project FREE WORLD> fwmic /query "SELECT Name FROM ComputerSystem" Name: hostname
Extending FWMIC
To add a new provider:
- Create an enumeration function that returns
fwmic_object_t* - Create a provider structure using
fwmic_create_provider() - Register the provider with
fwmic_register_provider()
Status: ✅ Extensible architecture ready for custom providers