Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I wrote a component, which retrives the bios data, like bios serial number, hdd, fdd settings, etc. The component reads directly from BIOS memory, using inline assembly. Here is a part of the code, (if I remember right) which reads the bios ,and put data into an array, in the components constructor:
constructor GetBiosInfo.Create(Owner: TComponent);
i,r : byte;
data : array[0..128] of byte;
inherited Create(Owner); // Initialize inherited parts
r := 0; // allocate r in memory
for i:= 0 to 128 do
xor ah,ah // clear accumlator
mov al,i // set required byte number
cli // clear interrupt
out $070,al // set register
nop // wait for output take place
in al,$071 // get bios data
mov r,al // set r as required byte
sti // reset interrupts
data[i] := r;
This function works well on windows 95, and 98 plattforms, but cannot work on XP, because I get a privileged instruction exception. I think the reason is the Protected mode differs in windows XP, and does not allow sti, cli, in and out.
Any idea, how else could I read bios data, if I do not really want to set any windows 98 emulation mode for my prog. I was searching for windows API functions, but I could not found any implementation.
Any help would be appriciated
0 · ·