/boot/trunk/arch/ppc32/loader/ofw.h |
---|
59,7 → 59,12 |
unsigned int scanline; |
} screen_t; |
typedef struct { |
void *addr; |
unsigned int size; |
} keyboard_t; |
extern void init(void); |
extern void ofw_write(const char *str, const int len); |
67,5 → 72,6 |
extern int ofw_map(const void *phys, const void *virt, const int size, const int mode); |
extern int ofw_memmap(memmap_t *map); |
extern int ofw_screen(screen_t *screen); |
extern int ofw_keyboard(keyboard_t *keyboard); |
#endif |
/boot/trunk/arch/ppc32/loader/main.c |
---|
100,8 → 100,14 |
halt(); |
} |
if (!ofw_keyboard(&bootinfo.keyboard)) { |
printf("Error: unable to get keyboard properties, halting.\n"); |
halt(); |
} |
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); |
void *real_mode_pa = ofw_translate(&real_mode); |
void *trans_pa = ofw_translate(&trans); |
/boot/trunk/arch/ppc32/loader/main.h |
---|
54,6 → 54,7 |
taskmap_t taskmap; |
memmap_t memmap; |
screen_t screen; |
keyboard_t keyboard; |
} bootinfo_t; |
extern void start(void); |
/boot/trunk/arch/ppc32/loader/ofw.c |
---|
245,3 → 245,22 |
return true; |
} |
int ofw_keyboard(keyboard_t *keyboard) |
{ |
char device_name[BUF_SIZE]; |
if (ofw_get_property(ofw_aliases, "macio", device_name, sizeof(char) * BUF_SIZE) <= 0) |
return false; |
phandle device = ofw_find_device(device_name); |
if (device == -1) |
return false; |
// FIXME |
keyboard->addr = (void *) 0x80816000; |
keyboard->size = 7680; |
return true; |
} |