Chameleon

Chameleon Commit Details

Date:2015-01-21 01:57:43 (4 years 10 months ago)
Author:ErmaC
Commit:2541
Parents: 2540
Message:Added getRTCdatetime() Int 1Ah function 02h - RTC service (Credits to Bungo)
Changes:
M/trunk/i386/libsaio/console.c
M/trunk/CHANGES
M/trunk/i386/libsaio/saio_internal.h

File differences

trunk/i386/libsaio/console.c
6767
6868
6969
70
71
72
73
74
75
76
77
78
79
80
81
7082
7183
7284
......
8698
8799
88100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
89126
90127
91128
char *msgbuf = 0;
char *cursor = 0;
// Bungo:
typedef struct {
uint16_t year;
uint8_t mon;
uint8_t day;
uint8_t hour;
uint8_t mins;
uint8_t secs;
uint8_t dlight;
} datetime_t;
static datetime_t datetime;
struct putc_info //Azi: exists on gui.c & printf.c
{
char * str;
return c;
}
uint64_t getRTCdatetime() // 0xYYYYMMDDHHMMSS0L in decimal
{
biosBuf_t bb;
bb.intno = 0x1a;
bb.eax.r.h = 0x04; // get RTC date
//bb.flags.cf = 0;
bios(&bb);
if (bb.flags.cf) return 0;
datetime.year = (bb.ecx.r.h >> 4) * 1000 + (bb.ecx.r.h & 0x0F) * 100 + (bb.ecx.r.l >> 4) * 10 + (bb.ecx.r.l & 0x0F) * 1;
datetime.mon = (bb.edx.r.h >> 4) * 10 + (bb.edx.r.h & 0x0F) * 1;
datetime.day = (bb.edx.r.l >> 4) * 10 + (bb.edx.r.l & 0x0F) * 1;
bb.intno = 0x1a;
bb.eax.r.h = 0x02; // get RTC time
//bb.flags.cf = 0;
bios(&bb);
if (bb.flags.cf) return 0;
datetime.dlight = bb.edx.r.l & 0x0F;
datetime.hour = (bb.ecx.r.h >> 4) * 10 + (bb.ecx.r.h & 0x0F) * 1;
datetime.mins = (bb.ecx.r.l >> 4) * 10 + (bb.ecx.r.l & 0x0F) * 1;
datetime.secs = (bb.edx.r.h >> 4) * 10 + (bb.edx.r.h & 0x0F) * 1;
return *(uint64_t *)&datetime;
}
void initBooterLog(void)
{
msgbuf = malloc(BOOTER_LOG_SIZE);
trunk/i386/libsaio/saio_internal.h
9898
9999
100100
101
101102
102103
103104
extern void stop(const char *format, ...) __attribute__ ((noreturn));
//Azi: replace getc/getchar with ? console.c
extern void pause();
extern uint64_t getRTCdatetime();
/* disk.c */
extern void rescanBIOSDevice(int biosdev);
trunk/CHANGES
1
12
23
34
- Bungo : Added getRTCdatetime() Int 1Ah function 02h - RTC service
- Zenith432 : Use caching with ExFat filesystem
- Zenith432 : Add turning off USB legacy for XHCI (XHCILegacyOff)
- ErmaC : C6 & C7 States credits to Clover Team.

Archive Download the corresponding diff file

Revision: 2541