LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   CMOS program (https://www.linuxquestions.org/questions/linux-software-2/cmos-program-33524/)

rao 10-23-2002 07:24 AM

CMOS program
 
Hi friends,

I am requesting one small(may be difficult) program.

How to write CMOS program in 'C'?. I ran one loop
for(int i = 0; i<=100; i++)
{
printf("%d",i);
sleep(5);
}

at the 45th time power failure, After recovering power, I ran same application. This time i want continue from 45th.. How to write this program.

Thanks & Regards

jglen490 10-23-2002 08:42 AM

Unless you write your counter to a file for each iteration through your loop, you can't resume the count after a power failure. Since the program is running in memory, a power failure will wipe memory.

Unless I don't understand the full question that you're asking ;) .

rao 10-24-2002 10:52 AM

Dear jglen490,
U did not understand my problem. Already i told as this is CMOS program. I will agree every applications running in memory. My problem is not belong to memory. My problem belong to CMOS.
Try to understand and if you got answer then give reply. Any how
thanks for responding

rao 10-28-2002 05:44 AM

Hello every one... pls help me above problem

jglen490 10-28-2002 07:27 AM

Regardless of where the program resides, you must have a means of storing the counter outside of volatile memory. If this program does not use disk storage in any way, then the counter must be written to some sort of non-volatile storage to preserve it between program runs. So I imagine that you must have data space available somewhere, perhaps on the chip itself, with a specific address range that can be used as a storage location.


All times are GMT -5. The time now is 06:02 AM.