[mem] Various fixes. gcc4.4 and 4.5 hate me, use 4.3 or a clange >2.0

This commit is contained in:
Kevin Lange 2011-03-28 00:26:35 -05:00
parent 5408885078
commit 6d95cf95a0
3 changed files with 2 additions and 8 deletions

View File

@ -1,4 +1,4 @@
#CC = gcc
#CC = gcc-4.3
CC = clang
# Sometimes we just have to use GCC
GCC = gcc

View File

@ -79,10 +79,8 @@ copy_stack(
uintptr_t old_base_pointer;
__asm__ __volatile__ ("mov %%ebp, %0" : "=r" (old_base_pointer));
uintptr_t offset = (uintptr_t)new_stack_start - initial;
kprintf("Offset is %x\n", offset);
uintptr_t new_stack_pointer = old_stack_pointer + offset;
uintptr_t new_base_pointer = old_base_pointer + offset;
kprintf("New base pointer is %x %x\n");
memcpy((void *)new_stack_pointer, (void *)old_stack_pointer, initial - old_stack_pointer);
for (i = (uintptr_t)new_stack_start; i > (uintptr_t)new_stack_start - size; i -= 4) {
uintptr_t temp = *(uintptr_t*)i;
@ -138,7 +136,6 @@ fork() {
uintptr_t ebp;
__asm__ __volatile__ ("mov %%esp, %0" : "=r" (esp));
__asm__ __volatile__ ("mov %%ebp, %0" : "=r" (ebp));
kprintf("%x %x %x\n", esp, current_task->stack, (current_task->stack + KERNEL_STACK_SIZE));
signed int old_stack_offset;
if (current_task->stack > new_task->stack) {
old_stack_offset = -(current_task->stack - new_task->stack);
@ -146,10 +143,7 @@ fork() {
old_stack_offset = new_task->stack - current_task->stack;
}
new_task->esp = esp + old_stack_offset;
kprintf("%x %x %x\n", new_task->esp, new_task->stack, new_task->stack + KERNEL_STACK_SIZE);
memcpy((void *)(new_task->esp),(void*)esp,current_task->stack + KERNEL_STACK_SIZE - esp);
//new_task->esp = esp;
kprintf("Herp.\n");
new_task->ebp = ebp + old_stack_offset;
new_task->eip = eip;
__asm__ __volatile__ ("sti");

View File

@ -84,7 +84,7 @@ void
bochs_scroll() {
__asm__ __volatile__ ("cli");
uint32_t * bank_store = malloc(sizeof(uint32_t) * BOCHS_BANK_SIZE);
for (uint32_t i = 1; i < BOCHS_BANKS; ++i) {
for (int i = 1; i < BOCHS_BANKS; ++i) {
bochs_set_bank(i);
memcpy(bank_store, BOCHS_VID_MEMORY, sizeof(uint32_t) * BOCHS_BANK_SIZE);
bochs_set_bank(i - 1);