~hamo/ubuntu/precise/grub2/grub2.hi_res

« back to all changes in this revision

Viewing changes to grub-core/lib/i386/relocator32.S

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, Colin Watson, Robert Millan, Updated translations
  • Date: 2010-11-22 12:24:56 UTC
  • mfrom: (1.26.4 upstream) (17.3.36 sid)
  • mto: (17.3.43 sid)
  • mto: This revision was merged to the branch mainline in revision 89.
  • Revision ID: james.westby@ubuntu.com-20101122122456-y82z3sfb7k4zfdcc
Tags: 1.99~20101122-1
[ Colin Watson ]
* New Bazaar snapshot.  Too many changes to list in full, but some of the
  more user-visible ones are as follows:
  - GRUB script:
    + Function parameters, "break", "continue", "shift", "setparams",
      "return", and "!".
    + "export" command supports multiple variable names.
    + Multi-line quoted strings support.
    + Wildcard expansion.
  - sendkey support.
  - USB hotunplugging and USB serial support.
  - Rename CD-ROM to cd on BIOS.
  - Add new --boot-directory option to grub-install, grub-reboot, and
    grub-set-default; the old --root-directory option is still accepted
    but was often confusing.
  - Basic btrfs detection/UUID support (but no file reading yet).
  - bash-completion for utilities.
  - If a device is listed in device.map, always assume that it is
    BIOS-visible rather than using extra layers such as LVM or RAID.
  - Add grub-mknetdir script (closes: #550658).
  - Remove deprecated "root" command.
  - Handle RAID devices containing virtio components.
  - GRUB Legacy configuration file support (via grub-menulst2cfg).
  - Keyboard layout support (via grub-mklayout and grub-kbdcomp).
  - Check generated grub.cfg for syntax errors before saving.
  - Pause execution for at most ten seconds if any errors are displayed,
    so that the user has a chance to see them.
  - Support submenus.
  - Write embedding zone using Reed-Solomon, so that it's robust against
    being partially overwritten (closes: #550702, #591416, #593347).
  - GRUB_DISABLE_LINUX_RECOVERY and GRUB_DISABLE_NETBSD_RECOVERY merged
    into a single GRUB_DISABLE_RECOVERY variable.
  - Fix loader memory allocation failure (closes: #551627).
  - Don't call savedefault on recovery entries (closes: #589325).
  - Support triple-indirect blocks on ext2 (closes: #543924).
  - Recognise DDF1 fake RAID (closes: #603354).

[ Robert Millan ]
* Use dpkg architecture wildcards.

[ Updated translations ]
* Slovenian (Vanja Cvelbar).  Closes: #604003
* Dzongkha (dawa pemo via Tenzin Dendup).  Closes: #604102

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  GRUB  --  GRand Unified Bootloader
 
3
 *  Copyright (C) 2009,2010  Free Software Foundation, Inc.
 
4
 *
 
5
 *  GRUB is free software: you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation, either version 3 of the License, or
 
8
 *  (at your option) any later version.
 
9
 *
 
10
 *  GRUB is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
/* The code segment of the protected mode.  */
 
20
#define CODE_SEGMENT    0x10
 
21
 
 
22
/* The data segment of the protected mode.  */
 
23
#define DATA_SEGMENT    0x18
 
24
 
 
25
#include "relocator_common.S"
 
26
 
 
27
        .p2align        4       /* force 16-byte alignment */
 
28
 
 
29
VARIABLE(grub_relocator32_start)
 
30
        PREAMBLE
 
31
 
 
32
        RELOAD_GDT
 
33
        .code32
 
34
        /* Update other registers. */
 
35
        movl    $DATA_SEGMENT, %eax
 
36
        movl    %eax, %ds
 
37
        movl    %eax, %es
 
38
        movl    %eax, %fs
 
39
        movl    %eax, %gs
 
40
        movl    %eax, %ss
 
41
 
 
42
        DISABLE_PAGING
 
43
 
 
44
#ifdef __x86_64__
 
45
        /* Disable amd64. */
 
46
        movl    $GRUB_MEMORY_CPU_AMD64_MSR, %ecx
 
47
        rdmsr
 
48
        andl    $(~GRUB_MEMORY_CPU_AMD64_MSR_ON), %eax
 
49
        wrmsr
 
50
#endif
 
51
 
 
52
        /* Turn off PAE. */
 
53
        movl    %cr4, %eax
 
54
        andl    $(~GRUB_MEMORY_CPU_CR4_PAE_ON), %eax
 
55
        movl    %eax, %cr4
 
56
 
 
57
        jmp     LOCAL(cont2)
 
58
LOCAL(cont2):
 
59
        .code32
 
60
 
 
61
        /* mov imm32, %eax */
 
62
        .byte   0xb8
 
63
VARIABLE(grub_relocator32_esp)
 
64
        .long   0
 
65
 
 
66
        movl    %eax, %esp
 
67
 
 
68
        /* mov imm32, %eax */
 
69
        .byte   0xb8
 
70
VARIABLE(grub_relocator32_ebp)
 
71
        .long   0
 
72
 
 
73
        movl    %eax, %ebp
 
74
 
 
75
        /* mov imm32, %eax */
 
76
        .byte   0xb8
 
77
VARIABLE(grub_relocator32_esi)
 
78
        .long   0
 
79
 
 
80
        movl    %eax, %esi
 
81
 
 
82
        /* mov imm32, %eax */
 
83
        .byte   0xb8
 
84
VARIABLE(grub_relocator32_edi)
 
85
        .long   0
 
86
 
 
87
        movl    %eax, %edi
 
88
 
 
89
        /* mov imm32, %eax */
 
90
        .byte   0xb8
 
91
VARIABLE(grub_relocator32_eax)
 
92
        .long   0
 
93
 
 
94
        /* mov imm32, %ebx */
 
95
        .byte   0xbb
 
96
VARIABLE(grub_relocator32_ebx)
 
97
        .long   0
 
98
 
 
99
        /* mov imm32, %ecx */
 
100
        .byte   0xb9
 
101
VARIABLE(grub_relocator32_ecx)
 
102
        .long   0
 
103
 
 
104
        /* mov imm32, %edx */
 
105
        .byte   0xba
 
106
VARIABLE(grub_relocator32_edx)
 
107
        .long   0
 
108
 
 
109
        /* Cleared direction flag is of no problem with any current
 
110
           payload and makes this implementation easier.  */
 
111
        cld
 
112
 
 
113
        .byte   0xea
 
114
VARIABLE(grub_relocator32_eip)
 
115
        .long   0
 
116
        .word   CODE_SEGMENT
 
117
 
 
118
        /* GDT. Copied from loader/i386/linux.c. */
 
119
        .p2align        4
 
120
LOCAL(gdt):
 
121
        /* NULL.  */
 
122
        .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
123
 
 
124
        /* Reserved.  */
 
125
        .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
126
 
 
127
        /* Code segment.  */
 
128
        .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00
 
129
 
 
130
        /* Data segment.  */
 
131
        .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00
 
132
LOCAL(gdt_end):
 
133
 
 
134
VARIABLE(grub_relocator32_end)