Changeset da0c91e7 in mainline


Ignore:
Timestamp:
2006-06-01T23:01:44Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
46bd593f
Parents:
c1d2c9d
Message:

Added very preliminary support for console on architectures
that do not support framebuffer.

Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • console/console.c

    rc1d2c9d rda0c91e7  
    116116                       
    117117                        conn = &connections[active_console];
    118                         if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) {
     118//                      if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + CONSOLE_COUNT)) {
     119                        if ((c >= '1') && (c < '1' + CONSOLE_COUNT)) {
    119120                                /*FIXME: draw another console content from buffer */
    120121
    121                                 active_console = c - KBD_KEY_F1;
     122                                active_console = c - '1';
    122123                                conn = &connections[active_console];
    123124
     
    232233        ipcarg_t retval, arg1 = 0xdead, arg2 = 0xbeef;
    233234        int i;
     235
     236        async_set_client_connection(client_connection);
    234237       
    235238        /* Connect to keyboard driver */
  • fb/Makefile

    rc1d2c9d rda0c91e7  
    4747SOURCES = \
    4848        fb.c \
    49         font-8x16.c
     49        font-8x16.c \
     50        main.c \
     51        sysio.c
    5052
    5153OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
  • fb/fb.c

    rc1d2c9d rda0c91e7  
    2828 */
    2929
    30 #include <stdio.h>
    3130#include <stdlib.h>
    3231#include <unistd.h>
    3332#include <string.h>
    3433#include <ddi.h>
    35 #include <task.h>
    3634#include <sysinfo.h>
    3735#include <align.h>
     
    390388}
    391389
    392 static int init_fb(void)
    393 {
    394         __address fb_ph_addr;
    395         unsigned int fb_width;
    396         unsigned int fb_height;
    397         unsigned int fb_bpp;
    398         unsigned int fb_scanline;
    399         __address fb_addr;
    400         int a=0;
    401         int i,j,k;
    402         int w;
    403         char text[]="HelenOS Framebuffer driver\non Virtual Framebuffer\nVFB ";
    404 
    405         fb_ph_addr=sysinfo_value("fb.address.physical");
    406         fb_width=sysinfo_value("fb.width");
    407         fb_height=sysinfo_value("fb.height");
    408         fb_bpp=sysinfo_value("fb.bpp");
    409         fb_scanline=sysinfo_value("fb.scanline");
    410 
    411         fb_addr=ALIGN_UP(((__address)set_maxheapsize(USER_ADDRESS_SPACE_SIZE_ARCH>>1)),PAGE_SIZE);
    412        
    413         map_physmem(task_get_id(),(void *)((__address)fb_ph_addr),(void *)fb_addr,
    414                     (fb_scanline*fb_height+PAGE_SIZE-1)>>PAGE_WIDTH,
    415                     AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
    416        
    417         screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline);
    418 
    419         return 0;
    420 }
    421 
    422390static void draw_char(int vp, char c, unsigned int row, unsigned int col)
    423391{
     
    443411}
    444412
    445 void client_connection(ipc_callid_t iid, ipc_call_t *icall)
     413static void fb_client_connection(ipc_callid_t iid, ipc_call_t *icall)
    446414{
    447415        ipc_callid_t callid;
     
    578546}
    579547
    580 int main(int argc, char *argv[])
    581 {
    582         char connected = 0;
    583         int res;
    584         ipcarg_t phonead;
    585 
    586         if(!sysinfo_value("fb"))
    587                 return -1;
    588 
    589         if ((res = ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, &phonead)) != 0)
    590                 return -1;
    591        
    592         if (init_fb() != 0)
    593                 return -1;
    594 
    595         async_manager();
    596         /* Never reached */
     548int fb_init(void)
     549{
     550        __address fb_ph_addr;
     551        unsigned int fb_width;
     552        unsigned int fb_height;
     553        unsigned int fb_bpp;
     554        unsigned int fb_scanline;
     555        __address fb_addr;
     556
     557        async_set_client_connection(fb_client_connection);
     558
     559        fb_ph_addr=sysinfo_value("fb.address.physical");
     560        fb_width=sysinfo_value("fb.width");
     561        fb_height=sysinfo_value("fb.height");
     562        fb_bpp=sysinfo_value("fb.bpp");
     563        fb_scanline=sysinfo_value("fb.scanline");
     564
     565        fb_addr=ALIGN_UP(((__address)set_maxheapsize(USER_ADDRESS_SPACE_SIZE_ARCH>>1)),PAGE_SIZE);
     566       
     567        map_physmem(task_get_id(),(void *)((__address)fb_ph_addr),(void *)fb_addr,
     568                    (fb_scanline*fb_height+PAGE_SIZE-1)>>PAGE_WIDTH,
     569                    AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
     570       
     571        screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline);
     572
    597573        return 0;
    598574}
     575
  • fb/fb.h

    rc1d2c9d rda0c91e7  
    3030#define _FB_H_
    3131
    32 #include <types.h>
    33 #include <arch/types.h>
     32int fb_init(void);
    3433
    3534#endif
  • libc/generic/async.c

    rc1d2c9d rda0c91e7  
    129129} connection_t;
    130130
     131
    131132__thread connection_t *PS_connection;
     133
     134static void default_client_connection(ipc_callid_t callid, ipc_call_t *call);
     135static async_client_conn_t client_connection = default_client_connection;
    132136
    133137/** Add microseconds to give timeval */
     
    273277 * user code.
    274278 */
    275 void client_connection(ipc_callid_t callid, ipc_call_t *call)
     279static void default_client_connection(ipc_callid_t callid, ipc_call_t *call)
    276280{
    277281        ipc_answer_fast(callid, ENOENT, 0, 0);
     
    671675        free(msg);
    672676}
     677
     678/** Set function that is called, IPC_M_CONNECT_ME_TO is received
     679 *
     680 * @param conn Function that will form new psthread.
     681 */
     682void async_set_client_connection(async_client_conn_t conn)
     683{
     684        client_connection = conn;
     685}
  • libc/generic/io/stream.c

    rc1d2c9d rda0c91e7  
    5353stream_t streams[FDS] = {{0, 0, 0}};
    5454
    55 /*
    56 ssize_t write_stdout(void *param, const void * buf, size_t count);
    57 ssize_t write_stdout(void *param, const void * buf, size_t count)
    58 {
    59         return (ssize_t) __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, (sysarg_t) count);
    60 }*/
    61 
    6255static ssize_t write_stderr(void *param, const void *buf, size_t count)
    6356{
    6457        return count;
    65         //return (ssize_t) __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, (sysarg_t) count);
    6658}
    6759
     
    7870        }
    7971        return i;
    80         //return (ssize_t) __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, (sysarg_t) count);
    8172}
    8273
     
    9081       
    9182        return count;
    92         //return (ssize_t) __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, (sysarg_t) count);
    9383}
    9484
  • libc/include/async.h

    rc1d2c9d rda0c91e7  
    3636
    3737typedef ipc_callid_t aid_t;
     38typedef void (*async_client_conn_t)(ipc_callid_t callid, ipc_call_t *call);
    3839
    3940int async_manager(void);
     
    7374void async_create_manager(void);
    7475void async_destroy_manager(void);
     76void async_set_client_connection(async_client_conn_t conn);
    7577int _async_init(void);
    7678
    7779/* Should be defined by application */
    78 void client_connection(ipc_callid_t callid, ipc_call_t *call) __attribute__((weak));
    7980void interrupt_received(ipc_call_t *call)  __attribute__((weak));
    8081
Note: See TracChangeset for help on using the changeset viewer.