0b412211b3
* TODO: Add note about endianness in grub-mkimage. * boot/powerpc/ieee1275/crt0.S (note): Remove unused .note section. * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Add grub-mkimage. (grub_mkimage_SOURCES): New target. * include/grub/kernel.h (grub_start_addr): Remove variable. (grub_end_addr): Likewise. (grub_total_module_size): Likewise. (grub_kernel_image_size): Likewise. (GRUB_MODULE_MAGIC): New constant. (grub_module_info): New structure. (grub_arch_modules_addr): New prototype. (grub_get_end_addr): Remove prototype. * include/grub/i386/pc/kernel.h (grub_end_addr): New prototype. * include/grub/powerpc/ieee1275/kernel.h: New file. * include/grub/util/misc.h (grub_util_get_fp_size): New prototype. (grub_util_read_at): Likewise. (grub_util_write_image_at): Likewise. * kern/main.c (grub_get_end_addr): Remove function. (grub_load_modules): Call grub_arch_modules_addr instead of using grub_end_addr. Look for a grub_module_info struct in memory. Use the grub_module_info fields instead of calling grub_get_end_addr as loop conditions. Move grub_add_unused_region code here. (grub_add_unused_region): Remove function. * kern/i386/pc/init.c: Include grub/cache.h. (grub_machine_init): Remove call to grub_get_end_addr. Remove one call to add_mem_region. (grub_arch_modules_addr): New function. * kern/powerpc/ieee1275/init.c (grub_end_addr): Remove variable. (grub_total_module_size): Likewise. Include grub/machine/kernel.h. (grub_arch_modules_addr): New function. * util/grub-emu.c (grub_end_addr): Remove variable. (grub_total_module_size): Likewise. (grub_arch_modules_addr): New function. * util/misc.c: Include unistd.h. (grub_util_get_fp_size): New function. (grub_util_read_at): Likewise. (grub_util_write_image_at): Likewise. (grub_util_read_image): Call grub_util_read_at. (grub_util_write_image): Call grub_util_write_image_at. * util/i386/pc/grub-mkimage.c (generate_image): Allocate additional memory in kernel_img for a struct grub_module_info. Fill in that grub_module_info. * util/powerpc/ieee1275/grub-mkimage.c: New file.
48 lines
1.3 KiB
ArmAsm
48 lines
1.3 KiB
ArmAsm
/* crt0.S - Startup code for the PowerPC. */
|
|
/*
|
|
* GRUB -- GRand Unified Bootloader
|
|
* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
|
*
|
|
* This program 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 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program 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 this program; if not, write to the Free Software
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*/
|
|
|
|
.extern __bss_start
|
|
.extern _end
|
|
|
|
.text
|
|
.align 2
|
|
.globl _start
|
|
_start:
|
|
li 2, 0
|
|
li 13, 0
|
|
|
|
/* Stage1 won't zero BSS for us. In other cases, why not do it again? */
|
|
lis 6, (__bss_start - 4)@h
|
|
ori 6, 6, (__bss_start - 4)@l
|
|
lis 7, (_end - 4)@h
|
|
ori 7, 7, (_end - 4)@l
|
|
subf 7, 6, 7
|
|
srwi 7, 7, 2 /* We store 4 bytes at a time. */
|
|
mtctr 7
|
|
2: stwu 2, 4(6) /* We know r2 is already 0 from above. */
|
|
bdnz 2b
|
|
|
|
bl cmain
|
|
1: b 1b
|
|
|
|
.section ".bss"
|
|
.lcomm _ppc_init_stack, 4096*2, 16
|
|
init_stack:
|
|
|