#include <types.h>
#include <string.h>
+void systest();
+void sysdebug(unsigned int v);
int main()
{
while(1)
{
+ systest();
+ sysdebug(0xAABBCCDD);
+
printf("shell# ");
char cmd[256];
read(0, cmd, 256);
printk("cmdline: %s\n", system.cmdline);
get_value("root", value);
- printk("root device %s\n", value);
assert(value[0]=='h' && value[1]=='d' && value[2] == 'a');
system.root_dev = MAKE_DEV(DEV_MAJOR_HDA, atoi(value+3));
- printk("root device %08x\n", system.root_dev);
+ printk("root device %s [0x%08x]\n", value, system.root_dev);
get_value("delay", value);
system.delay = atoi(value);
void ide_printl()
{
- printl(MPL_IDE, "ide pio_cnt %d dma_cnt %d irq_cnt %d", drv.pio_cnt, drv.dma_cnt, drv.irq_cnt);
+ printl(MPL_IDE, "ide pio cnt %d dma cnt %d irq cnt %d", drv.pio_cnt, drv.dma_cnt, drv.irq_cnt);
}
void ide_cmd_out(dev_t dev, u32 sect_cnt, u64 sect_nr, u32 cmd)
HD_CHL1_CTL_BASE = pci->bars[3] ? pci->bars[3] : HD_CHL1_CTL_BASE;
printk("channel0: cmd %04x ctl %04x channel1: cmd %04x ctl %04x\n", HD_CHL0_CMD_BASE, HD_CHL0_CTL_BASE, HD_CHL1_CMD_BASE, HD_CHL1_CTL_BASE);
- printl(18, "channel0: cmd %04x ctl %04x channel1: cmd %04x ctl %04x", HD_CHL0_CMD_BASE, HD_CHL0_CTL_BASE, HD_CHL1_CMD_BASE, HD_CHL1_CTL_BASE);
+ //printl(18, "channel0: cmd %04x ctl %04x channel1: cmd %04x ctl %04x", HD_CHL0_CMD_BASE, HD_CHL0_CTL_BASE, HD_CHL1_CMD_BASE, HD_CHL1_CTL_BASE);
}
if(pci != 0 && pci->intr_line < 16)
{
printk("found pci vendor %04x device %04x class %04x intr %d\n", pci->vendor, pci->device, pci->classcode, pci->intr_line);
- printl(17, "found pci vendor %04x device %04x class %04x intr %d", pci->vendor, pci->device, pci->classcode, pci->intr_line);
+ //printl(17, "found pci vendor %04x device %04x class %04x intr %d", pci->vendor, pci->device, pci->classcode, pci->intr_line);
ide_pci_init(pci);
drv.pci = pci;
}
void kbd_debug(unsigned char scan_code)
{
static unsigned long kbd_cnt = 0;
- printl(MPL_KEYBOARD, "keyboard:%d scan code %02x", kbd_cnt++, scan_code);
+ printl(MPL_KEYBOARD, "keyboard irq: %d scan code %02x", kbd_cnt++, scan_code);
if(scan_code == 0x01) // Esc
reboot();
int printd(const char *fmtstr, ...);
int printlo(unsigned int line, unsigned int offset, const char *fmtstr, ...);
-#define printl(line, fmt, args...) printlo(line, 0, fmt, ## args)
+#define printl(line, fmt, args...) printlo(line, 1, fmt, ## args)
#define printll(line, fmt, args...) printlo(line, 0, fmt, ## args)
#define printlr(line, fmt, args...) printlo(line, 40, fmt, ## args)
TASK_UNUSED,
TASK_RUNNING,
TASK_WAIT,
- TASK_EXITING
+ TASK_EXITING,
+ TASK_END,
};
#define TASK_NAME_SIZE 32
jiffies++;
//printd("^");
- printl(MPL_CLOCK, "clock irq:%d", jiffies);
+ printl(MPL_CLOCK, "clock irq: %d", jiffies);
}
{
sysc_test();
//printl(MPL_ROOT, "root:0 [%08x] weight %d cnt %d", current, root_task.weight, cnt++);
- //asm("sti;hlt;");
- //sysc_test();
+ asm("sti;hlt;");
+ sysc_test();
//syscall0(SYSC_TEST);
}
}
unsigned long esp;
asm("movl %%esp, %%eax":"=a"(esp));
- printl(MPL_PREEMPT, "current %08x cr3 %08x preempt %d esp %08x", current, current->cr3, current->preempt_cnt, esp);
+ printl(MPL_PREEMPT, "current %08x cr3 %08x preempt %d esp %08x", current, current->cr3, current->preempt_cnt, esp);
p->chip->ack(irq);
sti();
const char *devname,
void *dev_id)
{
- irq_action_t * p;
+ irq_action_t *p;
if(irq >= NR_IRQS)
return -EINVAL;
int i;
printk("scanning pci bus %d\n", bus);
- system_delay();
-
for(dev=0; dev<32; dev++)
{
for(devfn =0; devfn<8; devfn++)
list_for_each(p, &pci_devs)
{
pci_device_t *pci = list_entry(p, pci_device_t, list);
- printk("vendor %04x device %04x class %04x intr %02d ", pci->vendor, pci->device, pci->classcode, pci->intr_line);
+ printk("vendor %04x device %04x class %04x intr %3d ", pci->vendor, pci->device, pci->classcode, pci->intr_line);
printk("%s\n", pci_get_info(pci->classcode, pci->progif));
continue;
switch(pci->hdr_type)
return p;
}
+static const char *task_state(unsigned int state)
+{
+ static const char s[][16] = {
+ " ERROR",
+ "RUNNING",
+ " WAIT",
+ "EXITING",
+ };
+
+ if(state >= TASK_END)
+ state = TASK_UNUSED;
+
+ return s[state];
+}
+
unsigned long schedule()
{
static turn = 0;
unsigned long iflags;
irq_save(iflags);
+ printl(MPL_ROOT, "root:%d [%08x] cnt %u", root_task.pid, &root_task, root_task.cnt);
list_for_each_safe(pos, t, &root_task.list)
{
p = list_entry(pos, task_union, list);
- printl(MPL_ROOT+p->pid, "task:%d [%08x] state %02x TURN %d turn %d cnt %u", p->pid, p, p->state, turn, p->weight, p->cnt);
+ printl(MPL_ROOT+p->pid, "task:%d [%08x] state %s cnt %u", p->pid, p, task_state(p->state), p->cnt);
if(p->state != TASK_RUNNING)
{
printl(MPL_TITLE, " SYSTEM MONITOR");
printl(MPL_ROOTDEV, "root device %08x", system.root_dev);
+ system_delay();
+
setup_tasks();
setup_irqs();
{
static unsigned int cnt=0;
current->cnt++;
- printl(MPL_TEST, "sysc_test cnt %u current %08x cnt %u",
- cnt++, current, current->cnt);
+ printl(MPL_TEST, "systest cnt %u current %08x cnt %u ",
+ cnt++, current, cnt);
return 0;
}
{
struct e820_entry *p = boot_params.e820map.map + i;
- printk("[%02d] 0x%08x - 0x%08x size %- 10d %8dKB %5dMB ", i, p->addr, p->addr + p->size - 1, p->size, p->size>>10, p->size>>20);
+ printk(" [%02d] 0x%08x - 0x%08x size %- 10d %8dKB %5dMB ", i, p->addr, p->addr + p->size - 1, p->size, p->size>>10, p->size>>20);
e820_print_type(p->type);