From 636813f768bc3c5d0561551a9198a0ffdac52bd2 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 25 Nov 2009 23:39:59 +0100 Subject: [PATCH 1/3] Split relocators from mips branch --- THANKS | 1 + conf/i386.rmk | 6 + include/grub/i386/memory.h | 30 +++ include/grub/i386/multiboot.h | 11 +- include/grub/i386/pc/memory.h | 5 +- include/grub/i386/relocator.h | 41 ++++ kern/i386/realmode.S | 4 +- lib/i386/relocator.c | 102 +++++++++ lib/i386/relocator_asm.S | 250 +++++++++++++++++++++++ lib/i386/relocator_backward.S | 2 + lib/mips/relocator.c | 109 ++++++++++ lib/mips/relocator_asm.S | 71 +++++++ lib/relocator.c | 113 ++++++++++ loader/i386/multiboot.c | 70 ++++--- loader/i386/multiboot_elfxx.c | 14 +- loader/i386/multiboot_helper.S | 75 ------- po/ca.po | 30 +-- po/id.po | 363 ++++++++++++++++++++++++++++----- po/zh_CN.po | 275 ++++++++++++++++++++++--- 19 files changed, 1356 insertions(+), 216 deletions(-) create mode 100644 include/grub/i386/memory.h create mode 100644 include/grub/i386/relocator.h create mode 100644 lib/i386/relocator.c create mode 100644 lib/i386/relocator_asm.S create mode 100644 lib/i386/relocator_backward.S create mode 100644 lib/mips/relocator.c create mode 100644 lib/mips/relocator_asm.S create mode 100644 lib/relocator.c diff --git a/THANKS b/THANKS index 5ce190944..82b4bc838 100644 --- a/THANKS +++ b/THANKS @@ -8,6 +8,7 @@ generally assist in the GRUB 2 maintainership process: Andrey Shuvikov Bibo Mao +David Miller Guillem Jover Harley D. Eades III Hitoshi Ozeki diff --git a/conf/i386.rmk b/conf/i386.rmk index bf102a9b6..c3f036d0f 100644 --- a/conf/i386.rmk +++ b/conf/i386.rmk @@ -15,6 +15,12 @@ vga_text_mod_SOURCES = term/i386/pc/vga_text.c term/i386/vga_common.c vga_text_mod_CFLAGS = $(COMMON_CFLAGS) vga_text_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += relocator.mod +relocator_mod_SOURCES = lib/i386/relocator.c lib/i386/relocator_asm.S lib/i386/relocator_backward.S +relocator_mod_CFLAGS = $(COMMON_CFLAGS) +relocator_mod_ASFLAGS = $(COMMON_ASFLAGS) +relocator_mod_LDFLAGS = $(COMMON_LDFLAGS) + pkglib_MODULES += ata.mod ata_mod_SOURCES = disk/ata.c ata_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/include/grub/i386/memory.h b/include/grub/i386/memory.h new file mode 100644 index 000000000..a0f3192b8 --- /dev/null +++ b/include/grub/i386/memory.h @@ -0,0 +1,30 @@ +/* memory.h - describe the memory map */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * 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 . + */ + +#ifndef GRUB_MEMORY_CPU_HEADER +#define GRUB_MEMORY_CPU_HEADER 1 + +/* The flag for protected mode. */ +#define GRUB_MEMORY_CPU_CR0_PE_ON 0x1 +#define GRUB_MEMORY_CPU_CR4_PAE_ON 0x00000040 +#define GRUB_MEMORY_CPU_CR0_PAGING_ON 0x80000000 +#define GRUB_MEMORY_CPU_AMD64_MSR 0xc0000080 +#define GRUB_MEMORY_CPU_AMD64_MSR_ON 0x00000100 + +#endif /* ! GRUB_MEMORY_CPU_HEADER */ diff --git a/include/grub/i386/multiboot.h b/include/grub/i386/multiboot.h index b8cab9d24..2d990bf86 100644 --- a/include/grub/i386/multiboot.h +++ b/include/grub/i386/multiboot.h @@ -27,16 +27,11 @@ void grub_multiboot2_real_boot (grub_addr_t entry, struct multiboot_info *mbi) __attribute__ ((noreturn)); -extern grub_addr_t grub_multiboot_payload_orig; +extern grub_uint32_t grub_multiboot_payload_eip; +extern char *grub_multiboot_payload_orig; extern grub_addr_t grub_multiboot_payload_dest; extern grub_size_t grub_multiboot_payload_size; -extern grub_uint32_t grub_multiboot_payload_entry_offset; -extern grub_uint8_t grub_multiboot_forward_relocator; -extern grub_uint8_t grub_multiboot_forward_relocator_end; -extern grub_uint8_t grub_multiboot_backward_relocator; -extern grub_uint8_t grub_multiboot_backward_relocator_end; - -#define RELOCATOR_SIZEOF(x) (&grub_multiboot_##x##_relocator_end - &grub_multiboot_##x##_relocator) +#define GRUB_MULTIBOOT_STACK_SIZE 4096 #endif /* ! GRUB_MULTIBOOT_CPU_HEADER */ diff --git a/include/grub/i386/pc/memory.h b/include/grub/i386/pc/memory.h index 4ce3a6283..1b470f8c2 100644 --- a/include/grub/i386/pc/memory.h +++ b/include/grub/i386/pc/memory.h @@ -27,6 +27,8 @@ #include #endif +#include + /* The scratch buffer used in real mode code. */ #define GRUB_MEMORY_MACHINE_SCRATCH_ADDR 0x68000 #define GRUB_MEMORY_MACHINE_SCRATCH_SEG (GRUB_MEMORY_MACHINE_SCRATCH_ADDR >> 4) @@ -62,9 +64,6 @@ /* The address where another boot loader is loaded. */ #define GRUB_MEMORY_MACHINE_BOOT_LOADER_ADDR 0x7c00 -/* The flag for protected mode. */ -#define GRUB_MEMORY_MACHINE_CR0_PE_ON 0x1 - /* The code segment of the protected mode. */ #define GRUB_MEMORY_MACHINE_PROT_MODE_CSEG 0x8 diff --git a/include/grub/i386/relocator.h b/include/grub/i386/relocator.h new file mode 100644 index 000000000..ef7fe23aa --- /dev/null +++ b/include/grub/i386/relocator.h @@ -0,0 +1,41 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * 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 . + */ + +#ifndef GRUB_RELOCATOR_CPU_HEADER +#define GRUB_RELOCATOR_CPU_HEADER 1 + +#include +#include + +struct grub_relocator32_state +{ + grub_uint32_t esp; + grub_uint32_t eax; + grub_uint32_t ebx; + grub_uint32_t ecx; + grub_uint32_t edx; + grub_uint32_t eip; +}; + +void *grub_relocator32_alloc (grub_size_t size); +grub_err_t grub_relocator32_boot (void *relocator, grub_uint32_t dest, + struct grub_relocator32_state state); +void *grub_relocator32_realloc (void *relocator, grub_size_t size); +void grub_relocator32_free (void *relocator); + +#endif /* ! GRUB_RELOCATOR_CPU_HEADER */ diff --git a/kern/i386/realmode.S b/kern/i386/realmode.S index 11f4d5347..5f28f9eb3 100644 --- a/kern/i386/realmode.S +++ b/kern/i386/realmode.S @@ -127,7 +127,7 @@ real_to_prot: /* turn on protected mode */ movl %cr0, %eax - orl $GRUB_MEMORY_MACHINE_CR0_PE_ON, %eax + orl $GRUB_MEMORY_CPU_CR0_PE_ON, %eax movl %eax, %cr0 /* jump to relocation, flush prefetch queue, and reload %cs */ @@ -196,7 +196,7 @@ tmpcseg: /* clear the PE bit of CR0 */ movl %cr0, %eax - andl $(~GRUB_MEMORY_MACHINE_CR0_PE_ON), %eax + andl $(~GRUB_MEMORY_CPU_CR0_PE_ON), %eax movl %eax, %cr0 /* flush prefetch queue, reload %cs */ diff --git a/lib/i386/relocator.c b/lib/i386/relocator.c new file mode 100644 index 000000000..ae7caf28b --- /dev/null +++ b/lib/i386/relocator.c @@ -0,0 +1,102 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * 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 . + */ + +#include +#include + +#include +#include +#include + +#include + +extern grub_uint8_t grub_relocator32_forward_start; +extern grub_uint8_t grub_relocator32_forward_end; +extern grub_uint8_t grub_relocator32_backward_start; +extern grub_uint8_t grub_relocator32_backward_end; + +extern grub_uint32_t grub_relocator32_backward_dest; +extern grub_uint32_t grub_relocator32_backward_size; +extern grub_addr_t grub_relocator32_backward_src; + +extern grub_uint32_t grub_relocator32_forward_dest; +extern grub_uint32_t grub_relocator32_forward_size; +extern grub_addr_t grub_relocator32_forward_src; + +extern grub_uint32_t grub_relocator32_forward_eax; +extern grub_uint32_t grub_relocator32_forward_ebx; +extern grub_uint32_t grub_relocator32_forward_ecx; +extern grub_uint32_t grub_relocator32_forward_edx; +extern grub_uint32_t grub_relocator32_forward_eip; +extern grub_uint32_t grub_relocator32_forward_esp; + +extern grub_uint32_t grub_relocator32_backward_eax; +extern grub_uint32_t grub_relocator32_backward_ebx; +extern grub_uint32_t grub_relocator32_backward_ecx; +extern grub_uint32_t grub_relocator32_backward_edx; +extern grub_uint32_t grub_relocator32_backward_eip; +extern grub_uint32_t grub_relocator32_backward_esp; + +#define RELOCATOR_SIZEOF(x) (&grub_relocator32_##x##_end - &grub_relocator32_##x##_start) +#define RELOCATOR_ALIGN 16 +#define PREFIX(x) grub_relocator32_ ## x + +static void +write_call_relocator_bw (void *ptr, void *src, grub_uint32_t dest, + grub_size_t size, struct grub_relocator32_state state) +{ + grub_relocator32_backward_dest = dest; + grub_relocator32_backward_src = PTR_TO_UINT64 (src); + grub_relocator32_backward_size = size; + + grub_relocator32_backward_eax = state.eax; + grub_relocator32_backward_ebx = state.ebx; + grub_relocator32_backward_ecx = state.ecx; + grub_relocator32_backward_edx = state.edx; + grub_relocator32_backward_eip = state.eip; + grub_relocator32_backward_esp = state.esp; + + grub_memmove (ptr, + &grub_relocator32_backward_start, + RELOCATOR_SIZEOF (backward)); + ((void (*) (void)) ptr) (); +} + +static void +write_call_relocator_fw (void *ptr, void *src, grub_uint32_t dest, + grub_size_t size, struct grub_relocator32_state state) +{ + + grub_relocator32_forward_dest = dest; + grub_relocator32_forward_src = PTR_TO_UINT64 (src); + grub_relocator32_forward_size = size; + + grub_relocator32_forward_eax = state.eax; + grub_relocator32_forward_ebx = state.ebx; + grub_relocator32_forward_ecx = state.ecx; + grub_relocator32_forward_edx = state.edx; + grub_relocator32_forward_eip = state.eip; + grub_relocator32_forward_esp = state.esp; + + grub_memmove (ptr, + &grub_relocator32_forward_start, + RELOCATOR_SIZEOF (forward)); + ((void (*) (void)) ptr) (); +} + +#include "../relocator.c" diff --git a/lib/i386/relocator_asm.S b/lib/i386/relocator_asm.S new file mode 100644 index 000000000..343991d3d --- /dev/null +++ b/lib/i386/relocator_asm.S @@ -0,0 +1,250 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * 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 . + */ + +#include +#include + +#ifdef BACKWARD +#define RELOCATOR_VARIABLE(x) VARIABLE(grub_relocator32_backward_ ## x) +#else +#define RELOCATOR_VARIABLE(x) VARIABLE(grub_relocator32_forward_ ## x) +#endif +#ifdef __x86_64__ +#define RAX %rax +#define RCX %rcx +#define RDX %rdx +#define RDI %rdi +#define RSI %rdi +#else +#define RAX %eax +#define RCX %ecx +#define RDX %edx +#define RDI %edi +#define RSI %esi +#endif + +/* The code segment of the protected mode. */ +#define CODE_SEGMENT 0x10 + +/* The data segment of the protected mode. */ +#define DATA_SEGMENT 0x18 + + .p2align 4 /* force 16-byte alignment */ + +RELOCATOR_VARIABLE(start) +#ifdef BACKWARD +LOCAL(base): +#endif + cli + +#ifndef __x86_64__ + /* mov imm32, %eax */ + .byte 0xb8 +RELOCATOR_VARIABLE(dest) + .long 0 + movl %eax, %edi + + /* mov imm32, %eax */ + .byte 0xb8 +RELOCATOR_VARIABLE(src) + .long 0 + movl %eax, %esi + + /* mov imm32, %ecx */ + .byte 0xb9 +RELOCATOR_VARIABLE(size) + .long 0 +#else + xorq %rax, %rax + + /* mov imm32, %eax */ + .byte 0xb8 +RELOCATOR_VARIABLE(dest) + .long 0 + movq %rax, %rdi + + /* mov imm64, %rax */ + .byte 0x48 + .byte 0xb8 +RELOCATOR_VARIABLE(src) + .long 0, 0 + movq %rax, %rsi + + xorq %rcx, %rcx + /* mov imm32, %ecx */ + .byte 0xb9 +RELOCATOR_VARIABLE(size) + .long 0 + +#endif + + mov RDI, RAX + +#ifdef BACKWARD + add RCX, RSI + add RDX, RDI +#endif + +#ifndef BACKWARD + add RCX, RAX +#endif + add $0x3, RCX + shr $2, RCX + + +#ifdef BACKWARD + /* Backward movsl is implicitly off-by-four. compensate that. */ + sub $4, RSI + sub $4, RDI + + /* Backward copy. */ + std + + rep + movsl + +#else + /* Forward copy. */ + cld + rep + movsl +#endif + + /* %rax contains now our new 'base'. */ + mov RAX, RSI + add $(LOCAL(cont0) - LOCAL(base)), RAX + jmp *RAX +LOCAL(cont0): + lea (LOCAL(cont1) - LOCAL(base)) (RSI, 1), RAX + movl %eax, (LOCAL(jump_vector) - LOCAL(base)) (RSI, 1) + + lea (LOCAL(gdt) - LOCAL(base)) (RSI, 1), RAX + mov RAX, (LOCAL(gdt_addr) - LOCAL(base)) (RSI, 1) + + /* Switch to compatibility mode. */ + + lgdt (LOCAL(gdtdesc) - LOCAL(base)) (RSI, 1) + + /* Update %cs. Thanks to David Miller for pointing this mistake out. */ + ljmp *(LOCAL(jump_vector) - LOCAL(base)) (RSI, 1) + +LOCAL(cont1): + .code32 + + /* Update other registers. */ + movl $DATA_SEGMENT, %eax + movl %eax, %ds + movl %eax, %es + movl %eax, %fs + movl %eax, %gs + movl %eax, %ss + + /* Disable paging. */ + movl %cr0, %eax + andl $(~GRUB_MEMORY_CPU_CR0_PAGING_ON), %eax + movl %eax, %cr0 + + /* Disable amd64. */ + movl $GRUB_MEMORY_CPU_AMD64_MSR, %ecx + rdmsr + andl $(~GRUB_MEMORY_CPU_AMD64_MSR_ON), %eax + wrmsr + + /* Turn off PAE. */ + movl %cr4, %eax + andl $GRUB_MEMORY_CPU_CR4_PAE_ON, %eax + movl %eax, %cr4 + + jmp LOCAL(cont2) +LOCAL(cont2): + .code32 + + /* mov imm32, %eax */ + .byte 0xb8 +RELOCATOR_VARIABLE (esp) + .long 0 + + movl %eax, %esp + + /* mov imm32, %eax */ + .byte 0xb8 +RELOCATOR_VARIABLE (eax) + .long 0 + + /* mov imm32, %ebx */ + .byte 0xbb +RELOCATOR_VARIABLE (ebx) + .long 0 + + /* mov imm32, %ecx */ + .byte 0xb9 +RELOCATOR_VARIABLE (ecx) + .long 0 + + /* mov imm32, %edx */ + .byte 0xba +RELOCATOR_VARIABLE (edx) + .long 0 + + /* Cleared direction flag is of no problem with any current + payload and makes this implementation easier. */ + cld + + .byte 0xea +RELOCATOR_VARIABLE (eip) + .long 0 + .word 0x08 + + /* GDT. Copied from loader/i386/linux.c. */ + .p2align 4 +LOCAL(gdt): + /* NULL. */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + /* Reserved. */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + /* Code segment. */ + .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00 + + /* Data segment. */ + .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00 + + .p2align 4 +LOCAL(gdtdesc): + .word 0x27 +LOCAL(gdt_addr): +#ifdef __x86_64__ + /* Filled by the code. */ + .quad 0 +#else + /* Filled by the code. */ + .long 0 +#endif + + .p2align 4 +LOCAL(jump_vector): + /* Jump location. Is filled by the code */ + .long 0 + .long CODE_SEGMENT + +#ifndef BACKWARD +LOCAL(base): +#endif + +RELOCATOR_VARIABLE(end) diff --git a/lib/i386/relocator_backward.S b/lib/i386/relocator_backward.S new file mode 100644 index 000000000..06913470e --- /dev/null +++ b/lib/i386/relocator_backward.S @@ -0,0 +1,2 @@ +#define BACKWARD +#include "relocator_asm.S" diff --git a/lib/mips/relocator.c b/lib/mips/relocator.c new file mode 100644 index 000000000..796473bf7 --- /dev/null +++ b/lib/mips/relocator.c @@ -0,0 +1,109 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * 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 . + */ + +#include +#include + +#include +#include +#include +#include + +#include + +/* Remark: doesn't work with source outside of 4G. + Use relocator64 in this case. + */ + +extern grub_uint8_t grub_relocator32_forward_start; +extern grub_uint8_t grub_relocator32_forward_end; +extern grub_uint8_t grub_relocator32_backward_start; +extern grub_uint8_t grub_relocator32_backward_end; + +#define REGW_SIZEOF (2 * sizeof (grub_uint32_t)) +#define JUMP_SIZEOF (sizeof (grub_uint32_t)) + +#define RELOCATOR_SRC_SIZEOF(x) (&grub_relocator32_##x##_end \ + - &grub_relocator32_##x##_start) +#define RELOCATOR_SIZEOF(x) (RELOCATOR_SRC_SIZEOF(x) \ + + REGW_SIZEOF * (31 + 3) + JUMP_SIZEOF) +#define RELOCATOR_ALIGN 16 + +#define PREFIX(x) grub_relocator32_ ## x + +static void +write_reg (int regn, grub_uint32_t val, void **target) +{ + /* lui $r, (val+0x8000). */ + *(grub_uint32_t *) *target = ((0x3c00 | regn) << 16) | ((val + 0x8000) >> 16); + *target = ((grub_uint32_t *) *target) + 1; + /* addiu $r, $r, val. */ + *(grub_uint32_t *) *target = (((0x2400 | regn << 5 | regn) << 16) + | (val & 0xffff)); + *target = ((grub_uint32_t *) *target) + 1; +} + +static void +write_jump (int regn, void **target) +{ + /* j $r. */ + *(grub_uint32_t *) *target = (regn<<21) | 0x8; + *target = ((grub_uint32_t *) *target) + 1; +} + +static void +write_call_relocator_bw (void *ptr0, void *src, grub_uint32_t dest, + grub_size_t size, struct grub_relocator32_state state) +{ + void *ptr = ptr0; + int i; + write_reg (8, (grub_uint32_t) src, &ptr); + write_reg (9, dest, &ptr); + write_reg (10, size, &ptr); + grub_memcpy (ptr, &grub_relocator32_backward_start, + RELOCATOR_SRC_SIZEOF (backward)); + ptr = (grub_uint8_t *) ptr + RELOCATOR_SRC_SIZEOF (backward); + for (i = 1; i < 32; i++) + write_reg (i, state.gpr[i], &ptr); + write_jump (state.jumpreg, &ptr); + grub_arch_sync_caches (ptr0, (grub_uint8_t *) ptr - (grub_uint8_t *) ptr0); + grub_dprintf ("relocator", "Backward relocator: about to jump to %p\n", ptr0); + ((void (*) (void)) ptr0) (); +} + +static void +write_call_relocator_fw (void *ptr0, void *src, grub_uint32_t dest, + grub_size_t size, struct grub_relocator32_state state) +{ + void *ptr = ptr0; + int i; + write_reg (8, (grub_uint32_t) src, &ptr); + write_reg (9, dest, &ptr); + write_reg (10, size, &ptr); + grub_memcpy (ptr, &grub_relocator32_forward_start, + RELOCATOR_SRC_SIZEOF (forward)); + ptr = (grub_uint8_t *) ptr + RELOCATOR_SRC_SIZEOF (forward); + for (i = 1; i < 32; i++) + write_reg (i, state.gpr[i], &ptr); + write_jump (state.jumpreg, &ptr); + grub_arch_sync_caches (ptr0, (grub_uint8_t *) ptr - (grub_uint8_t *) ptr0); + grub_dprintf ("relocator", "Forward relocator: about to jump to %p\n", ptr0); + ((void (*) (void)) ptr0) (); +} + +#include "../relocator.c" diff --git a/lib/mips/relocator_asm.S b/lib/mips/relocator_asm.S new file mode 100644 index 000000000..f9cdf1470 --- /dev/null +++ b/lib/mips/relocator_asm.S @@ -0,0 +1,71 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * 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 . + */ + +#include + + .p2align 4 /* force 16-byte alignment */ + +VARIABLE (grub_relocator32_forward_start) + move $12, $9 + move $13, $10 + +copycont1: + lb $11,0($8) + sb $11,0($9) + addiu $8, $8, 0x1 + addiu $9, $9, 0x1 + addiu $10, $10, 0xffff + subu $11,$10,$0 + bne $11, $0, copycont1 + +cachecont1: + cache 1,0($12) + cache 0,0($12) + addiu $12, $12, 0x1 + addiu $13, $13, 0xffff + subu $11,$13,$0 + bne $11, $0, cachecont1 +VARIABLE (grub_relocator32_forward_end) + +VARIABLE (grub_relocator32_backward_start) + move $12, $9 + move $13, $10 + + addu $9, $9, $10 + addu $8, $8, $10 + /* Backward movsl is implicitly off-by-one. compensate that. */ + addiu $9, $9, 0xffff + addiu $8, $8, 0xffff +copycont2: + lb $11,0($8) + sb $11,0($9) + cache 1, 0($9) + cache 0, 0($9) + addiu $8, $8, 0xffff + addiu $9, $9, 0xffff + addiu $10, 0xffff + subu $11,$10,$0 + bne $11, $0, copycont2 +cachecont2: + cache 1,0($12) + cache 0,0($12) + addiu $12, $12, 0x1 + addiu $13, $13, 0xffff + subu $11,$13,$0 + bne $11, $0, cachecont2 +VARIABLE (grub_relocator32_backward_end) diff --git a/lib/relocator.c b/lib/relocator.c new file mode 100644 index 000000000..bebf7ada9 --- /dev/null +++ b/lib/relocator.c @@ -0,0 +1,113 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * 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 . + */ + +void * +PREFIX (alloc) (grub_size_t size) +{ + char *playground; + + playground = grub_malloc ((RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN) + + size + + (RELOCATOR_SIZEOF (backward) + + RELOCATOR_ALIGN)); + if (!playground) + return 0; + + *(grub_size_t *) playground = size; + + return playground + RELOCATOR_SIZEOF (forward); +} + +void * +PREFIX (realloc) (void *relocator, grub_size_t size) +{ + char *playground; + + playground = (char *) relocator - RELOCATOR_SIZEOF (forward); + + playground = grub_realloc (playground, + (RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN) + + size + + (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN)); + if (!playground) + return 0; + + *(grub_size_t *) playground = size; + + return playground + RELOCATOR_SIZEOF (forward); +} + +void +PREFIX(free) (void *relocator) +{ + if (relocator) + grub_free ((char *) relocator - RELOCATOR_SIZEOF (forward)); +} + +grub_err_t +PREFIX (boot) (void *relocator, grub_uint32_t dest, + struct grub_relocator32_state state) +{ + grub_size_t size; + char *playground; + + playground = (char *) relocator - RELOCATOR_SIZEOF (forward); + size = *(grub_size_t *) playground; + + grub_dprintf ("relocator", + "Relocator: source: %p, destination: 0x%x, size: 0x%x\n", + relocator, dest, size); + + if (UINT_TO_PTR (dest) >= relocator) + { + int overhead; + overhead = + ALIGN_UP (dest - RELOCATOR_SIZEOF (backward) - RELOCATOR_ALIGN, + RELOCATOR_ALIGN); + grub_dprintf ("relocator", + "Backward relocator: code %p, source: %p, " + "destination: 0x%x, size: 0x%x\n", + (char *) relocator - overhead, + (char *) relocator - overhead, + dest - overhead, size + overhead); + + write_call_relocator_bw ((char *) relocator - overhead, + (char *) relocator - overhead, + dest - overhead, size + overhead, state); + } + else + { + int overhead; + + overhead = ALIGN_UP (dest + size, RELOCATOR_ALIGN) + + RELOCATOR_SIZEOF (forward) - (dest + size); + grub_dprintf ("relocator", + "Forward relocator: code %p, source: %p, " + "destination: 0x%x, size: 0x%x\n", + (char *) relocator + size + overhead + - RELOCATOR_SIZEOF (forward), + relocator, dest, size + overhead); + + write_call_relocator_fw ((char *) relocator + size + overhead + - RELOCATOR_SIZEOF (forward), + relocator, dest, size + overhead, state); + } + + /* Not reached. */ + return GRUB_ERR_NONE; +} diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index d1ea307d2..33c7433f2 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -48,18 +48,35 @@ #include #include #endif +#include extern grub_dl_t my_mod; static struct multiboot_info *mbi, *mbi_dest; -static grub_addr_t entry; -static char *playground = 0; static grub_size_t code_size; +char *grub_multiboot_payload_orig; +grub_addr_t grub_multiboot_payload_dest; +grub_size_t grub_multiboot_payload_size; +grub_uint32_t grub_multiboot_payload_eip; +grub_uint32_t grub_multiboot_payload_esp; + static grub_err_t grub_multiboot_boot (void) { - grub_multiboot_real_boot (entry, mbi_dest); + struct grub_relocator32_state state = + { + .eax = MULTIBOOT_MAGIC2, + .ebx = PTR_TO_UINT32 (mbi_dest), + .ecx = 0, + .edx = 0, + .eip = grub_multiboot_payload_eip, + .esp = grub_multiboot_payload_esp + }; + + grub_relocator32_boot (grub_multiboot_payload_orig, + grub_multiboot_payload_dest, + state); /* Not reached. */ return GRUB_ERR_NONE; @@ -68,7 +85,7 @@ grub_multiboot_boot (void) static grub_err_t grub_multiboot_unload (void) { - if (playground) + if (mbi) { unsigned int i; for (i = 0; i < mbi->mods_count; i++) @@ -79,11 +96,11 @@ grub_multiboot_unload (void) ((struct multiboot_mod_list *) mbi->mods_addr)[i].cmdline); } grub_free ((void *) mbi->mods_addr); - grub_free (playground); } + grub_relocator32_free (grub_multiboot_payload_orig); mbi = NULL; - playground = NULL; + grub_multiboot_payload_orig = NULL; grub_dl_unref (my_mod); return GRUB_ERR_NONE; @@ -250,11 +267,8 @@ grub_multiboot (int argc, char *argv[]) goto fail; } - if (playground) - { - grub_free (playground); - playground = NULL; - } + grub_relocator32_free (grub_multiboot_payload_orig); + grub_multiboot_payload_orig = NULL; mmap_length = grub_get_multiboot_mmap_len (); @@ -276,11 +290,13 @@ grub_multiboot (int argc, char *argv[]) ((void *) ((x) + code_size + cmdline_length)) #define mbi_addr(x) ((void *) ((x) + code_size + cmdline_length + boot_loader_name_length)) #define mmap_addr(x) ((void *) ((x) + code_size + cmdline_length + boot_loader_name_length + sizeof (struct multiboot_info))) +#define stack_addr(x) ((void *) ((x) + code_size + cmdline_length + boot_loader_name_length + sizeof (struct multiboot_info) + mmap_length + GRUB_MULTIBOOT_STACK_SIZE)) grub_multiboot_payload_size = cmdline_length /* boot_loader_name_length might need to grow for mbi,etc to be aligned (see below) */ + boot_loader_name_length + 3 - + sizeof (struct multiboot_info) + mmap_length; + + sizeof (struct multiboot_info) + mmap_length + + GRUB_MULTIBOOT_STACK_SIZE; if (header->flags & MULTIBOOT_AOUT_KLUDGE) { @@ -296,11 +312,12 @@ grub_multiboot (int argc, char *argv[]) grub_multiboot_payload_dest = header->load_addr; grub_multiboot_payload_size += code_size; - playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward)); - if (! playground) - goto fail; - grub_multiboot_payload_orig = (long) playground + RELOCATOR_SIZEOF(forward); + grub_multiboot_payload_orig + = grub_relocator32_alloc (grub_multiboot_payload_size); + + if (! grub_multiboot_payload_orig) + goto fail; if ((grub_file_seek (file, offset)) == (grub_off_t) - 1) goto fail; @@ -313,7 +330,7 @@ grub_multiboot (int argc, char *argv[]) grub_memset ((void *) (grub_multiboot_payload_orig + load_size), 0, header->bss_end_addr - header->load_addr - load_size); - grub_multiboot_payload_entry_offset = header->entry_addr - header->load_addr; + grub_multiboot_payload_eip = header->entry_addr; } else if (grub_multiboot_load_elf (file, buffer) != GRUB_ERR_NONE) @@ -334,23 +351,6 @@ grub_multiboot (int argc, char *argv[]) mbi->mmap_addr = (grub_uint32_t) mmap_addr (grub_multiboot_payload_dest); mbi->flags |= MULTIBOOT_INFO_MEM_MAP; - if (grub_multiboot_payload_dest >= grub_multiboot_payload_orig) - { - grub_memmove (playground, &grub_multiboot_forward_relocator, RELOCATOR_SIZEOF(forward)); - entry = (grub_addr_t) playground; - } - else - { - grub_memmove ((char *) (grub_multiboot_payload_orig + grub_multiboot_payload_size), - &grub_multiboot_backward_relocator, RELOCATOR_SIZEOF(backward)); - entry = (grub_addr_t) grub_multiboot_payload_orig + grub_multiboot_payload_size; - } - - grub_dprintf ("multiboot_loader", "dest=%p, size=0x%x, entry_offset=0x%x\n", - (void *) grub_multiboot_payload_dest, - grub_multiboot_payload_size, - grub_multiboot_payload_entry_offset); - /* Convert from bytes to kilobytes. */ mbi->mem_lower = grub_mmap_get_lower () / 1024; mbi->mem_upper = grub_mmap_get_upper () / 1024; @@ -382,6 +382,8 @@ grub_multiboot (int argc, char *argv[]) if (grub_multiboot_get_bootdev (&mbi->boot_device)) mbi->flags |= MULTIBOOT_INFO_BOOTDEV; + grub_multiboot_payload_esp = PTR_TO_UINT32 (stack_addr (grub_multiboot_payload_dest)); + grub_loader_set (grub_multiboot_boot, grub_multiboot_unload, 1); fail: diff --git a/loader/i386/multiboot_elfxx.c b/loader/i386/multiboot_elfxx.c index 77c47118c..0b9820dcc 100644 --- a/loader/i386/multiboot_elfxx.c +++ b/loader/i386/multiboot_elfxx.c @@ -32,6 +32,8 @@ #error "I'm confused" #endif +#include + #define CONCAT(a,b) CONCAT_(a, b) #define CONCAT_(a,b) a ## b @@ -99,11 +101,12 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) grub_multiboot_payload_dest = phdr(lowest_segment)->p_paddr; grub_multiboot_payload_size += code_size; - playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward)); - if (! playground) - return grub_errno; - grub_multiboot_payload_orig = (long) playground + RELOCATOR_SIZEOF(forward); + grub_multiboot_payload_orig + = grub_relocator32_alloc (grub_multiboot_payload_size); + + if (!grub_multiboot_payload_orig) + return grub_errno; /* Load every loadable segment in memory. */ for (i = 0; i < ehdr->e_phnum; i++) @@ -135,8 +138,7 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) if (phdr(i)->p_vaddr <= ehdr->e_entry && phdr(i)->p_vaddr + phdr(i)->p_memsz > ehdr->e_entry) { - grub_multiboot_payload_entry_offset = (ehdr->e_entry - phdr(i)->p_vaddr) - + (phdr(i)->p_paddr - phdr(lowest_segment)->p_paddr); + grub_multiboot_payload_eip = ehdr->e_entry; break; } diff --git a/loader/i386/multiboot_helper.S b/loader/i386/multiboot_helper.S index d1094588b..2f9af778b 100644 --- a/loader/i386/multiboot_helper.S +++ b/loader/i386/multiboot_helper.S @@ -22,81 +22,6 @@ .p2align 2 /* force 4-byte alignment */ -/* - * This starts the multiboot kernel. - */ - -VARIABLE(grub_multiboot_payload_size) - .long 0 -VARIABLE(grub_multiboot_payload_orig) - .long 0 -VARIABLE(grub_multiboot_payload_dest) - .long 0 -VARIABLE(grub_multiboot_payload_entry_offset) - .long 0 - -/* - * The relocators below understand the following parameters: - * ecx: Size of the block to be copied. - * esi: Where to copy from (always lowest address, even if we're relocating - * backwards). - * edi: Where to copy to (likewise). - * edx: Offset of the entry point (relative to the beginning of the block). - */ - -VARIABLE(grub_multiboot_forward_relocator) - /* Add entry offset. */ - addl %edi, %edx - - /* Forward copy. */ - cld - rep - movsb - - jmp *%edx -VARIABLE(grub_multiboot_forward_relocator_end) - -VARIABLE(grub_multiboot_backward_relocator) - /* Add entry offset (before %edi is mangled). */ - addl %edi, %edx - - /* Backward movsb is implicitly off-by-one. compensate that. */ - decl %esi - decl %edi - - /* Backward copy. */ - std - addl %ecx, %esi - addl %ecx, %edi - rep - movsb - - cld - jmp *%edx -VARIABLE(grub_multiboot_backward_relocator_end) - -FUNCTION(grub_multiboot_real_boot) - /* Push the entry address on the stack. */ - pushl %eax - /* Move the address of the multiboot information structure to ebx. */ - movl %edx,%ebx - - /* Interrupts should be disabled. */ - cli - - /* Where do we copy what from. */ - movl EXT_C(grub_multiboot_payload_size), %ecx - movl EXT_C(grub_multiboot_payload_orig), %esi - movl EXT_C(grub_multiboot_payload_dest), %edi - movl EXT_C(grub_multiboot_payload_entry_offset), %edx - - /* Move the magic value into eax. */ - movl $MULTIBOOT_MAGIC2, %eax - - /* Jump to the relocator. */ - popl %ebp - jmp *%ebp - /* * This starts the multiboot 2 kernel. */ diff --git a/po/ca.po b/po/ca.po index 58783edbd..a72601c84 100644 --- a/po/ca.po +++ b/po/ca.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: GNU GRUB\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-11-22 11:45+0000\n" +"POT-Creation-Date: 2009-11-25 23:35+0100\n" "PO-Revision-Date: 2009-11-17 12:26+0100\n" "Last-Translator: Robert Millan \n" "Language-Team: None \n" @@ -40,7 +40,7 @@ msgstr "" msgid "Core image is too big (%p > %p)\n" msgstr "" -#: util/i386/pc/grub-mkimage.c:321 util/i386/pc/grub-setup.c:587 +#: util/i386/pc/grub-mkimage.c:321 util/i386/pc/grub-setup.c:589 #, c-format msgid "Try ``%s --help'' for more information.\n" msgstr "Proveu «%s --help» per a obtenir més informació.\n" @@ -162,39 +162,39 @@ msgstr "" msgid "If you really want blocklists, use --force." msgstr "" -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:441 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:442 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:500 #, c-format msgid "Cannot read `%s' correctly" msgstr "" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:513 msgid "No terminator in the core image" msgstr "" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:524 msgid "Failed to read the first sector of the core image" msgstr "" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:530 msgid "Failed to read the rest sectors of the core image" msgstr "" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:549 #, c-format msgid "Cannot open `%s'" msgstr "" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:591 #, c-format msgid "" "Usage: grub-setup [OPTION]... DEVICE\n" @@ -216,27 +216,27 @@ msgid "" "Report bugs to <%s>.\n" msgstr "" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:721 #, c-format msgid "No device is specified.\n" msgstr "" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:727 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:744 #, c-format msgid "Invalid device `%s'.\n" msgstr "" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid root device `%s'" msgstr "" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:770 msgid "Cannot guess the root device. Specify the option ``--root-device''." msgstr "" diff --git a/po/id.po b/po/id.po index d97cfb9e7..69692a003 100644 --- a/po/id.po +++ b/po/id.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: grub 1.97+20091122\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-11-22 11:48+0100\n" +"POT-Creation-Date: 2009-11-25 23:35+0100\n" "PO-Revision-Date: 2009-11-22 20:00+0700\n" "Last-Translator: Arif E. Nugroho \n" "Language-Team: Indonesian \n" @@ -41,7 +41,7 @@ msgstr "besar diskboot.img seharusnya %u bytes" msgid "Core image is too big (%p > %p)\n" msgstr "Image core terlalu besar (%p >%p)\n" -#: util/i386/pc/grub-mkimage.c:321 util/i386/pc/grub-setup.c:587 +#: util/i386/pc/grub-mkimage.c:321 util/i386/pc/grub-setup.c:589 #, c-format msgid "Try ``%s --help'' for more information.\n" msgstr "Coba ``%s --help'' untuk informasi lebih lanjut.\n" @@ -72,7 +72,8 @@ msgstr "" " -p, --prefix=DIR set direktori grub_prefix [baku=%s]\n" " -m, --memdisk=BERKAS tempatkan BERKAS sebagai sebuah image memdisk\n" " -c, --config=BERKAS tempatkan BERKAS sebagai konfigurasi boot\n" -" -o, --output=BERKAS keluarkan sebuah image yang dihasilkan ke BERKAS [baku=stdout]\n" +" -o, --output=BERKAS keluarkan sebuah image yang dihasilkan ke BERKAS " +"[baku=stdout]\n" " -h, --help tampilkan pesan ini dan keluar\n" " -V, --version tampilkan informasi versi dan keluar\n" " -v, --verbose tampilkan informasi secara detail\n" @@ -114,86 +115,122 @@ msgstr "Ukuran dari `%s' terlalu besar" #: util/i386/pc/grub-setup.c:261 #, c-format msgid "Unable to identify a filesystem in %s; safety check can't be performed" -msgstr "Tidak dapat mengidentifikasikan sebuah sistem berkas dalam %s; pemeriksaan keamanan tidak dapat dilakukan" +msgstr "" +"Tidak dapat mengidentifikasikan sebuah sistem berkas dalam %s; pemeriksaan " +"keamanan tidak dapat dilakukan" #: util/i386/pc/grub-setup.c:265 #, c-format -msgid "%s appears to contain a %s filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk)" -msgstr "%s sepertinya berisi sebuah sistem berkas %s yang tidak diketahui untuk mereserve ruang untuk boot gaya-DOS. Memasang GRUB disana dapat berakibat KERUSAKAN SISTEM BERKAS jika data berharga dipaksa tulis oleh grub-setup (--skip-fs-probe menonaktifkan pemeriksaan ini, gunakan sesuai resiko anda)" +msgid "" +"%s appears to contain a %s filesystem which isn't known to reserve space for " +"DOS-style boot. Installing GRUB there could result in FILESYSTEM " +"DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe " +"disables this check, use at your own risk)" +msgstr "" +"%s sepertinya berisi sebuah sistem berkas %s yang tidak diketahui untuk " +"mereserve ruang untuk boot gaya-DOS. Memasang GRUB disana dapat berakibat " +"KERUSAKAN SISTEM BERKAS jika data berharga dipaksa tulis oleh grub-setup (--" +"skip-fs-probe menonaktifkan pemeriksaan ini, gunakan sesuai resiko anda)" #: util/i386/pc/grub-setup.c:314 msgid "No DOS-style partitions found" msgstr "Tidak ditemukan gaya partisi DOS" #: util/i386/pc/grub-setup.c:330 util/i386/pc/grub-setup.c:355 -msgid "Attempting to install GRUB to a partitionless disk. This is a BAD idea." -msgstr "Mencoba memasang GRUB ke sebuah disk yang tidak berpartisi. Ini mungkin bukan ide baik." +msgid "" +"Attempting to install GRUB to a partitionless disk. This is a BAD idea." +msgstr "" +"Mencoba memasang GRUB ke sebuah disk yang tidak berpartisi. Ini mungkin " +"bukan ide baik." #: util/i386/pc/grub-setup.c:336 -msgid "Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea." -msgstr "Mencoba memasang GRUB ke sebuah partisi daripada MBR. Ini mungkin bukan ide baik." +msgid "" +"Attempting to install GRUB to a partition instead of the MBR. This is a BAD " +"idea." +msgstr "" +"Mencoba memasang GRUB ke sebuah partisi daripada MBR. Ini mungkin bukan ide " +"baik." #: util/i386/pc/grub-setup.c:365 -msgid "This msdos-style partition label has no post-MBR gap; embedding won't be possible!" -msgstr "Label partisi gaya msdos ini tidak memiliki post-MBR gap; penempatan tidak memungkinkan!" +msgid "" +"This msdos-style partition label has no post-MBR gap; embedding won't be " +"possible!" +msgstr "" +"Label partisi gaya msdos ini tidak memiliki post-MBR gap; penempatan tidak " +"memungkinkan!" #: util/i386/pc/grub-setup.c:367 -msgid "This GPT partition label has no BIOS Boot Partition; embedding won't be possible!" -msgstr "Label partisi GPT ini tidak memiliki partisi boot BIOS; penempatan tidak memungkinkan!" +msgid "" +"This GPT partition label has no BIOS Boot Partition; embedding won't be " +"possible!" +msgstr "" +"Label partisi GPT ini tidak memiliki partisi boot BIOS; penempatan tidak " +"memungkinkan!" #: util/i386/pc/grub-setup.c:374 msgid "Your core.img is unusually large. It won't fit in the embedding area." -msgstr "Besar core.img anda sangat besar. Ini tidak akan masuk dalam area penempatan." +msgstr "" +"Besar core.img anda sangat besar. Ini tidak akan masuk dalam area penempatan." #: util/i386/pc/grub-setup.c:376 msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "Penempatan anda sangat kecil. core.img tidak akan masuk disana." #: util/i386/pc/grub-setup.c:418 -msgid "Embedding is not possible, but this is required when the root device is on a RAID array or LVM volume." -msgstr "Penempatan tidak memungkinkan, tetapi ini dibutuhkan ketika perangkat root berada di sebuah array RAID atau volume LVM." +msgid "" +"Embedding is not possible, but this is required when the root device is on a " +"RAID array or LVM volume." +msgstr "" +"Penempatan tidak memungkinkan, tetapi ini dibutuhkan ketika perangkat root " +"berada di sebuah array RAID atau volume LVM." #: util/i386/pc/grub-setup.c:421 -msgid "Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged." -msgstr "Penempatan tidak memungkinkan. GRUB hanya dapat dipasang di konfigurasi ini dengan menggunakan blocklists. Akan tetapi, blocklists TIDAK DAPAT DIJAGAKAN dan penggunaan ini tidak disarankan." +msgid "" +"Embedding is not possible. GRUB can only be installed in this setup by " +"using blocklists. However, blocklists are UNRELIABLE and its use is " +"discouraged." +msgstr "" +"Penempatan tidak memungkinkan. GRUB hanya dapat dipasang di konfigurasi ini " +"dengan menggunakan blocklists. Akan tetapi, blocklists TIDAK DAPAT DIJAGAKAN " +"dan penggunaan ini tidak disarankan." #: util/i386/pc/grub-setup.c:425 msgid "If you really want blocklists, use --force." msgstr "Jika anda benar benar menginginkan blocklists, gunakan --force." -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:441 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "mencoba untuk membaca image core `%s' dari GRUB" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:442 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "mencoba untuk membaca image core `%s' dari GRUB lagi" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:500 #, c-format msgid "Cannot read `%s' correctly" msgstr "Tidak dapat membaca `%s' secara benar" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:513 msgid "No terminator in the core image" msgstr "Tidak ada pengakhir dalam image core" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:524 msgid "Failed to read the first sector of the core image" msgstr "Gagal untuk membaca sektor pertama dari core image" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:530 msgid "Failed to read the rest sectors of the core image" msgstr "Gagal untuk membaca sektor selanjutnya dari image core" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:549 #, c-format msgid "Cannot open `%s'" msgstr "Tidak dapat membuka `%s'" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:591 #, c-format msgid "" "Usage: grub-setup [OPTION]... DEVICE\n" @@ -225,36 +262,38 @@ msgstr "" " -m, --device-map=BERKAS gunakan BERKAS sebagai peta perangkat [baku=%s]\n" " -r, --root-device=DEV gunakan DEV sebagai perangkat root [baku=ditebak]\n" " -f, --force pasang walaupun masalah terdeteksi\n" -" -s, --skip-fs-probe jangan periksa untuk sistem berkas dalam PERANGKAT\n" +" -s, --skip-fs-probe jangan periksa untuk sistem berkas dalam " +"PERANGKAT\n" " -h, --help tampilkan pesan bantuan ini dan keluar\n" " -V, --version tampilkan informasi versi dan keluar\n" " -v, --verbose tampilkan informasi secara detail\n" "\n" "Laporkan bugs ke <%s>.\n" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:721 #, c-format msgid "No device is specified.\n" msgstr "Perangkat tidak dispesifikasikan.\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:727 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "Argumen ekstra `%s' tidak diketahui.\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:744 #, c-format msgid "Invalid device `%s'.\n" msgstr "Perangkat `%s' tidak valid.\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid root device `%s'" msgstr "Perangkat root `%s' tidak valid" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:770 msgid "Cannot guess the root device. Specify the option ``--root-device''." -msgstr "Tidak dapat menebak perangkat root. Spesifikasikan pilihan ``--root-device''." +msgstr "" +"Tidak dapat menebak perangkat root. Spesifikasikan pilihan ``--root-device''." #: util/mkisofs/eltorito.c:96 #, c-format @@ -269,7 +308,9 @@ msgstr "Mohon periksa berkas berikut: %s.\n" #: util/mkisofs/eltorito.c:98 #, c-format msgid "This file must be removed before a bootable CD can be done.\n" -msgstr "Berkas ini mungkin telah terhapus sebelum sebuah CD bootable dapat dilakukan.\n" +msgstr "" +"Berkas ini mungkin telah terhapus sebelum sebuah CD bootable dapat " +"dilakukan.\n" #: util/mkisofs/eltorito.c:110 #, c-format @@ -360,7 +401,9 @@ msgstr "Error menulis ke boot image (%s)" #: util/mkisofs/joliet.c:359 util/mkisofs/write.c:981 #, c-format msgid "Unable to generate sane path tables - too many directories (%d)\n" -msgstr "Tidak dapat menghasilkan tabel jalur yang masuk akal - terlalu banyak direktori (%d)\n" +msgstr "" +"Tidak dapat menghasilkan tabel jalur yang masuk akal - terlalu banyak " +"direktori (%d)\n" #: util/mkisofs/joliet.c:398 util/mkisofs/write.c:1017 #, c-format @@ -392,6 +435,208 @@ msgstr "Fatal goof - tidak dapat menemukan lokasi direktori\n" msgid "Unexpected joliet directory length %d %d %s\n" msgstr "Panjang direktori joliet tidak terduga %d %d %s\n" +#: util/mkisofs/mkisofs.c:203 +msgid "Process all files (don't skip backup files)" +msgstr "" + +#: util/mkisofs/mkisofs.c:205 +#, fuzzy +msgid "Set Abstract filename" +msgstr "String nama berkas abstrak terlalu panjang\n" + +#: util/mkisofs/mkisofs.c:207 +msgid "Set Application ID" +msgstr "" + +#: util/mkisofs/mkisofs.c:209 +#, fuzzy +msgid "Set Bibliographic filename" +msgstr "String nama berkas bibliographic terlalu panjang\n" + +#: util/mkisofs/mkisofs.c:211 +#, fuzzy +msgid "Set Copyright filename" +msgstr "String nama berkas Hak Cipta terlalu panjang\n" + +#: util/mkisofs/mkisofs.c:213 +msgid "Set El Torito boot image name" +msgstr "" + +#: util/mkisofs/mkisofs.c:215 +#, fuzzy +msgid "Set El Torito boot catalog name" +msgstr "Error menulis ke katalog boot" + +#: util/mkisofs/mkisofs.c:217 +msgid "Patch Boot Info Table in El Torito boot image" +msgstr "" + +#: util/mkisofs/mkisofs.c:219 +msgid "Dummy option for backward compatibility" +msgstr "" + +#: util/mkisofs/mkisofs.c:221 +msgid "Enable floppy drive emulation for El Torito" +msgstr "" + +#: util/mkisofs/mkisofs.c:223 +msgid "Magic parameters from cdrecord" +msgstr "" + +#: util/mkisofs/mkisofs.c:225 +msgid "Omit trailing periods from filenames" +msgstr "" + +#: util/mkisofs/mkisofs.c:227 +#, fuzzy +msgid "Disable deep directory relocation" +msgstr "Fatal goof - tidak dapat menemukan lokasi direktori\n" + +#: util/mkisofs/mkisofs.c:229 +msgid "Follow symbolic links" +msgstr "" + +#: util/mkisofs/mkisofs.c:231 util/mkisofs/mkisofs.c:233 +msgid "Print option help" +msgstr "" + +#: util/mkisofs/mkisofs.c:235 +msgid "Print version information and exit" +msgstr "" + +#: util/mkisofs/mkisofs.c:237 +msgid "Hide ISO9660/RR file" +msgstr "" + +#: util/mkisofs/mkisofs.c:239 +msgid "Hide Joliet file" +msgstr "" + +#: util/mkisofs/mkisofs.c:241 +#, fuzzy +msgid "No longer supported" +msgstr "pilihan -i tidak lagi didukung.\n" + +#: util/mkisofs/mkisofs.c:243 +msgid "Generate Joliet directory information" +msgstr "" + +#: util/mkisofs/mkisofs.c:245 +msgid "Allow full 32 character filenames for iso9660 names" +msgstr "" + +#: util/mkisofs/mkisofs.c:247 +msgid "Allow iso9660 filenames to start with '.'" +msgstr "" + +#: util/mkisofs/mkisofs.c:249 +#, fuzzy +msgid "Re-direct messages to LOG_FILE" +msgstr "menredireksikan seluruh pesan ke %s\n" + +#: util/mkisofs/mkisofs.c:251 +msgid "Exclude file name" +msgstr "" + +#: util/mkisofs/mkisofs.c:253 +#, fuzzy +msgid "Set path to previous session to merge" +msgstr "Tidak dapat membuka sesi image sebelumnya %s\n" + +#: util/mkisofs/mkisofs.c:255 +msgid "Omit version number from iso9660 filename" +msgstr "" + +#: util/mkisofs/mkisofs.c:257 +msgid "Inhibit splitting symlink components" +msgstr "" + +#: util/mkisofs/mkisofs.c:259 +msgid "Inhibit splitting symlink fields" +msgstr "" + +#: util/mkisofs/mkisofs.c:261 +msgid "Set output file name" +msgstr "" + +#: util/mkisofs/mkisofs.c:263 +msgid "Set Volume preparer" +msgstr "" + +#: util/mkisofs/mkisofs.c:265 +msgid "Print estimated filesystem size and exit" +msgstr "" + +#: util/mkisofs/mkisofs.c:267 +msgid "Set Volume publisher" +msgstr "" + +#: util/mkisofs/mkisofs.c:269 +msgid "Run quietly" +msgstr "" + +#: util/mkisofs/mkisofs.c:271 +msgid "Generate rationalized Rock Ridge directory information" +msgstr "" + +#: util/mkisofs/mkisofs.c:273 +msgid "Generate Rock Ridge directory information" +msgstr "" + +#: util/mkisofs/mkisofs.c:275 +msgid "Split output into files of approx. 1GB size" +msgstr "" + +#: util/mkisofs/mkisofs.c:277 +msgid "Set System ID" +msgstr "" + +#: util/mkisofs/mkisofs.c:279 +msgid "" +"Generate translation tables for systems that don't understand long filenames" +msgstr "" + +#: util/mkisofs/mkisofs.c:281 +msgid "Verbose" +msgstr "" + +#: util/mkisofs/mkisofs.c:283 +msgid "Set Volume ID" +msgstr "" + +#: util/mkisofs/mkisofs.c:285 +msgid "Set Volume set ID" +msgstr "" + +#: util/mkisofs/mkisofs.c:287 +msgid "Set Volume set size" +msgstr "" + +#: util/mkisofs/mkisofs.c:289 +#, fuzzy +msgid "Set Volume set sequence number" +msgstr "Set urutan nomor volume terlalu besar\n" + +#: util/mkisofs/mkisofs.c:291 +msgid "Exclude file name (deprecated)" +msgstr "" + +#: util/mkisofs/mkisofs.c:297 +msgid "Override creation date" +msgstr "" + +#: util/mkisofs/mkisofs.c:299 +msgid "Override modification date" +msgstr "" + +#: util/mkisofs/mkisofs.c:301 +msgid "Override expiration date" +msgstr "" + +#: util/mkisofs/mkisofs.c:303 +msgid "Override effective date" +msgstr "" + #: util/mkisofs/mkisofs.c:373 #, c-format msgid "Using \"%s\"\n" @@ -509,12 +754,16 @@ msgstr "Peringatan: setrlimit" #: util/mkisofs/mkisofs.c:978 #, c-format msgid "Multisession usage bug: Must specify -C if -M is used.\n" -msgstr "Bug penggunaan multi sesi: Harus menspesifikasikan -C jika -M digunakan.\n" +msgstr "" +"Bug penggunaan multi sesi: Harus menspesifikasikan -C jika -M digunakan.\n" #: util/mkisofs/mkisofs.c:984 #, c-format -msgid "Warning: -C specified without -M: old session data will not be merged.\n" -msgstr "Peringatan: -C dispesifikasikan tanpa -M: data sesi lama tidak akan digabungkan.\n" +msgid "" +"Warning: -C specified without -M: old session data will not be merged.\n" +msgstr "" +"Peringatan: -C dispesifikasikan tanpa -M: data sesi lama tidak akan " +"digabungkan.\n" #: util/mkisofs/mkisofs.c:1023 #, c-format @@ -574,8 +823,13 @@ msgstr "**Atribut versi RR buruk" #: util/mkisofs/multi.c:546 #, c-format -msgid "Warning: Neither Rock Ridge (-R) nor TRANS.TBL (-T) name translations were found on previous session. ISO (8.3) file names have been used instead.\n" -msgstr "Peringatan: Bukan Rock Ridge (-R) ataupun TRANS.TBL (-T) nama terjemahan ditemukan dalam sesi sebelumnya. ISO (8.3) nama berkas yang telah digunakan.\n" +msgid "" +"Warning: Neither Rock Ridge (-R) nor TRANS.TBL (-T) name translations were " +"found on previous session. ISO (8.3) file names have been used instead.\n" +msgstr "" +"Peringatan: Bukan Rock Ridge (-R) ataupun TRANS.TBL (-T) nama terjemahan " +"ditemukan dalam sesi sebelumnya. ISO (8.3) nama berkas yang telah " +"digunakan.\n" #: util/mkisofs/multi.c:764 #, c-format @@ -593,12 +847,15 @@ msgstr "Parameter cdwrite salah format\n" #: util/mkisofs/rock.c:309 #, c-format msgid "symbolic link ``%s'' to long for one SL System Use Field, splitting" -msgstr "link simbolik ``%s'' terlalu panjang untuk satu SL Sistem Menggunakan Field, dipisahkan" +msgstr "" +"link simbolik ``%s'' terlalu panjang untuk satu SL Sistem Menggunakan " +"Field, dipisahkan" #: util/mkisofs/rock.c:517 #, c-format msgid "Unable to insert transparent compressed file - name conflict\n" -msgstr "Tidak dapat memasukan berkas terkompress secara transparan - konflik nama\n" +msgstr "" +"Tidak dapat memasukan berkas terkompress secara transparan - konflik nama\n" #: util/mkisofs/rock.c:591 msgid "Extension record too long\n" @@ -674,7 +931,8 @@ msgstr "Tidak ada atau tidak dapat diakses: %s\n" #: util/mkisofs/tree.c:997 util/mkisofs/tree.c:1103 #, c-format msgid "Unable to stat file %s - ignoring and continuing.\n" -msgstr "Tidak dapat memperoleh statistik berkas %s - mengabaikan dan melanjutkan.\n" +msgstr "" +"Tidak dapat memperoleh statistik berkas %s - mengabaikan dan melanjutkan.\n" #: util/mkisofs/tree.c:1003 #, c-format @@ -791,8 +1049,11 @@ msgstr "Total ekstensi yang sebenarnya tertulis = %llu\n" #: util/mkisofs/write.c:1154 #, c-format -msgid "Number of extents written different than what was predicted. Please fix.\n" -msgstr "Jumlah dari ekstensi yang ditulis berbeda dari apa yang direncanakan. Mohon betulkan.\n" +msgid "" +"Number of extents written different than what was predicted. Please fix.\n" +msgstr "" +"Jumlah dari ekstensi yang ditulis berbeda dari apa yang direncanakan. Mohon " +"betulkan.\n" #: util/mkisofs/write.c:1155 #, c-format @@ -819,6 +1080,13 @@ msgstr "Total bytes direktori: %d\n" msgid "Path table size(bytes): %d\n" msgstr "Ukuran tabel jalur(bytes): %d\n" +#: normal/menu_text.c:97 +#, c-format +msgid "" +"\n" +" Use the %C and %C keys to select which entry is highlighted.\n" +msgstr "" + #: util/grub.d/10_kfreebsd.in:40 msgid "%s, with kFreeBSD %s" msgstr "%s, dengan kFreeBSD %s" @@ -858,7 +1126,8 @@ msgstr "%s, dengan Linux %s" #~ msgid "the core image will be embedded at sector 0x%llx" #~ msgstr "core image akan di ditempatkan di sektor 0x%llx" -#~ msgid "succeeded in opening the core image but the size is different (%d != %d)" +#~ msgid "" +#~ "succeeded in opening the core image but the size is different (%d != %d)" #~ msgstr "sukses dalam membuka image core tetapi ukurannya berbeda (%d != %d)" #~ msgid "succeeded in opening the core image but cannot read %d bytes" diff --git a/po/zh_CN.po b/po/zh_CN.po index 9816afbad..8858f0a6a 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -8,10 +8,11 @@ msgid "" msgstr "" "Project-Id-Version: grub 1.97+20091122\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-11-22 11:48+0100\n" +"POT-Creation-Date: 2009-11-25 23:35+0100\n" "PO-Revision-Date: 2009-11-23 18:36+0800\n" "Last-Translator: Aron Xu \n" -"Language-Team: Chinese (simplified) \n" +"Language-Team: Chinese (simplified) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -42,7 +43,7 @@ msgstr "diskboot.img 的大小必须为 %u 字节" msgid "Core image is too big (%p > %p)\n" msgstr "核心映像太大(%p > %p)\n" -#: util/i386/pc/grub-mkimage.c:321 util/i386/pc/grub-setup.c:587 +#: util/i386/pc/grub-mkimage.c:321 util/i386/pc/grub-setup.c:589 #, c-format msgid "Try ``%s --help'' for more information.\n" msgstr "请尝试运行 ``%s --help'' 以获得更多信息。\n" @@ -105,7 +106,11 @@ msgstr "" #: util/i386/pc/grub-setup.c:265 #, c-format -msgid "%s appears to contain a %s filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk)" +msgid "" +"%s appears to contain a %s filesystem which isn't known to reserve space for " +"DOS-style boot. Installing GRUB there could result in FILESYSTEM " +"DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe " +"disables this check, use at your own risk)" msgstr "" #: util/i386/pc/grub-setup.c:314 @@ -113,19 +118,26 @@ msgid "No DOS-style partitions found" msgstr "未找到 DOS 类型分区" #: util/i386/pc/grub-setup.c:330 util/i386/pc/grub-setup.c:355 -msgid "Attempting to install GRUB to a partitionless disk. This is a BAD idea." +msgid "" +"Attempting to install GRUB to a partitionless disk. This is a BAD idea." msgstr "正在试图安装 GRUB 到未分区的磁盘。 这是一个坏主意。" #: util/i386/pc/grub-setup.c:336 -msgid "Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea." +msgid "" +"Attempting to install GRUB to a partition instead of the MBR. This is a BAD " +"idea." msgstr "正在试图安装 GRUB 到分区而非 MBR。 这是一个坏主意。" #: util/i386/pc/grub-setup.c:365 -msgid "This msdos-style partition label has no post-MBR gap; embedding won't be possible!" +msgid "" +"This msdos-style partition label has no post-MBR gap; embedding won't be " +"possible!" msgstr "" #: util/i386/pc/grub-setup.c:367 -msgid "This GPT partition label has no BIOS Boot Partition; embedding won't be possible!" +msgid "" +"This GPT partition label has no BIOS Boot Partition; embedding won't be " +"possible!" msgstr "" #: util/i386/pc/grub-setup.c:374 @@ -137,50 +149,55 @@ msgid "Your embedding area is unusually small. core.img won't fit in it." msgstr "您的嵌入式环境超乎寻常的小。core.img 无法适用于此处。" #: util/i386/pc/grub-setup.c:418 -msgid "Embedding is not possible, but this is required when the root device is on a RAID array or LVM volume." +msgid "" +"Embedding is not possible, but this is required when the root device is on a " +"RAID array or LVM volume." msgstr "" #: util/i386/pc/grub-setup.c:421 -msgid "Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged." +msgid "" +"Embedding is not possible. GRUB can only be installed in this setup by " +"using blocklists. However, blocklists are UNRELIABLE and its use is " +"discouraged." msgstr "" #: util/i386/pc/grub-setup.c:425 msgid "If you really want blocklists, use --force." msgstr "" -#: util/i386/pc/grub-setup.c:439 +#: util/i386/pc/grub-setup.c:441 #, c-format msgid "attempting to read the core image `%s' from GRUB" msgstr "正在尝试从 GRUB 读取核心映像 `%s'" -#: util/i386/pc/grub-setup.c:440 +#: util/i386/pc/grub-setup.c:442 #, c-format msgid "attempting to read the core image `%s' from GRUB again" msgstr "正在再次尝试从 GRUB 读取核心映像 `%s'" -#: util/i386/pc/grub-setup.c:498 +#: util/i386/pc/grub-setup.c:500 #, c-format msgid "Cannot read `%s' correctly" msgstr "无法正确读取 `%s'" -#: util/i386/pc/grub-setup.c:511 +#: util/i386/pc/grub-setup.c:513 msgid "No terminator in the core image" msgstr "核心映像中没有终止符" -#: util/i386/pc/grub-setup.c:522 +#: util/i386/pc/grub-setup.c:524 msgid "Failed to read the first sector of the core image" msgstr "" -#: util/i386/pc/grub-setup.c:528 +#: util/i386/pc/grub-setup.c:530 msgid "Failed to read the rest sectors of the core image" msgstr "" -#: util/i386/pc/grub-setup.c:547 +#: util/i386/pc/grub-setup.c:549 #, c-format msgid "Cannot open `%s'" msgstr "无法打开 `%s'" -#: util/i386/pc/grub-setup.c:589 +#: util/i386/pc/grub-setup.c:591 #, c-format msgid "" "Usage: grub-setup [OPTION]... DEVICE\n" @@ -202,27 +219,27 @@ msgid "" "Report bugs to <%s>.\n" msgstr "" -#: util/i386/pc/grub-setup.c:719 +#: util/i386/pc/grub-setup.c:721 #, c-format msgid "No device is specified.\n" msgstr "没有指定设备。\n" -#: util/i386/pc/grub-setup.c:725 +#: util/i386/pc/grub-setup.c:727 #, c-format msgid "Unknown extra argument `%s'.\n" msgstr "未知的额外参数 `%s'。\n" -#: util/i386/pc/grub-setup.c:742 +#: util/i386/pc/grub-setup.c:744 #, c-format msgid "Invalid device `%s'.\n" msgstr "无效的设备 `%s'。\n" -#: util/i386/pc/grub-setup.c:755 +#: util/i386/pc/grub-setup.c:757 #, c-format msgid "Invalid root device `%s'" msgstr "无效的根设备 `%s'" -#: util/i386/pc/grub-setup.c:768 +#: util/i386/pc/grub-setup.c:770 msgid "Cannot guess the root device. Specify the option ``--root-device''." msgstr "无法猜测根设备。请使用 ``--root-device'' 选项指定。" @@ -362,6 +379,201 @@ msgstr "" msgid "Unexpected joliet directory length %d %d %s\n" msgstr "" +#: util/mkisofs/mkisofs.c:203 +msgid "Process all files (don't skip backup files)" +msgstr "" + +#: util/mkisofs/mkisofs.c:205 +msgid "Set Abstract filename" +msgstr "" + +#: util/mkisofs/mkisofs.c:207 +msgid "Set Application ID" +msgstr "" + +#: util/mkisofs/mkisofs.c:209 +msgid "Set Bibliographic filename" +msgstr "" + +#: util/mkisofs/mkisofs.c:211 +msgid "Set Copyright filename" +msgstr "" + +#: util/mkisofs/mkisofs.c:213 +msgid "Set El Torito boot image name" +msgstr "" + +#: util/mkisofs/mkisofs.c:215 +msgid "Set El Torito boot catalog name" +msgstr "" + +#: util/mkisofs/mkisofs.c:217 +msgid "Patch Boot Info Table in El Torito boot image" +msgstr "" + +#: util/mkisofs/mkisofs.c:219 +msgid "Dummy option for backward compatibility" +msgstr "" + +#: util/mkisofs/mkisofs.c:221 +msgid "Enable floppy drive emulation for El Torito" +msgstr "" + +#: util/mkisofs/mkisofs.c:223 +msgid "Magic parameters from cdrecord" +msgstr "" + +#: util/mkisofs/mkisofs.c:225 +msgid "Omit trailing periods from filenames" +msgstr "" + +#: util/mkisofs/mkisofs.c:227 +msgid "Disable deep directory relocation" +msgstr "" + +#: util/mkisofs/mkisofs.c:229 +msgid "Follow symbolic links" +msgstr "" + +#: util/mkisofs/mkisofs.c:231 util/mkisofs/mkisofs.c:233 +msgid "Print option help" +msgstr "" + +#: util/mkisofs/mkisofs.c:235 +msgid "Print version information and exit" +msgstr "" + +#: util/mkisofs/mkisofs.c:237 +msgid "Hide ISO9660/RR file" +msgstr "" + +#: util/mkisofs/mkisofs.c:239 +msgid "Hide Joliet file" +msgstr "" + +#: util/mkisofs/mkisofs.c:241 +#, fuzzy +msgid "No longer supported" +msgstr "-i 选项已不再被支持。\n" + +#: util/mkisofs/mkisofs.c:243 +msgid "Generate Joliet directory information" +msgstr "" + +#: util/mkisofs/mkisofs.c:245 +msgid "Allow full 32 character filenames for iso9660 names" +msgstr "" + +#: util/mkisofs/mkisofs.c:247 +msgid "Allow iso9660 filenames to start with '.'" +msgstr "" + +#: util/mkisofs/mkisofs.c:249 +msgid "Re-direct messages to LOG_FILE" +msgstr "" + +#: util/mkisofs/mkisofs.c:251 +msgid "Exclude file name" +msgstr "" + +#: util/mkisofs/mkisofs.c:253 +#, fuzzy +msgid "Set path to previous session to merge" +msgstr "无法打开上一会话使用的映像 %s\n" + +#: util/mkisofs/mkisofs.c:255 +msgid "Omit version number from iso9660 filename" +msgstr "" + +#: util/mkisofs/mkisofs.c:257 +msgid "Inhibit splitting symlink components" +msgstr "" + +#: util/mkisofs/mkisofs.c:259 +msgid "Inhibit splitting symlink fields" +msgstr "" + +#: util/mkisofs/mkisofs.c:261 +msgid "Set output file name" +msgstr "" + +#: util/mkisofs/mkisofs.c:263 +msgid "Set Volume preparer" +msgstr "" + +#: util/mkisofs/mkisofs.c:265 +msgid "Print estimated filesystem size and exit" +msgstr "" + +#: util/mkisofs/mkisofs.c:267 +msgid "Set Volume publisher" +msgstr "" + +#: util/mkisofs/mkisofs.c:269 +msgid "Run quietly" +msgstr "" + +#: util/mkisofs/mkisofs.c:271 +msgid "Generate rationalized Rock Ridge directory information" +msgstr "" + +#: util/mkisofs/mkisofs.c:273 +msgid "Generate Rock Ridge directory information" +msgstr "" + +#: util/mkisofs/mkisofs.c:275 +msgid "Split output into files of approx. 1GB size" +msgstr "" + +#: util/mkisofs/mkisofs.c:277 +msgid "Set System ID" +msgstr "" + +#: util/mkisofs/mkisofs.c:279 +msgid "" +"Generate translation tables for systems that don't understand long filenames" +msgstr "" + +#: util/mkisofs/mkisofs.c:281 +msgid "Verbose" +msgstr "" + +#: util/mkisofs/mkisofs.c:283 +msgid "Set Volume ID" +msgstr "" + +#: util/mkisofs/mkisofs.c:285 +msgid "Set Volume set ID" +msgstr "" + +#: util/mkisofs/mkisofs.c:287 +msgid "Set Volume set size" +msgstr "" + +#: util/mkisofs/mkisofs.c:289 +msgid "Set Volume set sequence number" +msgstr "" + +#: util/mkisofs/mkisofs.c:291 +msgid "Exclude file name (deprecated)" +msgstr "" + +#: util/mkisofs/mkisofs.c:297 +msgid "Override creation date" +msgstr "" + +#: util/mkisofs/mkisofs.c:299 +msgid "Override modification date" +msgstr "" + +#: util/mkisofs/mkisofs.c:301 +msgid "Override expiration date" +msgstr "" + +#: util/mkisofs/mkisofs.c:303 +msgid "Override effective date" +msgstr "" + #: util/mkisofs/mkisofs.c:373 #, c-format msgid "Using \"%s\"\n" @@ -483,7 +695,8 @@ msgstr "" #: util/mkisofs/mkisofs.c:984 #, c-format -msgid "Warning: -C specified without -M: old session data will not be merged.\n" +msgid "" +"Warning: -C specified without -M: old session data will not be merged.\n" msgstr "" #: util/mkisofs/mkisofs.c:1023 @@ -544,7 +757,9 @@ msgstr "" #: util/mkisofs/multi.c:546 #, c-format -msgid "Warning: Neither Rock Ridge (-R) nor TRANS.TBL (-T) name translations were found on previous session. ISO (8.3) file names have been used instead.\n" +msgid "" +"Warning: Neither Rock Ridge (-R) nor TRANS.TBL (-T) name translations were " +"found on previous session. ISO (8.3) file names have been used instead.\n" msgstr "" #: util/mkisofs/multi.c:764 @@ -761,7 +976,8 @@ msgstr "" #: util/mkisofs/write.c:1154 #, c-format -msgid "Number of extents written different than what was predicted. Please fix.\n" +msgid "" +"Number of extents written different than what was predicted. Please fix.\n" msgstr "" #: util/mkisofs/write.c:1155 @@ -789,6 +1005,13 @@ msgstr "" msgid "Path table size(bytes): %d\n" msgstr "" +#: normal/menu_text.c:97 +#, c-format +msgid "" +"\n" +" Use the %C and %C keys to select which entry is highlighted.\n" +msgstr "" + #: util/grub.d/10_kfreebsd.in:40 msgid "%s, with kFreeBSD %s" msgstr "" From 928506da8b405370c54ad41aab44e329af143325 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 26 Nov 2009 16:50:56 +0100 Subject: [PATCH 2/3] Fix wrong segment selector --- lib/i386/relocator_asm.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/i386/relocator_asm.S b/lib/i386/relocator_asm.S index 343991d3d..bd25143e8 100644 --- a/lib/i386/relocator_asm.S +++ b/lib/i386/relocator_asm.S @@ -208,7 +208,7 @@ RELOCATOR_VARIABLE (edx) .byte 0xea RELOCATOR_VARIABLE (eip) .long 0 - .word 0x08 + .word CODE_SEGMENT /* GDT. Copied from loader/i386/linux.c. */ .p2align 4 From bd7fbf102065df36e6eea1d54edd71eb1e0767e3 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 26 Nov 2009 16:52:10 +0100 Subject: [PATCH 3/3] Prevent relocator of overwriting itself --- lib/relocator.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/lib/relocator.c b/lib/relocator.c index bebf7ada9..68260b197 100644 --- a/lib/relocator.c +++ b/lib/relocator.c @@ -16,15 +16,17 @@ * along with GRUB. If not, see . */ +#define MAX_OVERHEAD ((RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN) \ + + (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN) \ + + (RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN) \ + + (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN)) + void * PREFIX (alloc) (grub_size_t size) { char *playground; - playground = grub_malloc ((RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN) - + size - + (RELOCATOR_SIZEOF (backward) + - RELOCATOR_ALIGN)); + playground = grub_malloc (size + MAX_OVERHEAD); if (!playground) return 0; @@ -40,10 +42,7 @@ PREFIX (realloc) (void *relocator, grub_size_t size) playground = (char *) relocator - RELOCATOR_SIZEOF (forward); - playground = grub_realloc (playground, - (RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN) - + size - + (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN)); + playground = grub_realloc (playground, size + MAX_OVERHEAD); if (!playground) return 0; @@ -73,6 +72,25 @@ PREFIX (boot) (void *relocator, grub_uint32_t dest, "Relocator: source: %p, destination: 0x%x, size: 0x%x\n", relocator, dest, size); + /* Very unlikely condition: Relocator may risk overwrite itself. + Just move it a bit up. */ + if ((grub_uint8_t *) UINT_TO_PTR (dest) - (grub_uint8_t *) relocator + < RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN + && (grub_uint8_t *) UINT_TO_PTR (dest) - (grub_uint8_t *) relocator + > -(RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN)) + { + void *relocator_new = ((grub_uint8_t *) relocator) + + (RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN) + + (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN); + grub_dprintf ("relocator", "Overwrite condition detected moving " + "relocator from %p to %p\n", relocator, relocator_new); + grub_memmove (relocator_new, relocator, + (RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN) + + size + + (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN)); + relocator = relocator_new; + } + if (UINT_TO_PTR (dest) >= relocator) { int overhead;