55,6 → 55,7 |
#include <ddi/device.h> |
#include <symtab.h> |
#include <errno.h> |
#include <putchar.h> |
|
/** Simple kernel console. |
* |
87,30 → 88,6 |
index_t *end); |
static char history[KCONSOLE_HISTORY][MAX_CMDLINE] = {}; |
|
/* |
* For now, we use 0 as INR. |
* However, it is therefore desirable to have architecture specific |
* definition of KCONSOLE_VIRT_INR in the future. |
*/ |
#define KCONSOLE_VIRT_INR 0 |
|
bool kconsole_notify = false; |
irq_t kconsole_irq; |
|
|
/** Allways refuse IRQ ownership. |
* |
* This is not a real IRQ, so we always decline. |
* |
* @return Always returns IRQ_DECLINE. |
* |
*/ |
static irq_ownership_t kconsole_claim(irq_t *irq) |
{ |
return IRQ_DECLINE; |
} |
|
|
/** Initialize kconsole data structures |
* |
* This is the most basic initialization, almost no |
126,30 → 103,6 |
history[i][0] = '\0'; |
} |
|
|
/** Initialize kconsole notification mechanism |
* |
* Initialize the virtual IRQ notification mechanism. |
* |
*/ |
void kconsole_notify_init(void) |
{ |
devno_t devno = device_assign_devno(); |
|
sysinfo_set_item_val("kconsole.present", NULL, true); |
sysinfo_set_item_val("kconsole.devno", NULL, devno); |
sysinfo_set_item_val("kconsole.inr", NULL, KCONSOLE_VIRT_INR); |
|
irq_initialize(&kconsole_irq); |
kconsole_irq.devno = devno; |
kconsole_irq.inr = KCONSOLE_VIRT_INR; |
kconsole_irq.claim = kconsole_claim; |
irq_register(&kconsole_irq); |
|
kconsole_notify = true; |
} |
|
|
/** Register kconsole command. |
* |
* @param cmd Structure describing the command. |
207,9 → 160,9 |
} |
|
/** Print count times a character */ |
static void rdln_print_c(char ch, int count) |
static void rdln_print_c(wchar_t ch, count_t count) |
{ |
int i; |
count_t i; |
for (i = 0; i < count; i++) |
putchar(ch); |
} |