2
* GRUB -- GRand Unified Bootloader
3
* Copyright (C) 2009,2010 Free Software Foundation, Inc.
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.
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.
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/>.
20
#include <grub/symbol.h>
21
#include <grub/i386/memory.h>
32
#ifdef GRUB_MACHINE_IEEE1275
36
andl $(~GRUB_MEMORY_CPU_CR0_PAGING_ON), %eax
42
/* %rax contains now our new 'base'. */
45
add $(LOCAL(cont0) - LOCAL(base)), RAX
51
lea (LOCAL(cont1) - LOCAL(base)) (RSI, 1), RAX
52
movl %eax, (LOCAL(jump_vector) - LOCAL(base)) (RSI, 1)
54
lea (LOCAL(gdt) - LOCAL(base)) (RSI, 1), RAX
55
mov RAX, (LOCAL(gdt_addr) - LOCAL(base)) (RSI, 1)
57
/* Switch to compatibility mode. */
58
lgdt (LOCAL(gdtdesc) - LOCAL(base)) (RSI, 1)
61
ljmp *(LOCAL(jump_vector) - LOCAL(base)) (RSI, 1)
65
.word LOCAL(gdt_end) - LOCAL(gdt)
68
/* Filled by the code. */
71
/* Filled by the code. */
77
/* Jump location. Is filled by the code */