/kernel/trunk/genarch/include/fb/fb.h |
---|
34,6 → 34,5 |
extern spinlock_t fb_lock; |
void fb_init(__address addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan); |
void fb_register(void); |
#endif |
/kernel/trunk/genarch/src/fb/fb.c |
---|
32,6 → 32,9 |
#include <console/console.h> |
#include <sysinfo/sysinfo.h> |
#include <mm/slab.h> |
#include <mm/as.h> |
#include <bitops.h> |
#include <align.h> |
#include <panic.h> |
#include <memstr.h> |
#include <config.h> |
312,7 → 315,7 |
/** Initialize framebuffer as a chardev output device |
* |
* @param addr Address of theframebuffer |
* @param addr Physical address of the framebuffer |
* @param x Screen width in pixels |
* @param y Screen height in pixels |
* @param bpp Bits per pixel (8, 16, 24, 32) |
345,8 → 348,22 |
default: |
panic("Unsupported bpp"); |
} |
fbaddress = (unsigned char *) addr; |
unsigned int fbsize = scan * y; |
unsigned int fborder; |
if (fbsize <= FRAME_SIZE) |
fborder = 0; |
else |
fborder = (fnzb32(fbsize - 1) + 1) - FRAME_WIDTH; |
/* Map the framebuffer */ |
fbaddress = (__u8 *) PA2KA(PFN2ADDR(frame_alloc(fborder, FRAME_KA))); |
pfn_t i; |
for (i = 0; i < ADDR2PFN(ALIGN_UP(fbsize, PAGE_SIZE)); i++) |
page_mapping_insert(AS_KERNEL, (__address) fbaddress + PFN2ADDR(i), addr + PFN2ADDR(i), PAGE_NOT_CACHEABLE); |
xres = x; |
yres = y; |
bitspp = bpp; |
361,18 → 378,11 |
chardev_initialize("fb", &framebuffer, &fb_ops); |
stdout = &framebuffer; |
} |
/** Register framebuffer in sysinfo |
* |
*/ |
void fb_register(void) |
{ |
sysinfo_set_item_val("fb", NULL, true); |
sysinfo_set_item_val("fb.width", NULL, xres); |
sysinfo_set_item_val("fb.height", NULL, yres); |
sysinfo_set_item_val("fb.scanline", NULL, scanline); |
sysinfo_set_item_val("fb.bpp", NULL, bitspp); |
sysinfo_set_item_val("fb.address.virtual", NULL, (__address) fbaddress); |
sysinfo_set_item_val("fb.width", NULL, x); |
sysinfo_set_item_val("fb.height", NULL, y); |
sysinfo_set_item_val("fb.bpp", NULL, bpp); |
sysinfo_set_item_val("fb.scanline", NULL, scan); |
sysinfo_set_item_val("fb.address.physical", NULL, addr); |
} |
/kernel/trunk/arch/ppc32/include/exception.h |
---|
78,7 → 78,7 |
static inline void istate_set_retaddr(istate_t *istate, __address retaddr) |
{ |
/* TODO */ |
istate->pc = retaddr; |
} |
#endif |
/kernel/trunk/arch/ppc32/Makefile.inc |
---|
61,7 → 61,6 |
CONFIG_SOFTINT = y |
ARCH_SOURCES = \ |
arch/$(ARCH)/src/console.c \ |
arch/$(ARCH)/src/context.S \ |
arch/$(ARCH)/src/debug/panic.s \ |
arch/$(ARCH)/src/fpu_context.S \ |
/kernel/trunk/arch/ppc32/src/console.c |
---|
File deleted |
/kernel/trunk/arch/ppc32/src/ppc32.c |
---|
57,8 → 57,6 |
/* Start decrementer */ |
start_decrementer(); |
ppc32_console_init(); |
cuda_init(); |
} |
65,6 → 63,8 |
void arch_post_mm_init(void) |
{ |
if (config.cpu_active == 1) { |
fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline); |
/* Merge all zones to 1 big zone */ |
zone_merge_all(); |
/kernel/trunk/arch/ia32/src/drivers/vesa.c |
---|
58,30 → 58,9 |
return false; |
} |
static count_t vesa_frame_order(void) |
{ |
__u32 x = vesa_scanline*vesa_height; |
if (x <= FRAME_SIZE) |
return 0; |
return (fnzb32(x - 1) + 1) - FRAME_WIDTH; |
} |
void vesa_init(void) |
{ |
int a; |
__address vram_lin_addr; |
vram_lin_addr = PA2KA(PFN2ADDR(frame_alloc(vesa_frame_order(), FRAME_KA))); |
/* Map videoram */ |
for (a = 0; a < ((vesa_scanline * vesa_height + PAGE_SIZE - 1) >> PAGE_WIDTH); a++) |
page_mapping_insert(AS_KERNEL, vram_lin_addr + a*PAGE_SIZE, vesa_ph_addr + a*FRAME_SIZE, |
PAGE_NOT_CACHEABLE); |
fb_init(vram_lin_addr, vesa_width, vesa_height, vesa_bpp, vesa_scanline); |
fb_register(); |
sysinfo_set_item_val("fb.address.physical", NULL, vesa_ph_addr); |
fb_init(vesa_ph_addr, vesa_width, vesa_height, vesa_bpp, vesa_scanline); |
} |
#endif |