From: acevest Date: Mon, 29 May 2023 15:39:18 +0000 (+0800) Subject: KERNEL MONITOR页面输入排版小改 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=3722bae5a68a3ce8b5506dd6e7e9ae4cdbc4c567;p=kernel.git KERNEL MONITOR页面输入排版小改 --- diff --git a/drivers/ide.c b/drivers/ide.c index edf0144..61bb7da 100644 --- a/drivers/ide.c +++ b/drivers/ide.c @@ -550,14 +550,20 @@ void wait_on_ide() { wait_event(&ide_wait_queue_head, ide_pci_controller.done); #endif extern void *mbr_buf; -uint8_t ata_pci_bus_status(); extern ide_pci_controller_t ide_pci_controller; +extern uint32_t disk_request_cnt; +extern uint32_t disk_handled_cnt; + +uint8_t ata_pci_bus_status(); volatile uint32_t disk_inter_cnt = 0; void ide_irq_bh_handler() { disk_inter_cnt++; + // printl(MPL_IDE, "disk req %u consumed %u irq %u", disk_request_cnt, disk_handled_cnt, disk_inter_cnt); + printlxy(MPL_IDE, MPO_IDE, "disk irq %u req %u consumed %u ", disk_inter_cnt, disk_request_cnt, disk_handled_cnt); + // up里不会立即重新调度进程 up(&disk_intr_sem); } diff --git a/drivers/keyboard.c b/drivers/keyboard.c index a3b953b..5c44506 100644 --- a/drivers/keyboard.c +++ b/drivers/keyboard.c @@ -75,7 +75,8 @@ extern tty_t debug_tty; void kbd_debug(uint8_t scan_code) { static unsigned long kbd_cnt = 0; - printl(MPL_KEYBOARD, "keyboard irq: %d scan code %02x", kbd_cnt++, scan_code); + // printl(MPL_KEYBOARD, "keyboard irq: %d scan code %02x", kbd_cnt++, scan_code); + printlxy(MPL_IRQ, MPO_KEYBOARD, "keyboard irq: %d %02x", kbd_cnt++, scan_code); if (scan_code == 0x01) { // Esc // reboot(); diff --git a/include/printk.h b/include/printk.h index e8f1c6f..00efc26 100644 --- a/include/printk.h +++ b/include/printk.h @@ -23,18 +23,15 @@ int printlo(unsigned int line, unsigned int offset, const char *fmtstr, ...); #define printl(line, fmt, args...) printlo(1, line, fmt, ##args) #define printll(line, fmt, args...) printlo(0, line, fmt, ##args) #define printlr(line, fmt, args...) printlo(40, line, fmt, ##args) +#define printlxy(line, offset, fmt, args...) printlo(offset, line, fmt, ##args) // monitor print line enum { MPL_TITLE, - MPL_CLOCK, - MPL_KEYBOARD, + MPL_IRQ, MPL_IDE, - MPL_IDE_INTR, MPL_CURRENT, - MPL_TEST0, MPL_TEST, - MPL_X, MPL_DEBUG, MPL_TASK_TITLE, MPL_TASK_0, @@ -48,3 +45,10 @@ enum { MPL_TASK_8, MPL_END }; + +// monitor print offset +enum { + MPO_CLOCK = 1, + MPO_KEYBOARD = 50, + MPO_IDE = 1, +}; diff --git a/kernel/clock.c b/kernel/clock.c index 7b58c5e..aabd0b6 100644 --- a/kernel/clock.c +++ b/kernel/clock.c @@ -26,7 +26,8 @@ void dump_irq_nr_stack(); void clk_bh_handler(); void clk_handler(unsigned int irq, pt_regs_t *regs, void *dev_id) { // if (jiffies % 100 == 0) { - printl(MPL_CLOCK, "clock irq: %d", jiffies); + // printl(MPL_CLOCK, "clock irq: %d", jiffies); + printlxy(MPL_IRQ, MPO_CLOCK, "clock irq: %d", jiffies); // } jiffies++; diff --git a/kernel/irq.c b/kernel/irq.c index 1557343..cbc190c 100644 --- a/kernel/irq.c +++ b/kernel/irq.c @@ -52,7 +52,7 @@ void dump_irq_nr_stack() { return; } - printl(MPL_TEST0, "irq nr stack pos %u", irq_nr_stack_pos); + printl(MPL_DEBUG, "irq nr stack pos %u", irq_nr_stack_pos); char buf[128]; diff --git a/kernel/sched.c b/kernel/sched.c index e464e5e..54fab03 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -163,10 +163,6 @@ const char *task_state(unsigned int state) { return s[state]; } -extern uint32_t disk_request_cnt; -extern uint32_t disk_handled_cnt; -extern uint32_t disk_inter_cnt; - void debug_print_all_tasks() { task_union *p = 0; list_head_t *pos = 0, *t = 0; @@ -185,8 +181,6 @@ void schedule() { task_union *p = 0; list_head_t *pos = 0, *t = 0; - printl(MPL_X, "disk req %u consumed %u irq %u", disk_request_cnt, disk_handled_cnt, disk_inter_cnt); - assert(current->ticks <= TASK_MAX_PRIORITY); assert(current->priority <= TASK_MAX_PRIORITY);