source: mainline/uspace/srv/hid/fb/msim.c@ 6b10dab

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 6b10dab was d9fae235, checked in by Martin Decky <martin@…>, 15 years ago

sysinfo overhaul

  • cleanup (nicer data structures, use of SLAB allocator)
  • add support for storing arbitrary binary data
  • properly reimplement non-constant values (generated by functions)
  • add support for non-constant subtrees (generated by functions)
  • syscall ABI change, libc API change
  • reflect changes in user code

libc: task_spawn() can now return error code

  • reflect change in user code, print error strings after failed task_spawn()

uspace cleanup

  • more use of string and other constants
  • more use of str_error()
  • unify error reporting in init
  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*
2 * Copyright (c) 2006 Ondrej Palkovsky
3 * Copyright (c) 2008 Martin Decky
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
28 */
29
30/** @defgroup msimfb MSIM text console
31 * @brief HelenOS MSIM text console.
32 * @ingroup fbs
33 * @{
34 */
35/** @file
36 */
37
38#include <async.h>
39#include <libc.h>
40#include <sysinfo.h>
41#include <as.h>
42#include <ddi.h>
43#include <errno.h>
44
45#include "serial_console.h"
46#include "msim.h"
47
48#define WIDTH 80
49#define HEIGHT 24
50
51static char *virt_addr;
52
53static void msim_putc(const char c)
54{
55 *virt_addr = c;
56}
57
58int msim_init(void)
59{
60 sysarg_t phys_addr;
61 if (sysinfo_get_value("fb.address.physical", &phys_addr) != EOK)
62 return -1;
63
64 virt_addr = (char *) as_get_mappable_page(1);
65
66 if (physmem_map((void *) phys_addr, virt_addr, 1,
67 AS_AREA_READ | AS_AREA_WRITE) != 0)
68 return -1;
69
70 serial_console_init(msim_putc, WIDTH, HEIGHT);
71
72 async_set_client_connection(serial_client_connection);
73 return 0;
74}
75
76/** @}
77 */
Note: See TracBrowser for help on using the repository browser.