~martin-decky/helenos/rcu

« back to all changes in this revision

Viewing changes to kernel/arch/ia32/src/boot/multiboot.S

  • Committer: Martin Decky
  • Date: 2011-12-02 17:29:43 UTC
  • Revision ID: martin@decky.cz-20111202172943-nfwv3ssk450efp61
implement multiboot v2 specification and use it in GRUB for UEFI
 - improve multiboot v1 code, move defines to a common location
 - rename VESA framebuffer stuff to generic "boot framebuffer"
 - small collateral changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 */
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
 
37
37
#define START_STACK  (BOOT_OFFSET - BOOT_STACK_SIZE)
91
91
        jmpl $GDT_SELECTOR(KTEXT_DES), $multiboot_meeting_point
92
92
        multiboot_meeting_point:
93
93
        
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
97
97
        
98
98
        pm_status $status_prot
99
99
        
134
134
        
135
135
        pm2_status $status_prot3
136
136
        
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
140
140
        call arch_pre_main
141
141
        
142
142
        pm2_status $status_main
195
195
 * of the kernel. For simplicity, we map the entire 4G space.
196
196
 *
197
197
 */
 
198
.global map_kernel_non_pse
198
199
map_kernel_non_pse:
199
200
        /* Paging features */
200
201
        movl %cr4, %ecx
298
299
/** Find free 2M (+4k for alignment) region where to store page tables */
299
300
find_mem_for_pt:
300
301
        /* Check if multiboot info is present */
301
 
        cmpl $MULTIBOOT_LOADER_MAGIC, grub_eax
 
302
        cmpl $MULTIBOOT_LOADER_MAGIC, multiboot_eax
302
303
        je check_multiboot_map
303
304
                
304
305
                ret
306
307
        check_multiboot_map:
307
308
                
308
309
                /* Copy address of the multiboot info to ebx */
309
 
                movl grub_ebx, %ebx
 
310
                movl multiboot_ebx, %ebx
310
311
                
311
312
                /* Check if memory map flag is present */
312
313
                movl (%ebx), %edx
700
701
page_directory:
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
 
712
717
pt_loc:
724
729
        .asciz "[non_pse] "
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] "
731
736
status_prot2: