dxd - dynax driver framework  2979
cross platform open source driver development framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dxd Namespace Reference

dynax driver framework kernel namespace More...

Namespaces

 debug
 
 dmus
 dmus namespace
 
 doubly
 
 ioctl
 kernel IOCTLs
 
 linked
 
 multichannel
 
 portcls
 portcls namespace
 
 property
 
 range
 range namespace
 
 wavecyclic
 wavecyclic namespace
 
 wdm
 WDM++ - windows helper classes.
 

Classes

singleton  __atomic_pointer
 atomic pointer operations More...
 
class  __atomic_pointer< type_t * >
 
singleton  __atomic_scalar
 
class  __atomic_scalar< 4, type_t >
 32bit atomic operations More...
 
class  adapter
 adapter driver skeleton More...
 
struct  adjust
 
struct  adjust< host >
 
struct  adjust< swap >
 
class  array
 
class  atomic
 atomic operations More...
 
class  atomic< type_t * >
 explicitely specify pointer template argument: More...
 
class  audio
 
class  broadcast
 
class  buffer
 kernel memory buffer w/o alignment and boundary requirements More...
 
class  bus
 WDM BUS class. More...
 
class  client
 
class  device
 
class  engine
 
singleton  event
 IOKit user client. More...
 
class  event< dx::kernel >
 
class  event< dx::user >
 kernel representation of shared user space event More...
 
union  fourchar_string
 
class  fw
 WDK: FireWire device. More...
 
class  guid
 
class  iostream
 
class  lock
 
singleton  map
 WDK memory mapping. More...
 
class  map< dx::kernel, vm_t >
 WDK: kernel space memory mapping. More...
 
class  map< dx::user, vm_t >
 WDK: user space memory mapping. More...
 
class  memory
 virtual kernel memory description More...
 
class  mutex
 mutex More...
 
class  open
 
class  pci
 
class  port
 miniport creation helper More...
 
class  ppc
 PPC device. More...
 
class  process
 IOKit process thread. More...
 
class  reference
 reference holder for object based reference counter More...
 
class  referenced
 reference counting base class More...
 
class  scoped
 
class  scoped<::URB >
 
class  spinlock
 WDK spinlock. More...
 
class  stream
 generic kernel stream More...
 
class  usb_device
 
class  usb_stream_client
 generic USB user client class More...
 
class  usb_stream_device
 generic USB device More...
 
class  wstring
 

Enumerations

enum  {
  ok =kIOReturnSuccess, not_implemented =kIOReturnUnsupported, invalid =kIOReturnBadArgument, device_error =kIOReturnDeviceError,
  no_resources =kIOReturnNoResources, not_initialized =kIOReturnNotReady, interrupt_level_mismatch =STATUS_INVALID_LEVEL, timeout =kIOReturnTimeout,
  invalid_size =kIOReturnNoSpace, not_aligned =STATUS_DATATYPE_MISALIGNMENT_ERROR, aborted =kIOReturnAborted, failed =STATUS_UNSUCCESSFUL,
  device_removed =kIOReturnNotAttached, not_permitted =kIOReturnNotPermitted, internal_error =kIOReturnInternalError
}
 
enum  {
  ok =kIOReturnSuccess, not_implemented =kIOReturnUnsupported, invalid =kIOReturnBadArgument, device_error =kIOReturnDeviceError,
  no_resources =kIOReturnNoResources, not_initialized =kIOReturnNotReady, timeout =kIOReturnTimeout, invalid_size =kIOReturnNoSpace,
  aborted =kIOReturnAborted, exclusive =kIOReturnExclusiveAccess, device_removed =kIOReturnNotAttached, closed =kIOReturnNotOpen,
  not_permitted =kIOReturnNotPermitted, internal_error =kIOReturnInternalError
}
 
enum  : int64_t {
  nsec =1ll, usec =nsec*1000ll, msec =usec*1000ll, sec =msec*1000ll,
  base =0ll
}
 
enum  direction {
  in =::kIODirectionIn, out =::kIODirectionOut, both =::kIODirectionInOut, none,
  in =::kIODirectionIn, out =::kIODirectionOut, both =::kIODirectionInOut
}
 direction of memory operation More...
 
enum  direction {
  in =::kIODirectionIn, out =::kIODirectionOut, both =::kIODirectionInOut, none,
  in =::kIODirectionIn, out =::kIODirectionOut, both =::kIODirectionInOut
}
 
enum  endian { little_endian, big_endian, host =little_endian, swap =big_endian }
 
enum  scale : int64_t {
  nsec =1ll, usec =nsec*1000ll, msec =usec*1000ll, sec =msec*1000ll,
  base =0ll
}
 
enum  synchrony { synchrony::sync, synchrony::async }
 
enum  version { elcapitan =0x10110000 }
 

Functions

bool below32 (::MDL *mdl)
 indicates whether memory is mapped above 4GB boundary More...
 
template<class driver_t >
::NTSTATUS create (::DRIVER_OBJECT *wdm_driver,::UNICODE_STRING *registry, wchar_t *name=L"", dxd::guid guid=0)
 
template<class client_t = ::IOUserClient, typename return_t = os_result, typename exec_arg_t , typename exec_t >
return_t each (::OSIterator *iterator, exec_arg_t exec_arg, exec_t exec)
 for each iterator executor More...
 
void errorlog (const char *fmt...)
 
template<>
os_result fw::read32< dx::kernel, host > (unsigned int *dst, size_t size32, uint64_t space, int64_t timeout)
 WDK: synchronously submit an firewire async read request. More...
 
template<>
os_result fw::read32< dx::kernel, swap > (unsigned int *dst, size_t size32, uint64_t space, int64_t timeout)
 WDK: synchronously submit an firewire async swapped data read request. More...
 
template<>
os_result fw::write32< dx::kernel, host > (const unsigned int *src, size_t size32, uint64_t space, int64_t timeout)
 WDK: synchronously submit an firewire async write request. More...
 
template<>
os_result fw::write32< dx::kernel, swap > (const unsigned int *src, size_t size32, uint64_t space, int64_t timeout)
 WDK: synchronously submit an firewire async swapped data write request. More...
 
void log (const char *fmt...)
 windows kernel logging More...
 
unsigned int os_version ()
 
int64_t time (int64_t timestamp, scale scale=usec)
 WDK: timestamp to Windows time converter. More...
 
void warnlog (const char *fmt...)
 

Variables

typedef::IOLock * os_event
 platform abstract type os_event for IOKit driver More...
 
typedef::IOReturn os_result
 defining platform abstract type os_result for IOKit driver More...
 
::DRIVER_OBJECT * wdm_driver =nullptr
 Main driver entry. More...
 

Detailed Description

dynax driver framework kernel namespace

dxd - dynax driver framework

Enumeration Type Documentation

anonymous enum
Enumerator
ok 
not_implemented 
invalid 
device_error 
no_resources 
not_initialized 
interrupt_level_mismatch 
timeout 
invalid_size 
not_aligned 
aborted 
failed 
device_removed 
not_permitted 
internal_error 
anonymous enum
Enumerator
ok 
not_implemented 
invalid 
device_error 
no_resources 
not_initialized 
timeout 
invalid_size 
aborted 
exclusive 
device_removed 
closed 
not_permitted 
internal_error 
anonymous enum : int64_t
Enumerator
nsec 

pseudo scale addressing Windows' odd 100ns precision

usec 
msec 
sec 
base 

direction of memory operation

Enumerator
in 
out 
both 
none 
in 
out 
both 
Enumerator
in 
out 
both 
none 
in 
out 
both 
Enumerator
little_endian 

data is little endian and will only be swapped if either host or device is big endian

big_endian 

data is big endian and will only be swapped if either host or device is little endian

host 

data is in host endian format and will only be swapped if target device is in the opposit endian format

swap 

data is not in host endian format and will only be swapped if target device is in host endian format

Enumerator
nsec 

pseudo scale addressing Windows' odd 100ns precision

usec 
msec 
sec 
base 
enum dxd::synchrony
strong
Enumerator
sync 
async 
Enumerator
elcapitan 

Function Documentation

bool dxd::below32 ( ::MDL *  mdl)

indicates whether memory is mapped above 4GB boundary

  • a serious OS should handle physical memory layout dependencies transparently. Bills buggy experiment on the other hand requires the awareness of where memory is physically mapped.

+ Here is the caller graph for this function:

template<class driver_t >
::NTSTATUS dxd::create ( ::DRIVER_OBJECT *  wdm_driver,
::UNICODE_STRING *  registry,
wchar_t *  name = L"",
dxd::guid  guid = 0 
)
Parameters
wdm_driverA pointer to a DRIVER_OBJECT structure that represents the driver's WDM driver object.
registryA pointer to a UNICODE_STRING structure that specifies the path to the driver's Parameters key in the registry.
nameAn internal unique name
guidGUID identifying the kernel driver interface
template<class client_t = ::IOUserClient, typename return_t = os_result, typename exec_arg_t , typename exec_t >
return_t dxd::each ( ::OSIterator *  iterator,
exec_arg_t  exec_arg,
exec_t  exec 
)

for each iterator executor

Todo:
deduct exec_t return type
void dxd::errorlog ( const char *  fmt...)

+ Here is the caller graph for this function:

template<>
os_result dxd::fw::read32< dx::kernel, host > ( unsigned int *  dst,
size_t  size32,
uint64_t  space,
int64_t  timeout 
)

WDK: synchronously submit an firewire async read request.

Checks for valid fw unit object,

creates kernel memory object from pointer:size of kernel origin,

checks kernel memory object,

create and submit read command for kernel memory object.

Create a memory object from kernel originated pointer:size

checks the kernel memory object,

constructs the appropriate irb and submits it to the lower device

template<>
os_result dxd::fw::read32< dx::kernel, swap > ( unsigned int *  dst,
size_t  size32,
uint64_t  space,
int64_t  timeout 
)

WDK: synchronously submit an firewire async swapped data read request.

Checks for valid fw unit object,

create kernel memory object from pointer:size of kernel origin

check kernel memory object

Create a memory object from kernel originated pointer:size

checks the kernel memory object,

constructs the appropriate irb and submits it to the lower device,

swaps the received data.

template<>
os_result dxd::fw::write32< dx::kernel, host > ( const unsigned int *  src,
size_t  size32,
uint64_t  space,
int64_t  timeout 
)

WDK: synchronously submit an firewire async write request.

Checks for valid fw unit object,

create a kernel memory object from kernel originated pointer:size

check kernel memory object

create and submit firewire write cmd

Create a memory object from kernel originated pointer:size

checks the kernel memory object,

constructs the appropriate irb and submits it to the lower device.

template<>
os_result dxd::fw::write32< dx::kernel, swap > ( const unsigned int *  src,
size_t  size32,
uint64_t  space,
int64_t  timeout 
)

WDK: synchronously submit an firewire async swapped data write request.

Checks for valid fw unit object,

creates a secondary endian swap kernel buffer memory object below 4GB boundary from size,

creates kernel mapping to endian swap data into,

checks the mapping,

endian swaps into kernel buffer,

creates and submits firewire write cmd.

Creates an intermediate swap buffer memory object,

checks the buffer creation status,

swaps the data into the newly constructed buffer,

constructs the appropriate irb and submits it to the lower device.

void dxd::log ( const char *  fmt...)

windows kernel logging

By default Windows only displays critical logging from the errorlog. To enable other the levels and tracing: double click kernel/wdk/dxd_log.reg https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/reading-and-filtering-debugging-messages

+ Here is the caller graph for this function:

unsigned int dxd::os_version ( )
int64_t dxd::time ( int64_t  timestamp,
scale  scale = usec 
)
inline

WDK: timestamp to Windows time converter.

+ Here is the caller graph for this function:

void dxd::warnlog ( const char *  fmt...)

Variable Documentation

typedef::KEVENT * dxd::os_event

platform abstract type os_event for IOKit driver

platform abstract type os_event for WDK driver

typedef::NTSTATUS dxd::os_result

defining platform abstract type os_result for IOKit driver

platform abstract type os_result for WDK driver

extern::DRIVER_OBJECT * dxd::wdm_driver =nullptr

Main driver entry.

DriverEntry is the first driver-supplied routine that is called after a driver is loaded. It is responsible for initializing the driver.

This is the main WDF managed driver entry; the first call to the driver will end up here. from here it is the responisibilty of the driver to register at least a callback for the case the I/O manager matches a device to this driver and adds the FDO to the driver stack.

The WDF framework is called with an initialized WDF_DRIVER_CONFIG containing the EvtDeviceAdd callback.

for further reference see: http://msdn.microsoft.com/en-us/library/aa491316.aspx


(c) copyright 2009 dynamic acoustics e.U. generated on Fri Nov 8 2019

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.