Anton, no there is no need to explain how to do this. I’m curious why
you thought you might need to explain such a simple task? I was just
hunting for a more elegant and safer method for upgrading my device’s
firmware than the two methods that have been discussed so far, and an
embedded binary string in the driver that bypasses any external steps
would have been one way to keep our build process from adding any more
complexity than it already has.
BTW, we’ve been shipping high-volume production drivers for many years
that are built through Visual Studio. I’d rather not get into the
details in this thread, but please note that it isn’t as difficult as
some have made it out to be.
Thank you to all that have chimed-in on this topic.
Regards, MKE.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Monday, January 14, 2008 2:30 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Embedding an OROM in a driver binary
Are there any built-in compiler techniques that will automatically
embed an object file like device firmware (a.k.a. Option ROM) in a
driver,
especially based in the use of MSVC++?
I’ve never heard of drivers with RESOURCE section - although the thing
you mention (i.e. including raw binary data in an image) is common at
the app level, I’ve never heard of anyone doing it with a driver.
Furthermore, building drivers with VC,rather that WDK, is not really a
good idea, so to say.
In any case, let’s assume you have succeeded. How are you going to
access this data from your driver??? There is no system-provided
function to reach it it the kernel mode. Therefore, you will have to
parse your image’s PE header (which is not that simple in the kernel
mode, compared to the user one, because some parts of your driver image
may be discarded upon the load), and, in any case, RESOURCE section is
not the easiest one to deal with…
In other words, it looks like too much hassle to me - I would rather do
it differently. What you can do here is to present everything as simple
initialized data array. Imagine that your binary image resides in the
array like
unsigned char dataarray [N]={0xa,
0xb,
0xc,
.
.
.
};
In other words, it is just hardcoded into your source. Then you can
simply use a standard WDK build without any additional hacks, and access
your data without a slightest problem. Write a simple program that
generates a source file like that from your binary data (I really hope
there is no need to explain to you how to do it - it takes literally
less than 5 minutes of work), include it into your SOURCES file, and
that’s it…
Anton Bassov
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer