- Timestamp:
- 2011-12-08T23:12:14Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9c986d3
- Parents:
- b25199bc (diff), c40f385 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel
- Files:
-
- 6 edited
-
arch/amd64/src/boot/multiboot2.S (modified) (3 diffs)
-
arch/ia32/src/boot/multiboot2.S (modified) (3 diffs)
-
genarch/src/drivers/i8042/i8042.c (modified) (7 diffs)
-
genarch/src/fb/bfb.c (modified) (2 diffs)
-
genarch/src/multiboot/multiboot2.c (modified) (2 diffs)
-
generic/src/main/main.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/boot/multiboot2.S
rb25199bc r89128f3 55 55 .long MULTIBOOT2_TAG_MODULE 56 56 .long MULTIBOOT2_TAG_MEMMAP 57 #ifdef CONFIG_FB 57 58 .long MULTIBOOT2_TAG_FBINFO 59 #endif 58 60 tag_info_req_end: 59 61 … … 85 87 tag_flags_end: 86 88 89 #ifdef CONFIG_FB 87 90 /* Framebuffer tag */ 88 91 tag_framebuffer_start: … … 94 97 .long CONFIG_BFB_BPP 95 98 tag_framebuffer_end: 99 #endif 96 100 97 101 /* Module alignment tag */ -
kernel/arch/ia32/src/boot/multiboot2.S
rb25199bc r89128f3 53 53 .long MULTIBOOT2_TAG_MODULE 54 54 .long MULTIBOOT2_TAG_MEMMAP 55 #ifdef CONFIG_FB 55 56 .long MULTIBOOT2_TAG_FBINFO 57 #endif 56 58 tag_info_req_end: 57 59 … … 83 85 tag_flags_end: 84 86 87 #ifdef CONFIG_FB 85 88 /* Framebuffer tag */ 86 89 tag_framebuffer_start: … … 92 95 .long CONFIG_BFB_BPP 93 96 tag_framebuffer_end: 97 #endif 94 98 95 99 /* Module alignment tag */ -
kernel/genarch/src/drivers/i8042/i8042.c
rb25199bc r89128f3 44 44 #include <mm/slab.h> 45 45 #include <ddi/device.h> 46 #include <time/delay.h> 46 47 47 48 #define i8042_SET_COMMAND 0x60 … … 51 52 #define i8042_BUFFER_FULL_MASK 0x01 52 53 #define i8042_WAIT_MASK 0x02 54 55 #define i8042_TIMEOUT 65536 53 56 54 57 static irq_ownership_t i8042_claim(irq_t *irq) … … 77 80 static void i8042_clear_buffer(i8042_t *dev) 78 81 { 79 while (pio_read_8(&dev->status) & i8042_BUFFER_FULL_MASK) 82 for (uint32_t i = 0; i < i8042_TIMEOUT; i++) { 83 if ((pio_read_8(&dev->status) & i8042_BUFFER_FULL_MASK) == 0) 84 break; 85 80 86 (void) pio_read_8(&dev->data); 87 delay(50); /* 50 us think time */ 88 } 89 } 90 91 static void i8042_send_command(i8042_t *dev, uint8_t cmd) 92 { 93 for (uint32_t i = 0; i < i8042_TIMEOUT; i++) { 94 if ((pio_read_8(&dev->status) & i8042_WAIT_MASK) == 0) 95 break; 96 97 delay(50); /* 50 us think time */ 98 } 99 100 pio_write_8(&dev->status, cmd); 101 delay(10000); /* 10 ms think time */ 81 102 } 82 103 … … 84 105 i8042_instance_t *i8042_init(i8042_t *dev, inr_t inr) 85 106 { 86 i8042_instance_t *instance 87 =malloc(sizeof(i8042_instance_t), FRAME_ATOMIC);107 i8042_instance_t *instance = 108 malloc(sizeof(i8042_instance_t), FRAME_ATOMIC); 88 109 if (instance) { 89 110 instance->i8042 = dev; … … 96 117 instance->irq.handler = i8042_irq_handler; 97 118 instance->irq.instance = instance; 98 99 119 } 100 120 … … 107 127 ASSERT(kbrdin); 108 128 129 i8042_clear_buffer(instance->i8042); 130 109 131 instance->kbrdin = kbrdin; 110 132 irq_register(&instance->irq); 111 i8042_clear_buffer(instance->i8042);112 133 } 113 134 … … 116 137 { 117 138 interrupts_disable(); 118 119 139 i8042_clear_buffer(dev); 120 121 /* Reset CPU */ 122 pio_write_8(&dev->status, i8042_CPU_RESET); 140 i8042_send_command(dev, i8042_CPU_RESET); 123 141 } 124 142 -
kernel/genarch/src/fb/bfb.c
rb25199bc r89128f3 40 40 #include <console/console.h> 41 41 42 uintptr_t bfb_addr = (uintptr_t) -1;42 uintptr_t bfb_addr = 0; 43 43 uint32_t bfb_width = 0; 44 44 uint32_t bfb_height = 0; … … 57 57 bool bfb_init(void) 58 58 { 59 if ((bfb_width == 0) || (bfb_height == 0)) 59 if ((bfb_addr == 0) || (bfb_width == 0) || (bfb_height == 0) || 60 (bfb_bpp == 0) || (bfb_scanline == 0)) 60 61 return false; 61 62 -
kernel/genarch/src/multiboot/multiboot2.c
rb25199bc r89128f3 76 76 static void multiboot2_fbinfo(const multiboot2_fbinfo_t *fbinfo) 77 77 { 78 #ifdef CONFIG_FB 78 79 if (fbinfo->visual == MULTIBOOT2_VISUAL_RGB) { 79 80 bfb_addr = fbinfo->addr; … … 92 93 bfb_blue_size = fbinfo->rgb.blue_size; 93 94 } 95 #endif 94 96 } 95 97 -
kernel/generic/src/main/main.c
rb25199bc r89128f3 262 262 * Create the first thread. 263 263 */ 264 thread_t *kinit_thread 265 =thread_create(kinit, NULL, kernel, 0, "kinit", true);264 thread_t *kinit_thread = 265 thread_create(kinit, NULL, kernel, 0, "kinit", true); 266 266 if (!kinit_thread) 267 267 panic("Cannot create kinit thread.");
Note:
See TracChangeset
for help on using the changeset viewer.
