[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
|
||||
|
||||
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) \
|
||||
-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
|
||||
KeSetupIDT();
|
||||
KeEnableIRQs();
|
||||
KeGetCpuInfos();
|
||||
MmInitGdt();
|
||||
|
||||
// Start drivers
|
||||
// Clocks
|
||||
KeEnableRTC();
|
||||
KeEnablePIT();
|
||||
|
||||
// Start drivers
|
||||
KeGetCpuInfos();
|
||||
IoEnableKeyb();
|
||||
MmActivatePageHandler();
|
||||
|
||||
|
|
|
@ -121,10 +121,10 @@ static void UpdateCurTime(void)
|
|||
uchar minRemain, hourRemain, dayRemain;
|
||||
|
||||
CurTime.sec =
|
||||
(uchar)(((ulong)KeGetOriginTime()->sec + (Ticks / frequency)) % 60);
|
||||
(uchar)(((ulong)KeGetOriginTime()->sec * frequency + Ticks) / frequency % 60);
|
||||
|
||||
minRemain =
|
||||
(uchar)(((ulong)KeGetOriginTime()->sec + (Ticks / frequency)) / 60);
|
||||
(uchar)(((ulong)KeGetOriginTime()->sec * frequency + Ticks) / (60 * frequency));
|
||||
|
||||
CurTime.min =
|
||||
(uchar)(((ulong)KeGetOriginTime()->min + minRemain) % 60);
|
||||
|
|
Loading…
Reference in New Issue