Changeset a71c158 in mainline for kernel/arch/ia32/src


Ignore:
Timestamp:
2009-08-21T14:12:45Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0e6dce8, b50b5af2, e5792d1
Parents:
90c8b8d
Message:

kernel output devices now suport multiple instances (except ski and sgcn, which respect the same interface, but behave as singletons)
if more than one output device gets initialized, the output is cloned to all of them
get rid of arch_grab_console() and arch_release_console() (output devices can implement a generic "redraw" method, input devices respect the "silent" global variable)
related cleanups and modifications

Location:
kernel/arch/ia32/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/drivers/vesa.c

    r90c8b8d ra71c158  
    2727 */
    2828
    29 /** @addtogroup ia32   
     29/** @addtogroup ia32
    3030 * @{
    3131 */
     
    4040#include <genarch/fb/visuals.h>
    4141#include <arch/drivers/vesa.h>
     42#include <console/chardev.h>
     43#include <console/console.h>
    4244#include <putchar.h>
    4345#include <mm/page.h>
     
    6668uint8_t vesa_blue_pos;
    6769
    68 int vesa_present(void)
     70bool vesa_init(void)
    6971{
    70         if ((vesa_width != 0xffff) && (vesa_height != 0xffff))
    71                 return true;
     72        if ((vesa_width == 0xffff) || (vesa_height == 0xffff))
     73                return false;
    7274       
    73         return false;
    74 }
    75 
    76 void vesa_init(void)
    77 {
    78         unsigned int visual;
     75        visual_t visual;
    7976       
    8077        switch (vesa_bpp) {
     
    9794                break;
    9895        default:
    99                 panic("Unsupported bits per pixel.");
     96                LOG("Unsupported bits per pixel.");
     97                return false;
    10098        }
    10199       
     
    108106                .visual = visual,
    109107        };
    110         fb_init(&vesa_props);
    111 }
    112 
    113 void vesa_redraw(void)
    114 {
    115         fb_redraw();
     108       
     109        outdev_t *fbdev = fb_init(&vesa_props);
     110        if (!fbdev)
     111                return false;
     112       
     113        stdout_wire(fbdev);
     114        return true;
    116115}
    117116
  • kernel/arch/ia32/src/ia32.c

    r90c8b8d ra71c158  
    112112                i8254_init();
    113113               
     114#if (defined(CONFIG_FB) || defined(CONFIG_EGA))
     115                bool vesa = false;
     116#endif
     117               
    114118#ifdef CONFIG_FB
    115                 if (vesa_present())
    116                         vesa_init();
    117                 else
    118 #endif
     119                vesa = vesa_init();
     120#endif
     121               
    119122#ifdef CONFIG_EGA
    120                         ega_init(EGA_BASE, EGA_VIDEORAM);  /* video */
    121 #else
    122                         {}
     123                if (!vesa) {
     124                        outdev_t *egadev = ega_init(EGA_BASE, EGA_VIDEORAM);
     125                        if (egadev)
     126                                stdout_wire(egadev);
     127                }
    123128#endif
    124129               
     
    201206        THREAD->arch.tls = addr;
    202207        set_tls_desc(addr);
    203 
     208       
    204209        return 0;
    205 }
    206 
    207 /** Acquire console back for kernel
    208  *
    209  */
    210 void arch_grab_console(void)
    211 {
    212 #ifdef CONFIG_FB
    213         if (vesa_present())
    214                 vesa_redraw();
    215         else
    216 #endif
    217 #ifdef CONFIG_EGA
    218                 ega_redraw();
    219 #else
    220                 {}
    221 #endif
    222 }
    223 
    224 /** Return console to userspace
    225  *
    226  */
    227 void arch_release_console(void)
    228 {
    229210}
    230211
Note: See TracChangeset for help on using the changeset viewer.