What I am after is this. I have a x86 system that I have up and running on a
advantech AIMB-762 motherboard and P4 processor. Basically a desktop
computer. That I have running with windows CE.
The modules that I need to add are:
12 encoder inputs
24 digital inputs
12 analog outputs.
12 digital outputs.
All these can be evidently on several io cards.
We purchased some HUMUSOFT MF624 cards for this but the damn things are
refusing to function.
Any help would be vastly appreciated.
Thank you in advance
Teoman
We have some devices that modularly add encoder and digital inputs and
outputs to a base unit that runs Windows CE, but none of it is PCI, so, if
you're attached to your processor, our stuff won't help you...
Paul T.
"Teoman" <Teo...@discussions.microsoft.com> wrote in message
news:CDE04B02-A549-47D3...@microsoft.com...
The real problme is that I havent been able to write the driver yet. The
cards that came did not have driversi only for WinXP and open source linux
drivers. Writing the is proving to be too time consuming as I can not yet see
the light at the end of the tunnel. So it might wiser to just buy something
off the shelf that works.
The reason I bought the cards was that we previously had the ISA versions
and then decided to purchase PCI ones. I was able to access the ISA ones with
ease. However the PCI ones are not so easy. The ISA version functions well
and I have the code written for it.
I might be able to write a driver if some one can provide a sample PCI io
dirver. The WAV driver is a bit too complicated to begin with.
So... As time is running out I am looking for alternatives.
Thank you.
Teoman
You might look at pcicfg.cpp in the ATAPI driver in
common\oak\drivers\block. Of course, you have the source for the PCI bus
driver, too, so you can look in on that.
As far as finding suitable hardware/drivers, I think that your best chance
is a Web search with "windows ce" in the strings.
Paul T.
"Teoman" <Teo...@discussions.microsoft.com> wrote in message
news:2FB1C7B8-1C52-4F0C...@microsoft.com...
> All these can be evidently on several io cards.
>
> We purchased some HUMUSOFT MF624 cards for this but the damn things are
> refusing to function.
There are available so called generic device drivers. These drivers could
prolongate memory mapping into userspace. As far as I know they are not free
of charge.
Both Windows and Linux drivers are userspace drivers and a kernel part only
handles PCI mapping stuff. I know it quite well because I have programmed
both of them.
Buy generic driver for WinCE and link source codes from free Linux driver
against it. It don't look, but several pieces of code are compilable under
windows. It must work.
And don't expect more support with this unsupported OS.
Jara
I am not expecting any more support from you thank you, you have already
stated that you have no dealings with "windows ce" and will not be providing
drivers for windows ce any time in the future. You were kind enough to give
me the linux drivers and I appreciate that. And once I get the iospace mapped
writing the driver will not be a problem.
I am asking for support to write "windows ce" drivers that is why I am
writing to this forum and not you. I fail to see your reasonning why should I
not expect any support from these kind people!?
Teoman
Paul T.
"Teoman" <Teo...@discussions.microsoft.com> wrote in message
news:005C4D1E-FAA2-4FD0...@microsoft.com...
I am no randomly checking the driver files if there is a simpler driver file
that I might be able to relate to.
I can consider dicontinuing with the current hardware however I have to find
an alternative but I havent been able to find it. So the alternative is using
linux.
Teoman
"Paul G. Tobey [eMVP]" wrote:
We don't know what sort of driver model your existing driver is built on or
how it communicates with PCI in Linux. Different drivers can have different
formats in Windows CE, unlike Unix where they usually are really stream-type
drivers, in my experience, at least. Some of the stream drivers that you'd
find in Windows CE would be serial port drivers, parallel port drivers, etc.
Most drivers in Windows CE are found in
$(_WINCEROOT)\public\common\oak\drivers.
Starting your first Windows CE project with porting of a driver is probably
not the best choice. If you feel like you're more familiar with Linux, go
at it. The goal is to get it done, with a high-quality result, as quickly
as practical. If the only thing stopping you from doing Windows CE is the
difficulty of porting this one single driver, hire someone to do it! You've
already spent enough of your time to pay for a substantial fraction of the
cost, I'd guess, and you'll surely spend a lot more porting Linux and
changing over all of your software development to different tools, or
learning enough about drivers to do something useful, then porting the
driver, than you would just hiring someone who is an expert with Windows CE.
Paul T.
"Teoman" <Teo...@discussions.microsoft.com> wrote in message
news:58439FC4-C497-4C15...@microsoft.com...
So maby someone can help me, here is what I have done:
I have setup a WinCe OS (6.0) Using the platform builder. And I have it
running from a Hard disk on my x86.
After I added a sub project. A dll project that exprots some functions.
THen I started looking at the WAV driver. And I included the following files
to the sub-project.
cregkey.h and cregkey.cpp that can be found in:
C:\WINCE600\PUBLIC\COMMON\OAK\DRIVERS\WAVEDEV\UNIFIED\ENSONIQ
Then I copy paste cut my driver code. It does nothing. What I am trying to
achieve initially is to display something on the printer port (address
0x378). I have LED's attached. (Code at bottom of post)
Then I added the following code right after the #defines in the
"platform.reg" file
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\HumusoftCE]
"Dll"="HumusoftCE.dll"
"VendorID"=multi_sz:"186C"
"DeviceID"=multi_sz:"624"
"Prefix"="HMS"
Then I added the following after the MODULES tag of the "platform.bib" file
HumusoftCE.dll $(_FLATRELEASEDIR)\HumusoftCE.dll NK
The Code for my driver: It is almost the same as es1371 except that I
removed some intermediate functions. And then added output to the printer
port.
I expect the leds to change indicating that the driver has been loaded when
the computer starts up.
// HumusoftCE.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include "HumusoftCE.h"
#include <wtypes.h>
#include <nkintr.h>
#include <ceddk.h>
#include <devload.h>
#include <Ddkreg.h>
#include <ddkreg.h>
#include "cregkey.h"
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
HumusoftCE_API HMS_Init(PCTSTR pszActiveKey){
CRegKey regkey(pszActiveKey);
CRegKey * pRegKey = ®key;
PHYSICAL_ADDRESS MappedAddress;
DDKWINDOWINFO wini;
DDKISRINFO isri;
DDKPCIINFO pcii;
DWORD dwStatus;
DEBUGMSG(ZONE_ERROR, (_T("Drivera girdi")));
WRITE_PORT_UCHAR((PUCHAR)0x378,5);
// read window information
wini.cbSize = sizeof(wini);
dwStatus = DDKReg_GetWindowInfo(pRegKey->Key(), &wini);
if(dwStatus != ERROR_SUCCESS) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: DDKReg_GetWindowInfo() failed %d\r\n"),
dwStatus));
return FALSE;
}
// m_dwBusNumber = wini.dwBusNumber;
// m_dwInterfaceType = wini.dwInterfaceType;
// sanity check return values
if(wini.dwNumIoWindows != 1) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: invalid window parameters read from
registry\r\n")));
return FALSE;
}
// read ISR information
isri.cbSize = sizeof(isri);
dwStatus = DDKReg_GetIsrInfo(pRegKey->Key(), &isri);
if(dwStatus != ERROR_SUCCESS) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: DDKReg_GetIsrInfo() failed %d\r\n"),
dwStatus));
return FALSE;
}
// sanity check return values
if(isri.dwSysintr == SYSINTR_NOP) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: no sysintr specified in registry\r\n")));
return FALSE;
}
if(isri.szIsrDll[0] != 0) {
if(isri.szIsrHandler[0] == 0 || isri.dwIrq == IRQ_UNSPECIFIED) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: invalid installable ISR information in
registry\r\n")));
return FALSE;
}
}
// read PCI id
pcii.cbSize = sizeof(pcii);
dwStatus = DDKReg_GetPciInfo(pRegKey->Key(), &pcii);
if(dwStatus != ERROR_SUCCESS) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: DDKReg_GetPciInfo() failed %d\r\n"),
dwStatus));
return FALSE;
}
// sanity check return values
if((pcii.dwWhichIds & (PCIIDM_DEVICEID | PCIIDM_REVISIONID)) !=
(PCIIDM_DEVICEID | PCIIDM_REVISIONID)) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: insufficient device ID information in
registry\r\n")));
return FALSE;
}
//m_IntrAudio = isri.dwSysintr;
//m_dwPciLength = wini.ioWindows[0].dwLen;
//m_dwDeviceID = pcii.idVals[PCIID_DEVICEID];
//m_dwRevisionID = pcii.idVals[PCIID_REVISIONID];
PHYSICAL_ADDRESS PortAddress = {wini.ioWindows[0].dwBase, 0};
// Install ISR handler if there is one
/*
if (isri.szIsrDll[0] != 0) {
// Install ISR handler
m_hIsrHandler = LoadIntChainHandler(isri.szIsrDll,
isri.szIsrHandler, (BYTE) isri.dwIrq);
if (m_hIsrHandler == NULL) {
DEBUGMSG(ZONE_ERROR, (TEXT("Ensoniq: Couldn't install ISR
handler\r\n")));
} else {
GIISR_INFO Info;
PVOID dwPhysAddr;
DWORD inIoSpace = 1; // io space
if (!TransBusAddrToStatic(PCIBus, 0, PortAddress, m_dwPciLength,
&inIoSpace, &dwPhysAddr)) {
DEBUGMSG(ZONE_ERROR, (TEXT("Ensoniq: Failed
TransBusAddrToStatic\r\n")));
return FALSE;
}
DEBUGMSG(ZONE_ERROR, (TEXT("Ensoniq: Installed ISR handler, Dll
= '%s', Handler = '%s', Irq = %d, PhysAddr = 0x%x\r\n"),
isri.szIsrDll, isri.szIsrHandler, isri.dwIrq, dwPhysAddr));
// Set up ISR handler
Info.SysIntr = m_IntrAudio;
Info.CheckPort = TRUE;
Info.PortIsIO = TRUE;
Info.UseMaskReg = FALSE;
Info.PortAddr = (DWORD)dwPhysAddr + ES1371_dSTATUS_OFF;
Info.PortSize = sizeof(DWORD);
Info.Mask = ES1371_INTSTAT_PENDING;
if (!KernelLibIoControl(m_hIsrHandler, IOCTL_GIISR_INFO, &Info,
sizeof(Info), NULL, 0, NULL)) {
DEBUGMSG(ZONE_ERROR, (TEXT("Ensoniq: KernelLibIoControl call
failed.\r\n")));
return FALSE;
}
}
}
*/
//
// Translate IO address
//
ULONG fInIoSpace = TRUE; // io space
if ( ! HalTranslateBusAddress( PCIBus, 0, PortAddress, &fInIoSpace,
&MappedAddress)) {
DEBUGMSG(ZONE_ERROR, (TEXT("Ensoniq: HalTranslateBusAddress
failed\r\n")));
return FALSE;
}
BOOL m_fIsMapped;
if ( fInIoSpace ) {
m_pPciAddr = (PUCHAR) MappedAddress.LowPart;
m_fIsMapped = FALSE;
}
else {
m_pPciAddr = (PUCHAR) MmMapIoSpace(MappedAddress, m_dwPciLength,
FALSE);
m_fIsMapped = TRUE;
}
DEBUGMSG(ZONE_INFO, (TEXT("ENSONIQ1371: IO PORT [%X]\r\n"),m_pPciAddr));
//
// Configure Interupt
//
//
// Map IO and Interupt to System spaces
//
/*
m_hISTInterruptEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if (m_hISTInterruptEvent == NULL) {
DEBUGMSG(ZONE_ERROR, (TEXT("ES1371 - unable to create IST event\r\n")));
return FALSE;
}
if (!InterruptInitialize(m_IntrAudio, m_hISTInterruptEvent, NULL, NULL) ) {
DEBUGMSG(ZONE_ERROR, (TEXT("ES1371 - InterruptInitialize(%d,%08x)
Failed\r\n"), m_IntrAudio, m_hISTInterruptEvent));
return FALSE;
}
*/
//
// We'll try and reserve physical memory since it is more likely to succeed
// on driver load
// If this fails, we'll try again at run-time
/*
for (int i = 0; i < NUM_DMACHANNELS; i++) {
DMA_ADAPTER_OBJECT AdapterObject;
PHYSICAL_ADDRESS LogicalAddress;
AdapterObject.ObjectSize = sizeof(DMA_ADAPTER_OBJECT);
AdapterObject.InterfaceType = (INTERFACE_TYPE) m_dwInterfaceType;
AdapterObject.BusNumber = m_dwBusNumber;
if ((m_dmachannel[i].pvBufferVirtAddr =
HalAllocateCommonBuffer(&AdapterObject, m_dmachannel[i].ulInitialSize,
&LogicalAddress, FALSE)) != NULL)
{
m_dmachannel[i].ulBufferPhysAddr = LogicalAddress.LowPart;
m_dmachannel[i].ulAllocatedSize = m_dmachannel[i].ulInitialSize;
}
else
{
m_dmachannel[i].ulAllocatedSize = 0;
DEBUGMSG(ZONE_WARNING,(TEXT("ES1371: unable to reserve %d bytes
for DMA channel %d\r\n"),
m_dmachannel[i].ulInitialSize, i ));
}
}
*/
// record the Device ID and Revision ID for posterity.
//call our initialization functions
// InitHardware();
//
// Turn on card
//
// SetPowerState(1); // Turn off to set register arrays
// SetPowerState(0);
DEBUGMSG(ZONE_INFO, (TEXT("ES1371: PCI Init Done\r\n")));
return TRUE;
You've got debug messages in your driver. Is the driver getting loaded at
all? Have you set breakpoints in it, if so, and traced where things are
going wrong?
Paul T.
"Teoman" <Teo...@discussions.microsoft.com> wrote in message
news:02320ED0-E5AC-4EFF...@microsoft.com...
>me the linux drivers and I appreciate that. And once I get the iospace mapped
>writing the driver will not be a problem.
Ignore IO space. Memory space is sufficient enough for MF624. Win64 platform
also don't allow to map I/O space to user space so full MF624 device handling
could be done without I/O space.
>I am asking for support to write "windows ce" drivers that is why I am
>writing to this forum and not you. I fail to see your reasonning why should I
>not expect any support from these kind people!?
I have meant that Humusoft has never think about WindowsCE, has no schedule
to do anythink with this OS. Its all.
I have never boot this OS and I have never used any Windows CE SDK.
Jara