[Inconsistent] Work on Cpu
This commit is contained in:
parent
21b15dcffe
commit
b016271c24
2
Makefile
2
Makefile
|
@ -265,7 +265,7 @@ OS/K: $(dep) ./ProjectTree $(BINDIR)/kaleid
|
||||||
## QEMU/DEBUG RELATED
|
## QEMU/DEBUG RELATED
|
||||||
|
|
||||||
test: all install
|
test: all install
|
||||||
@qemu-system-x86_64 -vga std -cpu core2duo -soundhw pcspk -s \
|
@qemu-system-x86_64 -vga std -cpu core2duo -enable-kvm -soundhw pcspk -s \
|
||||||
-rtc base=localtime -m $(ram) -hda $(installdisk) \
|
-rtc base=localtime -m $(ram) -hda $(installdisk) \
|
||||||
-d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log &
|
-d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log &
|
||||||
|
|
||||||
|
|
|
@ -68,12 +68,14 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
|
||||||
// Interrupts launching
|
// Interrupts launching
|
||||||
KeSetupIDT();
|
KeSetupIDT();
|
||||||
KeEnableIRQs();
|
KeEnableIRQs();
|
||||||
KeGetCpuInfos();
|
|
||||||
MmInitGdt();
|
MmInitGdt();
|
||||||
|
|
||||||
// Start drivers
|
// Clocks
|
||||||
KeEnableRTC();
|
KeEnableRTC();
|
||||||
KeEnablePIT();
|
KeEnablePIT();
|
||||||
|
|
||||||
|
// Start drivers
|
||||||
|
KeGetCpuInfos();
|
||||||
IoEnableKeyb();
|
IoEnableKeyb();
|
||||||
MmActivatePageHandler();
|
MmActivatePageHandler();
|
||||||
|
|
||||||
|
|
|
@ -121,10 +121,10 @@ static void UpdateCurTime(void)
|
||||||
uchar minRemain, hourRemain, dayRemain;
|
uchar minRemain, hourRemain, dayRemain;
|
||||||
|
|
||||||
CurTime.sec =
|
CurTime.sec =
|
||||||
(uchar)(((ulong)KeGetOriginTime()->sec + (Ticks / frequency)) % 60);
|
(uchar)(((ulong)KeGetOriginTime()->sec * frequency + Ticks) / frequency % 60);
|
||||||
|
|
||||||
minRemain =
|
minRemain =
|
||||||
(uchar)(((ulong)KeGetOriginTime()->sec + (Ticks / frequency)) / 60);
|
(uchar)(((ulong)KeGetOriginTime()->sec * frequency + Ticks) / (60 * frequency));
|
||||||
|
|
||||||
CurTime.min =
|
CurTime.min =
|
||||||
(uchar)(((ulong)KeGetOriginTime()->min + minRemain) % 60);
|
(uchar)(((ulong)KeGetOriginTime()->min + minRemain) % 60);
|
||||||
|
|
Loading…
Reference in New Issue