From fdfaf07c51ec46266bebd298c2cbdbe2dfc65492 Mon Sep 17 00:00:00 2001 From: Bas Wijnen Date: Sun, 27 Dec 2009 00:12:35 +0100 Subject: [PATCH] make things work --- boot-programs/buzzer.ccp | 5 +- boot-programs/charset | 1752 ++++++++++++++++--------------- boot-programs/init.ccp | 27 +- boot-programs/lcd.ccp | 12 +- boot-programs/metronome.ccp | 3 +- boot-programs/nanonote-gpio.ccp | 13 +- boot-programs/udc.ccp | 3 + invoke.ccp | 2 +- memory.ccp | 2 +- mips/arch.ccp | 6 +- mips/init.ccp | 3 + mips/nanonote/Makefile.arch | 4 +- 12 files changed, 917 insertions(+), 915 deletions(-) diff --git a/boot-programs/buzzer.ccp b/boot-programs/buzzer.ccp index 9dad386..7fdcef4 100644 --- a/boot-programs/buzzer.ccp +++ b/boot-programs/buzzer.ccp @@ -121,15 +121,14 @@ Kernel::Num start (): Kernel::free_cap (reply) break case Buzzer::STOP: - kdebug ("stop\n") buzzer.stop () Kernel::recv.reply.invoke () break default: - kdebug ("other\n") + kdebug ("Buzzer: other\n") break break default: - kdebug ("unknown num: ") + kdebug ("Buzzer: unknown num: ") kdebug_num (Kernel::recv.protected_data.h) kdebug ("\n") diff --git a/boot-programs/charset b/boot-programs/charset index 2602743..5a073a7 100755 --- a/boot-programs/charset +++ b/boot-programs/charset @@ -1,883 +1,887 @@ #!/usr/bin/env python data = """ -...... -...... -...... -...... -...... -...... -...... -...... - -..#... -..#... -..#... -..#... -...... -..#... -...... -...... - -.#.#.. -.#.#.. -.#.#.. -...... -...... -...... -...... -...... - -...... -.#.#.. -#####. -.#.#.. -#####. -.#.#.. -...... -...... - -..#... -.####. -#.#... -.###.. -..#.#. -####.. -..#... -...... - -...... -#...#. -.#.... -..#... -...#.. -#...#. -...... -...... - -.#.... -#.#... -.#.... -#.#.#. -#..#.. -.##.#. -...... -...... - -...#.. -...#.. -..#... -...... -...... -...... -...... -...... - -....#. -...#.. -..#... -..#... -..#... -...#.. -....#. -...... - -#..... -.#.... -..#... -..#... -..#... -.#.... -#..... -...... - -...... -#...#. -.#.#.. -#####. -.#.#.. -#...#. -...... -...... - -...... -..#... -..#... -#####. -..#... -..#... -...... -...... - -...... -...... -...... -...... -..#... -..#... -.#.... -...... - -...... -...... -...... -...... -#####. -...... -...... -...... - -...... -...... -...... -...... -...... -..#... -...... -...... - -...... -....#. -...#.. -..#... -.#.... -#..... -...... -...... - -...... -.###.. -#...#. -#.#.#. -#...#. -.###.. -...... -...... - -...... -..#... -.##... -..#... -..#... -.###.. -...... -...... - -...... -.###.. -#...#. -..##.. -.#.... -#####. -...... -...... - -...... -.###.. -#...#. -..##.. -#...#. -.###.. -...... -...... - -...... -.#.#.. -#..#.. -#####. -...#.. -...#.. -...... -...... - -...... -#####. -#..... -####.. -....#. -####.. -...... -...... - -...#.. -..#... -.###.. -#...#. -#...#. -.###.. -...... -...... - -...... -#####. -....#. -...#.. -...#.. -..#... -..#... -...... - -...... -.###.. -#...#. -.###.. -#...#. -.###.. -...... -...... - -...... -.###.. -#...#. -#...#. -.###.. -..#... -.#.... -...... - -...... -...... -..#... -...... -...... -..#... -...... -...... - -...... -...... -..#... -...... -...... -..#... -.#.... -...... - -...... -....#. -..##.. -##.... -..##.. -....#. -...... -...... - -...... -...... -#####. -...... -#####. -...... -...... -...... - -...... -#..... -.##... -...##. -.##... -#..... -...... -...... - -.###.. -#...#. -#...#. -...#.. -..#... -...... -..#... -...... - -...... -####.. -....#. -.##.#. -#.#.#. -.###.. -...... -...... - -..#... -.#.#.. -#...#. -#####. -#...#. -#...#. -...... -...... - -###... -#..#.. -####.. -#...#. -#...#. -####.. -...... -...... - -.###.. -#...#. -#..... -#..... -#...#. -.###.. -...... -...... - -###... -#..#.. -#...#. -#...#. -#..#.. -###... -...... -...... - -#####. -#..... -###... -#..... -#..... -#####. -...... -...... - -#####. -#..... -#..... -###... -#..... -#..... -...... -...... - -.###.. -#..... -#..... -#..##. -#...#. -.###.. -...... -...... - -#...#. -#...#. -#####. -#...#. -#...#. -#...#. -...... -...... - -.###.. -..#... -..#... -..#... -..#... -.###.. -...... -...... - -..###. -...#.. -...#.. -...#.. -#..#.. -.##... -...... -...... - -#...#. -#..#.. -#.#... -###... -#..#.. -#...#. -...... -...... - -#..... -#..... -#..... -#..... -#..... -#####. -...... -...... - -#...#. -##.##. -#.#.#. -#...#. -#...#. -#...#. -...... -...... - -#...#. -##..#. -#.#.#. -#..##. -#...#. -#...#. -...... -...... - -.###.. -#...#. -#...#. -#...#. -#...#. -.###.. -...... -...... - -####.. -#...#. -#...#. -####.. -#..... -#..... -...... -...... - -.###.. -#...#. -#...#. -#.#.#. -#..#.. -.##.#. -...... -...... - -####.. -#...#. -#...#. -####.. -#..#.. -#...#. -...... -...... - -.####. -#..... -.###.. -....#. -....#. -####.. -...... -...... - -#####. -..#... -..#... -..#... -..#... -..#... -...... -...... - -#...#. -#...#. -#...#. -#...#. -#...#. -.###.. -...... -...... - -#...#. -#...#. -.#.#.. -.#.#.. -..#... -..#... -...... -...... - -#...#. -#...#. -#.#.#. -#.#.#. -.#.#.. -.#.#.. -...... -...... - -#...#. -#...#. -.###.. -.#.#.. -#...#. -#...#. -...... -...... - -#...#. -#...#. -.#.#.. -..#... -.#.... -#..... -...... -...... - -#####. -...#.. -..#... -.#.... -#..... -#####. -...... -...... - -..###. -..#... -..#... -..#... -..#... -..#... -..###. -...... - -...... -#..... -.#.... -..#... -...#.. -....#. -...... -...... - -###... -..#... -..#... -..#... -..#... -..#... -###... -...... - -..#... -.#.#.. -#...#. -...... -...... -...... -...... -...... - -...... -...... -...... -...... -...... -#####. -...... -...... - -..#... -..#... -...#.. -...... -...... -...... -...... -...... - -...... -.##.#. -#..##. -#...#. -#..##. -.##.#. -...... -...... - -#..... -#..... -####.. -#...#. -#...#. -####.. -...... -...... - -...... -.###.. -#...#. -#..... -#...#. -.###.. -...... -...... - -....#. -....#. -.####. -#...#. -#...#. -.####. -...... -...... - -...... -.###.. -#...#. -####.. -#..... -.####. -...... -...... - -...#.. -..#.#. -..#... -.###.. -..#... -..#... -...... -...... - -...... -.####. -#...#. -#...#. -.####. -....#. -.###.. -...... - -#..... -#..... -####.. -#...#. -#...#. -#...#. -...... -...... - -..#... -...... -..#... -..#... -..#... -..#... -...... -...... - -..#... -...... -..#... -..#... -..#... -#.#... -.#.... -...... - -#..... -#..#.. -#.#... -##.... -#.#... -#..#.. -...... -...... - -..#... -..#... -..#... -..#... -..#... -..#... -...... -...... - -...... -.#.#.. -#.#.#. -#.#.#. -#...#. -#...#. -...... -...... - -...... -#.##.. -##..#. -#...#. -#...#. -#...#. -...... -...... - -...... -.###.. -#...#. -#...#. -#...#. -.###.. -...... -...... - -...... -####.. -#...#. -#...#. -####.. -#..... -#..... -...... - -...... -.####. -#...#. -#...#. -.####. -....#. -....#. -...... - -...... -#.##.. -##..#. -#..... -#..... -#..... -...... -...... - -...... -.####. -#..... -.###.. -....#. -####.. -...... -...... - -...... -..#... -.###.. -..#... -..#.#. -...#.. -...... -...... - -...... -#...#. -#...#. -#...#. -#...#. -.###.. -...... -...... - -...... -#...#. -#...#. -.#.#.. -.#.#.. -..#... -...... -...... - -...... -#...#. -#...#. -#.#.#. -#.#.#. -.#.#.. -...... -...... - -...... -#...#. -.#.#.. -..#... -.#.#.. -#...#. -...... -...... - -...... -#...#. -.#.#.. -..#... -.#.... -#..... -...... -...... - -...... -#####. -...#.. -..#... -.#.... -#####. -...... -...... - -...##. -..#... -..#... -##.... -..#... -..#... -...##. -...... - -..#... -..#... -..#... -..#... -..#... -..#... -..#... -...... - -##.... -..#... -..#... -...##. -..#... -..#... -##.... -...... - -...... -...... -.#.... -#.#.#. -...#.. -...... -...... -...... - -#####. -#...#. -#.#.#. -#.#.#. -#.#.#. -#...#. -#####. -...... + . . . . . . +. . . . . . + . . . . . . +. . . . . . + . . . . . . +. . . . . . + . . . . . . +. . . . . . + + . . . . # . +. . . . # . + . . . # . . +. . . # . . + . . # . . . +. . . . . . + . # . . . . +. . . . . . + + . # # . # # +. . # . . # + + # . + # . +. . . . . . + . . . . . . +. . . . . . + . . . . . . +. . . . . . + + . . . . . . +. . . . . . + . . # . # . +. # # # # # + . # . # . . +# # # # # . + # . # . . . +. . . . . . + + . . . . # . +. . # # # # + . # . # . . +. . # # # . + . . # . # . +. # # # # . + . # . . . . +. . . . . . + + . . . . . . +. # # . # . + . # . # . . +. . . # . . + . . # . . . +. . # . # . + . # . # # . +. . . . . . + + . # # . . . +. # . # . . + . # # . . . +. . # . . . + . # # . # . +. # . # # . + . # # # # . +. . . . . . + + . . # # . . +. . . # . . + . + # . . . +. . . . . . + . . . . . . +. . . . . . + . . . . . . +. . . . . . + + . . . + # # +. . . # . . + . . # . . . +. . # . . . + . # . . . . +. . # . . . + . . # # . . +. . . . . . + + . . # # . . +. . . . # . + . . . . # . +. . . . # . + . . . # . . +. . . # . . + # # + . . . +. . . . . . + + . # . . # . +. . # . # . + . . # # . . +. # # # # # + . . # # . . +. . # . # . + . # . . # . +. . . . . . + + . . . . . . +. . . . . . + . . . # . . +. . . # . . + # # # # # . +. . # . . . + . # . . . . +. . . . . . + + . . . . . . +. . . . . . + . . . . . . +. . . . . . + . . . . . . +. . # # . . + . . # . . . +. + # . . . + + . . . . . . +. . . . . . + . . . . . . +. . . . . . + . # # # # . +. . . . . . + . . . . . . +. . . . . . + + . . . . . . +. . . . . . + . . . . . . +. . . . . . + . . . . . . +. . . # . . + . . # # . . +. . . . . . + + . . . . . . +. . . . # . + . . . # . . +. . . # . . + . . # . . . +. . # . . . + . # . . . . +. . . . . . + + . . . . . . +. . + # # . + . # + . # . +. # . . # . + # . . # . . +# . + # . . + # # + . . . +. . . . . . + + . . . . . . +. . . . # . + . . # # . . +. . . # . . + . . # . . . +. . # . . . + # # # . . . +. . . . . . + + . . . . . . +. . + # # . + . + + . # . +. . . . # . + . + # . . . +. # . . . . + # # # # . . +. . . . . . + + . . . . . . +. . # # # . + . . . . # . +. . . + # . + . + # . . . +. . . # . . + # # # . . . +. . . . . . + + . . . . . . +. . # . . # + . # . . # . +. # # # # . + . . . # . . +. . . # . . + . . # . . . +. . . . . . + + . . . . . . +. . # # # # + . # . . . . +. # # # . . + . . . # . . +. . . . # . + # # # # . . +. . . . . . + + . . . + # . +. . . # . . + . . # . . . +. . # # # . + . # . . # . +. # . . # . + . # # # . . +. . . . . . + + . . . . . . +. . # # # # + . . . . # . +. . . . # . + . . + + . . +. . + + . . + . # . . . . +. . . . . . + + . . . . . . +. . + # # . + . # . . # . +. + # # + . + # . . # . . +# . . # . . + # # + . . . +. . . . . . + + . . . . . . +. . + # # . + . # . . # . +. # . + # . + . # + # . . +. . . # . . + # # # . . . +. . . . . . + + . . . . . . +. . . # . . + . . # # . . +. . . . . . + . . . . . . +. # # . . . + . # . . . . +. . . . . . + + . . . . . . +. . . # . . + . . # # . . +. . . . . . + . . . . . . +. # # . . . + . # . . . . ++ # . . . . + + . . . . . . +. . . # + . + . + + . . . +. # . . . . + . # . . . . +. . # . . . + . . # . . . +. . . . . . + + . . . . . . +. . . . . . + . # # # # . +. . . . . . + . . . . . . +# # # # . . + . . . . . . +. . . . . . + + . . . . . . +. . # . . . + . . # . . . +. . . # . . + . . . # . . +. . + + . . + + # . . . . +. . . . . . + + . . # # . . +. . # . # . + . . . . # . +. . . + # . + . . # . . . +. . . . . . + . # . . . . +. . . . . . + + . . # # # . +. . # . . # + . # . # . # +. # . # + # + # . # # # . +. # . . . . + . # # # . . +. . . . . . + + . . . + # . +. . . # . # + . . # . . # +. . # # # # + . # . . # . +. # . . # . + # . . # . . +. . . . . . + + . . . # # . +. . . # . # + . . # . # . +. . # # # . + . # . . # . +. # . + # . + # # # + . . +. . . . . . + + . . + # # . +. . # + . # + . # . . . . +. # . . . . + # . . . . . ++ + . + + . + # # # . . . +. . . . . . + + . . . # # . +. . . # . # + . . # . . # +. . # . . # + . # . . # . +. # . + # . + # # # + . . +. . . . . . + + . . . # # # +. . . # . . + . . # . . . +. . # # . . + . # . . . . +. # . . . . + # # # . . . +. . . . . . + + . . . # # # +. . . # . . + . . # . . . +. . # # . . + . # . . . . +. # . . . . + # . . . . . +. . . . . . + + . . + # # . +. . # + . # + . # . . . . +. # . . . . + # . # # . . ++ + . # . . + + # # . . . +. . . . . . + + . . . # . # +. . . # . # + . . # . # . +. . # # # . + . # . # . . +. # . # . . + # . # . . . +. . . . . . + + . . . # # # +. . . . # . + . . . # . . +. . . # . . + . . # . . . +. . # . . . + # # # . . . +. . . . . . + + . . . # # # +. . . . # . + . . . # . . +. . . # . . + . . # . . . +# . # . . . + # # . . . . +. . . . . . + + . . . # . # +. . . # . # + . . # . # . +. . # # + . + . # + . . . +. # . # . . + # . . # . . +. . . . . . + + . . . # . . +. . . # . . + . . # . . . +. . # . . . + . # . . . . +. # . . . . + # # # # . . +. . . . . . + + . . # . # # +. . # + # + + . # . # . # +. # . . . # + # . . . # . +# . . . # . + + . . # . . +. . . . . . + + . . # . . # +. . # # . + + . # + + . # +. # . # . # + # . + + # . +# . . # # . + + . . # . . +. . . . . . + + . . . # # . +. . # + . # + . # . . . # +. # . . . # + # . . . # . +# . . + # . + # # # . . . +. . . . . . + + . . . # # . +. . . # . # + . . # . . # +. . # . + # + . # # # + . +. # . . . . + # . . . . . +. . . . . . + + . . . # # . +. . # + . # + . # . . . # +. # . . . # + # . . # # . +# . . . # . + # # # . # . +. . . . . . + + . . . # # . +. . . # . # + . . # . . # +. . # . + # + . # # # + . +. # . # . . + # . . # . . +. . . . . . + + . . + # # # +. . # + . . + . # . . . . +. . # # . . + . . . # . . +. . . . # . + # # # # . . +. . . . . . + + . # # # # # +. . . # . . + . . # . . . +. . # . . . + . # . . . . +. # . . . . + # . . . . . +. . . . . . + + . . # . . # +. . # . . # + . # . . # . +. # . . # . + # . . # . . +# . + # . . + # # + . . . +. . . . . . + + . + . . . # +. # . . . # + + . . . # . +. # . . # . + + . . # . . +. # + + . . + . # . . . . +. . . . . . + + . . # . . + +. . # . . + + . # . . . # +. # . . . # + # . # . # . +# + # . # . + # + # # . . +. . . . . . + + . # . . . # +. . # . . # + . . # # + . +. . . # . . + . + # # . . +. # . . # . + # . . . # . +. . . . . . + + . # . . . # +. . # . . # + . . # # + . +. . . # . . + . + # . . . +. # . . . . + # . . . . . +. . . . . . + + . . # # # # +. . . . . # + . . . # + . +. . . # . . + . + # . . . +. # . . . . + # # # # . . +. . . . . . + + . . . # # # +. . . # . . + . . # . . . +. . # . . . + . # . . . . +. # . . . . + # # # . . . +. . . . . . + + . # . . . . +. . # . . . + . . # . . . +. . . # . . + . . . # . . +. . . . # . + . . . . # . +. . . . . . + + . . . # # # +. . . . . # + . . . . # . +. . . . # . + . . . # . . +. . . # . . + # # # . . . +. . . . . . + + . . . + # . +. . + # . # + . # . . . # +. . . . . . + . . . . . . +. . . . . . + . . . . . . +. . . . . . + + . . . . . . +. . . . . . + . . . . . . +. . . . . . + . . . . . . +. . . . . . + # # # # # . +. . . . . . + + . . # # . . +. . . # . . + . . + # . . +. . . . . . + . . . . . . +. . . . . . + . . . . . . +. . . . . . + + . . . . . . +. . # # + # + . # . # # . +. # . . # . + # . . # . . +. # + # . . + . # # . . . +. . . . . . + + . . . # . . +. . . # . . + . . # . . . +. . # # # . + . # . . # . +. # . . # . + # # # # . . +. . . . . . + + . . . . . . +. . . # # . + . # + . # . +. # . . . . + # . . . . . +. # . # . . + . # + . . . +. . . . . . + + . . . . . # +. . . . . # + . . # # # . +. # + . # . + # . . # . . +# . . # . . + # # # . . . +. . . . . . + + . . . . . . +. . + # # . + . # . . # . +. # # # + . + # . . . . . +. # . . . . + . # # . . . +. . . . . . + + . . . # # . +. . . # . # + . . # . . . +. # # # . . + . # . . . . +. # . . . . + # . . . . . +. . . . . . + + . . . . . . +. . . # # # + . . # . . # +. . . # # # + . . . . # . +. . . + # . + . # # . . . +. . . . . . + + . . . # . . +. . . # . . + . . # . . . +. . # . . . + . # # # . . +. # . . # . + # . . # . . +. . . . . . + + . . . . # . +. . . . . . + . . . # . . +. . . # . . + . . # . . . +. . # . . . + . # . . . . +. . . . . . + + . . . . # . +. . . . . . + . . . # . . +. . . # . . + . . # . . . +. . # . . . + . # . . . . +# # . . . . + + . . . # . . +. . . # . . + . . # . . . +. . # . . . + . # + # . . +. # # + . . + # . # + . . +. . . . . . + + . . . . # . +. . . . # . + . . . # . . +. . . # . . + . . # . . . +. . # . . . + . # . . . . +. . . . . . + + . . . . . . +. . . # # # + . . # + + # +. . # + + # + . # + + # . +. # + + # . + # + + # . . +. . . . . . + + . . . . . . +. . . # + # + . . # # + # +. . # . . # + . # . . # . +. # . . # . + # . . # . . +. . . # . . + + . . . . . . +. . + # # . + . # + . # . +. # . . . # + # . . . # . +. # . + # . + . # # + . . +. . . . . . + + . . . . . . +. . . # # # + . . # . . # +. . # . . # + . # # # + . +. # . . . . + # . . . . . +. . . . . . + + . . . . . . +. . + # # # + . # . . # . +. # . . # . + . # # # . . +. . . # . . + . . # . . . +. . # . . . + + . . . . . . +. . . # + # + . . # # . # +. . # . . . + . # . . . . +. # . . . . + # . . . . . +. . . . . . + + . . . . . . +. . # # # # + . # . . . . +. . # # . . + . . . # . . +. . . . # . + # # # # . . +. . . . . . + + . . . . . . +. . . # . . + . # # # . . +. . # . . . + . # . . . . +. # . # . . + . # + . . . +. . . . . . + + . . . . . . +. . # . . # + . # . . # . +. # . . # . + # . . # . . +# . + # . . + # # + . . . +. . . . . . + + . . . . . . +. + # . . + + . # . . . # +. + + . + # + . # . # + . +. # . # . . + . # . . . . +. . . . . . + + . . . . . . +. . # . . + + . # . . . # +. # . # . # + # . # . # . +# . # . # . + # # # + . . +. . . . . . + + . . . . . . +. . # . . # + . . # . # . +. . + # + . + . + # + . . +. # . # . . + # . . # . . +. . . . . . + + . . . . . . +. . # . . # + . # . . # . +. . # # # . + . . . # . . +. . + # . . + # # + . . . +. . . . . . + + . . . . . . +. . # # # # + . . . . # . +. . . # + . + . + # . . . +. # . . . . + # # # # . . +. . . . . . + + . . . + # # +. . . # . . + . . # . . . +. # + . . . + . # . . . . +. # . . . . + + # # . . . +. . . . . . + + . . . . # . +. . . . # . + . . . # . . +. . . # . . + . . # . . . +. . # . . . + . # . . . . +. . . . . . + + . . . # # + +. . . . . # + . . . . # . +. . . . + # + . . . # . . +. . . # . . + # # + . . . +. . . . . . + + . # # . . . +. # . # . # + . . . # # . +. . . . . . + . . . . . . +. . . . . . + . . . . . . +. . . . . . + + . . . . . . +. # + # + . + . # + # + . +. + # + # . + . + # + # . +. # + # + . + . # + # + . +. . . . . . + """ -# """ # add quotes, because vim thinkt the qotes on the previous line start a string. +# """ # add quotes, because vim thinks the qotes on the previous line start a string. import sys -charsize = 7 * 8 + 1 +charsize = 25 * 4 + 1 for c in range (128 - 32): line = [] for l in range (8): - offset = 1 + c * charsize + 7 * l - line += [int (data[offset:offset + 6].replace ('.', '0').replace ('#', '1'), 2)] - kols = [] - for k in range (5, -1, -1): - d = 0 - for l in range (8): - if line[l] & (1 << k): - d += 1 << l - sys.stdout.write (chr (d)) + offset = 2 + c * charsize + 25 * (l >> 1) + 12 * (l & 1) + ln = "" + for x in range (6): + char = data[offset + x * 2] + if char == '.': + sys.stdout.write (chr (0)) + elif char == '+': + sys.stdout.write (chr (128)) + elif char == '#': + sys.stdout.write (chr (255)) + else: + raise "invalid character in " + str (c) diff --git a/boot-programs/init.ccp b/boot-programs/init.ccp index 174c698..360dfaa 100644 --- a/boot-programs/init.ccp +++ b/boot-programs/init.ccp @@ -20,7 +20,7 @@ #include "iris.hh" static Keyboard sysreq -static Device kbd_dev, buz_dev, backlight_dev +static Device kbd_dev, buz_dev, backlight_dev, rootfs_dev static unsigned slot // Event types. @@ -29,12 +29,12 @@ enum type: KBDDEV BUZDEV BACKLIGHTDEV + ROOTFSDEV static void user_reply (Kernel::Cap target, unsigned dev): switch dev: case Keyboard::ID: // keyboard user - kdebug ("keyboard requested\n") Kernel::Cap kbd = kbd_dev.create_user (Kernel::Cap ()) kbd_dev.use (kbd) target.invoke (0, 0, kbd.copy ()) @@ -42,12 +42,8 @@ static void user_reply (Kernel::Cap target, unsigned dev): break case Buzzer::ID: // buzzer user - kdebug ("buzzer requested\n") Kernel::Cap buzzer = buz_dev.create_user (Kernel::Cap ()) buz_dev.use (buzzer) - kdebug ("invoking reply: ") - kdebug_num (target.code) - kdebug ("\n") target.invoke (0, 0, buzzer.copy ()) Kernel::free_cap (buzzer) break @@ -98,8 +94,16 @@ static void setup (): reply.invoke () Kernel::free_cap (reply) break + case Directory::ID: + caps.set (ROOTFSDEV, arg.copy ()) + rootfs_dev = Kernel::Cap (slot, ROOTFSDEV) + reply.invoke () + Kernel::free_cap (reply) + break default: - kdebug ("unexpected device\n") + kdebug ("unexpected device: ") + kdebug_num (Kernel::recv.data[1].l) + kdebug_char ('\n') break break case Parent::GET_DEVICE: @@ -113,24 +117,20 @@ static void setup (): Kernel::free_cap (arg) continue Kernel::free_cap (arg) - if ++state == 5: + if ++state == 6: break // sysreq - kdebug ("using sysreq\n") Kernel::Cap cb = Kernel::my_receiver.create_capability (SYSREQ) sysreq.set_cb (cb.copy ()) Kernel::free_cap (cb) // First user reply. - kdebug ("sending first user reply\n") user_reply (user, device) Kernel::free_cap (user) Kernel::Num start (): Kernel::schedule () setup () - kdebug ("init set up\n") // claim backlight - kdebug ("claiming backlight\n") Setting backlight = backlight_dev.create_user (Kernel::Cap ()) backlight_dev.use (backlight) while true: @@ -138,12 +138,9 @@ Kernel::Num start (): switch Kernel::recv.protected_data.value (): case SYSREQ: unsigned code = Kernel::recv.data[0].l - kdebug ("\n\nSystem request ") if code & Keyboard::RELEASE: - kdebug ("released.\n\n") backlight.set (~0) else: - kdebug ("pressed.\n\n") backlight.set (0) break default: diff --git a/boot-programs/lcd.ccp b/boot-programs/lcd.ccp index 9bdb196..7265146 100644 --- a/boot-programs/lcd.ccp +++ b/boot-programs/lcd.ccp @@ -21,8 +21,7 @@ #include "arch.hh" __asm__ volatile (".section .rodata\n.globl charset\ncharset:\n.incbin \"boot-programs/charset.data\"\n.section .text") -// charset is really the first character in the array. Its address is used as the start of the array. -extern unsigned char const charset[127-32][6] +extern unsigned char const charset[127-32][8][6] #define assert(x) do { if (!(x)) { kdebug ("assertion failed " #x); while (true) {} } } while (0) @@ -195,14 +194,14 @@ static void reset (): LCD_CTRL = (bpp << LCD_CTRL_BPP_BIT) | LCD_CTRL_BST_16 | LCD_CTRL_ENA //lcd_enable_eof_intr () -static void putchar (unsigned x, unsigned y, unsigned ch, unsigned fg = 0xffff, unsigned bg = 0x0000): +static void putchar (unsigned x, unsigned y, unsigned ch): if ch < 32 || ch > 126: ch = 127 ch -= 32 - unsigned lookup[2] = { bg, fg } for unsigned k = 0; k < 6; ++k: for unsigned r = 0; r < 8; ++r: - LCD_FRAMEBUFFER_BASE[(y * 8 + r) * h + x * 6 + k] = lookup[charset[ch][k] & (1 << r) ? 1 : 0] + LCD_FRAMEBUFFER_BASE[(y * 8 + r) * h + x * 6 + k] = charset[ch][r][k] * 0x00010101 + static unsigned log_x = LOG_X_BASE, log_y = LOG_Y_BASE static void inc_logx (): @@ -314,8 +313,9 @@ Kernel::Num start (): unsigned backlight_user = 0 Kernel::Num current_backlight = 0 while true: + log_str ("Wachten...\n") Kernel::wait () - //log_msg () + log_msg () switch Kernel::recv.protected_data.h: case 0: switch Kernel::recv.protected_data.l: diff --git a/boot-programs/metronome.ccp b/boot-programs/metronome.ccp index 208a168..f02eb64 100644 --- a/boot-programs/metronome.ccp +++ b/boot-programs/metronome.ccp @@ -21,7 +21,6 @@ Kernel::Num start (): Kernel::schedule () - kdebug ("metronome started\n") Buzzer buzzer = Kernel::my_parent.get_device () Keyboard kbd = Kernel::my_parent.get_device () Kernel::Cap key = Kernel::my_receiver.create_capability (0) @@ -68,5 +67,5 @@ Kernel::Num start (): break break default: - kdebug ("huh?\n") + kdebug ("metronome: huh?\n") break diff --git a/boot-programs/nanonote-gpio.ccp b/boot-programs/nanonote-gpio.ccp index a0e3ba8..f747150 100644 --- a/boot-programs/nanonote-gpio.ccp +++ b/boot-programs/nanonote-gpio.ccp @@ -246,7 +246,6 @@ Kernel::Num start (): // Keyboard device control request. switch Kernel::recv.data[0].l: case Device::CREATE_USER: - kdebug ("create\n") Kernel::Cap reply = Kernel::get_reply () Keyboard cap = Kernel::my_receiver.create_capability (Kernel::Num (next_user++, KBD_DEV)) reply.invoke (0, 0, cap.copy ()) @@ -254,23 +253,20 @@ Kernel::Num start (): Kernel::free_cap (reply) break case Device::DESTROY_USER: - kdebug ("destroy\n") Kernel::recv.reply.invoke () break case Device::UNUSE: - kdebug ("unuse\n") kbd.inactive () Kernel::recv.reply.invoke () break case Device::USE: - kdebug ("use\n") Kernel::Cap reply = Kernel::get_reply () user = Kernel::my_receiver.get_protected (Kernel::recv.arg).l reply.invoke () Kernel::free_cap (reply) break default: - kdebug ("other dev:") + kdebug ("gpio other dev:") kdebug_num (Kernel::recv.data[0].l) kdebug ("\n") break @@ -286,25 +282,22 @@ Kernel::Num start (): break switch Kernel::recv.data[0].l: case Keyboard::SET_CB: - kdebug ("set cb\n") Kernel::Cap reply = Kernel::get_reply () kbd.active (Kernel::get_arg ()) reply.invoke () Kernel::free_cap (reply) break case Keyboard::GET_NUM_KEYS: - kdebug ("get #keys\n") Kernel::recv.reply.invoke (kbd.size ()) break case Keyboard::GET_KEYS: - kdebug ("get keys\n") kbd.send_keys (Kernel::recv.data[0].l, Kernel::recv.reply) break default: - kdebug ("other\n") + kdebug ("keyboard other\n") break break default: - kdebug ("unknown num: ") + kdebug ("keyboard unknown num: ") kdebug_num (Kernel::recv.protected_data.h) kdebug ("\n") diff --git a/boot-programs/udc.ccp b/boot-programs/udc.ccp index 60040f9..797ab52 100644 --- a/boot-programs/udc.ccp +++ b/boot-programs/udc.ccp @@ -215,6 +215,9 @@ void Udc::init (): // enable interrupts on endpoint 0. UDC_INTRINE |= 1 << 0 UDC_INDEX = 0 + // Wait a while. + for unsigned w = 0; w < 10000; ++w: + Kernel::schedule () // Connect to the host. UDC_POWER |= UDC_POWER_SOFTCONN diff --git a/invoke.ccp b/invoke.ccp index b9c0110..8a7395a 100644 --- a/invoke.ccp +++ b/invoke.ccp @@ -47,7 +47,6 @@ static void log_message (char const *prefix, unsigned target, unsigned pdata, kC dbg_log ("\n") void kThread::raise (unsigned code, unsigned data): - dpanic (code, "raise") dbg_log ("raise ") dbg_log_num (old_current->id, 2) dbg_log_char (':') @@ -61,6 +60,7 @@ void kThread::raise (unsigned code, unsigned data): dbg_log_char ('/') dbg_log_num (data) dbg_log_char ('\n') + dpanic (code, "raise") unrun () if slots < 1 || !slot[0].caps || !slot[0].caps->cap (0)->target: return diff --git a/memory.ccp b/memory.ccp index ab556e9..a8aff18 100644 --- a/memory.ccp +++ b/memory.ccp @@ -10,7 +10,7 @@ static void clear_page (unsigned page, unsigned num = 1): if *((unsigned *)page) != 0 || ((unsigned *)page)[(num << (PAGE_BITS - 2)) - 1] != 0: dpanic (0, "clear_page didn't work") -#if 1 +#if 0 static unsigned free_begin static unsigned free_end diff --git a/mips/arch.ccp b/mips/arch.ccp index 34427ee..07f5cc2 100644 --- a/mips/arch.ccp +++ b/mips/arch.ccp @@ -260,11 +260,15 @@ void kMemory_arch_unmap (kMemory *mem, kPage *page, unsigned address): free_page (t, p) kPage *kMemory_arch_get_mapping (kMemory *mem, unsigned address, bool *readonly): - if address >= 0x80000000: + if address >= 0x80000000 || !mem->arch.directory: return NULL unsigned *table = mem->arch.directory[address >> 21] + if !table: + return NULL unsigned idx = (address >> 12) & ((1 << 9) - 1) arch_page *page = (arch_page *)table[idx + 0x200] + if !page: + return NULL if readonly: *readonly = !(table[idx] & 4) return page->page diff --git a/mips/init.ccp b/mips/init.ccp index 1a6bde4..e79f50f 100644 --- a/mips/init.ccp +++ b/mips/init.ccp @@ -116,6 +116,9 @@ static void init_threads (): first_alarm = NULL kReceiver *init_receiver = NULL for unsigned i = 0; i < NUM_THREADS; ++i: + dbg_log ("Starting thread ") + dbg_log_num (i, 2) + dbg_log ("\n") kMemory *mem = top_memory.alloc_memory () assert (mem) kThread *thread = mem->alloc_thread (NUM_SLOTS) diff --git a/mips/nanonote/Makefile.arch b/mips/nanonote/Makefile.arch index 0062121..81c5f36 100644 --- a/mips/nanonote/Makefile.arch +++ b/mips/nanonote/Makefile.arch @@ -18,7 +18,7 @@ load = 0x80000000 ARCH_CXXFLAGS = -DNUM_THREADS=6 -ARCH_CPPFLAGS = -I. -Imips -Imips/nanonote -Wa,-mips32 -DNANONOTE #-DUSE_SERIAL +ARCH_CPPFLAGS = -I. -Imips -Imips/nanonote -Wa,-mips32 -DNANONOTE -DUSE_SERIAL CROSS = mipsel-linux-gnu- OBJDUMP = $(CROSS)objdump junk = mdebug.abi32 reginfo comment pdr @@ -56,7 +56,7 @@ mips/init.o: TARGET_FLAGS = -I/usr/include $(addsuffix .elf,$(boot_threads)): TARGET_FLAGS = -I. $(addsuffix .elf,$(boot_threads)): LDFLAGS = -EL $(addprefix boot-programs/,$(addsuffix .cc,$(boot_threads))): devices.hh keys.hh -lcd.elf: boot-programs/charset.data +boot-programs/lcd.o: boot-programs/charset.data boot-programs/charset.data: boot-programs/charset $< > $@