Hello fellow developers,
I've encountered a problem while getting time from CMOS in QEMU
The problem is converting BCD time to plain binary.
(bcd >> 1) + (bcd >> 3) + (bcd & 0xf), this doesn't work , optimized version doesn't work either.
Any help?
QEMU time problem
- xenos
- Member
- Posts: 1121
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: QEMU time problem
The problem is not related to QEMU, but to your BCD conversion formula. As pointed out in this post, it should be
((bcd & 0xF0) >> 1) + ((bcd & 0xF0) >> 3) + (bcd & 0x0F)
((bcd & 0xF0) >> 1) + ((bcd & 0xF0) >> 3) + (bcd & 0x0F)
Re: QEMU time problem
That didn't work either
Re: QEMU time problem
You say it doesn't work. Mind describing how it doesn't work?
I am not an expert on this, but if the problem is that the time showing up isn't correct, are you even sure that QEMU has the right time in the CMOS?
I am not an expert on this, but if the problem is that the time showing up isn't correct, are you even sure that QEMU has the right time in the CMOS?
Re: QEMU time problem
Well if I display the time, seconds for example, as hexademical it shows the right time, when I use the code above it just shows some well, crap, pardon my French
- xenos
- Member
- Posts: 1121
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: QEMU time problem
This could have one of these reasons:
- The input data is not BCD coded.
- The number you get out of this formula is wrong (unlikely).
- The printf function for decimal numbers does not work properly.
Re: QEMU time problem
Print for numbers works, but I think that the format is not BCD coded, because the formula produces the wrong output >_>
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: QEMU time problem
This is a QEMU problem and has been fixed in version 0.14.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]