Resolved #76...

This commit is contained in:
Adrien Bourmault 2020-01-08 21:10:24 +01:00
parent 737bea025f
commit 6785767528
4 changed files with 13 additions and 17 deletions

View File

@ -41,7 +41,7 @@ CCNAME=x86_64-elf-gcc
ASMFLAGS=-f elf64
LDFLAGS=-melf_x86_64
COPTIM=-O2
CWARNS=-Wall -Wextra -Wno-unused-parameter -Wno-implicit-fallthrough -Werror=implicit-function-declaration -Werror=return-type -Wpadded
CWARNS=-Wall -Wextra -Wno-unused-parameter -Wno-implicit-fallthrough -Werror=implicit-function-declaration -Werror=return-type #-Wpadded
CINCLUDES=-Iinclude
CFLAGS1=-nostdlib -ffreestanding -mcmodel=large -std=gnu11 -fstack-protector-all -fdump-rtl-expand
CFLAGS2= -c -mno-red-zone -mno-mmx -mno-sse -mno-sse2

View File

@ -31,17 +31,17 @@
//----------------------------------------------------------------------------//
void IoStartSpeaker(int);
void IoStartSpeaker(ulong);
void IoDoBeep(void);
void IoDoTone(uint tone, uint time);
void IoDoTone(ulong tone, ulong time);
void IoDoBeepNoIdt(void);
void IoDoStarWars(void);
struct Note
{
uint tone;
uint time;
ulong tone;
ulong time;
};
//----------------------------------------------------------------------------//

View File

@ -28,7 +28,7 @@
extern bool KeIdtIsInitialized;
const struct Note score[40] = { {440, 200}, {110, 200}, {440, 200}, {110, 200},
struct Note score[40] = { {440, 200}, {110, 200}, {440, 200}, {110, 200},
{440, 200}, {110, 200}, {349, 140}, {87, 100},
{523, 60}, {87, 100}, {440, 200}, {110, 200},
{349, 140}, {87, 100}, {523, 60}, {87, 100},
@ -37,13 +37,12 @@ const struct Note score[40] = { {440, 200}, {110, 200}, {440, 200}, {110, 200},
{659, 200}, {87, 200}, {698, 140}, {87, 100},
{523, 60}, {87, 100}, {415, 200}, {87, 200},
{349, 140}, {87, 100}, {523, 60}, {87, 100},
{440, 200}, {110, 200}, {110, 200}, {110, 200}
};
{440, 200}, {110, 200}, {110, 200}, {110, 200} };
void IoStartSpeaker(int freq)
void IoStartSpeaker(ulong freq)
{
uchar temp;
uint pitf = 1193180 / freq;
ulong pitf = 1193180 / freq;
ulong flags = KePauseIRQs();
IoWriteByteOnPort(0x43, 0xB6);
@ -64,13 +63,13 @@ static inline void IoQuietSpeaker(void)
KeRestoreIRQs(flags);
}
void IoDoTone(uint tone, uint time)
void IoDoTone(ulong tone, ulong time)
{
IoStartSpeaker(tone);
KeSleep(time);
}
static void IoDoToneNoIdt(uint tone, uint time)
static void IoDoToneNoIdt(ulong tone, ulong time)
{
extern void temporize(void);
IoStartSpeaker(tone);
@ -94,10 +93,7 @@ void IoDoBeepNoIdt(void)
void IoDoStarWars(void)
{
for (uint i = 0; i < 40; i++) {
//IoDoTone(score[i].tone, score[i].time);
bprintf(BStdOut, "At %p : %u\n", &(score[i].tone), score[i].tone);
bprintf(BStdOut, "At %p : %u\n", &(score[i].time), score[i].time);
BStdOut->flusher(BStdOut);
IoDoTone(score[i].tone, score[i].time);
}
IoQuietSpeaker();

View File

@ -59,7 +59,7 @@ void MmInitPaging(void)
// STACK GUARD PAGE
if ((ulong)(i*KPAGESIZE) == (ulong)BtLoaderInfo.stackEndAddr) {
MmPT[i] = ((ulong)(i*KPAGESIZE));
MmStackGuards[0] = ((ulong)(i*KPAGESIZE));
MmStackGuards[0] = ((ulong)(i*KPAGESIZE ));
continue;
}