Changeset f245145 in mainline
- Timestamp:
- 2009-01-04T14:07:27Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a45752d
- Parents:
- 44ff4fb
- Location:
- kernel
- Files:
-
- 1 added
- 1 deleted
- 15 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/Makefile.inc
r44ff4fb rf245145 76 76 DEFS += -DCONFIG_I8042 77 77 78 ## Compile with EGA support 79 # 80 81 CONFIG_EGA = y 82 DEFS += -DCONFIG_EGA 83 78 84 ## Accepted configuration directives 79 85 # … … 97 103 arch/$(ARCH)/src/context.S \ 98 104 arch/$(ARCH)/src/ddi/ddi.c \ 99 arch/$(ARCH)/src/drivers/ega.c \100 105 arch/$(ARCH)/src/drivers/vesa.c \ 101 106 arch/$(ARCH)/src/drivers/i8254.c \ -
kernel/arch/amd64/include/types.h
r44ff4fb rf245145 58 58 typedef int64_t native_t; 59 59 60 typedef uintptr_t ioport_t; 61 60 62 /**< Formats for uintptr_t, size_t, count_t and index_t */ 61 63 #define PRIp "llx" -
kernel/arch/amd64/src/amd64.c
r44ff4fb rf245145 41 41 #include <proc/thread.h> 42 42 #include <arch/drivers/ega.h> 43 #include <genarch/drivers/ega/ega.h> 43 44 #include <arch/drivers/vesa.h> 44 45 #include <genarch/kbd/i8042.h> … … 140 141 else 141 142 #endif 142 ega_init( ); /* video */143 ega_init(EGA_BASE, EGA_VIDEORAM); /* video */ 143 144 144 145 /* Enable debugger */ -
kernel/arch/ia32/Makefile.inc
r44ff4fb rf245145 111 111 DEFS += -DCONFIG_I8042 112 112 113 ## Compile with EGA support 114 # 115 116 CONFIG_EGA = y 117 DEFS += -DCONFIG_EGA 118 113 119 ## Accepted configuration directives 114 120 # … … 156 162 arch/$(ARCH)/src/drivers/i8254.c \ 157 163 arch/$(ARCH)/src/drivers/i8259.c \ 158 arch/$(ARCH)/src/drivers/ega.c \159 164 arch/$(ARCH)/src/drivers/vesa.c \ 160 165 arch/$(ARCH)/src/boot/boot.S \ -
kernel/arch/ia32/include/drivers/ega.h
r44ff4fb rf245145 1 1 /* 2 * Copyright (c) 200 1-2004 Jakub Jermar2 * Copyright (c) 2008 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup ia32 29 /** @addtogroup ia32 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef KERN_ia32_EGA_H _36 #define KERN_ia32_EGA_H _35 #ifndef KERN_ia32_EGA_H 36 #define KERN_ia32_EGA_H 37 37 38 #define VIDEORAM 0xb8000 39 #define ROW 80 40 #define ROWS 25 41 #define SCREEN (ROW * ROWS) 42 43 extern void ega_redraw(void); 44 extern void ega_init(void); 38 #define EGA_VIDEORAM 0xb8000 39 #define EGA_BASE 0x3d4 45 40 46 41 #endif -
kernel/arch/ia32/include/types.h
r44ff4fb rf245145 58 58 typedef int32_t native_t; 59 59 60 typedef uintptr_t ioport_t; 61 60 62 #define PRIp "x" /**< Format for uintptr_t. */ 61 63 #define PRIs "u" /**< Format for size_t. */ -
kernel/arch/ia32/src/ia32.c
r44ff4fb rf245145 40 40 41 41 #include <arch/drivers/ega.h> 42 #include <genarch/drivers/ega/ega.h> 42 43 #include <arch/drivers/vesa.h> 43 44 #include <genarch/kbd/i8042.h> … … 94 95 else 95 96 #endif 96 ega_init( );/* video */97 ega_init(EGA_BASE, EGA_VIDEORAM); /* video */ 97 98 98 99 /* Enable debugger */ -
kernel/arch/ia64/Makefile.inc
r44ff4fb rf245145 60 60 CONFIG_ASID_FIFO = y 61 61 62 63 62 ## Compile with support for software integer division. 64 63 # … … 93 92 94 93 ifeq ($(MACHINE),i460GX) 95 ARCH_SOURCES += arch/$(ARCH)/src/drivers/ega.c96 94 CONFIG_I8042 = y 97 DEFS += -DI460GX -DCONFIG_I8042 95 CONFIG_EGA = y 96 DEFS += -DI460GX -DCONFIG_I8042 -DCONFIG_EGA 98 97 BFD = binary 99 98 endif -
kernel/arch/ia64/include/asm.h
r44ff4fb rf245145 40 40 #include <arch/register.h> 41 41 42 typedef uint64_t ioport_t;43 44 42 #define IA64_IOSPACE_ADDRESS 0xE001000000000000ULL 45 43 -
kernel/arch/ia64/include/drivers/ega.h
r44ff4fb rf245145 1 1 /* 2 * Copyright (c) 2001-2004 Jakub Jermar 3 * 2007 Jakub Vana 2 * Copyright (c) 2008 Jakub Jermar 4 3 * All rights reserved. 5 4 * … … 28 27 */ 29 28 30 /** @addtogroup ia 3229 /** @addtogroup ia64 31 30 * @{ 32 31 */ … … 37 36 #define KERN_ia64_EGA_H 38 37 39 #define VIDEORAM (0xe0020000000B8000LL) 40 41 #define ROW 80 42 #define ROWS 25 43 #define SCREEN (ROW * ROWS) 44 45 extern void ega_init(void); 38 #define EGA_VIDEORAM 0xb8000 39 #define EGA_BASE 0x3d4 46 40 47 41 #endif -
kernel/arch/ia64/include/types.h
r44ff4fb rf245145 66 66 typedef int64_t native_t; 67 67 68 typedef uintptr_t ioport_t; 69 68 70 #define PRIp "lx" /**< Format for uintptr_t. */ 69 71 #define PRIs "lu" /**< Format for size_t. */ -
kernel/arch/ia64/src/asm.S
r44ff4fb rf245145 129 129 br _memsetb 130 130 131 .global memsetw 132 memsetw: 133 br _memsetw 134 131 135 .global cpu_halt 132 136 cpu_halt: -
kernel/arch/ia64/src/ia64.c
r44ff4fb rf245145 52 52 #include <ddi/irq.h> 53 53 #include <ddi/device.h> 54 #include <arch/bootinfo.h> 54 55 #include <arch/drivers/ega.h> 55 #include < arch/bootinfo.h>56 #include <genarch/drivers/ega/ega.h> 56 57 #include <genarch/kbd/i8042.h> 57 58 #include <genarch/kbd/ns16550.h> … … 133 134 ski_init_console(); 134 135 #else 135 ega_init( );136 ega_init(EGA_BASE, EGA_VIDEORAM); 136 137 #endif 137 138 } -
kernel/arch/sparc64/include/types.h
r44ff4fb rf245145 55 55 typedef uint64_t ipl_t; 56 56 57 typedef uint64_t ioport_t;58 59 57 typedef uint64_t unative_t; 60 58 typedef int64_t native_t; 59 60 typedef uintptr_t ioport_t; 61 61 62 62 /**< Formats for uintptr_t, size_t, count_t and index_t */ -
kernel/genarch/Makefile.inc
r44ff4fb rf245145 104 104 genarch/src/ofw/upa.c 105 105 endif 106 107 ## EGA 108 ifeq ($(CONFIG_EGA), y) 109 GENARCH_SOURCES += \ 110 genarch/src/drivers/ega/ega.c 111 endif -
kernel/genarch/src/drivers/ega/ega.c
r44ff4fb rf245145 27 27 */ 28 28 29 /** @addtogroup ia3229 /** @addtogroup genarch_drivers 30 30 * @{ 31 31 */ … … 35 35 */ 36 36 37 #include < arch/drivers/ega.h>37 #include <genarch/drivers/ega/ega.h> 38 38 #include <putchar.h> 39 39 #include <mm/page.h> … … 61 61 static uint8_t *videoram; 62 62 static uint8_t *backbuf; 63 static ioport_t ega_base; 63 64 64 65 static void ega_putchar(chardev_t *d, const char ch); … … 71 72 static void ega_move_cursor(void); 72 73 73 void ega_init( void)74 void ega_init(ioport_t base, uintptr_t videoram_phys) 74 75 { 75 uint8_t hi, lo; 76 /* Initialize the software structure. */ 77 ega_base = base; 76 78 77 79 backbuf = (uint8_t *) malloc(SCREEN * 2, 0); … … 79 81 panic("Unable to allocate backbuffer.\n"); 80 82 81 videoram = (uint8_t *) hw_map( VIDEORAM, SCREEN * 2);82 outb(0x3d4, 0xe);83 hi = inb(0x3d5);84 outb(0x3d4, 0xf);85 lo = inb(0x3d5);86 ega_ cursor = (hi << 8) | lo;83 videoram = (uint8_t *) hw_map(videoram_phys, SCREEN * 2); 84 85 /* Clear the screen and set the cursor position. */ 86 memsetw(videoram, SCREEN, 0x0720); 87 memsetw(backbuf, SCREEN, 0x0720); 88 ega_move_cursor(); 87 89 88 90 chardev_initialize("ega_out", &ega_console, &ega_ops); 89 91 stdout = &ega_console; 90 92 91 ega_parea.pbase = VIDEORAM;93 ega_parea.pbase = videoram_phys; 92 94 ega_parea.vbase = (uintptr_t) videoram; 93 95 ega_parea.frames = 1; … … 99 101 sysinfo_set_item_val("fb.width", NULL, ROW); 100 102 sysinfo_set_item_val("fb.height", NULL, ROWS); 101 sysinfo_set_item_val("fb.address.physical", NULL, VIDEORAM); 103 sysinfo_set_item_val("fb.blinking", NULL, true); 104 sysinfo_set_item_val("fb.address.physical", NULL, videoram_phys); 102 105 } 103 106 … … 116 119 return; 117 120 118 memmove((void *) videoram, (void *) (videoram + ROW * 2), (SCREEN - ROW) * 2); 119 memmove((void *) backbuf, (void *) (backbuf + ROW * 2), (SCREEN - ROW) * 2); 121 memmove((void *) videoram, (void *) (videoram + ROW * 2), 122 (SCREEN - ROW) * 2); 123 memmove((void *) backbuf, (void *) (backbuf + ROW * 2), 124 (SCREEN - ROW) * 2); 120 125 memsetw(videoram + (SCREEN - ROW) * 2, ROW, 0x0720); 121 126 memsetw(backbuf + (SCREEN - ROW) * 2, ROW, 0x0720); … … 155 160 void ega_move_cursor(void) 156 161 { 157 outb( 0x3d4, 0xe);158 outb( 0x3d5, (uint8_t) ((ega_cursor >> 8) & 0xff));159 outb( 0x3d4, 0xf);160 outb( 0x3d5, (uint8_t) (ega_cursor & 0xff));162 outb(ega_base + EGA_INDEX_REG, 0xe); 163 outb(ega_base + EGA_DATA_REG, (uint8_t) ((ega_cursor >> 8) & 0xff)); 164 outb(ega_base + EGA_INDEX_REG, 0xf); 165 outb(ega_base + EGA_DATA_REG, (uint8_t) (ega_cursor & 0xff)); 161 166 } 162 167
Note:
See TracChangeset
for help on using the changeset viewer.