summaryrefslogtreecommitdiff
path: root/src/kernel/core
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-04 20:06:37 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-04 20:06:37 +0200
commit277e4af4fa9e80816c809542d792ee6bebb7f202 (patch)
tree9abb7f207d185909427137e4861b81c057de1259 /src/kernel/core
parente9683297bf480f9590b0e5796f4520fb430e2e03 (diff)
downloadTCE-277e4af4fa9e80816c809542d792ee6bebb7f202.tar.gz
TCE-277e4af4fa9e80816c809542d792ee6bebb7f202.zip
Migration to C++!
Diffstat (limited to 'src/kernel/core')
-rw-r--r--src/kernel/core/kmain.cpp (renamed from src/kernel/core/kmain.c)10
-rw-r--r--src/kernel/core/monitor.cpp (renamed from src/kernel/core/monitor.c)0
-rw-r--r--src/kernel/core/sys.cpp (renamed from src/kernel/core/sys.c)4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/kernel/core/kmain.c b/src/kernel/core/kmain.cpp
index 8c36b54..0a5f2d8 100644
--- a/src/kernel/core/kmain.c
+++ b/src/kernel/core/kmain.cpp
@@ -17,7 +17,7 @@
It then loads the modules the kernel was given by the bootloader.
This function never returns : once multitasking is started for good,
the execution flow of this function is never returned to. */
-void kmain(struct multiboot_info_t* mbd, int32_t magic) {
+extern "C" void kmain(multiboot_info_t* mbd, int32_t magic) {
ASSERT(magic == MULTIBOOT_BOOTLOADER_MAGIC);
size_t totalRam = 0;
@@ -25,7 +25,7 @@ void kmain(struct multiboot_info_t* mbd, int32_t magic) {
mem_placementAddr = ((size_t)&end & 0xFFFFF000) + 0x1000;
mbd->cmdline += K_HIGHHALF_ADDR; mbd->mods_addr += K_HIGHHALF_ADDR;
- struct module_t *mods = (struct module_t*)mbd->mods_addr;
+ module_t *mods = (module_t*)mbd->mods_addr;
for (i = 0; i < mbd->mods_count; i++) {
mods[i].mod_start += K_HIGHHALF_ADDR;
mods[i].mod_end += K_HIGHHALF_ADDR;
@@ -48,7 +48,7 @@ void kmain(struct multiboot_info_t* mbd, int32_t magic) {
totalRam = ((mbd->mem_upper + mbd->mem_lower) * 1024);
paging_init(totalRam);
- _no_more_ksbrk = 1;
+ _no_more_ksbrk = true;
gdt_init();
paging_cleanup();
@@ -56,14 +56,14 @@ void kmain(struct multiboot_info_t* mbd, int32_t magic) {
timer_init(30);
tasking_init();
- monitor_write("\n\nLoading modules :\n");
+ monitor_write("\nLoading modules :\n");
for (i = 0; i < mbd->mods_count; i++) {
monitor_write(" * ");
monitor_write((char*)mods[i].string);
if (elf_check((uint8_t*)mods[i].mod_start)) {
monitor_write(" : Invalid ELF file\n");
} else {
- struct process *pr = elf_exec((uint8_t*)mods[i].mod_start, PL_USER);
+ process *pr = elf_exec((uint8_t*)mods[i].mod_start, PL_USER);
if (pr == 0) {
monitor_write(" : Error loading\n");
} else {
diff --git a/src/kernel/core/monitor.c b/src/kernel/core/monitor.cpp
index ba2a6df..ba2a6df 100644
--- a/src/kernel/core/monitor.c
+++ b/src/kernel/core/monitor.cpp
diff --git a/src/kernel/core/sys.c b/src/kernel/core/sys.cpp
index 2c2372d..d95b678 100644
--- a/src/kernel/core/sys.c
+++ b/src/kernel/core/sys.cpp
@@ -29,8 +29,8 @@ uint16_t inw(uint16_t port) {
//////
void stack_trace(size_t bp) {
uint32_t *stack = (uint32_t*)bp, i;
- for (i = 0; i < 5 && stack > K_HIGHHALF_ADDR && stack < (bp + 0x8000); i++) {
- monitor_write("| "); monitor_writeHex(stack);
+ for (i = 0; i < 5 && (size_t)stack > K_HIGHHALF_ADDR && (size_t)stack < (bp + 0x8000); i++) {
+ monitor_write("| "); monitor_writeHex((size_t)stack);
monitor_write("\tnext:"); monitor_writeHex(stack[0]); monitor_write("\t\tret:"); monitor_writeHex(stack[1]);
monitor_write("\n");
stack = (uint32_t*)stack[0];