Subversion Repositories HelenOS

Rev

Rev 1404 | Rev 1445 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1404 Rev 1430
Line 26... Line 26...
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
28
 */
29
 
29
 
30
#include <stdio.h>
30
#include <stdio.h>
31
#include <ddi.h>
-
 
32
#include <task.h>
-
 
33
#include <stdlib.h>
31
#include <stdlib.h>
-
 
32
#include <unistd.h>
-
 
33
#include <string.h>
34
#include <ddi.h>
34
#include <ddi.h>
-
 
35
#include <task.h>
35
#include <sysinfo.h>
36
#include <sysinfo.h>
36
#include <align.h>
37
#include <align.h>
37
#include <as.h>
38
#include <as.h>
38
#include <ipc/fb.h>
39
#include <ipc/fb.h>
39
 
-
 
40
 
-
 
41
#include <ipc/ipc.h>
40
#include <ipc/ipc.h>
42
#include <ipc/services.h>
-
 
43
#include <unistd.h>
-
 
44
#include <stdlib.h>
-
 
45
#include <ipc/ns.h>
41
#include <ipc/ns.h>
46
 
-
 
-
 
42
#include <ipc/services.h>
47
#include <kernel/errno.h>
43
#include <kernel/errno.h>
48
#include <async.h>
44
#include <async.h>
49
 
-
 
50
 
-
 
51
#include "font-8x16.h"
45
#include "font-8x16.h"
52
#include <string.h>
-
 
53
 
-
 
54
#include "helenos.xbm"
46
#include "helenos.xbm"
55
#include "fb.h"
47
#include "fb.h"
56
 
48
 
57
#define EFB (-1)
49
#define EFB (-1)
58
 
50
 
Line 67... Line 59...
67
#define SPACING (2)
59
#define SPACING (2)
68
 
60
 
69
#define H_NO_VFBS 3
61
#define H_NO_VFBS 3
70
#define V_NO_VFBS 3
62
#define V_NO_VFBS 3
71
 
63
 
72
 
-
 
73
static void fb_putchar(int item,char ch);
64
static void fb_putchar(int item,char ch);
74
int create_window(int item,unsigned int x, unsigned int y,unsigned int x_size, unsigned int y_size,
65
int create_window(int item,unsigned int x, unsigned int y,unsigned int x_size, unsigned int y_size,
75
    unsigned int BGCOLOR,unsigned int FGCOLOR,unsigned int LOGOCOLOR);
66
    unsigned int BGCOLOR,unsigned int FGCOLOR,unsigned int LOGOCOLOR);
76
void fb_init(int item,__address addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan,
67
void fb_init(int item,__address addr, unsigned int x, unsigned int y, unsigned int bpp, unsigned int scan,
77
    unsigned int BGCOLOR,unsigned int FGCOLOR,unsigned int LOGOCOLOR);
68
    unsigned int BGCOLOR,unsigned int FGCOLOR,unsigned int LOGOCOLOR);
78
 
69
 
79
 
-
 
80
unsigned int mod_col(unsigned int col,int mod);
70
unsigned int mod_col(unsigned int col,int mod);
81
 
71
 
82
 
-
 
83
 
-
 
84
static int init_fb(void)
72
static int init_fb(void)
85
{
73
{
86
    __address fb_ph_addr;
74
    __address fb_ph_addr;
87
    unsigned int fb_width;
75
    unsigned int fb_width;
88
    unsigned int fb_height;
76
    unsigned int fb_height;
Line 100... Line 88...
100
    fb_bpp=sysinfo_value("fb.bpp");
88
    fb_bpp=sysinfo_value("fb.bpp");
101
    fb_scanline=sysinfo_value("fb.scanline");
89
    fb_scanline=sysinfo_value("fb.scanline");
102
 
90
 
103
    fb_addr=ALIGN_UP(((__address)set_maxheapsize(USER_ADDRESS_SPACE_SIZE_ARCH>>1)),PAGE_SIZE);
91
    fb_addr=ALIGN_UP(((__address)set_maxheapsize(USER_ADDRESS_SPACE_SIZE_ARCH>>1)),PAGE_SIZE);
104
 
92
   
105
 
-
 
106
   
-
 
107
    map_physmem(task_get_id(),(void *)((__address)fb_ph_addr),(void *)fb_addr,
93
    map_physmem(task_get_id(),(void *)((__address)fb_ph_addr),(void *)fb_addr,
108
            (fb_scanline*fb_height+PAGE_SIZE-1)>>PAGE_WIDTH,1);
94
            (fb_scanline*fb_height+PAGE_SIZE-1)>>PAGE_WIDTH,
-
 
95
            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
109
   
96
   
110
    fb_init(0,fb_addr, fb_width, fb_height, fb_bpp, fb_scanline,
97
    fb_init(0,fb_addr, fb_width, fb_height, fb_bpp, fb_scanline,
111
        MAIN_BGCOLOR,MAIN_FGCOLOR,MAIN_LOGOCOLOR);
98
        MAIN_BGCOLOR,MAIN_FGCOLOR,MAIN_LOGOCOLOR);
112
 
99
 
113
    fb_putchar(0,'\n');
100
    fb_putchar(0,'\n');