Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3828 → Rev 3829

/trunk/boot/arch/ppc32/loader/main.c
89,7 → 89,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 → 107,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(" 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);
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);
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);
/trunk/boot/arch/ppc32/loader/main.h
47,7 → 47,7
memmap_t memmap;
taskmap_t taskmap;
screen_t screen;
keyboard_t keyboard;
macio_t macio;
} bootinfo_t;
 
extern void start(void);
/trunk/boot/arch/ppc32/loader/ofwarch.c
48,22 → 48,23
}
}
 
int ofw_keyboard(keyboard_t *keyboard)
int ofw_macio(macio_t *macio)
{
char device_name[BUF_SIZE];
if (ofw_get_property(ofw_aliases, "macio", device_name, sizeof(device_name)) <= 0)
return false;
phandle device = ofw_find_device(device_name);
if (device == -1)
return false;
pci_reg_t macio;
if (ofw_get_property(device, "assigned-addresses", &macio, sizeof(macio)) <= 0)
pci_reg_t pci_reg;
if (ofw_get_property(device, "assigned-addresses", &pci_reg, sizeof(pci_reg)) <= 0)
return false;
keyboard->addr = (void *) macio.addr.addr_lo;
keyboard->size = macio.size_lo;
macio->addr = (void *) pci_reg.addr.addr_lo;
macio->size = pci_reg.size_lo;
 
return true;
}