Changeset 7aaed09 in mainline for kernel/arch/ia32/src


Ignore:
Timestamp:
2011-12-18T14:02:30Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c868e2d
Parents:
3b71e84d (diff), 1761268 (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.
Message:

Merge mainline changes.

Location:
kernel/arch/ia32/src
Files:
1 added
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/boot/memmap.c

    r3b71e84d r7aaed09  
    3535#include <arch/boot/memmap.h>
    3636
    37 uint8_t e820counter = 0xffU;
     37uint8_t e820counter = 0;
    3838e820memmap_t e820table[MEMMAP_E820_MAX_RECORDS];
    3939
  • kernel/arch/ia32/src/boot/multiboot.S

    r3b71e84d r7aaed09  
    3030
    3131#include <arch/boot/boot.h>
    32 #include <arch/boot/memmap.h>
    3332#include <arch/mm/page.h>
    3433#include <arch/pm.h>
     34#include <genarch/multiboot/multiboot.h>
    3535#include <arch/cpuid.h>
    3636
     
    9292        multiboot_meeting_point:
    9393       
    94         /* Save GRUB arguments */
    95         movl %eax, grub_eax
    96         movl %ebx, grub_ebx
     94        /* Save multiboot arguments */
     95        movl %eax, multiboot_eax
     96        movl %ebx, multiboot_ebx
    9797       
    9898        pm_status $status_prot
     
    135135        pm2_status $status_prot3
    136136       
    137         /* Call arch_pre_main(grub_eax, grub_ebx) */
    138         pushl grub_ebx
    139         pushl grub_eax
     137        /* Call arch_pre_main(multiboot_eax, multiboot_ebx) */
     138        pushl multiboot_ebx
     139        pushl multiboot_eax
    140140        call arch_pre_main
    141141       
     
    196196 *
    197197 */
     198.global map_kernel_non_pse
    198199map_kernel_non_pse:
    199200        /* Paging features */
     
    299300find_mem_for_pt:
    300301        /* Check if multiboot info is present */
    301         cmpl $MULTIBOOT_LOADER_MAGIC, grub_eax
     302        cmpl $MULTIBOOT_LOADER_MAGIC, multiboot_eax
    302303        je check_multiboot_map
    303304               
     
    307308               
    308309                /* Copy address of the multiboot info to ebx */
    309                 movl grub_ebx, %ebx
     310                movl multiboot_ebx, %ebx
    310311               
    311312                /* Check if memory map flag is present */
     
    701702        .space 4096, 0
    702703
     704.global bootstrap_gdtr
    703705bootstrap_gdtr:
    704706        .word GDT_SELECTOR(GDT_ITEMS)
    705707        .long KA2PA(gdt)
    706708
    707 grub_eax:
     709.global multiboot_eax
     710multiboot_eax:
    708711        .long 0
    709 grub_ebx:
     712
     713.global multiboot_ebx
     714multiboot_ebx:
    710715        .long 0
    711716
     
    725730status_vesa_copy:
    726731        .asciz "[vesa_copy] "
    727 status_grub_cmdline:
    728         .asciz "[grub_cmdline] "
     732status_multiboot_cmdline:
     733        .asciz "[multiboot_cmdline] "
    729734status_vesa_real:
    730735        .asciz "[vesa_real] "
  • kernel/arch/ia32/src/boot/vesa_prot.inc

    r3b71e84d r7aaed09  
    11#ifdef CONFIG_FB
    22
    3 #define MULTIBOOT_LOADER_MAGIC  0x2BADB002
    43#define MBINFO_BIT_CMDLINE      2
    54#define MBINFO_OFFSET_CMDLINE   16
     
    1413        rep movsb
    1514       
    16         /* Check for GRUB command line */
     15        /* Check for multiboot command line */
    1716       
    18         pm_status $status_grub_cmdline
     17        pm_status $status_multiboot_cmdline
    1918       
    20         mov grub_eax, %eax
     19        mov multiboot_eax, %eax
    2120        cmp $MULTIBOOT_LOADER_MAGIC, %eax
    2221        jne no_cmdline
    2322       
    24         mov grub_ebx, %ebx
     23        mov multiboot_ebx, %ebx
    2524        mov (%ebx), %eax
    2625        bt $MBINFO_BIT_CMDLINE, %eax
     
    8988                /* Returned back to protected mode */
    9089               
    91                 mov %ax, KA2PA(vesa_scanline)
     90                movzx %ax, %ecx
     91                mov %ecx, KA2PA(bfb_scanline)
     92               
    9293                shr $16, %eax
    93                 mov %ax, KA2PA(vesa_bpp)
     94                mov %ax, KA2PA(bfb_bpp)
    9495               
    95                 mov %bx, KA2PA(vesa_height)
     96                movzx %bx, %ecx
     97                mov %ecx, KA2PA(bfb_height)
     98               
    9699                shr $16, %ebx
    97                 mov %bx, KA2PA(vesa_width)
     100                mov %ebx, KA2PA(bfb_width)
    98101               
    99                 mov %dl, KA2PA(vesa_green_pos)
     102                mov %dl, KA2PA(bfb_green_pos)
     103               
    100104                shr $8, %edx
    101                 mov %dl, KA2PA(vesa_green_mask)
     105                mov %dl, KA2PA(bfb_green_size)
     106               
    102107                shr $8, %edx
    103                 mov %dl, KA2PA(vesa_red_pos)
     108                mov %dl, KA2PA(bfb_red_pos)
     109               
    104110                shr $8, %edx
    105                 mov %dl, KA2PA(vesa_red_mask)
     111                mov %dl, KA2PA(bfb_red_size)
    106112               
    107113                mov %esi, %edx
    108                 mov %dl, KA2PA(vesa_blue_pos)
     114                mov %dl, KA2PA(bfb_blue_pos)
     115               
    109116                shr $8, %edx
    110                 mov %dl, KA2PA(vesa_blue_mask)
     117                mov %dl, KA2PA(bfb_blue_size)
    111118               
    112                 mov %edi, KA2PA(vesa_ph_addr)
     119                mov %edi, KA2PA(bfb_addr)
    113120#endif
  • kernel/arch/ia32/src/boot/vesa_real.inc

    r3b71e84d r7aaed09  
    304304                /*
    305305                 * Store mode parameters:
    306                  *  eax = bpp[8] scanline[16]
     306                 *  eax = bpp[16] scanline[16]
    307307                 *  ebx = width[16]  height[16]
    308308                 *  edx = red_mask[8] red_pos[8] green_mask[8] green_pos[8]
     
    328328                shl $8, %edx
    329329                mov VESA_MODE_RED_POS_OFFSET(%di), %dl
     330               
    330331                shl $8, %edx
    331332                mov VESA_MODE_GREEN_MASK_OFFSET(%di), %dl
     
    369370                mov $0x0003, %ax
    370371                int $0x10
    371                 mov $0xffffffff, %edi
    372                 xor %ax, %ax
     372               
     373                xor %eax, %eax
     374                xor %ebx, %ebx
     375                xor %edx, %edx
     376                xor %edi, %edi
     377               
    373378                jz vesa_leave_real  /* force relative jump */
    374379
     
    386391
    387392default_mode:
    388         .ascii STRING(CONFIG_VESA_MODE)
     393        .ascii STRING(CONFIG_BFB_MODE)
    389394        .ascii "-"
    390         .asciz STRING(CONFIG_VESA_BPP)
     395        .asciz STRING(CONFIG_BFB_BPP)
    391396        .fill 24
    392397
  • kernel/arch/ia32/src/ia32.c

    r3b71e84d r7aaed09  
    3636
    3737#include <arch.h>
    38 
    3938#include <typedefs.h>
    40 
    41 #include <arch/pm.h>
    42 
    43 #include <genarch/multiboot/multiboot.h>
    44 #include <genarch/drivers/legacy/ia32/io.h>
    45 #include <genarch/drivers/ega/ega.h>
    46 #include <arch/drivers/vesa.h>
    47 #include <genarch/drivers/i8042/i8042.h>
    48 #include <genarch/kbrd/kbrd.h>
     39#include <errno.h>
     40#include <memstr.h>
     41#include <interrupt.h>
     42#include <console/console.h>
     43#include <syscall/syscall.h>
     44#include <sysinfo/sysinfo.h>
     45#include <arch/bios/bios.h>
     46#include <arch/boot/boot.h>
     47#include <arch/debugger.h>
    4948#include <arch/drivers/i8254.h>
    5049#include <arch/drivers/i8259.h>
    51 
    52 #include <arch/context.h>
    53 
    54 #include <config.h>
    55 
    56 #include <arch/interrupt.h>
    57 #include <arch/asm.h>
    5850#include <genarch/acpi/acpi.h>
    59 
    60 #include <arch/bios/bios.h>
    61 
    62 #include <interrupt.h>
    63 #include <ddi/irq.h>
    64 #include <arch/debugger.h>
    65 #include <proc/thread.h>
    66 #include <syscall/syscall.h>
    67 #include <console/console.h>
    68 #include <sysinfo/sysinfo.h>
    69 #include <arch/boot/boot.h>
    70 #include <memstr.h>
     51#include <genarch/drivers/ega/ega.h>
     52#include <genarch/drivers/i8042/i8042.h>
     53#include <genarch/drivers/legacy/ia32/io.h>
     54#include <genarch/fb/bfb.h>
     55#include <genarch/kbrd/kbrd.h>
     56#include <genarch/multiboot/multiboot.h>
     57#include <genarch/multiboot/multiboot2.h>
    7158
    7259#ifdef CONFIG_SMP
     
    7663/** Perform ia32-specific initialization before main_bsp() is called.
    7764 *
    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)
     65 * @param signature Multiboot signature.
     66 * @param info      Multiboot information structure.
     67 *
     68 */
     69void arch_pre_main(uint32_t signature, void *info)
    8270{
    8371        /* Parse multiboot information obtained from the bootloader. */
    84         multiboot_info_parse(signature, mi);
     72        multiboot_info_parse(signature, (multiboot_info_t *) info);
     73        multiboot2_info_parse(signature, (multiboot2_info_t *) info);
    8574       
    8675#ifdef CONFIG_SMP
     
    114103               
    115104#if (defined(CONFIG_FB) || defined(CONFIG_EGA))
    116                 bool vesa = false;
     105                bool bfb = false;
    117106#endif
    118107               
    119108#ifdef CONFIG_FB
    120                 vesa = vesa_init();
     109                bfb = bfb_init();
    121110#endif
    122111               
    123112#ifdef CONFIG_EGA
    124                 if (!vesa) {
     113                if (!bfb) {
    125114                        outdev_t *egadev = ega_init(EGA_BASE, EGA_VIDEORAM);
    126115                        if (egadev)
     
    216205 * selector, and the descriptor->base is the correct address.
    217206 */
    218 sysarg_t sys_tls_set(sysarg_t addr)
     207sysarg_t sys_tls_set(uintptr_t addr)
    219208{
    220209        THREAD->arch.tls = addr;
    221210        set_tls_desc(addr);
    222211       
    223         return 0;
     212        return EOK;
    224213}
    225214
Note: See TracChangeset for help on using the changeset viewer.