How to read the actual settings via C which are made in BIOS

Hi,

how do I manage to read out all the settings which are adjustable from within the BIOS?
I’ve got a PC which runs under QNX 6.3.2. This system needs to have some changed BIOS values, which I made by hand.
As I run my application, which talks directly to a special hardware and which is very time critical or let me say hard real time, I’ve to assure, that those BIOS-settings are still in use.
If some of those BIOS-settings are not in use, there will be a chance that my application may fail. But my application has to run automatically and error free all the time, without needing my help in re-adjust the BIOS-settings…

Any ideas on how to get/compare/set the actual BIOS-settings via c-code?

Martin

I don’t think you can change the effective BIOS settings on-the-fly (or at least it would be very difficult).

You shouldn’t have too much trouble getting the settings (you need to understand the format), and maybe not even too much trouble writing these settings; however, when you write the settings they will only take effect after the next reboot (duplicating the chip programming that the BIOS does based on the setting is most likely quite difficult).

Best place for information on how to do this for your specific system would be the Linux source for /dev/nvram…

If you wanted to create a /dev/nvram for QNX, you might want to look at my free C++ class library (community.qnx.com/sf/projects/qfc), which would make creating the resmgr part of it very simple.

Thansk for your answer, this was very helpful for me.

Martin

hai Eiswuerfel
as you have written that you were able to access hardware via C code i think u can help me.
have you written the c code in momentics IDE to access the target system?
can u share some code by which i can draw a pixel at terget surface calling ghrapics related API(with out using PHOTON)

I’m sorry, but I don’t access a target system, I’m working self-hosted with Momentics/Photon under 6.3 SP 3.

Martin

thanks for ur response
It’s ok.i think the C code will be same for self hosted or other.could u please share some code that atleast help me on my above mentioned problem(accessing hardware/draw pixel)

Hi again,

I’m using this kind of code to display some small previews, which are directly stamped into the actual display of my photon application.
I do it this way, because I want to use the fastest way to display some small previews which I’ve made by shrinking the picture width and height by 4,
while my realtime testsystem is making many tests, generating much data and sending 50 MB/s via a special PCI-card to the product to be tested.
The small previews are 192x127 and it lasts roughly 2 ms to stamp such a pre-calculated preview into the photon display.

May it help you on whatever you are doing on your system. ;-)

Martin

// MyPictureData is a pointer to my pixels
// Height and Width are the size of the picture in pixels
// Pg_IMAGE_DIRECT_8888 gives the fastest way to set pixels
// Pixel data is 32-bit (reserved/red/green/blue)

  PhImage_t *pPhImage = NULL;
  PhPoint_t PhUpperLeftCorner;

  pPhImage = PhCreateImage(NULL, Width, Height, Pg_IMAGE_DIRECT_8888, NULL, 0, 0);



  // Picture data must be copied line by line, because pPhImage->bpl may be not identical with the number of visible pixels in horizontal direction
  for(Index=0 ; Index < Height ; Index++)
  {
    memcpy(((unsigned char*)pPhImage->image) + (Index * pPhImage->bpl), ((unsigned char*)MyPictureData) + (Index * (Width * sizeof(*MyPictureData))), Width * sizeof(*MyPictureData));
  }
  PhUpperLeftCorner.x = MyPosX;
  PhUpperLeftCorner.y = MyPosY;
  PgFFlush(Ph_START_DRAW);
  PgDrawImage(pPhImage->image, pPhImage->type, &PhUpperLeftCorner, &pPhImage->size, pPhImage->bpl, 0);
  PgFFlush(Ph_DONE_DRAW);




  PhReleaseImage(pPhImage);

thanks a lot .I am trying.If anything would be positive i will inform u :smiley: