Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1371 → Rev 1370

/kernel/trunk/arch/ppc32/include/exception.h
78,7 → 78,7
 
static inline void istate_set_retaddr(istate_t *istate, __address retaddr)
{
istate->pc = retaddr;
/* TODO */
}
 
#endif
/kernel/trunk/arch/ppc32/src/ppc32.c
57,6 → 57,8
/* Start decrementer */
start_decrementer();
 
ppc32_console_init();
cuda_init();
}
 
63,8 → 65,6
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/ppc32/src/console.c
0,0 → 1,47
/*
* Copyright (C) 2005 Jakub Jermar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#include <arch/boot/boot.h>
#include <arch/console.h>
#include <console/chardev.h>
#include <console/console.h>
#include <genarch/fb/fb.h>
 
 
/** Initialize console to use frame buffer. */
void ppc32_console_init(void)
{
/* TODO: Framebuffer mapping */
fb_init(0xf0000000 + (bootinfo.screen.addr & ((__address) ~0 >> 15)), bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline);
}
 
 
void ppc32_console_register(void)
{
fb_register();
}
/kernel/trunk/arch/ppc32/Makefile.inc
61,6 → 61,7
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/ia32/src/drivers/vesa.c
58,9 → 58,30
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)
{
fb_init(vesa_ph_addr, vesa_width, vesa_height, vesa_bpp, vesa_scanline);
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);
}
 
#endif
/kernel/trunk/genarch/src/fb/fb.c
32,9 → 32,6
#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>
315,7 → 312,7
 
/** Initialize framebuffer as a chardev output device
*
* @param addr Physical address of the framebuffer
* @param addr Address of theframebuffer
* @param x Screen width in pixels
* @param y Screen height in pixels
* @param bpp Bits per pixel (8, 16, 24, 32)
348,22 → 345,8
default:
panic("Unsupported bpp");
}
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);
fbaddress = (unsigned char *) addr;
xres = x;
yres = y;
bitspp = bpp;
378,11 → 361,18
 
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, 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);
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);
}
/kernel/trunk/genarch/include/fb/fb.h
34,5 → 34,6
 
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