/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009,2010 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
/* The data segment of the protected mode. */
#include "relocator_common.S"
#ifndef __x86_64__
/* Turn on PAE. */
/* mov imm32, %eax */
.byte 0xb8
.long 0
/* Turn on amd64. */
/* Enable paging. */
#else
/* mov imm64, %rax */
.byte 0x48
.byte 0xb8
.quad 0
#endif
/* mov imm64, %rax */
.byte 0x48
.byte 0xb8
.quad 0
/* mov imm64, %rax */
.byte 0x48
.byte 0xb8
.quad 0
/* mov imm64, %rax */
.byte 0x48
.byte 0xb8
.quad 0
/* mov imm64, %rbx */
.byte 0x48
.byte 0xbb
.quad 0
/* mov imm64, %rcx */
.byte 0x48
.byte 0xb9
.quad 0
/* mov imm64, %rdx */
.byte 0x48
.byte 0xba
.quad 0
/* Cleared direction flag is of no problem with any current
payload and makes this implementation easier. */
.quad 0
#ifndef __x86_64__
.p2align 4
/* NULL. */
/* 64-bit segment. */
| (0 << 5) /* Ring 0. */ | (1 << 7) /* Present. */)
| (1 << 5) /* 64-bit. */ | (0 << 6) \
| (1 << 7) /* 4K granular. */)
/* Data segment*/
| (0 << 5) /* Ring 0. */ | (1 << 7) /* Present. */)
| (0 << 5) /* Data. */ | (0 << 6) \
| (1 << 7) /* 4K granular. */)
/* Compatibility segment. */
| (0 << 5) /* Ring 0. */ | (1 << 7) /* Present. */)
| (0 << 5) /* 32-bit. */ | (1 << 6) /* 32-bit. */ \
| (1 << 7) /* 4K granular. */)
#endif