Hi everyone,
I want to read the time and date from the CMOS.
I am using visual c++ 2005
i read the wiki document but it doesn't run
---------------
Thank you in advance
CMOS
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: CMOS
I point you to the forum rules and the "How to asks questions the smart way" link
Just saying "it doesn't" work is useless. It's just about as useful as ringing up a doctor and telling him "I feel sick" and expecting him to tell you exactly what is wrong over the phone.
"It doesn't run" - How doesn't it run? Does it not compile, does the code never execute, does it crash? And if so, how does it crash? Are you using Bochs, Qemu, VirtualPC, VirtualBox or Real Hardware.
Learn to ask questions correctly, and you will get kind and useful help. Ignore this advice, and expect to be ignored to the rest of your days.
Just saying "it doesn't" work is useless. It's just about as useful as ringing up a doctor and telling him "I feel sick" and expecting him to tell you exactly what is wrong over the phone.
"It doesn't run" - How doesn't it run? Does it not compile, does the code never execute, does it crash? And if so, how does it crash? Are you using Bochs, Qemu, VirtualPC, VirtualBox or Real Hardware.
Learn to ask questions correctly, and you will get kind and useful help. Ignore this advice, and expect to be ignored to the rest of your days.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
-
- Member
- Posts: 109
- Joined: Wed Nov 10, 2010 10:49 am
Re: CMOS
it returns wrong values on boches , virtual pc and real hardware
Re: CMOS
Hello,
Always make sure to provide non-working code, what you expect for it to perform, and what it is doing. Also, you should never copy and paste code.
Always make sure to provide non-working code, what you expect for it to perform, and what it is doing. Also, you should never copy and paste code.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: CMOS
Some values in the CMOS could be stored in BCD format (there are hex values to be used them like decimal). Are you sure your code make this conversion?
Re: CMOS
You can also tell the RTC to store the date/time in binary mode by setting the bit 2 of the status register B. Binary mode is exactly what you would expect the value to be.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
-
- Member
- Posts: 223
- Joined: Thu Jul 05, 2007 8:58 am
Re: CMOS
Not all cmos implementations actually support that, so it is best to just read that register and write code for all possible situations, and not try to edit it.