Hi all,

How to write my own information into the NK.bin?
For example:
I want to write "CE420b2" in the fixed offset of NK.bin.
Can I finish that while making the nk image?

Thanks

Bryan

Re: Question about NK.bin by Steve

Steve
Wed Dec 03 07:52:48 CST 2003

No, You can however create a file that is included in the ROM file system
and has that value. You can also put a registry setting in the system to
store that. But you cannot force it to exist at a fixed location.

--
Steve Maillet (eMVP)
Entelechy Consulting
smaillet_AT_EntelechyConsulting_DOT_com



Re: Question about NK.bin by Dean

Dean
Fri Dec 05 09:43:33 CST 2003

It's just a file, you can do anything you like with it. Create a
PostRomImage.bat file and put your code there (it gets called after
makeimg). However, make sure you know what you're doing, do you really want
to write that string into the nk.bin? It's a collection of records, not an
absolute copy of the resulting image. You might be doing something you
didn't intend...

--
Dean Ramsier - eMVP
Accelent Systems
http://www.accelent.com

"Bryan" <anonymous@discussions.microsoft.com> wrote in message
news:08a001c3b971$3e5c3860$a301280a@phx.gbl...
> Hi all,
>
> How to write my own information into the NK.bin?
> For example:
> I want to write "CE420b2" in the fixed offset of NK.bin.
> Can I finish that while making the nk image?
>
> Thanks
>
> Bryan
>



Re: Question about NK.bin by Kermit

Kermit
Mon Dec 08 16:04:42 CST 2003

I'm not sure exactly what you are trying to do. However, have you looked
into using a fixup variable?

Basically, in your OAL code do something like this:

DWORD *image_version = (DWORD *)0;


Then, in your config.bib file, do something like this:

image_version 00000000 0xCE420b2 FIXUPVAR


At link time, the value of image version will be populated with 0xce420b2
and you can access it like so:

printf("image_version: 0x%x\n", image_version);

That is assuming that you want to deal with hex numbers. You can easily get
creative and turn this into a string if you want to as well.

Not sure if that is what you were looking for. If it is, hope it helps.

By the way, you _must_ allocate some space for the variable in the OAL by
giving it an initial value. If you don't, then this won't work. I normally
do the following:

#define NOT_FIXED_UP (0xdeadbeef)

DWORD *image_version = (DWORD *)NOT_FIXED_UP;

if ( (DWORD *)NOT_FIXED_UP != image_version )
{
printf("Linker fixed up my fixup-variable to: image_version: 0x%x\n",
image_version);
}
else
{
printf("I messed something up and the linker didn't modify my variable\n");
}

Best of luck,
--kermit


--
It wasn't easy being Greazy ....but it was interesting.