Repos / kernel.git / commitdiff
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4255516)
raw | patch | inline | side by side (parent: 4255516)
| author | zhaoyanbai <zhaoyanbai@126.com> | |
| Sun, 14 Nov 2021 12:16:40 +0000 (20:16 +0800) | ||
| committer | zhaoyanbai <zhaoyanbai@126.com> | |
| Sun, 14 Nov 2021 12:16:40 +0000 (20:16 +0800) |
| drivers/pci.c | patch | blob | history | |
| include/printk.h | patch | blob | history | |
| kernel/setup.c | patch | blob | history | |
| kernel/system.c | patch | blob | history | |
| kernel/tty.c | patch | blob | history |
diff --git a/drivers/pci.c b/drivers/pci.c
--- a/drivers/pci.c
+++ b/drivers/pci.c
}
dump_pci_dev();
- asm("cli;hlt;");
}
typedef struct pci_info {
diff --git a/include/printk.h b/include/printk.h
--- a/include/printk.h
+++ b/include/printk.h
#pragma once
-void switch_printk_screen();
int printk(const char *fmtstr, ...);
int printd(const char *fmtstr, ...);
int printlo(unsigned int line, unsigned int offset, const char *fmtstr, ...);
diff --git a/kernel/setup.c b/kernel/setup.c
--- a/kernel/setup.c
+++ b/kernel/setup.c
printl(MPL_TITLE, " SYSTEM MONITOR");
printl(MPL_ROOTDEV, "root device %08x", system.root_dev);
- system_delay();
-
// setup_tasks();
setup_irqs();
void ide_init();
ide_init();
- while (1) {
- asm("sti;hlt;");
- }
- extern tty_t monitor_tty;
- // tty_switch(&monitor_tty);
- // asm("sti");
- // while (1) { /* code */
- // }
-
- return;
- // switch_printk_screen();
+ detect_cpu();
- // switch_printk_screen();
- system_delay();
+ printk(version);
- system_delay();
+ extern tty_t monitor_tty;
+ tty_switch(&monitor_tty);
- detect_cpu();
+ while (1) {
+ asm("sti;hlt;");
+ }
setup_fs();
-
- printk(version);
-
- // switch_printk_screen();
}
diff --git a/kernel/system.c b/kernel/system.c
--- a/kernel/system.c
+++ b/kernel/system.c
return 0;
}
-
-void system_delay() {
- unsigned long flags;
- irq_save(flags);
- unsigned int n = system.delay;
- while (n--) {
- unsigned long cr0;
- asm("movl %%cr0, %%eax;" : "=a"(cr0));
- asm("movl %%eax, %%cr0;" ::"a"(cr0));
- }
- irq_restore(flags);
-}
diff --git a/kernel/tty.c b/kernel/tty.c
--- a/kernel/tty.c
+++ b/kernel/tty.c
irq_restore(flags);
current_tty = tty;
+
+ tty_set_cursor(current_tty);
}
tty_t *current_tty;
\ No newline at end of file