aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarvin Borner2020-01-04 23:30:28 +0100
committerMarvin Borner2020-01-04 23:30:28 +0100
commit527d8bfeffa41086ad4e0c257b27e8c916fd514c (patch)
treed5d94bc43c8d8bd091ec5b3296b13e4c640290ce /src
parente015aeacf14c1ec50ca14dda01c760dc16b26506 (diff)
Removed hardcoded line numbers
Wasn't that hard after all, eh?
Diffstat (limited to 'src')
-rw-r--r--src/kernel/acpi/acpi.c2
-rw-r--r--src/kernel/gdt/gdt.c2
-rw-r--r--src/kernel/graphics/font.c1
-rw-r--r--src/kernel/graphics/vesa.c10
-rw-r--r--src/kernel/interrupts/idt.c2
-rw-r--r--src/kernel/interrupts/irq.c2
-rw-r--r--src/kernel/interrupts/isr.c2
-rw-r--r--src/kernel/io/io.c2
-rw-r--r--src/kernel/kernel.c2
-rw-r--r--src/kernel/paging/paging.c2
-rw-r--r--src/kernel/system.c5
-rw-r--r--src/kernel/system.h3
12 files changed, 19 insertions, 16 deletions
diff --git a/src/kernel/acpi/acpi.c b/src/kernel/acpi/acpi.c
index 7348127..36a3d29 100644
--- a/src/kernel/acpi/acpi.c
+++ b/src/kernel/acpi/acpi.c
@@ -153,7 +153,7 @@ int acpi_install()
SCI_EN = 1;
acpi_enable();
- vga_log("Installed ACPI", 3);
+ vga_log("Installed ACPI");
success = 1;
} // Else: \_S5 parse error
diff --git a/src/kernel/gdt/gdt.c b/src/kernel/gdt/gdt.c
index 41e6909..ea492b6 100644
--- a/src/kernel/gdt/gdt.c
+++ b/src/kernel/gdt/gdt.c
@@ -98,7 +98,7 @@ void gdt_install()
// Remove old GDT and install the new changes!
gdt_flush();
- vga_log("Installed Global Descriptor Table", 1);
+ vga_log("Installed Global Descriptor Table");
}
void tss_write(int32_t num, uint16_t ss0)
diff --git a/src/kernel/graphics/font.c b/src/kernel/graphics/font.c
index 2a16d2f..49bcd8a 100644
--- a/src/kernel/graphics/font.c
+++ b/src/kernel/graphics/font.c
@@ -24,4 +24,5 @@ void font_install()
ATAPI_granular_read(1 + (font_e->length / 2048), font_e->lba, (uint8_t *) font);
kfree(font_e);
}
+ vga_log("Successfully loaded font");
} \ No newline at end of file
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c
index c06bef6..2b8dfef 100644
--- a/src/kernel/graphics/vesa.c
+++ b/src/kernel/graphics/vesa.c
@@ -101,8 +101,8 @@ struct vbe_mode_info *vbe_get_mode_info(uint16_t mode)
void set_optimal_resolution()
{
- vga_log("Switching to graphics mode", 8);
- vga_log("Trying to detect available modes", 9);
+ vga_log("Switching to graphics mode");
+ vga_log("Trying to detect available modes");
uint16_t *video_modes = vbe_get_modes();
uint16_t highest = 0;
@@ -135,8 +135,8 @@ void set_optimal_resolution()
if (highest == 0) {
serial_printf("Mode detection failed!\nTrying common modes...");
- vga_log("Mode detection failed!", 11);
- vga_log("Trying common modes...", 12);
+ vga_log("Mode detection failed!");
+ vga_log("Trying common modes...");
struct vbe_mode_info *mode_info;
int modes[] = {
322, 287, 286, 285, 284, // 1600x1200
@@ -175,7 +175,7 @@ void set_optimal_resolution()
// Everything else failed :(
if (highest == 0)
switch_to_vga();
- } else vga_log("Mode detection succeeded", 11);
+ } else vga_log("Mode detection succeeded");
vbe_set_mode(highest);
diff --git a/src/kernel/interrupts/idt.c b/src/kernel/interrupts/idt.c
index de17c72..25a9504 100644
--- a/src/kernel/interrupts/idt.c
+++ b/src/kernel/interrupts/idt.c
@@ -44,5 +44,5 @@ void idt_install()
memset(&idt, 0, sizeof(struct idt_entry) * 256);
idt_load();
- vga_log("Installed Interrupt Descriptor Table", 5);
+ vga_log("Installed Interrupt Descriptor Table");
} \ No newline at end of file
diff --git a/src/kernel/interrupts/irq.c b/src/kernel/interrupts/irq.c
index 2fae9de..dd8ce90 100644
--- a/src/kernel/interrupts/irq.c
+++ b/src/kernel/interrupts/irq.c
@@ -92,7 +92,7 @@ void irq_install()
idt_set_gate(45, (unsigned) irq13, 0x08, 0x8E);
idt_set_gate(46, (unsigned) irq14, 0x08, 0x8E);
idt_set_gate(47, (unsigned) irq15, 0x08, 0x8E);
- vga_log("Installed Interrupt Requests", 7);
+ vga_log("Installed Interrupt Requests");
}
// Handle IRQ ISRs
diff --git a/src/kernel/interrupts/isr.c b/src/kernel/interrupts/isr.c
index f774b86..eb932b2 100644
--- a/src/kernel/interrupts/isr.c
+++ b/src/kernel/interrupts/isr.c
@@ -45,7 +45,7 @@ void isrs_install()
idt_set_gate(0x80, (unsigned) isr128, 0x08, 0xEE);
- vga_log("Installed Interrupt Service Routines", 6);
+ vga_log("Installed Interrupt Service Routines");
}
irq_handler_t isr_routines[256] = {0};
diff --git a/src/kernel/io/io.c b/src/kernel/io/io.c
index b54a859..0dc7483 100644
--- a/src/kernel/io/io.c
+++ b/src/kernel/io/io.c
@@ -46,7 +46,7 @@ void init_serial()
outb(0x3f8 + 3, 0x03);
outb(0x3f8 + 2, 0xC7);
outb(0x3f8 + 4, 0x0B);
- vga_log("Installed serial connection", 2);
+ vga_log("Installed serial connection");
}
int is_transmit_empty()
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index cce1e55..d8f8c66 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -20,7 +20,7 @@ extern void jump_userspace();
void kernel_main()
{
- vga_log("Installing basic features of Melvix...", 0);
+ vga_log("Installing basic features of Melvix...");
// Install features
memory_init();
diff --git a/src/kernel/paging/paging.c b/src/kernel/paging/paging.c
index 723e09a..33c57bd 100644
--- a/src/kernel/paging/paging.c
+++ b/src/kernel/paging/paging.c
@@ -24,7 +24,7 @@ void paging_install()
paging_enable();
- vga_log("Installed paging", 4);
+ vga_log("Installed paging");
}
void paging_disable()
diff --git a/src/kernel/system.c b/src/kernel/system.c
index ada1750..f7c7fc8 100644
--- a/src/kernel/system.c
+++ b/src/kernel/system.c
@@ -18,7 +18,9 @@ void vga_clear()
terminal_buffer[y * 80 + x] = 0 | (uint16_t) 0x700;
}
-void vga_log(char *msg, int line)
+static line = 0;
+
+void vga_log(char *msg)
{
if (line == 0) vga_clear();
uint16_t *terminal_buffer = (uint16_t *) 0xB8000;
@@ -32,6 +34,7 @@ void vga_log(char *msg, int line)
strcat(string, msg);
strcat(string, "\n");
strcat(vga_buffer, string);
+ line++;
}
void kernel_time()
diff --git a/src/kernel/system.h b/src/kernel/system.h
index 26530f9..af33b26 100644
--- a/src/kernel/system.h
+++ b/src/kernel/system.h
@@ -34,9 +34,8 @@ char *vga_buffer;
/**
* Log a message before VESA has been initialized
* @param msg The message
- * @param line The hardcoded linenumber
*/
-void vga_log(char *msg, int line);
+void vga_log(char *msg);
/**
* Print the current kernel time