This commit is contained in:
Adrien Bourmault 2019-11-15 21:31:10 +01:00
parent 884600cceb
commit c92cb89399
3 changed files with 12 additions and 21 deletions

View File

@ -31,6 +31,7 @@
# Debug
mode ?= debug
ram ?= 4G
cpu ?= core2duo
# Programs
ASM=nasm
@ -265,12 +266,12 @@ OS/K: $(dep) ./ProjectTree $(BINDIR)/kaleid
## QEMU/DEBUG RELATED
testkvm: all install
@qemu-system-x86_64 -vga std -cpu core2duo -enable-kvm -soundhw pcspk -s \
@qemu-system-x86_64 -vga std -enable-kvm -soundhw pcspk -s \
-rtc base=localtime -m $(ram) -hda $(installdisk) \
-d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log &
test: all install
@qemu-system-x86_64 -vga std -cpu core2duo -soundhw pcspk -s \
@qemu-system-x86_64 -vga std -cpu $(cpu) -soundhw pcspk -s \
-rtc base=localtime -m $(ram) -hda $(installdisk) \
-d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log &

View File

@ -40,9 +40,9 @@ void KeGetCpuInfos(void)
if (CpuInfo.featureFlag & FEAT_EDX_SSE) {
KeActivateSSE();
}
CpuInfo.frequency = KeGetCpuFrequency();
CpuInfo.frequency = KeGetCpuFrequency();
}
DebugLog("\tCPU %s %#d KHz detected with features %#x\n",
CpuInfo.vendorStr,

View File

@ -115,23 +115,12 @@ error_t CmdColor(int argc, char **argv, char *cmdline)
return EOK;
}
error_t CmdCpuid(int argc, char **argv, char *cmdline)
{
return EOK;
}
error_t CmdDate(int argc, char **argv, char *cmdline)
{
KernLog("%.10s\n", KeFormatCurTime());
return EOK;
}
error_t CmdDie(int argc, char **argv, char *cmdline)
{
*(char *)NULL += 1;
return EOK;
}
error_t CmdSleep(int argc, char **argv, char *cmdline)
{
int delay = ShAtoi(argv[1]);
@ -211,10 +200,13 @@ error_t CmdMemUsage(int argc, char **argv, char *cmdline);
error_t CmdPF(int argc, char **argv, char *cmdline)
{
for (int i = 0; i < 32; i++) {
KernLog("%dGB ", i);
*((char*)(i*GB)) = 1;
}
char *address = (void*)(ulong)ShAtoi(argv[1]);
KernLog("Provoking Page Fault at %#x\n", address);
*address = 1;
KernLog("No page fault : address was valid/present\n");
return EOK;
}
@ -307,9 +299,7 @@ Command_t shcmdtable[] =
{ "beep", CmdBeep, "Make a beep" },
{ "cls", CmdClear, "Clears standard output" },
{ "color", CmdColor, "Change shell text color" },
{ "cpuid", CmdCpuid, "Request a cpuid info." },
{ "date", CmdDate, "Print date" },
{ "die", CmdDie, "Die painfully" },
{ "dmpsec", CmdDumpATASect, "Dump an ATA sector on screen" },
{ "help", CmdHelp, "Show this message" },
{ "mmap", CmdMemMap, "Show memory map" },