2007/1/22, Dan Shimshoni <[EMAIL PROTECTED]>:
Hello linux il , I had been playing with the idea of writing a small utility in "C" on linux which will enable me to change boot prioirity on a linux machine, so that I will be able to toggle the boot sequence (boot from CD/ not boot from CD). I mean the boot sequence which the BIOS saves in CMOS. This is a task which I do quite frequently by entering the BIOS. Is there an API which enable me to perform such a task ? Did anybody tried a thing like that ? and in case it is possible - how much complex is it ?
There is a module/driver/device called /dev/nvram (modprobe nvram) which gives you read/write access to the cmos ram. As far as I know, it's not completely documented - it might as well completely undocumented, I did not do a thorough search. You can dump it to a file before and after making the desired change in your BIOS's setup, and cmp to find what changed. Then you can write a small script (probably something like cat some1bytefile | dd bs=1 of=/dev/nvram seek=NN but might be a bit more complex) that does this change. I used such a technique to do some other change to the cmos ram of a class of machines, and it usually, but IIRC not always, worked. -- Didi
