Strict Standards: Declaration of action_plugin_importoldchangelog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /DISK2/WWW/pavel-rimsky.cz/helenos/lib/plugins/importoldchangelog/action.php on line 8 Strict Standards: Declaration of action_plugin_importoldindex::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /DISK2/WWW/pavel-rimsky.cz/helenos/lib/plugins/importoldindex/action.php on line 0 Deprecated: Function split() is deprecated in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 154 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 456 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 456 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 453 Index: kernel/generic/src/main/kinit.c =================================================================== --- kernel/generic/src/main/kinit.c (revision 3514) +++ kernel/generic/src/main/kinit.c (working copy) @@ -156,8 +156,6 @@ interrupts_enable(); -#if 0 - /* * Create user tasks, load RAM disk images. */ @@ -204,7 +202,6 @@ program_ready(&programs[i]); } } -#endif if (!stdin) { while (1) { Index: kernel/generic/src/ipc/irq.c =================================================================== --- kernel/generic/src/ipc/irq.c (revision 3492) +++ kernel/generic/src/ipc/irq.c (working copy) @@ -339,10 +339,8 @@ call->priv = ++irq->notif_cfg.counter; /* Set up args */ IPC_SET_METHOD(call->data, irq->notif_cfg.method); - /* Execute code to handle irq */ code_execute(call, irq->notif_cfg.code); - send_call(irq, call); } } Index: kernel/arch/sparc64/include/drivers/sgcn.h =================================================================== --- kernel/arch/sparc64/include/drivers/sgcn.h (revision 3514) +++ kernel/arch/sparc64/include/drivers/sgcn.h (working copy) @@ -36,6 +36,7 @@ #define KERN_sparc64_SGCN_H_ #include +#include /* number of bytes in the TOC magic, including the terminating '\0' */ #define TOC_MAGIC_BYTES 8 @@ -115,7 +116,7 @@ uint32_t out_wrptr; } __attribute__ ((packed)) sgcn_buffer_header_t; -void sgcn_init(void); +void sgcn_init(devno_t devno); void sgcn_poll(void); #endif Index: kernel/arch/sparc64/src/sparc64.c =================================================================== --- kernel/arch/sparc64/src/sparc64.c (revision 3502) +++ kernel/arch/sparc64/src/sparc64.c (working copy) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -90,7 +91,7 @@ irq_init(1 << 11, 128); #if defined (CONFIG_SIMICS_OUTPUT) - sgcn_init(); + sgcn_init(device_assign_devno()); #else standalone_sparc64_console_init(); #endif Index: kernel/arch/sparc64/src/drivers/sgcn.c =================================================================== --- kernel/arch/sparc64/src/drivers/sgcn.c (revision 3514) +++ kernel/arch/sparc64/src/drivers/sgcn.c (working copy) @@ -40,8 +40,10 @@ #include #include #include +#include #include #include +#include #include /* @@ -103,7 +105,9 @@ */ static uintptr_t sgcn_buffer_begin; +static irq_t sgcn_irq; + /* * Ensures that writing to the buffer and consequent update of the write pointer * are together one atomic operation. @@ -267,9 +271,11 @@ */ static char sgcn_key_read(chardev_t *d) { - return (char) 0; + return (char) 5; } +static volatile char read_character = 77; + /** * Function regularly called by the keyboard polling thread. Finds out whether * there are some unread characters in the input queue. If so, it picks them up @@ -277,9 +283,12 @@ */ void sgcn_poll(void) { + char c; + ipl_t ipl; + + ipl = interrupts_disable(); spinlock_lock(&sgcn_input_lock); - char c; uint32_t begin = SGCN_BUFFER_HEADER->in_begin; uint32_t end = SGCN_BUFFER_HEADER->in_end; uint32_t size = end - begin; @@ -298,19 +307,44 @@ chardev_push_character(&sgcn_input, c); if (c == '\r') chardev_push_character(&sgcn_input, '\n'); + read_character = c; + ipc_irq_send_notif(&sgcn_irq); } spinlock_unlock(&sgcn_input_lock); + interrupts_restore(ipl); } +static irq_ownership_t sgcn_claim(void) +{ + return IRQ_ACCEPT; +} + +static void sgcn_irq_handler(irq_t *irq, void *arg, ...) +{ + printf("Interrupt occurred."); +} + /** * A public function which initializes I/O from/to Serengeti console * and sets it as a default input/output. */ -void sgcn_init(void) +void sgcn_init(devno_t devno) { sgcn_buffer_begin_init(); + irq_initialize(&sgcn_irq); + sgcn_irq.devno = devno; + sgcn_irq.inr = 1; + sgcn_irq.claim = sgcn_claim; + sgcn_irq.handler = sgcn_irq_handler; + irq_register(&sgcn_irq); + + sysinfo_set_item_val("kbd", NULL, true); + sysinfo_set_item_val("kbd.devno", NULL, devno); + sysinfo_set_item_val("kbd.inr", NULL, 1); + sysinfo_set_item_val("kbd.address.virtual", NULL, (uintptr_t) &read_character); + chardev_initialize("sgcn_output", &sgcn_stdout, &sgcn_output_ops); stdout = &sgcn_stdout; Index: uspace/srv/kbd/arch/sparc64/src/kbd.c =================================================================== --- uspace/srv/kbd/arch/sparc64/src/kbd.c (revision 3492) +++ uspace/srv/kbd/arch/sparc64/src/kbd.c (working copy) @@ -61,6 +61,22 @@ z8530_cmds }; +irq_cmd_t sgcn_cmds[] = { + { + CMD_MEM_READ_1, + 0, /**< Address. Will be patched in run-time. */ + 0, /**< Value. Not used. */ + 1 /**< Arg 1 will contain the result. */ + } +}; + +irq_code_t sgcn_kbd = { + 1, + sgcn_cmds +}; + + + /** Top-half pseudocode for ns16550. */ irq_cmd_t ns16550_cmds[] = { { @@ -94,6 +110,12 @@ default: break; } + + /**/ + sgcn_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual"); + ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &sgcn_kbd); + /**/ + return 0; } @@ -101,6 +123,8 @@ int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call) { int scan_code = IPC_GET_ARG1(*call); + + printf("scancode = %d\n", scan_code); if (scan_code == KBD_ALL_KEYS_UP) return 1; Index: usiii.simics =================================================================== --- usiii.simics (revision 3514) +++ usiii.simics (working copy) @@ -9,7 +9,7 @@ if not defined mac_address {$mac_address = "10:10:10:10:10:24"} if not defined disk_size {$disk_size = 2128486400} if not defined rtc_time {$rtc_time = "2002-06-02 17:00:00 UTC"} -if not defined num_cpus {$num_cpus = 3} +if not defined num_cpus {$num_cpus = 1} if not defined megs_per_cpu {$megs_per_cpu = 256} if not defined cpu_class {$cpu_class = "ultrasparc-iii-plus"}