]> Zhao Yanbai Git Server - kernel.git/commitdiff
re use the right code
authoracevest <root@ace.laptop>
Thu, 26 Jun 2014 16:52:55 +0000 (00:52 +0800)
committeracevest <root@ace.laptop>
Thu, 26 Jun 2014 16:52:55 +0000 (00:52 +0800)
drivers/ide.c
drivers/keyboard.c
kernel/clock.c
kernel/init.c
kernel/interrupts.S
kernel/sched.c
kernel/wait.c

index 0e1eb66be1db825f0d2491662647082a37fd9eff..bcaf72021a6fbc63c67d7aeb902b1a721d96d78c 100644 (file)
@@ -116,7 +116,7 @@ void ide_debug()
 
     ide_cmd_out(0, nsect,  sect_nr, HD_CMD_READ_EXT);
 
-    //printk("ide_debug\n");
+    printk("ide_debug\n");
 }
 
 DECLARE_MUTEX(mutex);
@@ -142,7 +142,7 @@ void ide_irq()
 {
     u8_t status = inb(REG_STATUS(0));
 
-    //memset(buf, 0xEE, 1024);
+    memset(buf, 0xEE, 1024);
 
     status = inb(drv.iobase+PCI_IDE_STATUS);
     if(0 == (status & PCI_IDE_STATUS_INTR))
@@ -154,14 +154,11 @@ void ide_irq()
     outb(status, drv.iobase+PCI_IDE_STATUS);
     outb(0x00,   drv.iobase+PCI_IDE_CMD);
 
-    //insl(REG_DATA(0), buf, (512>>2));
-    int i;
-    unsigned short sig;
-    for(i=0; i<256; ++i)
-        sig = inw(REG_DATA(0));
-    //u16_t *s = (u16_t *) (buf+510);
-    //printd(11, "hard disk data %04x\n", sig);
-    //up(&mutex);
+    insl(REG_DATA(0), buf, (512>>2));
+    u16_t sig = *((u16_t *) (buf+510));
+    printd(11, "hard disk data %04x", sig);
+
+    up(&mutex);
 }
 
 
@@ -225,7 +222,6 @@ void ide_read_identify()
     if(retires == 0)
         panic("hard disk is not ready");
 
-    //char buf[1024];
     insl(REG_DATA(0), buf, 512>>2);
     print_ide_identify(buf);
 }
index 267e9822f7926a27d226833b0ec8ce2dd20beba3..c263536e91559d26a5c4387ca88118dd194c7cf3 100644 (file)
@@ -35,7 +35,7 @@ void kbd_handler(unsigned int irq, pt_regs_t * regs, void *dev_id)
     if(scan_code == 0x01) // Esc
         reboot();
     
-    //printk("[%02x]", scan_code);
+    printk("[%02x]", scan_code);
 
     if(scan_code == 0x13)   // r
         ide_debug();
@@ -56,7 +56,7 @@ void kbd_handler(unsigned int irq, pt_regs_t * regs, void *dev_id)
     if(scan_code == 0x3E)   // F4
         debug_wait_queue_put(2);
 
-#if 0
+#if 1
     printd(10, "CNSL HEAD : %d", cnsl_rd_q.head);
     if((cnsl_rd_q.head+1) == cnsl_rd_q.tail)
         goto end;
@@ -64,7 +64,6 @@ void kbd_handler(unsigned int irq, pt_regs_t * regs, void *dev_id)
     cnsl_rd_q.data[cnsl_rd_q.head++] = (char) scan_code;
 
 end:
-
     wake_up(&cnsl_rd_q.wait);
 #endif
 }
index 2e30ba8550ff7144d49763a1f3aa10ad4a1c9eeb..5dd66df3518c5f5195de12f11636c899b367fdad 100644 (file)
@@ -19,6 +19,6 @@ void    clk_handler(unsigned int irq, pt_regs_t * regs, void *dev_id)
 {
     jiffies++;
 
-    //printk("^");
-    //printd(0, "clock: %d", jiffies);
+    printk("^");
+    printd(0, "clock: %d", jiffies);
 }
index ac2739efbf54677b213fd8fdabf327b52a956fb1..4309561c96de4ad6801db4be838c57796270389e 100644 (file)
@@ -75,8 +75,8 @@ void root_task_entry()
     int cnt;
     while(1)
     {
-        printd(1, "root_task [%08x] cnt %d preempt_cnt %08x", current, cnt++, root_task.preempt_cnt);
-        printd(9, "pid %d ppid %08x state %08x weight %08x",
+        printd(1, "root_task [%08x] cnt %d preempt_cnt %d", current, cnt++, root_task.preempt_cnt);
+        printd(9, "pid %d ppid %d state %d weight %d",
             root_task.pid, root_task.ppid, root_task.state, root_task.weight);
         asm("sti;hlt;");
         //sysc_test();
index df965d043d26a72b37eda5d4715c327a1ce3a6e8..e459c7ce9bf3893e903de4308bab26bbe686df14 100644 (file)
@@ -78,7 +78,7 @@ return:
 
 resched:
 
-    #call    schedule
+    call    schedule
 
 restore_regs:
 
index 7fcebdeddfaaf4018fff3f316f95222cecc23406..31cc824e2a93c0b2e9c095a6054590a6b4b8e411 100644 (file)
@@ -58,9 +58,9 @@ void init_root_tsk()
 
     root_task.preempt_cnt = 0;
     root_task.pid    = get_next_pid();
-    root_task.ppid   = 1000;
-    root_task.state  = 2000;//TASK_RUNNING;
-    root_task.weight = 3000;//TASK_INIT_WEIGHT;
+    root_task.ppid   = 0;
+    root_task.state  = TASK_RUNNING;
+    root_task.weight = TASK_INIT_WEIGHT;
     INIT_LIST_HEAD(&root_task.list);
 
     for(i=0; i<NR_OPENS; i++)
index d07014d25435a0daad76f2722238740ccf74b468..66daa6cef928f466ca237e99ce447976b7a68694 100644 (file)
@@ -52,7 +52,6 @@ DECLARE_WAIT_QUEUE_HEAD(debug_wq);
 unsigned int debug_global_var = 0;
 int debug_wait_queue_get()
 {
-    return 0;
     unsigned int v = 0;
     task_union * task = current;
     DECLARE_WAIT_QUEUE(wait, task);