Great, I really like multiple choices. I will propably try both registry
entries and binary file.
Again, thank you very much.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mats PETERSSON
Sent: Tuesday, November 09, 2004 1:07 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Configuration Parameters
It’s easy to get the picture when you’re given enough details to know
roughtly what someone is doing.
Yes, that makes sense to me.
In the case of the “initialization file”, I would go for something that is
easy to parse in the driver, so thus avoiding anything that is text-based.
I know it’s easier to modifiy a text file, but the advantage of not having
to parse text files in driver wins, since if nothing else, it’s a security
issue.
Another thought: if the configuration information is relatively small, such
as this structure:
struct IOAdress {
ULONG base;
ULONG size;
ULONG type;
};
If you have a few of these (say less than 20), you could easily put these
in a “binary” registry entry, rather than putting them in a file. And just
read it straight out of the registry entry. If you make the first entry a
size, so that you know how many entries you’ve got, then you’re able to
write a tiny little read-routine, that stuffs the data from the registry
into an array for the driver to set things up.
And writing a small application to generate a registry file isn’t
particularly hard work. Then apply the registry file to the registry, and
voila, you have a new setup.
Even fancier would be to have an IOCTL that re-reads the registry when
you’ve changed the setup, and perhaps also reload the binary, if that’s an
option.
Best of luck.
–
Mats
xxxxx@lists.osr.com wrote on 11/09/2004 10:45:46 AM:
You obviously got the picture. The user can select a variaty of bin files
To download, thus changing completely CTRL registers that the driver uses
in
order to configure the Xilinx implementation.
So, I think that I can have a registry entry for the location of the bin
file and another entry of a txt mode or bin mode initialization file.
Does
this make sence to you?
Thank you very much.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mats PETERSSON
Sent: Monday, November 08, 2004 5:46 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Configuration Parameters
Ok. If so, I’d add a registry entry that contains the filename to be
downloaded, combined with a CRC or some such to make sure that the file
you’re trying to load is actually a correct one.
You can then write a tool for updating the Xilinx code by updating the
CRC
and the new file.
Obviously, you’d need to check the CRC before you download (or during
download if there is an option to reset the downloaded data if the CRC
doesn’t match). But presumably it’s not a huge amount of data, so I
suspect
you can allocate a suitable buffer, load it up, CRC it, and then transfer
to the Xilinx part.
Another, completely different approach is of course to have the filename
sent in by a IOCTL call to the device that you’re representing, and
letting
the user-mode software decide what it needs to download. This is probably
a
better option in the case where the customer is often changing the
hardware, and less good an option if the user is often loading and
unloading the user-mode software.
Of course, in either case, make sure you’re checking the data coming in
thoroughly, so that noone can use your code to hack the system (for
example. make sure you only read as much file as your buffer can hold).
–
Mats
xxxxx@lists.osr.com wrote on 11/08/2004 03:39:17 PM:
> Thank you very much.
>
> The board has a rapid prototype chip (Xilinx) and one add on card for
> physical connection. So, it’s up to software to download the correct
Xilinx
> version.
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
> ForwardSourceID:NT00006ECE
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@4plus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@3dlabs.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
ForwardSourceID:NT00006FC2
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@4plus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com