2008-01-15 Robert Millan <rmh@aybabtu.com>
* configure.ac: Add `i386-ieee1275' to the list of supported targets. * conf/i386-ieee1275.rmk: New file. * include/grub/i386/ieee1275/console.h: Likewise. * include/grub/i386/ieee1275/ieee1275.h: Likewise. * include/grub/i386/ieee1275/kernel.h: Likewise. * include/grub/i386/ieee1275/time.h: Likewise. * kern/i386/ieee1275/init.c: Likewise. * kern/i386/ieee1275/startup.S: Likewise.
This commit is contained in:
parent
d1bc1b738c
commit
3d04eab83e
8 changed files with 5277 additions and 3399 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2008-01-15 Robert Millan <rmh@aybabtu.com>
|
||||||
|
|
||||||
|
* configure.ac: Add `i386-ieee1275' to the list of supported targets.
|
||||||
|
* conf/i386-ieee1275.rmk: New file.
|
||||||
|
* include/grub/i386/ieee1275/console.h: Likewise.
|
||||||
|
* include/grub/i386/ieee1275/ieee1275.h: Likewise.
|
||||||
|
* include/grub/i386/ieee1275/kernel.h: Likewise.
|
||||||
|
* include/grub/i386/ieee1275/time.h: Likewise.
|
||||||
|
* kern/i386/ieee1275/init.c: Likewise.
|
||||||
|
* kern/i386/ieee1275/startup.S: Likewise.
|
||||||
|
|
||||||
2008-01-15 Robert Millan <rmh@aybabtu.com>
|
2008-01-15 Robert Millan <rmh@aybabtu.com>
|
||||||
|
|
||||||
* kern/misc.c (grub_vsprintf): Do not reset `longlongfmt' to zero
|
* kern/misc.c (grub_vsprintf): Do not reset `longlongfmt' to zero
|
||||||
|
|
1167
conf/i386-ieee1275.mk
Normal file
1167
conf/i386-ieee1275.mk
Normal file
File diff suppressed because it is too large
Load diff
132
conf/i386-ieee1275.rmk
Normal file
132
conf/i386-ieee1275.rmk
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
# -*- makefile -*-
|
||||||
|
|
||||||
|
COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin
|
||||||
|
COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3
|
||||||
|
COMMON_LDFLAGS = -nostdlib -static -lgcc
|
||||||
|
|
||||||
|
# Images.
|
||||||
|
pkglib_PROGRAMS = kernel.elf
|
||||||
|
|
||||||
|
# For kernel.elf.
|
||||||
|
kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \
|
||||||
|
kern/powerpc/ieee1275/init.c \
|
||||||
|
kern/powerpc/ieee1275/cmain.c kern/powerpc/ieee1275/openfw.c \
|
||||||
|
kern/main.c kern/device.c \
|
||||||
|
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
|
||||||
|
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
|
||||||
|
kern/i386/dl.c kern/parser.c kern/partition.c \
|
||||||
|
kern/env.c \
|
||||||
|
kern/ieee1275/ieee1275.c \
|
||||||
|
term/ieee1275/ofconsole.c disk/ieee1275/ofdisk.c \
|
||||||
|
symlist.c
|
||||||
|
kernel_elf_HEADERS = arg.h cache.h device.h disk.h dl.h elf.h elfload.h \
|
||||||
|
env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
|
||||||
|
partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \
|
||||||
|
ieee1275/ieee1275.h machine/kernel.h
|
||||||
|
kernel_elf_CFLAGS = $(COMMON_CFLAGS)
|
||||||
|
kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic
|
||||||
|
|
||||||
|
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
|
||||||
|
DEFSYMFILES += kernel_syms.lst
|
||||||
|
|
||||||
|
symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh
|
||||||
|
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
||||||
|
|
||||||
|
kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh
|
||||||
|
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
|
||||||
|
|
||||||
|
# Utilities.
|
||||||
|
bin_UTILITIES = grub-mkimage
|
||||||
|
sbin_UTILITIES = grub-mkdevicemap grub-probe
|
||||||
|
ifeq ($(enable_grub_emu), yes)
|
||||||
|
sbin_UTILITIES += grub-emu
|
||||||
|
endif
|
||||||
|
|
||||||
|
# For grub-mkimage.
|
||||||
|
grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \
|
||||||
|
util/resolve.c
|
||||||
|
grub_mkimage_LDFLAGS = $(LIBLZO)
|
||||||
|
|
||||||
|
# For grub-mkdevicemap.
|
||||||
|
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \
|
||||||
|
util/i386/get_disk_name.c
|
||||||
|
|
||||||
|
# For grub-probe.
|
||||||
|
util/grub-probe.c_DEPENDENCIES = grub_probe_init.h
|
||||||
|
grub_probe_SOURCES = util/grub-probe.c \
|
||||||
|
util/biosdisk.c util/misc.c util/getroot.c \
|
||||||
|
kern/device.c kern/disk.c kern/err.c kern/misc.c fs/fat.c \
|
||||||
|
fs/ext2.c kern/parser.c kern/partition.c \
|
||||||
|
partmap/pc.c partmap/apple.c partmap/gpt.c \
|
||||||
|
fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/ntfs.c fs/ntfscomp.c \
|
||||||
|
fs/xfs.c fs/affs.c fs/sfs.c fs/hfsplus.c \
|
||||||
|
kern/fs.c \
|
||||||
|
kern/env.c fs/fshelp.c \
|
||||||
|
disk/lvm.c disk/raid.c grub_probe_init.c
|
||||||
|
|
||||||
|
# For grub-emu.
|
||||||
|
grub_emu_DEPENDENCIES = grub_script.tab.c grub_script.tab.h \
|
||||||
|
grub_emu_init.h
|
||||||
|
grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
|
||||||
|
commands/configfile.c commands/echo.c commands/help.c \
|
||||||
|
commands/terminal.c commands/ls.c commands/test.c \
|
||||||
|
commands/search.c commands/blocklist.c commands/hexdump.c \
|
||||||
|
commands/ieee1275/halt.c commands/ieee1275/reboot.c \
|
||||||
|
commands/i386/cpuid.c \
|
||||||
|
disk/host.c disk/loopback.c disk/raid.c disk/lvm.c \
|
||||||
|
fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \
|
||||||
|
fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c fs/hfsplus.c \
|
||||||
|
fs/ntfs.c fs/ntfscomp.c fs/cpio.c \
|
||||||
|
io/gzio.c \
|
||||||
|
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
|
||||||
|
kern/err.c \
|
||||||
|
normal/execute.c kern/file.c kern/fs.c normal/lexer.c \
|
||||||
|
kern/loader.c kern/main.c kern/misc.c kern/parser.c \
|
||||||
|
grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \
|
||||||
|
normal/arg.c normal/cmdline.c normal/command.c normal/function.c\
|
||||||
|
normal/completion.c normal/main.c \
|
||||||
|
normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \
|
||||||
|
normal/color.c \
|
||||||
|
partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \
|
||||||
|
partmap/acorn.c partmap/gpt.c \
|
||||||
|
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
|
||||||
|
util/biosdisk.c util/getroot.c \
|
||||||
|
util/i386/pc/misc.c grub_emu_init.c
|
||||||
|
|
||||||
|
grub_emu_LDFLAGS = $(LIBCURSES)
|
||||||
|
|
||||||
|
# Modules.
|
||||||
|
pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod
|
||||||
|
|
||||||
|
# For normal.mod.
|
||||||
|
normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h
|
||||||
|
normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \
|
||||||
|
normal/completion.c normal/execute.c \
|
||||||
|
normal/function.c normal/lexer.c normal/main.c normal/menu.c \
|
||||||
|
normal/menu_entry.c normal/misc.c grub_script.tab.c \
|
||||||
|
normal/script.c normal/i386/setjmp.S normal/color.c
|
||||||
|
normal_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
|
normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
||||||
|
normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
||||||
|
# For suspend.mod
|
||||||
|
suspend_mod_SOURCES = commands/ieee1275/suspend.c
|
||||||
|
suspend_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
|
suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
||||||
|
# For reboot.mod
|
||||||
|
reboot_mod_SOURCES = commands/ieee1275/reboot.c
|
||||||
|
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
|
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
||||||
|
# For halt.mod
|
||||||
|
halt_mod_SOURCES = commands/ieee1275/halt.c
|
||||||
|
halt_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
|
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
||||||
|
# For cpuid.mod.
|
||||||
|
cpuid_mod_SOURCES = commands/i386/cpuid.c
|
||||||
|
cpuid_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
|
cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
||||||
|
include $(srcdir)/conf/common.mk
|
|
@ -88,10 +88,10 @@
|
||||||
/* Define to the version of this package. */
|
/* Define to the version of this package. */
|
||||||
#undef PACKAGE_VERSION
|
#undef PACKAGE_VERSION
|
||||||
|
|
||||||
/* The size of a `long', as computed by sizeof. */
|
/* The size of `long', as computed by sizeof. */
|
||||||
#undef SIZEOF_LONG
|
#undef SIZEOF_LONG
|
||||||
|
|
||||||
/* The size of a `void *', as computed by sizeof. */
|
/* The size of `void *', as computed by sizeof. */
|
||||||
#undef SIZEOF_VOID_P
|
#undef SIZEOF_VOID_P
|
||||||
|
|
||||||
/* Define it to either start or _start */
|
/* Define it to either start or _start */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
# Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
|
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This configure.ac is free software; the author
|
# This configure.ac is free software; the author
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
@ -79,6 +79,7 @@ case "$target_cpu"-"$platform" in
|
||||||
i386-efi) ;;
|
i386-efi) ;;
|
||||||
i386-pc) ;;
|
i386-pc) ;;
|
||||||
i386-linuxbios) ;;
|
i386-linuxbios) ;;
|
||||||
|
i386-ieee1275) ;;
|
||||||
powerpc-ieee1275) ;;
|
powerpc-ieee1275) ;;
|
||||||
sparc64-ieee1275) ;;
|
sparc64-ieee1275) ;;
|
||||||
*) AC_MSG_ERROR([unsupported machine type]) ;;
|
*) AC_MSG_ERROR([unsupported machine type]) ;;
|
||||||
|
|
26
kern/i386/ieee1275/init.c
Normal file
26
kern/i386/ieee1275/init.c
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/* init.c -- Initialize GRUB on Open Firmware. */
|
||||||
|
/*
|
||||||
|
* GRUB -- GRand Unified Bootloader
|
||||||
|
* Copyright (C) 2003,2004,2005,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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <grub/types.h>
|
||||||
|
|
||||||
|
void
|
||||||
|
grub_arch_sync_caches (void *address __attribute__ ((unused)),
|
||||||
|
grub_size_t len __attribute__ ((unused)))
|
||||||
|
{
|
||||||
|
}
|
38
kern/i386/ieee1275/startup.S
Normal file
38
kern/i386/ieee1275/startup.S
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* GRUB -- GRand Unified Bootloader
|
||||||
|
* Copyright (C) 1999,2000,2001,2002,2003,2005,2006,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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ASM_FILE 1
|
||||||
|
|
||||||
|
#include <grub/symbol.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note: GRUB is compiled with the options -mrtd and -mregparm=3.
|
||||||
|
* So the first three arguments are passed in %eax, %edx, and %ecx,
|
||||||
|
* respectively, and if a function has a fixed number of arguments
|
||||||
|
* and the number if greater than three, the function must return
|
||||||
|
* with "ret $N" where N is ((the number of arguments) - 3) * 4.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.file "startup.S"
|
||||||
|
.text
|
||||||
|
.globl start, _start
|
||||||
|
|
||||||
|
start:
|
||||||
|
_start:
|
||||||
|
movl %eax, %ecx
|
||||||
|
jmp EXT_C(cmain)
|
Loading…
Reference in a new issue