32,6 → 32,8 |
#include "_components.h" |
#include <ofw.h> |
#include <align.h> |
#include <macros.h> |
#include <string.h> |
|
#define HEAP_GAP 1024000 |
|
72,16 → 74,16 |
} |
} |
|
char *release = RELEASE; |
char *release = STRING(RELEASE); |
|
#ifdef REVISION |
char *revision = ", revision " REVISION; |
char *revision = ", revision " STRING(REVISION); |
#else |
char *revision = ""; |
#endif |
|
#ifdef TIMESTAMP |
char *timestamp = "\nBuilt on " TIMESTAMP; |
char *timestamp = "\nBuilt on " STRING(TIMESTAMP); |
#else |
char *timestamp = ""; |
#endif |
89,7 → 91,7 |
/** Print version information. */ |
static void version_print(void) |
{ |
printf("HelenOS PPC32 Bootloader\nRelease %s%s%s\nCopyright (c) 2006 HelenOS project\n", release, revision, timestamp); |
printf("HelenOS PPC32 Bootloader\nRelease %s%s%s\nCopyright (c) 2006 HelenOS project\n\n", release, revision, timestamp); |
} |
|
void bootstrap(void) |
107,25 → 109,29 |
check_align(&trans, "translation table"); |
|
if (!ofw_memmap(&bootinfo.memmap)) { |
printf("Error: unable to get memory map, halting.\n"); |
printf("Error: Unable to get memory map, halting.\n"); |
halt(); |
} |
|
if (bootinfo.memmap.total == 0) { |
printf("Error: no memory detected, halting.\n"); |
printf("Error: No memory detected, halting.\n"); |
halt(); |
} |
|
if (!ofw_screen(&bootinfo.screen)) |
printf("Warning: unable to get screen properties.\n"); |
printf("Warning: Unable to get screen properties.\n"); |
|
if (!ofw_keyboard(&bootinfo.keyboard)) |
printf("Warning: unable to get keyboard properties.\n"); |
if (!ofw_macio(&bootinfo.macio)) |
printf("Warning: Unable to get macio properties.\n"); |
|
printf("\nDevice statistics\n"); |
printf("Device statistics\n"); |
|
if (bootinfo.screen.addr) |
printf(" screen at %L, resolution %dx%d, %d bpp (scanline %d bytes)\n", bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline); |
printf(" keyboard at %L (size %d bytes)\n", bootinfo.keyboard.addr, bootinfo.keyboard.size); |
|
if (bootinfo.macio.addr) |
printf(" macio at %L (size %d bytes)\n", bootinfo.macio.addr, bootinfo.macio.size); |
|
void *real_mode_pa = ofw_translate(&real_mode); |
void *trans_pa = ofw_translate(&trans); |
void *bootinfo_pa = ofw_translate(&bootinfo); |
161,6 → 167,9 |
if (j == 0) { |
bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr = (void *) (pages << PAGE_WIDTH); |
bootinfo.taskmap.tasks[bootinfo.taskmap.count].size = components[i].size; |
strncpy(bootinfo.taskmap.tasks[bootinfo.taskmap.count].name, |
components[i].name, BOOTINFO_TASK_NAME_BUFLEN); |
|
bootinfo.taskmap.count++; |
} |
} |
172,6 → 181,8 |
fix_overlap(&trans, &trans_pa, "translation table", &top); |
fix_overlap(&bootinfo, &bootinfo_pa, "boot info", &top); |
|
ofw_setup_palette(); |
|
printf("\nBooting the kernel...\n"); |
jump_to_kernel(bootinfo_pa, sizeof(bootinfo), trans_pa, pages << PAGE_WIDTH, real_mode_pa, (void *) bootinfo.screen.addr, bootinfo.screen.scanline); |
} |