Repos / kernel.git / commitdiff
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7474621)
raw | patch | inline | side by side (parent: 7474621)
| author | zhaoyanbai <zhaoyanbai@126.com> | |
| Thu, 26 Jun 2014 16:52:55 +0000 (00:52 +0800) | ||
| committer | zhaoyanbai <zhaoyanbai@126.com> | |
| Wed, 3 Nov 2021 02:45:29 +0000 (10:45 +0800) |
| drivers/ide.c | patch | blob | history | |
| drivers/keyboard.c | patch | blob | history | |
| kernel/clock.c | patch | blob | history | |
| kernel/init.c | patch | blob | history | |
| kernel/interrupts.S | patch | blob | history | |
| kernel/sched.c | patch | blob | history | |
| kernel/wait.c | patch | blob | history |
diff --git a/drivers/ide.c b/drivers/ide.c
--- a/drivers/ide.c
+++ b/drivers/ide.c
ide_cmd_out(0, nsect, sect_nr, HD_CMD_READ_EXT);
- //printk("ide_debug\n");
+ printk("ide_debug\n");
}
DECLARE_MUTEX(mutex);
{
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))
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);
}
if(retires == 0)
panic("hard disk is not ready");
- //char buf[1024];
insl(REG_DATA(0), buf, 512>>2);
print_ide_identify(buf);
}
diff --git a/drivers/keyboard.c b/drivers/keyboard.c
--- a/drivers/keyboard.c
+++ b/drivers/keyboard.c
if(scan_code == 0x01) // Esc
reboot();
- //printk("[%02x]", scan_code);
+ printk("[%02x]", scan_code);
if(scan_code == 0x13) // r
ide_debug();
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;
cnsl_rd_q.data[cnsl_rd_q.head++] = (char) scan_code;
end:
-
wake_up(&cnsl_rd_q.wait);
#endif
}
diff --git a/kernel/clock.c b/kernel/clock.c
--- a/kernel/clock.c
+++ b/kernel/clock.c
{
jiffies++;
- //printk("^");
- //printd(0, "clock: %d", jiffies);
+ printk("^");
+ printd(0, "clock: %d", jiffies);
}
diff --git a/kernel/init.c b/kernel/init.c
--- a/kernel/init.c
+++ b/kernel/init.c
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();
diff --git a/kernel/interrupts.S b/kernel/interrupts.S
--- a/kernel/interrupts.S
+++ b/kernel/interrupts.S
resched:
- #call schedule
+ call schedule
restore_regs:
diff --git a/kernel/sched.c b/kernel/sched.c
--- a/kernel/sched.c
+++ b/kernel/sched.c
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++)
diff --git a/kernel/wait.c b/kernel/wait.c
--- a/kernel/wait.c
+++ b/kernel/wait.c
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);