Hi Board!

Is it possible to read (and change) the BIOS/CMOS? IF so, does someone has a code?

Best regards,
Marc
Posted on 2004-06-25 19:08:52 by marc waesche
i'm not sure if it's possible for a normal win32 program to modify the BIOS anymore - i know that in NT, you can't read/write the BIOS on some computers unless you're logged in as administrator.

in a DOS program, you can access the BIOS at 0FE000h through 0FFFFFFh. i think that corresponds to F000:E000 through F000:FFFFh. And of course, any equivalent address, such as FE00:0000 through FE00:1FFFF. haven't done any of this kind of thing for quite some time :)

to read/write, just use the MOV instruction. something like this:

mov bx,0fe00
push bx ;can't remember whether mov ds,bx is permitted
pop ds
xor bx,bx
mov ax,bx

ax should now contain a word from 0FE000h.
Posted on 2004-06-25 20:42:42 by jademtech
Hi,

You read and write CMOS memory from hardware port 70h




mov ax,1516h
out 70h,al
in al,71h
mov [readval1],al
mov al,ah
out 70h,al
in al,71h
mov [readval2],al

....


This code read CMOS memory at adress 15h and 16h (Basic memory size)

You can write CMOS memory with OUT command but, be carefull, if you change wrong value possibble your system crash.

BTW: As say as jademtech you can read rom memory




push ds ; save ds
mov ax,0ffffh ; segment
mov ds,ax ; ds=0ffffh
mov ax,[fffe] ; target bios addr
pop ds ; restore ds
...



You can direct write rom bios flash from dos. But i think this code not safe, sorry

Best regards,
Posted on 2004-06-26 15:59:30 by CYDONIA
Also for fast CPU's you might wanna insert a small delay so that the CMOS RAM has time to respond
Posted on 2004-06-26 20:08:30 by x86asm
If you write to the CMOS area, iirc you must update the checksum... or the BIOS will reset all values to default. If you're going to do this from NT, you need a kernel mode driver, on 9x you might be able to get away with the in/out stuff, if not just use a ring0hack.

Hm, inserting small delays - is that really necessary? in/out is pretty slow :)
Posted on 2004-06-26 23:59:52 by f0dder