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

« back to all changes in this revision

Viewing changes to loader/i386/linux_trampoline.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  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
 
#include <grub/symbol.h>
20
 
 
21
 
 
22
 
        .p2align        4       /* force 16-byte alignment */
23
 
VARIABLE(grub_linux_trampoline_start)
24
 
        cli
25
 
        /* %rdi contains protected memory start and %rsi
26
 
        contains real memory start. */
27
 
 
28
 
        mov %rsi, %rbx
29
 
 
30
 
        call base
31
 
base:
32
 
        pop %rsi
33
 
 
34
 
#ifdef APPLE_CC
35
 
        lea (cont1 - base) (%esi, 1), %rax
36
 
        mov %eax, (jump_vector - base) (%esi, 1)
37
 
 
38
 
        lea (gdt - base) (%esi, 1), %rax
39
 
        mov %rax, (gdtaddr - base) (%esi, 1)
40
 
 
41
 
        /* Switch to compatibility mode. */
42
 
 
43
 
        lidt (idtdesc - base) (%esi, 1)
44
 
        lgdt (gdtdesc - base) (%esi, 1)
45
 
 
46
 
        /* Update %cs. Thanks to David Miller for pointing this mistake out. */
47
 
        ljmp *(jump_vector - base) (%esi, 1)
48
 
#else
49
 
        lea (cont1 - base) (%rsi, 1), %rax
50
 
        mov %eax, (jump_vector - base) (%rsi, 1)
51
 
 
52
 
        lea (gdt - base) (%rsi, 1), %rax
53
 
        mov %rax, (gdtaddr - base) (%rsi, 1)
54
 
 
55
 
        /* Switch to compatibility mode. */
56
 
 
57
 
        lidt (idtdesc - base) (%rsi, 1)
58
 
        lgdt (gdtdesc - base) (%rsi, 1)
59
 
 
60
 
        /* Update %cs. Thanks to David Miller for pointing this mistake out. */
61
 
        ljmp *(jump_vector - base) (%rsi, 1)
62
 
#endif
63
 
 
64
 
cont1:
65
 
        .code32
66
 
 
67
 
        /* Update other registers. */
68
 
        mov $0x18, %eax
69
 
        mov %eax, %ds
70
 
        mov %eax, %es
71
 
        mov %eax, %fs
72
 
        mov %eax, %gs
73
 
        mov %eax, %ss
74
 
 
75
 
        /* Disable paging. */
76
 
        mov %cr0, %eax
77
 
        and $0x7fffffff, %eax
78
 
        mov %eax, %cr0
79
 
 
80
 
        /* Disable amd64. */
81
 
        mov $0xc0000080, %ecx
82
 
        rdmsr
83
 
        and $0xfffffeff, %eax
84
 
        wrmsr
85
 
 
86
 
        /* Turn off PAE. */
87
 
        movl %cr4, %eax
88
 
        and $0xffffffcf, %eax
89
 
        mov %eax, %cr4
90
 
 
91
 
        jmp cont2
92
 
cont2:
93
 
        .code32
94
 
 
95
 
        mov %ebx, %esi
96
 
 
97
 
        jmp *%edi
98
 
 
99
 
        /* GDT. */
100
 
        .p2align 4
101
 
gdt:
102
 
        /* NULL.  */
103
 
        .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
104
 
 
105
 
        /* Reserved.  */
106
 
        .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
107
 
 
108
 
        /* Code segment.  */
109
 
        .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00
110
 
 
111
 
        /* Data segment.  */
112
 
        .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00
113
 
 
114
 
gdtdesc:
115
 
        .word 31
116
 
gdtaddr:
117
 
        .quad gdt
118
 
 
119
 
idtdesc:
120
 
        .word 0
121
 
idtaddr:
122
 
        .quad 0
123
 
 
124
 
        .p2align 4
125
 
jump_vector:
126
 
        /* Jump location. Is filled by the code */
127
 
        .long 0
128
 
        .long 0x10
129
 
VARIABLE(grub_linux_trampoline_end)