dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
3783

alien9999999
Your Head Looks Nice
Premium Member
join:2002-05-21
B-3000

alien9999999

Premium Member

how to write to CMOS (BIOS settings)

anyone have any idea as to how to accomplish such a thing?
and non-destructive?

I'd like to set the alarm settings of my BIOS with a script
to boot it up at a specific time (20m after shutdown)

TIA
netjunk4
join:2002-02-20
Centreville, VA

netjunk4

Member

It probably can't be done without corrupting CMOS. Besides, you would need special motherboard and BIOS that are designed to be operated in (up)time critical environment. You will most likely need to recompile Linux kernel to read NVRAM and write system (motherboard) specific program to read and change settings. It's much easier and less hassle to get a dedicated hardware watchdog to do the job.

Drunkula
Premium Member
join:2000-06-12
Denton, TX


1 recommendation

Drunkula to alien9999999

Premium Member

to alien9999999
cmosdump.zip
2,342 bytes
Unless you recalculate the checksum and write that as well your BIOS settings will be invalidated and reset to defaults.

Here's a small DOS based program I wrote centuries ago as I was learning assembler. It only displays the current contents of CMOS. Writing to CMOS is done similar to reading it. Load an offset value into port 70h and write the value you want to put at that offset into port 71h.

[text was edited by author 2003-08-02 15:09:14]
Drunkula

Drunkula

Premium Member

Hah! I just gave my old program a try on my XP box. It displays the correct values in a DOS window (cmd or command) but not in a fullscreen DOS window. Odd. Anyhow it does show how to at least retrieve data from CMOS.

Oh well. Like I said I wrote it centuries ago...

leibold
MVM
join:2002-07-09
Sunnyvale, CA
Netgear CG3000DCR
ZyXEL P-663HN-51

leibold to alien9999999

MVM

to alien9999999
While the warnings from previous posters are not to be ignored, there is the nvram driver in linux that allows you to read and write the nonvolatile memory in the CMOS RTC. It even handles the recalculating of the checksum for you.

You can read and write any byte in the nvram through the /dev/nvram device. A summary of data that is standard in all PC bios is available through: cat /proc/driver/nvram. Features such as wake-on-alarm may be stored in different locations (perhaps even differ between bios revisions). I also don't know if storing the wakeup time in the nvram is sufficient to activate the alarm timer or whether additional programming of the RTC is necessary.

alien9999999
Your Head Looks Nice
Premium Member
join:2002-05-21
B-3000

alien9999999

Premium Member

I don't seem to have this nvram thingie; but found /proc/driver/rtc :

rtc_time : 02:20:21
rtc_date : 2003-08-03
rtc_epoch : 1900
alarm : **:**:**
DST_enable : no
BCD : yes
24hr : yes
square_wave : no
alarm_IRQ : no
update_IRQ : no
periodic_IRQ : no
periodic_freq : 1024
batt_status : okay

I heard some /proc stuff can be written to, can this by any chance be used for such a purpose?
paul1238
join:2000-11-03
Brookline, MA

paul1238 to Drunkula

Member

to Drunkula
said by Drunkula:
Here's a small DOS based program I wrote centuries ago as I was learning assembler.
Oddly enough. I was just looking for an example of this. Thanks for sharing.
paul1238

paul1238 to alien9999999

Member

to alien9999999
said by alien9999999:
I don't seem to have this nvram thingie;
You must compile your kernel with CONFIG_NVRAM support.
netjunk4
join:2002-02-20
Centreville, VA

netjunk4 to alien9999999

Member

to alien9999999
Just found something you might be interested in...

»sourceforge.net/projects ··· -wakeup/

davidsmind
The Eye's Mind
Premium Member
join:2001-07-04
Canada

davidsmind

Premium Member

This is all very enlightening....but I have a few questions myself. Most motherboard manufactuers provide a program to flash your bios and a firmware upgrade...however, these are usually provided though a dos executible...is there anyway I can configure linux with wine-console to be able to use these upgrades?

drjim
MVM
join:2000-06-13
Long Beach, CA

drjim

MVM

I don't think so, owing to the fact that the DOS boot disk has to be pretty clean, with minimal drivers, and no OS loaded.
Of course, if I'm wrong, I'm sure I'll be corrected shortly!
drjim

leibold
MVM
join:2002-07-09
Sunnyvale, CA
Netgear CG3000DCR
ZyXEL P-663HN-51

leibold

MVM

There are "memory type device" drivers in the linux kernel including some designed to read and write bios and controller card firmware stored in flash memory. As long as the bios is copied from flash to ram and only executed in ram it is possible to update the flash memory while running a multitasking operating system. I haven't actually tried this and would like to know if anybody ever updated his pc bios through those device drivers ? Since there is a good chance of rendering a motherboard inoperable this way I'm not feeling to eager to play the guinea pig
netjunk4
join:2002-02-20
Centreville, VA

netjunk4 to davidsmind

Member

to davidsmind
I don't think Wine has any functions to access hardware directly so the BIOS flashers for DOS and Windows won't work.