#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);
}
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();
#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,
MPL_TASK_8,
MPL_END
};
+
+// monitor print offset
+enum {
+ MPO_CLOCK = 1,
+ MPO_KEYBOARD = 50,
+ MPO_IDE = 1,
+};
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++;
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];
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;
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);