mirror of
https://gitlab.os-k.eu/os-k-team/os-k.git
synced 2023-08-25 14:03:10 +02:00
time
This commit is contained in:
parent
50e29d5ad1
commit
1423366d88
@ -66,20 +66,6 @@ extern void IoEnableNMI(void);
|
||||
extern void IoDisableNMI(void);
|
||||
extern void IdtRegisterIrq(void (*isr)(void), uchar irq, uchar flags);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uchar sec;
|
||||
uchar min;
|
||||
uchar hour;
|
||||
uchar weekday;
|
||||
uchar day;
|
||||
uchar month;
|
||||
uchar year;
|
||||
uchar century;
|
||||
} Time_t;
|
||||
|
||||
extern void IoPrintRtcTime(void);
|
||||
|
||||
//
|
||||
// Restore IRQ flag to its state before KePauseIRQs
|
||||
//
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <kernel/mboot.h>
|
||||
#include <kernel/heap.h>
|
||||
#include <kernel/mm.h>
|
||||
#include <kernel/time.h>
|
||||
|
||||
// info.c
|
||||
extern void BtDoSanityChecks(uint mbMagic);
|
||||
@ -40,11 +41,6 @@ extern error_t IoInitVGABuffer(void);
|
||||
extern void IoSetupKeyb(void);
|
||||
extern void IoEnableKeyb(void);
|
||||
|
||||
//io/rtc.c
|
||||
extern void IoSetupRtc(void);
|
||||
extern void IoEnableRtc(void);
|
||||
extern ulong IoRtcTicks;
|
||||
|
||||
// cpu/idt.c
|
||||
extern void IdtSetup(void);
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <kernel/base.h>
|
||||
#include <kernel/iomisc.h>
|
||||
#include <extras/buf.h>
|
||||
#include <kernel/time.h>
|
||||
|
||||
extern void RtcIsr(void);
|
||||
|
||||
@ -32,9 +33,6 @@ ulong IoRtcTicks = 0;
|
||||
|
||||
Time_t IoRtcTime;
|
||||
|
||||
char* WeekDays[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
|
||||
|
||||
|
||||
void IoSetupRtc(void)
|
||||
{
|
||||
IdtRegisterIrq(RtcIsr, 0x28, 0x8E);
|
||||
@ -195,3 +193,14 @@ void IoPrintRtcTime(void)
|
||||
IoRtcTime.sec
|
||||
);
|
||||
}
|
||||
|
||||
Time_t* IoGetRtcTime(void)
|
||||
{
|
||||
return &IoRtcTime;
|
||||
}
|
||||
|
||||
ulong IoGetRtcTicks(void)
|
||||
{
|
||||
return IoRtcTicks;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user