35 lines
711 B
C
35 lines
711 B
C
#include "drivers.h"
|
|
#include "cmos/cmos.h"
|
|
#include "pit/pit.h"
|
|
#include "floppy/floppy.h"
|
|
#include "time.h"
|
|
#include "../hal/cpu/irq.h"
|
|
#include <debugio.h>
|
|
|
|
void DriversInstall_Clock()
|
|
{
|
|
// Set up PIT
|
|
PitSetFrequency(PIT_FREQUENCY);
|
|
|
|
// Update internal clock
|
|
Time time;
|
|
CmosGetRTC(&time);
|
|
|
|
TimeSetInternalTime(TimeConvertToTimeSystem(time));
|
|
|
|
Log("%#[Drivers] %#Read RTC time: ", ColorWhite, ColorLightGray);
|
|
Log("%#%u/%u/%u %u:%u:%u.%u\n", ColorLightCyan, time.Month, time.Day,
|
|
time.Year, time.Hour, time.Minute, time.Second, time.Milisecond);
|
|
}
|
|
|
|
|
|
void DriversInstall()
|
|
{
|
|
// Install clock
|
|
DriversInstall_Clock();
|
|
|
|
// Install fdc
|
|
IrqInstallHandler(6, FloppyIrqHandler);
|
|
FloppyInitialize();
|
|
}
|