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

« back to all changes in this revision

Viewing changes to grub-core/boot/mips/startup_raw.S

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, Colin Watson, Evan Broder, Mario Limonciello
  • Date: 2010-11-24 13:59:55 UTC
  • mfrom: (1.17.6 upstream) (17.6.15 experimental)
  • Revision ID: james.westby@ubuntu.com-20101124135955-r6ii5sepayr7jt53
Tags: 1.99~20101124-1ubuntu1
[ Colin Watson ]
* Resynchronise with Debian experimental.  Remaining changes:
  - Adjust for default Ubuntu boot options ("quiet splash").
  - Default to hiding the menu; holding down Shift at boot will show it.
  - Set a monochromatic theme for Ubuntu.
  - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
    recovery mode, quiet option, tweak how memtest86+ is displayed, and
    use UUIDs where appropriate.
  - Fix backslash-escaping in merge_debconf_into_conf.
  - Remove "GNU/Linux" from default distributor string.
  - Add crashkernel= options if kdump and makedumpfile are available.
  - If other operating systems are installed, then automatically unhide
    the menu.  Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
    if available to check whether Shift is pressed.  If it is, show the
    menu, otherwise boot immediately.  If keystatus is not available, then
    fall back to a short delay interruptible with Escape.
  - Allow Shift to interrupt 'sleep --interruptible'.
  - Don't display introductory message about line editing unless we're
    actually offering a shell prompt.  Don't clear the screen just before
    booting if we never drew the menu in the first place.
  - Remove some verbose messages printed before reading the configuration
    file.
  - Suppress progress messages as the kernel and initrd load for
    non-recovery kernel menu entries.
  - Change prepare_grub_to_access_device to handle filesystems
    loop-mounted on file images.
  - Ignore devices loop-mounted from files in 10_linux.
  - Show the boot menu if the previous boot failed, that is if it failed
    to get to the end of one of the normal runlevels.
  - Don't generate /boot/grub/device.map during grub-install or
    grub-mkconfig by default.
  - Adjust upgrade version checks for Ubuntu.
  - Don't display "GRUB loading" unless Shift is held down.
  - Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate
    our backport of the grub-doc split.
  - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
  - Look for .mo files in /usr/share/locale-langpack as well, in
    preference.
  - Make sure GRUB_TIMEOUT isn't quoted unnecessarily.
  - Probe all devices in 'grub-probe --target=drive' if
    /boot/grub/device.map is missing.
  - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
  - Use qemu rather than qemu-system-i386.
  - Program vesafb on BIOS systems rather than efifb.
  - Add a grub-rescue-efi-amd64 package containing a rescue CD-ROM image
    for EFI-AMD64.
  - On Wubi, don't ask for an install device, but just update wubildr
    using the diverted grub-install.
  - When embedding the core image in a post-MBR gap, check for and avoid
    sectors matching any of a list of known signatures.
  - Disable video_bochs and video_cirrus on PC BIOS systems, as probing
    PCI space seems to break on some systems.
* Downgrade "ACPI shutdown failed" error to a debug message, since it can
  cause spurious test failures.

[ Evan Broder ]
* Enable lua from grub-extras.
* Incorporate the bitop library into lua.
* Add enum_pci function to grub module in lua.
* Switch back to gfxpayload=keep by default, unless the video hardware
  is known to not support it.

[ Mario Limonciello ]
* Built part_msdos and vfat into bootx64.efi (LP: #677758)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* startup.S - Startup code for the MIPS.  */
 
2
/*
 
3
 *  GRUB  --  GRand Unified Bootloader
 
4
 *  Copyright (C) 2009  Free Software Foundation, Inc.
 
5
 *
 
6
 *  GRUB is free software: you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation, either version 3 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  GRUB is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#include <grub/symbol.h>
 
21
#include <grub/offsets.h>
 
22
#include <grub/machine/memory.h>
 
23
#include <grub/offsets.h>
 
24
 
 
25
#define BASE_ADDR 8
 
26
 
 
27
.extern __bss_start
 
28
.extern _end
 
29
 
 
30
        .globl __start, _start, start
 
31
        .set noreorder
 
32
        .set nomacro
 
33
__start:
 
34
_start:
 
35
start:          
 
36
 
 
37
        bal codestart
 
38
         nop
 
39
base:   
 
40
        . = _start + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE
 
41
compressed_size:
 
42
        .long 0
 
43
        . = _start + GRUB_KERNEL_MACHINE_UNCOMPRESSED_SIZE
 
44
uncompressed_size:
 
45
        .long 0
 
46
codestart:
 
47
        /* Save our base.  */
 
48
        move $s0, $ra
 
49
 
 
50
        /* Parse arguments. Has to be done before relocation.
 
51
        So need to do it in asm.  */
 
52
#ifdef GRUB_MACHINE_MIPS_YEELOONG
 
53
        move $s2, $zero
 
54
        move $s3, $zero
 
55
        move $s4, $zero
 
56
        move $s5, $zero
 
57
 
 
58
        /* $a2 has the environment.  */
 
59
        addiu $t0, $a2, 1
 
60
        beq $t0, $zero, argdone
 
61
         nop
 
62
        move $t0, $a2   
 
63
argcont:        
 
64
        lw $t1, 0($t0)
 
65
        beq $t1, $zero, argdone
 
66
         nop
 
67
#define DO_PARSE(str, reg) \
 
68
        addiu $t2, $s0, (str-base);\
 
69
        bal parsestr;\
 
70
         nop        ;\
 
71
        beq $v0, $zero, 1f;\
 
72
         nop              ;\
 
73
        b 2f;\
 
74
         move reg, $v0;  \
 
75
1:      
 
76
        DO_PARSE (busclockstr, $s2)
 
77
        DO_PARSE (cpuclockstr, $s3)
 
78
        DO_PARSE (memsizestr, $s4)
 
79
        DO_PARSE (highmemsizestr, $s5)
 
80
2:      
 
81
        b argcont
 
82
         addiu $t0, $t0, 4       
 
83
parsestr:
 
84
        move $v0, $zero
 
85
        move $t3, $t1
 
86
3:      
 
87
        lb $t4, 0($t2)
 
88
        lb $t5, 0($t3)
 
89
        addiu $t2, $t2, 1
 
90
        addiu $t3, $t3, 1
 
91
        beq $t5, $zero, 1f
 
92
         nop
 
93
        beq $t5, $t4, 3b
 
94
         nop
 
95
        bne $t4, $zero, 1f
 
96
         nop
 
97
 
 
98
        addiu $t3, $t3, 0xffff
 
99
digcont:        
 
100
        lb $t5, 0($t3)
 
101
        /* Substract '0' from digit.  */
 
102
        addiu $t5, $t5, 0xffd0
 
103
        bltz $t5, 1f
 
104
         nop
 
105
        addiu $t4, $t5, 0xfff7
 
106
        bgtz $t4, 1f
 
107
         nop
 
108
        /* Multiply $v0 by 10 with bitshifts. */
 
109
        sll $v0, $v0, 1
 
110
        sll $t4, $v0, 2
 
111
        addu $v0, $v0, $t4
 
112
        addu $v0, $v0, $t5
 
113
        addiu $t3, $t3, 1
 
114
        b digcont
 
115
         nop
 
116
1:
 
117
        jr $ra
 
118
         nop
 
119
busclockstr:    .asciiz "busclock="
 
120
cpuclockstr:    .asciiz "cpuclock="
 
121
memsizestr:     .asciiz "memsize="
 
122
highmemsizestr: .asciiz "highmemsize="
 
123
        .p2align 2
 
124
argdone:
 
125
#endif
 
126
        /* Copy the decompressor. */
 
127
        lui $t1, %hi(base)
 
128
        addiu $t1, $t1, %lo(base)
 
129
        lui $t3, %hi(__bss_start)
 
130
        addiu $t3, $t3, %lo(__bss_start)
 
131
        move $t2, $s0
 
132
 
 
133
1:
 
134
        beq $t1, $t3, 2f
 
135
         lb $t4, 0($t2)
 
136
        sb $t4, 0($t1)
 
137
        addiu $t1, $t1, 1
 
138
        b 1b
 
139
         addiu $t2, $t2, 1
 
140
2:
 
141
        /* Clean out its BSS.  */
 
142
        lui $t1, %hi(__bss_start)
 
143
        addiu $t1, $t1, %lo(__bss_start)
 
144
        lui $t2, %hi(_end)
 
145
        addiu $t2, $t2, %lo(_end)
 
146
1:
 
147
        beq $t1, $t2, 2f
 
148
         nop
 
149
        sb $zero, 0($t1)
 
150
        b 1b
 
151
         addiu $t1, $t1, 1
 
152
2:
 
153
 
 
154
        /* Decompress the payload. */
 
155
        lui $a0, %hi(__bss_start)
 
156
        addiu $a0, $a0, %lo(__bss_start)
 
157
        lui $t0, %hi(base)
 
158
        addiu $t0, $t0, %lo(base)
 
159
        subu $a0, $a0, $t0
 
160
        addu $a0, $a0, $s0
 
161
 
 
162
        lui $a1, %hi(GRUB_MACHINE_LINK_ADDR)
 
163
        addiu $a1, %lo(GRUB_MACHINE_LINK_ADDR)
 
164
        lw $a2, (GRUB_KERNEL_MACHINE_COMPRESSED_SIZE - BASE_ADDR)($s0)
 
165
        lw $a3, (GRUB_KERNEL_MACHINE_UNCOMPRESSED_SIZE - BASE_ADDR)($s0)
 
166
        move $s1, $a1
 
167
 
 
168
        /* $a0 contains source compressed address, $a1 is destination,
 
169
           $a2 is compressed size, $a3 is uncompressed size. 
 
170
        */
 
171
        move $s6, $a3
 
172
 
 
173
        lui $sp, %hi(_start - 256)
 
174
 
 
175
        bal EXT_C(grub_decompress_core)
 
176
         addiu $sp, $sp, %lo(_start - 256)
 
177
        
 
178
        move $a0, $s1
 
179
        move $a1, $s6
 
180
 
 
181
#include "../../kern/mips/cache_flush.S"
 
182
 
 
183
        lui $t1, %hi(GRUB_MACHINE_LINK_ADDR)
 
184
        addiu $t1, %lo(GRUB_MACHINE_LINK_ADDR)
 
185
 
 
186
        jr $t1
 
187
         nop