Changeset 1f5c9c96 in mainline for kernel/arch/ia32/src
- Timestamp:
- 2011-12-02T17:29:43Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b8b1e631, c3887ad
- Parents:
- c48f6ab
- Location:
- kernel/arch/ia32/src
- Files:
-
- 1 added
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/boot/memmap.c
rc48f6ab r1f5c9c96 35 35 #include <arch/boot/memmap.h> 36 36 37 uint8_t e820counter = 0 xffU;37 uint8_t e820counter = 0; 38 38 e820memmap_t e820table[MEMMAP_E820_MAX_RECORDS]; 39 39 -
kernel/arch/ia32/src/boot/multiboot.S
rc48f6ab r1f5c9c96 30 30 31 31 #include <arch/boot/boot.h> 32 #include <arch/boot/memmap.h>33 32 #include <arch/mm/page.h> 34 33 #include <arch/pm.h> 34 #include <genarch/multiboot/multiboot.h> 35 35 #include <arch/cpuid.h> 36 36 … … 92 92 multiboot_meeting_point: 93 93 94 /* Save GRUBarguments */95 movl %eax, grub_eax96 movl %ebx, grub_ebx94 /* Save multiboot arguments */ 95 movl %eax, multiboot_eax 96 movl %ebx, multiboot_ebx 97 97 98 98 pm_status $status_prot … … 135 135 pm2_status $status_prot3 136 136 137 /* Call arch_pre_main( grub_eax, grub_ebx) */138 pushl grub_ebx139 pushl grub_eax137 /* Call arch_pre_main(multiboot_eax, multiboot_ebx) */ 138 pushl multiboot_ebx 139 pushl multiboot_eax 140 140 call arch_pre_main 141 141 … … 196 196 * 197 197 */ 198 .global map_kernel_non_pse 198 199 map_kernel_non_pse: 199 200 /* Paging features */ … … 299 300 find_mem_for_pt: 300 301 /* Check if multiboot info is present */ 301 cmpl $MULTIBOOT_LOADER_MAGIC, grub_eax302 cmpl $MULTIBOOT_LOADER_MAGIC, multiboot_eax 302 303 je check_multiboot_map 303 304 … … 307 308 308 309 /* Copy address of the multiboot info to ebx */ 309 movl grub_ebx, %ebx310 movl multiboot_ebx, %ebx 310 311 311 312 /* Check if memory map flag is present */ … … 701 702 .space 4096, 0 702 703 704 .global bootstrap_gdtr 703 705 bootstrap_gdtr: 704 706 .word GDT_SELECTOR(GDT_ITEMS) 705 707 .long KA2PA(gdt) 706 708 707 grub_eax: 709 .global multiboot_eax 710 multiboot_eax: 708 711 .long 0 709 grub_ebx: 712 713 .global multiboot_ebx 714 multiboot_ebx: 710 715 .long 0 711 716 … … 725 730 status_vesa_copy: 726 731 .asciz "[vesa_copy] " 727 status_ grub_cmdline:728 .asciz "[ grub_cmdline] "732 status_multiboot_cmdline: 733 .asciz "[multiboot_cmdline] " 729 734 status_vesa_real: 730 735 .asciz "[vesa_real] " -
kernel/arch/ia32/src/boot/vesa_prot.inc
rc48f6ab r1f5c9c96 1 1 #ifdef CONFIG_FB 2 2 3 #define MULTIBOOT_LOADER_MAGIC 0x2BADB0024 3 #define MBINFO_BIT_CMDLINE 2 5 4 #define MBINFO_OFFSET_CMDLINE 16 … … 14 13 rep movsb 15 14 16 /* Check for GRUBcommand line */15 /* Check for multiboot command line */ 17 16 18 pm_status $status_ grub_cmdline17 pm_status $status_multiboot_cmdline 19 18 20 mov grub_eax, %eax19 mov multiboot_eax, %eax 21 20 cmp $MULTIBOOT_LOADER_MAGIC, %eax 22 21 jne no_cmdline 23 22 24 mov grub_ebx, %ebx23 mov multiboot_ebx, %ebx 25 24 mov (%ebx), %eax 26 25 bt $MBINFO_BIT_CMDLINE, %eax … … 89 88 /* Returned back to protected mode */ 90 89 91 mov %ax, KA2PA(vesa_scanline) 90 movzx %ax, %ecx 91 mov %ecx, KA2PA(bfb_scanline) 92 92 93 shr $16, %eax 93 mov %ax, KA2PA( vesa_bpp)94 mov %ax, KA2PA(bfb_bpp) 94 95 95 mov %bx, KA2PA(vesa_height) 96 movzx %bx, %ecx 97 mov %ecx, KA2PA(bfb_height) 98 96 99 shr $16, %ebx 97 mov % bx, KA2PA(vesa_width)100 mov %ebx, KA2PA(bfb_width) 98 101 99 mov %dl, KA2PA(vesa_green_pos) 102 mov %dl, KA2PA(bfb_green_pos) 103 100 104 shr $8, %edx 101 mov %dl, KA2PA(vesa_green_mask) 105 mov %dl, KA2PA(bfb_green_size) 106 102 107 shr $8, %edx 103 mov %dl, KA2PA(vesa_red_pos) 108 mov %dl, KA2PA(bfb_red_pos) 109 104 110 shr $8, %edx 105 mov %dl, KA2PA( vesa_red_mask)111 mov %dl, KA2PA(bfb_red_size) 106 112 107 113 mov %esi, %edx 108 mov %dl, KA2PA(vesa_blue_pos) 114 mov %dl, KA2PA(bfb_blue_pos) 115 109 116 shr $8, %edx 110 mov %dl, KA2PA( vesa_blue_mask)117 mov %dl, KA2PA(bfb_blue_size) 111 118 112 mov %edi, KA2PA( vesa_ph_addr)119 mov %edi, KA2PA(bfb_addr) 113 120 #endif -
kernel/arch/ia32/src/boot/vesa_real.inc
rc48f6ab r1f5c9c96 304 304 /* 305 305 * Store mode parameters: 306 * eax = bpp[ 8] scanline[16]306 * eax = bpp[16] scanline[16] 307 307 * ebx = width[16] height[16] 308 308 * edx = red_mask[8] red_pos[8] green_mask[8] green_pos[8] … … 328 328 shl $8, %edx 329 329 mov VESA_MODE_RED_POS_OFFSET(%di), %dl 330 330 331 shl $8, %edx 331 332 mov VESA_MODE_GREEN_MASK_OFFSET(%di), %dl … … 369 370 mov $0x0003, %ax 370 371 int $0x10 372 373 xor %eax, %eax 374 xor %ebx, %ebx 375 xor %edx, %edx 371 376 mov $0xffffffff, %edi 372 xor %ax, %ax377 373 378 jz vesa_leave_real /* force relative jump */ 374 379 … … 386 391 387 392 default_mode: 388 .ascii STRING(CONFIG_ VESA_MODE)393 .ascii STRING(CONFIG_BFB_MODE) 389 394 .ascii "-" 390 .asciz STRING(CONFIG_ VESA_BPP)395 .asciz STRING(CONFIG_BFB_BPP) 391 396 .fill 24 392 397 -
kernel/arch/ia32/src/ia32.c
rc48f6ab r1f5c9c96 42 42 43 43 #include <genarch/multiboot/multiboot.h> 44 #include <genarch/multiboot/multiboot2.h> 44 45 #include <genarch/drivers/legacy/ia32/io.h> 45 46 #include <genarch/drivers/ega/ega.h> 46 #include < arch/drivers/vesa.h>47 #include <genarch/fb/bfb.h> 47 48 #include <genarch/drivers/i8042/i8042.h> 48 49 #include <genarch/kbrd/kbrd.h> … … 76 77 /** Perform ia32-specific initialization before main_bsp() is called. 77 78 * 78 * @param signature Should contain the multiboot signature. 79 * @param mi Pointer to the multiboot information structure. 80 */ 81 void arch_pre_main(uint32_t signature, const multiboot_info_t *mi) 79 * @param signature Multiboot signature. 80 * @param info Multiboot information structure. 81 * 82 */ 83 void arch_pre_main(uint32_t signature, void *info) 82 84 { 83 85 /* Parse multiboot information obtained from the bootloader. */ 84 multiboot_info_parse(signature, mi); 86 multiboot_info_parse(signature, (multiboot_info_t *) info); 87 multiboot2_info_parse(signature, (multiboot2_info_t *) info); 85 88 86 89 #ifdef CONFIG_SMP … … 114 117 115 118 #if (defined(CONFIG_FB) || defined(CONFIG_EGA)) 116 bool vesa= false;119 bool bfb = false; 117 120 #endif 118 121 119 122 #ifdef CONFIG_FB 120 vesa = vesa_init();123 bfb = bfb_init(); 121 124 #endif 122 125 123 126 #ifdef CONFIG_EGA 124 if (! vesa) {127 if (!bfb) { 125 128 outdev_t *egadev = ega_init(EGA_BASE, EGA_VIDEORAM); 126 129 if (egadev)
Note:
See TracChangeset
for help on using the changeset viewer.