summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/entry.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/kernel/entry.c b/kernel/entry.c
index 2ec5089..0b22ee7 100644
--- a/kernel/entry.c
+++ b/kernel/entry.c
@@ -12,35 +12,15 @@ asm(
"call entry_main\n"
);
-void entry_serial_out(char* str);
-void entry_serial_out_hex(uint32_t x);
void entry_copy_multiboot(multiboot_info_t* mb_info);
void entry_main(uint32_t mb_magic, multiboot_info_t* mb_info) {
- entry_serial_out("entry_main()\n");
if(mb_magic != 0x2badb002) {
- entry_serial_out("Multiboot magic word is wrong!\n");
goto stop;
}
- entry_serial_out("Multiboot ok\n");
entry_copy_multiboot(mb_info);
- /*
- entry_serial_out("Flags: ");
- entry_serial_out_hex(mb_info->flags);
-
- if(mb_info->flags & (1 << 2)) {
- entry_serial_out(mb_info->cmdline);
- entry_serial_out("\n");
- } else {
- entry_serial_out("No cmdline.\n");
- }
-
- entry_serial_out("Module addr: ");
- entry_serial_out_hex(mb_info->mods_addr->mod_start);
- */
-
// Create initial page tables.
for(unsigned int i = 0; i < 1024; i++) {
// Clear page directory.
@@ -85,7 +65,6 @@ void entry_main(uint32_t mb_magic, multiboot_info_t* mb_info) {
main();
stop:
- entry_serial_out("Halting.\n");
asm volatile(
"cli\n"
"hlt\n"
@@ -136,23 +115,3 @@ void entry_copy_multiboot(multiboot_info_t* mb_info) {
high_p += s;
}
}
-
-#define outb(port, value) asm volatile("out %b0,%w1" : : "a" (value), "d" (port))
-
-void entry_serial_out(char* str) {
- while(*str) {
- if(*str == '\n') {
- outb(0x3f8, '\r');
- }
- outb(0x3f8, *str++);
- }
-}
-
-void entry_serial_out_hex(uint32_t x) {
- char str[] = "00000000\n";
- for(int i = 0; i < 8; i++) {
- int z = (x >> (28 - i * 4)) & 0xf;
- str[i] = z < 10 ? '0' + z : 'a' - 10 + z;
- }
- entry_serial_out(str);
-}