-
Keep in mind that the kernel stack is relatively limited in size.
Therefore, code that will be moved into the Kernel PlugIn should not
contain static memory allocations. Use the
malloc function
to allocate memory dynamically instead. This is especially important for
large data structures.
-
If the user-mode code that you are porting to the kernel accesses memory
addresses directly using the user-mode mapping of the physical address
returned from the low-level
WD_CardRegister
function – note that in the kernel you will need to use the kernel
mapping of the physical address instead (the kernel mapping is also
returned by WD_CardRegister). For details, refer to the
description of WD_CardRegister in the WinDriver PCI Manual.
When using the API of the WDC
library [B.2] to access memory, you do not
need to worry about this, since this API ensures that the correct mapping
of the memory is used depending on whether the relevant APIs are used from
the user mode or from the kernel mode.
|