From 184738af615dc0cbf855e32eff6a673e4bf50f0a Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Wed, 8 May 2019 00:08:45 +0200 Subject: [PATCH] Star Wars! --- kaleid/kernel/init/init.c | 10 ++++++++++ kaleid/kernel/io/keyb.c | 2 ++ 2 files changed, 12 insertions(+) diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index abacf82..234af40 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -100,12 +100,22 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg) // Main loop while ((rc = bgetc(BStdIn, &ch)) == EOK) { switch (ch) { + + case 7: // BEL + if (rand() % 32 == 0) { + IoDoStarWars(); + } + else IoDoBeep(); + break; + case 17: // DC1 IoScrollUp(); break; + case 18: // DC2 IoScrollDown(); break; + case 27: // ESC BFlushBuf(BStdOut); PoShutdownQemu(); diff --git a/kaleid/kernel/io/keyb.c b/kaleid/kernel/io/keyb.c index fd5721a..b3eb126 100644 --- a/kaleid/kernel/io/keyb.c +++ b/kaleid/kernel/io/keyb.c @@ -96,6 +96,8 @@ void ScanCodesInit(void) ScanCodes[0x1C] = '\n'; ScanCodes[0x39] = ' '; + ScanCodes[0x40] = 7; // BEL + // Numpad ScanCodes[0x48] = 17; // DC1, will serve as Arrow Up ScanCodes[0x50] = 18; // DC2, will serve as Arrow Down