Rev 1498 | Rev 1530 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1498 | Rev 1501 | ||
---|---|---|---|
Line 109... | Line 109... | ||
109 | } |
109 | } |
110 | 110 | ||
111 | int ega_init(void) |
111 | int ega_init(void) |
112 | { |
112 | { |
113 | void *ega_ph_addr; |
113 | void *ega_ph_addr; |
- | 114 | size_t sz; |
|
114 | 115 | ||
115 | 116 | ||
116 | ega_ph_addr=(void *)sysinfo_value("fb.address.physical"); |
117 | ega_ph_addr=(void *)sysinfo_value("fb.address.physical"); |
117 | scr_width=sysinfo_value("fb.width"); |
118 | scr_width=sysinfo_value("fb.width"); |
118 | scr_height=sysinfo_value("fb.height"); |
119 | scr_height=sysinfo_value("fb.height"); |
119 | 120 | ||
- | 121 | sz = scr_width*scr_height*2; |
|
120 | scr_addr=(void *)ALIGN_UP(((__address)set_maxheapsize(USER_ADDRESS_SPACE_SIZE_ARCH>>1)),PAGE_SIZE); |
122 | scr_addr = as_get_mappable_page(sz); |
121 | 123 | ||
122 | if (ega_ph_addr != ALIGN_DOWN((unsigned long)ega_ph_addr, PAGE_SIZE)) |
- | |
123 | return -1; |
- | |
124 | - | ||
125 | map_physmem(ega_ph_addr, scr_addr, (scr_width*scr_height*2+PAGE_SIZE-1)>>PAGE_WIDTH, |
124 | map_physmem(ega_ph_addr, scr_addr, ALIGN_UP(sz,PAGE_SIZE)>>PAGE_WIDTH, |
126 | AS_AREA_READ | AS_AREA_WRITE); |
125 | AS_AREA_READ | AS_AREA_WRITE); |
127 | 126 | ||
128 | - | ||
129 | async_set_client_connection(ega_client_connection); |
127 | async_set_client_connection(ega_client_connection); |
130 | 128 | ||
131 | clrscr(); |
129 | clrscr(); |
132 | 130 | ||
133 | return 0; |
131 | return 0; |