Add 68000-based macintosh support: load kernel at address 0x4000

This commit is contained in:
Laurent Vivier
2005-06-14 19:39:43 +00:00
parent 6b501d489e
commit 4ddcf438d9

View File

@@ -256,19 +256,39 @@ int start(emile_l2_header_t* info)
#ifdef ARCH_M68K
if (arch_type == gestalt68k)
{
ret = logical2physical((unsigned long)kernel, &physImage);
/* disable and flush cache */
disable_cache();
/* initialize bootinfo structure */
bootinfo_init(info->command_line,
(char*)ramdisk_start, info->ramdisk_size);
/* set bootinfo at end of kernel image */
set_kernel_bootinfo(kernel + info->kernel_size);
/* compute final address of kernel */
if (mmu_type == gestaltNoMMU)
{
unsigned long size = end_enter_kernel - enter_kernel;
start_mem = 0x4000;
entry = (entry_t)(start_mem - size);
printf("\n");
printf("Physical address of kernel will be 0x%08lx\n",
start_mem);
printf("Ok, booting the kernel.\n");
memcpy(entry, (char*)enter_kernel, size);
}
else
{
ret = logical2physical((unsigned long)kernel, &physImage);
/* disable and flush cache */
disable_cache();
/* add KERNEL_ALIGN if we have to align */
aligned_size = boot_info.memory[0].addr & (KERNEL_ALIGN - 1);
@@ -281,10 +301,6 @@ int start(emile_l2_header_t* info)
boot_info.memory[0].size = aligned_size;
}
/* set bootinfo at end of kernel image */
set_kernel_bootinfo(kernel + info->kernel_size);
start_mem = boot_info.memory[0].addr + PAGE_SIZE;
printf("\n");
@@ -308,6 +324,7 @@ int start(emile_l2_header_t* info)
memcpy((char*)entry, (char*)enter_kernel, size);
}
}
}
else
#ifndef ARCH_PPC
error("EMILE doesn't support your architecture");