Error with march (speaker) corrected
This commit is contained in:
parent
313c69a05b
commit
f844ed86a0
5
Makefile
5
Makefile
|
@ -194,6 +194,11 @@ $(KOBJDIR)/kernel/ke/cpuid.o: $(KALEIDDIR)/kernel/ke/cpuid.c \
|
||||||
@rm -f $@.1 $@.2
|
@rm -f $@.1 $@.2
|
||||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||||
|
|
||||||
|
$(KOBJDIR)/kernel/ke/shcmds.o: $(KALEIDDIR)/kernel/sh/shcmds.c | $(KOBJDIR)
|
||||||
|
@mkdir -p $(shell dirname $@)
|
||||||
|
@$(KCC_MATHS) -MM -MT $(@:%.d=%.o) -MF $@ $<
|
||||||
|
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||||
|
|
||||||
$(KOBJDIR)/kernel/mm/paging.o: $(KALEIDDIR)/kernel/mm/paging.c \
|
$(KOBJDIR)/kernel/mm/paging.o: $(KALEIDDIR)/kernel/mm/paging.c \
|
||||||
$(KALEIDDIR)/kernel/mm/paging.asm | $(KOBJDIR)
|
$(KALEIDDIR)/kernel/mm/paging.asm | $(KOBJDIR)
|
||||||
@mkdir -p $(shell dirname $@)
|
@mkdir -p $(shell dirname $@)
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
//----------------------------------------------------------------------------//
|
//----------------------------------------------------------------------------//
|
||||||
|
|
||||||
void IoStartSpeaker(int);
|
void IoStartSpeaker(int);
|
||||||
void IoQuietSpeaker(void);
|
|
||||||
void IoDoBeep(void);
|
void IoDoBeep(void);
|
||||||
void IoDoTone(uint tone, uint time);
|
void IoDoTone(uint tone, uint time);
|
||||||
void IoDoBeepNoIdt(void);
|
void IoDoBeepNoIdt(void);
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <io/spkr.h>
|
#include <io/spkr.h>
|
||||||
#include <ke/time.h>
|
#include <ke/time.h>
|
||||||
|
#include <lib/buf.h>
|
||||||
|
|
||||||
extern bool KeIdtIsInitialized;
|
extern bool KeIdtIsInitialized;
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ void IoStartSpeaker(int freq)
|
||||||
KeRestoreIRQs(flags);
|
KeRestoreIRQs(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IoQuietSpeaker(void)
|
static inline void IoQuietSpeaker(void)
|
||||||
{
|
{
|
||||||
ulong flags = KePauseIRQs();
|
ulong flags = KePauseIRQs();
|
||||||
IoWriteByteOnPort(0x61, IoReadByteFromPort(0x61) & 0xFC);
|
IoWriteByteOnPort(0x61, IoReadByteFromPort(0x61) & 0xFC);
|
||||||
|
@ -54,8 +55,7 @@ void IoQuietSpeaker(void)
|
||||||
void IoDoTone(uint tone, uint time)
|
void IoDoTone(uint tone, uint time)
|
||||||
{
|
{
|
||||||
IoStartSpeaker(tone);
|
IoStartSpeaker(tone);
|
||||||
KeDelayExecution(time);
|
KeSleep(time);
|
||||||
IoQuietSpeaker();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void IoDoToneNoIdt(uint tone, uint time)
|
static void IoDoToneNoIdt(uint tone, uint time)
|
||||||
|
@ -79,8 +79,6 @@ void IoDoBeepNoIdt(void)
|
||||||
|
|
||||||
void IoDoStarWars(void)
|
void IoDoStarWars(void)
|
||||||
{
|
{
|
||||||
size_t i;
|
|
||||||
|
|
||||||
struct Note {
|
struct Note {
|
||||||
uint tone;
|
uint tone;
|
||||||
uint time;
|
uint time;
|
||||||
|
@ -91,7 +89,6 @@ void IoDoStarWars(void)
|
||||||
{523, 60}, {87, 100}, {440, 200}, {110, 200},
|
{523, 60}, {87, 100}, {440, 200}, {110, 200},
|
||||||
{349, 140}, {87, 100}, {523, 60}, {87, 100},
|
{349, 140}, {87, 100}, {523, 60}, {87, 100},
|
||||||
{440, 200}, {110, 200}, {440, 200}, {110, 200},
|
{440, 200}, {110, 200}, {440, 200}, {110, 200},
|
||||||
|
|
||||||
{659, 200}, {110, 200}, {659, 200}, {110, 200},
|
{659, 200}, {110, 200}, {659, 200}, {110, 200},
|
||||||
{659, 200}, {87, 200}, {698, 140}, {87, 100},
|
{659, 200}, {87, 200}, {698, 140}, {87, 100},
|
||||||
{523, 60}, {87, 100}, {415, 200}, {87, 200},
|
{523, 60}, {87, 100}, {415, 200}, {87, 200},
|
||||||
|
@ -99,7 +96,14 @@ void IoDoStarWars(void)
|
||||||
{440, 200}, {110, 200}, {110, 200}, {110, 200}
|
{440, 200}, {110, 200}, {110, 200}, {110, 200}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i = 0; i < sizeof(score)/sizeof(struct Note); i++) {
|
//bprintf(BStdOut, "\n");
|
||||||
|
|
||||||
|
for (uint i = 0; i < sizeof(score)/sizeof(struct Note); i++) {
|
||||||
IoDoTone(score[i].tone, score[i].time);
|
IoDoTone(score[i].tone, score[i].time);
|
||||||
|
//bprintf(BStdOut, "%d ", i);
|
||||||
|
//BStdOut->flusher(BStdOut);
|
||||||
}
|
}
|
||||||
|
IoQuietSpeaker();
|
||||||
|
|
||||||
|
//bprintf(BStdOut, "FINISHED\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,6 +164,28 @@ error_t CmdDumpATASect(int argc, char **argv, char *cmdline)
|
||||||
return EOK;
|
return EOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error_t CmdFloat(int argc, char **argv, char *cmdline)
|
||||||
|
{
|
||||||
|
double param = (double)ShAtoi(argv[1]);
|
||||||
|
|
||||||
|
double b = 138899.009 / (14.9); //9322,0811409
|
||||||
|
|
||||||
|
double b_ent = (double)(ulong)b;
|
||||||
|
double dec = 0.0;
|
||||||
|
|
||||||
|
KernLog("int(b) = %d \n", (ulong)b_ent);
|
||||||
|
KernLog("dec(b) = ");
|
||||||
|
|
||||||
|
for(double i = 0; i < param; i++) {
|
||||||
|
dec = (((b*param) - (b_ent*param)) * 10.0 * i / param);
|
||||||
|
KernLog("%d", (ulong)dec);
|
||||||
|
}
|
||||||
|
|
||||||
|
KernLog("\n");
|
||||||
|
|
||||||
|
return EOK;
|
||||||
|
}
|
||||||
|
|
||||||
error_t CmdHelp(int argc, char **argv, char *cmdline)
|
error_t CmdHelp(int argc, char **argv, char *cmdline)
|
||||||
{
|
{
|
||||||
uint i, count = 0;
|
uint i, count = 0;
|
||||||
|
@ -338,8 +360,9 @@ static Command_t testcmdtable[] =
|
||||||
{ "args", CmdArgs, "Print command line" },
|
{ "args", CmdArgs, "Print command line" },
|
||||||
{ "dmpsec", CmdDumpATASect, "Dump an ATA sector on screen" },
|
{ "dmpsec", CmdDumpATASect, "Dump an ATA sector on screen" },
|
||||||
{ "help", CmdHelpTest, "Show this message" },
|
{ "help", CmdHelpTest, "Show this message" },
|
||||||
{ "pfault", CmdPF, "Provoke a PF. Usage: pfault <address>"},
|
{ "pf", CmdPF, "Provoke a PF. Usage: pfault <address>"},
|
||||||
{ "pstest", CmdPsTest, "Scheduler test routine" },
|
{ "ps", CmdPsTest, "Scheduler test routine" },
|
||||||
|
{ "float", CmdFloat, "Float test" },
|
||||||
{ "rpag", CmdReloadPage, "Reload the pages directory" },
|
{ "rpag", CmdReloadPage, "Reload the pages directory" },
|
||||||
{ "shell", CmdShell, "Start a new shell (nested)", },
|
{ "shell", CmdShell, "Start a new shell (nested)", },
|
||||||
{ "stkov", CmdStackOverflow, "Provoke a stack overflow" },
|
{ "stkov", CmdStackOverflow, "Provoke a stack overflow" },
|
||||||
|
|
Loading…
Reference in New Issue