merge mainline into nestpart

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-03-26 15:44:13 +01:00
commit c9ea504d25
170 changed files with 4270 additions and 3366 deletions

View file

@ -25,6 +25,8 @@ docs/version.texi
*.exec
genkernsyms.sh
gensymlist.sh
gentrigtables
grub-bin2h
grub-dumpbios
grub-editenv
grub-emu
@ -40,8 +42,13 @@ grub-pe2elf
grub-probe
grub_probe_init.c
grub_probe_init.h
grub-reboot
grub-script-check
grub_script_check_init.c
grub_script_check_init.h
grub_script.tab.c
grub_script.tab.h
grub-set-default
grub-setup
grub_setup_init.c
grub_setup_init.h
@ -62,4 +69,5 @@ stamp-h
stamp-h1
stamp-h.in
symlist.c
trigtables.c
update-grub_lib

846
ChangeLog
View file

@ -1,3 +1,849 @@
2010-03-24 Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
* kern/dl.c (grub_dl_resolve_symbols): Improve error message
grammar.
2010-03-24 Colin Watson <cjwatson@ubuntu.com>
* .bzrignore: Add grub-bin2h, grub-reboot, and grub-set-default.
2010-03-21 Colin Watson <cjwatson@ubuntu.com>
* util/grub-install.in: Copy .mo files from @datadir@/locale, to
match where 'make install' puts them.
* util/i386/efi/grub-install.in: Likewise.
2010-03-19 Colin Watson <cjwatson@ubuntu.com>
* .bzrignore: Add gentrigtables, grub-script-check,
grub_script_check_init.c, grub_script_check_init.h, and
trigtables.c.
2010-03-18 Vladimir Serbinenko <phcoder@gmail.com>
* kern/parser.c: Indented.
2010-03-17 Vladimir Serbinenko <phcoder@gmail.com>
* term/i386/pc/vesafb.c: Removed (orphaned, deprecated and broken).
2010-03-17 Vladimir Serbinenko <phcoder@gmail.com>
* video/fb/fbblit.c (grub_video_fbblit_blend_XXXA8888_1bit): Handle
alpha_mask_size == 0 case.
2010-03-14 BVK Chaitanya <bvk.groups@gmail.com>
GRUB shell lexer and parser improvements.
* conf/any-emu.rmk: Build rule updates.
* conf/common.rmk: Likewise.
* conf/i386-coreboot.rmk: Likewise.
* conf/i386-efi.rmk: Likewise.
* conf/i386-ieee1275.rmk: Likewise.
* conf/i386-pc.rmk: Likewise.
* conf/powerpc-ieee1275.rmk: Likewise.
* conf/x86_64-efi.rmk: Likewise.
* configure.ac: Configure check for flex.
* include/grub/script_sh.h (grub_script_arg_type_t): More argument
types.
(grub_lexer_param): Struct member updates.
(grub_parser_param): Likewise.
(GRUB_LEXER_TOKEN_MAX): Maximum token size.
(GRUB_LEXER_RECORD_INCREMENT): Memory increments' size.
(grub_script_lexer_init): Prototype update.
(grub_script_lexer_record_start): Likewise.
(grub_script_lexer_record_stop): Likewise.
(grub_script_lexer_yywrap): New function prototype.
(grub_script_lexer_fini): Likewise.
(grub_script_execute_argument_to_string): Removed by...
(grub_script_execute_argument_to_argv): ...better version.
* script/execute.c (ROUND_UPTO): New macro.
(grub_script_execute_cmdline): Out of memory fixes.
(grub_script_execute_menuentry): Likewise.
(grub_script_execute_argument_to_string): Removed. Update all
users by...
(grub_script_execute_argument_to_argv): ...better version.
* script/function.c (grub_script_function_create): Use
grub_script_execute_argument_to_argv instead of
grub_script_execute_argument_to_string.
* script/lexer.c (check_varstate): Removed.
(check_textstate): Removed.
(grub_script_lexer_record_start): Likewise.
(grub_script_lexer_record_stop): Likewise.
(recordchar): Replaced with...
(grub_script_lexer_record): ...new function.
(nextchar): Removed.
(grub_script_lexer_init): Rewritten.
(grub_script_yylex): Rewritten.
(append_newline): New function.
(grub_script_lexer_yywrap): New function.
(grub_script_lexer_fini): New function.
(grub_script_yyerror): Sets error flag.
* script/yylex.l: New file.
(grub_lexer_yyfree): Wrapper for flex yyffre.
(grub_lexer_yyalloc): Likewise.
(grub_lexer_yyrealloc): Likewise.
* script/parser.y: Refactored.
* script/script.c (grub_script_arg_add): Out of memory fixes.
(grub_script_add_arglist): Likewise.
(grub_script_create_cmdline): Likewise.
(grub_script_create_cmdmenu): Likewise.
(grub_script_add_cmd): Likewise.
(grub_script_parse): Use grub_script_lexer_fini to deallocated.
* util/grub-script-check.c (grub_script_execute_menuentry): Remove
unnecessary code.
* tests/grub_script_echo1.in: New testcase.
* tests/grub_script_vars1.in: New testcase.
* tests/grub_script_echo_keywords.in: New testcase.
2010-03-14 Vladimir Serbinenko <phcoder@gmail.com>
Remove some redundancy in build system.
* Makefile.in (TARGET_CFLAGS): Add -ffreestanding.
(TARGET_ASFLAGS): Add -nostdinc -fno-builtin.
(TARGET_LDFLAGS): Add -nostdlib.
(TARGET_IMG_LDFLAGS): Likewise.
* commands/lsmmap.c (grub_cmd_lsmmap) [GRUB_MACHINE_EMU]: Don't do
anything since mmap isn't available.
* conf/any-emu.rmk (kernel_img_SOURCES): Remove commands/boot.c.
Add util/time.c.
(pkglib_MODULES): Remove reboot.mod.
(reboot_mod_SOURCES): Removed.
(reboot_mod_CFLAGS): Likewise.
(reboot_mod_LDFLAGS): Likewise.
* conf/common.rmk (script/lexer.c_DEPENDENCIES): New variable.
(MOSTLYCLEANFILES): Add symlist.c kernel_syms.lst.
(DEFSYMFILES): Add kernel_syms.lst.
(kernel_img_HEADERS): Add common headers.
(symlist.c): New target.
(kernel_syms.lst): Likewise.
(pkglib_MODULES): Add memdisk.mod.
(memdisk_mod_SOURCES): New variable.
(memdisk_mod_CFLAGS): Likewise.
(memdisk_mod_LDFLAGS): Likewise.
(pkglib_MODULES): Add reboot.mod.
(reboot_mod_SOURCES): New variable.
(reboot_mod_CFLAGS): Likewise.
(reboot_mod_LDFLAGS): Likewise.
(pkglib_MODULES): Add date.mod.
(date_mod_SOURCES): New variable.
(date_mod_CFLAGS): Likewise.
(date_mod_LDFLAGS): Likewise.
(pkglib_MODULES): Add datehook.mod.
(datehook_mod_SOURCES): New variable.
(datehook_mod_CFLAGS): Likewise.
(datehook_mod_LDFLAGS): Likewise.
(pkglib_MODULES): Add lsmmap.mod.
(lsmmap_mod_SOURCES): New variable.
(lsmmap_mod_CFLAGS): Likewise.
(lsmmap_mod_LDFLAGS): Likewise.
(pkglib_MODULES): Add boot.mod.
(boot_mod_SOURCES): New variable.
(boot_mod_CFLAGS): Likewise.
(boot_mod_LDFLAGS): Likewise.
* conf/i386-coreboot.rmk: Removed redundant parts.
* conf/i386-ieee1275.rmk: Likewise.
* conf/i386-pc.rmk: Likewise.
* conf/mips-yeeloong.rmk: Likewise.
* conf/mips.rmk: Likewise.
* conf/powerpc-ieee1275.rmk: Likewise.
* conf/sparc64-ieee1275.rmk: Likewise.
* conf/x86_64-efi.rmk: Likewise.
* conf/i386-coreboot.rmk: Moved qemu parts ..
* conf/i386-qemu.rmk: ... here
* conf/i386-efi.rmk: Moved common parts to...
* conf/x86-efi.rmk: ... here.
* conf/i386.rmk: Added modules common to all x86 variants.
* configure.ac: Add -m32/-m64 to TARGET_ASFLAGS.
* disk/memdisk.c: Remove grub/machine/kernel.h.
* gensymlist.sh.in: Include symbol.h.
* hook/datehook.c: Correct module name.
* include/grub/datetime.h (grub_get_datetime) [GRUB_MACHINE_EMU]: Export.
(grub_set_datetime) [GRUB_MACHINE_EMU]: Likewise.
* include/grub/i386/efi/serial.h: New file.
* include/grub/x86_64/efi/serial.h: Likewise.
* util/time.c: Likewise.
* video/ieee1275.c (grub_video_ieee1275_setup): Handle 64-bit void *.
2010-03-14 Colin King <colin.king@ubuntu.com>
2010-03-14 Colin Watson <cjwatson@ubuntu.com>
Shrink the pre-partition-table part of boot.img by eight bytes.
* boot/i386/pc/boot.S (ERR): New macro.
(chs_mode): Use ERR.
(geometry_error): Likewise.
(hd_probe_error): Remove. This is only used once, so we wrwite
it inline instead.
(read_error): Instead of printing read_error_string, just set up
%si and fall through to ...
(error_message): ... this new function, also used by ERR.
2010-03-14 Colin Watson <cjwatson@ubuntu.com>
Speed up consecutive hostdisk operations on the same device.
* util/hostdisk.c (struct grub_util_biosdisk_data): New structure.
(grub_util_biosdisk_open): Initialise disk->data.
(struct linux_partition_cache): New structure.
(linux_find_partition): Cache partition start positions; these are
expensive to compute on every read and write.
(open_device): Cache open file descriptor in disk->data, so that we
don't have to reopen it and flush the buffer cache for consecutive
operations on the same device.
(grub_util_biosdisk_close): New function.
(grub_util_biosdisk_dev): Set `close' member.
* conf/common.rmk (grub_probe_SOURCES): Add kern/list.c.
* conf/i386-efi.rmk (grub_setup_SOURCES): Likewise.
* conf/i386-pc.rmk (grub_setup_SOURCES): Likewise.
* conf/sparc64-ieee1275.rmk (grub_setup_SOURCES): Likewise.
* conf/x86_64-efi.rmk (grub_setup_SOURCES): Likewise.
2010-03-14 Vladimir Serbinenko <phcoder@gmail.com>
Compile parts of grub-emu as modules.
* Makefile.in (TARGET_CPPFLAGS) [emu]: Remove -nostdinc -isystem.
(pkglib_DATA) [emu]: Remove moddep.lst command.lst fs.lst
partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst.
(all-local): Add $(GRUB_EMU).
(install-local): Install $(GRUB_EMU).
(uninstall): Uninstall $(GRUB_EMU).
* commands/parttool.c: Replace GRUB_UTIL with GRUB_NO_MODULES.
* kern/dl.c: Likewise.
* commands/sleep.c: Not include machine/time.h.
* conf/any-emu.rmk (COMMON_LDFLAGS): New variable.
(COMMON_CFLAGS): Likewise.
(sbin_UTILITIES): Remove grub-emu.
(grub_emu_SOURCES): Removed.
(kernel_img_RELOCATABLE): New variable.
(pkglib_PROGRAMS): Add kernel.img.
(kernel_img_SOURCES): New variable
(kernel_img_CFLAGS): Likewise.
(kernel_img_LDFLAGS): Likewise.
(TARGET_NO_STRIP): Likewise.
(TARGET_NO_DYNAMIC_MODULES): Likewise.
(pkglib_MODULES): Add progname.mod, hostfs.mod, host.mod, reboot.mod,
halt.mod, cpuid.mod, usb.mod, sdl.mod and pci.mod.
(grub-emu): New target.
(GRUB_EMU): New variable.
* configure.ac: Whitelist -emu as possible x86_64 architecture.
* efiemu/main.c: Replace GRUB_UTIL with GRUB_MACHINE_EMU.
* loader/xnu.c: Likewise.
* include/grub/pci.h: Likewise.
* genemuinit.sh: New file.
* genemuinitheader.sh: Likewise.
* genmk.rb: Don't strip if TARGET_NO_STRIP is yes.
Support TARGET_NO_DYNAMIC_MODULES.
* include/grub/dl.h (GRUB_NO_MODULES): New variable.
* commands/search.c: Fix GRUB_MOD_INIT and GRUB_MOD_FINI arguments.
* disk/loopback.c: Likewise.
* font/font_cmd.c: Likewise.
* partmap/acorn.c: Likewise.
* partmap/amiga.c: Likewise.
* partmap/apple.c: Likewise.
* partmap/gpt.c: Likewise.
* partmap/msdos.c: Likewise.
* partmap/sun.c: Likewise.
* parttool/msdospart.c: Likewise.
* term/gfxterm.c: Likewise.
* video/bitmap.c: Likewise.
* video/readers/jpeg.c: Likewise.
* video/readers/png.c: Likewise.
* video/readers/tga.c: Likewise.
* video/video.c: Likewise.
* util/grub-emu.c (read_command_list): Removed.
(main): Don't call util_init_nls.
* util/misc.c (grub_err_printf) [!GRUB_UTIL]: Removed.
(grub_util_init_nls) [!GRUB_UTIL]: Likewise.
2010-03-14 Vladimir Serbinenko <phcoder@gmail.com>
* conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add datetime.mod,
date.mod, datehook.mod.
(datetime_mod_SOURCES): New variable.
(datetime_mod_CFLAGS): Likewise.
(datetime_mod_LDFLAGS): Likewise.
(date_mod_SOURCES): Likewise.
(date_mod_CFLAGS): Likewise.
(date_mod_LDFLAGS): Likewise.
(datehook_mod_SOURCES): Likewise.
(datehook_mod_CFLAGS): Likewise.
(datehook_mod_LDFLAGS): Likewise.
* conf/sparc64-ieee1275.rmk: Likewise.
* lib/ieee1275/datetime.c: New file.
2010-03-14 Vladimir Serbinenko <phcoder@gmail.com>
* conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add ieee1275_fb.mod.
(ieee1275_fb_mod_SOURCES): New variable.
(ieee1275_fb_mod_CFLAGS): Likewise.
(ieee1275_fb_mod_LDFLAGS): Likewise.
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_devices_iterate):
New proto.
* kern/ieee1275/init.c (HEAP_MAX_SIZE): Increased.
(HEAP_MAX_ADDR): Likewise.
* kern/ieee1275/openfw.c (grub_children_iterate): Don't skip empty
type.
Correct stop condition.
(grub_ieee1275_devices_iterate): New function.
* video/ieee1275.c: New file.
2010-03-14 Vladimir Serbinenko <phcoder@gmail.com>
Merge sparc grub-mkimage into generic grub-mkimage and a.out support.
* boot/sparc64/ieee1275/boot.S (boot_continue): Use SCRATCH_PAD_BOOT
as scratch.
* boot/sparc64/ieee1275/diskboot.S (after_info_block): Use
SCRATCH_PAD_DISKBOOT as scratch.
(bootit): Pass Openfirmware pointer in %o4.
* conf/sparc64-ieee1275.rmk (kernel_img_LDFLAGS): Link at 0x4400 instead
of 0x200000.
(grub_mkimage_SOURCES): Replace util/sparc64/ieee1275/grub-mkimage.c
with util/grub-mkrawimage.c.
* configure.ac: Handle GRUB_MACHINE_SPARC64 and GRUB_MACHINE_MIPS.
* include/grub/aout.h (AOUT_MID_SUN): New definition.
(grub_aout_get_type) [GRUB_UTIL]: Removed.
(grub_aout_load) [GRUB_UTIL]: Likewise.
* include/grub/kernel.h (grub_modules_get_end): New proto.
* include/grub/sparc64/ieee1275/boot.h (SCRATCH_PAD): Removed.
(SCRATCH_PAD_BOOT): New definition.
(SCRATCH_PAD_DISKBOOT): Likewise.
(GRUB_BOOT_MACHINE_IMAGE_ADDRESS): Set to 0x4400.
* include/grub/sparc64/ieee1275/ieee1275.h
(grub_ieee1275_original_stack): New variable
* include/grub/sparc64/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE):
New definition
(GRUB_KERNEL_MACHINE_STACK_SIZE): Likewise.
(GRUB_PLATFORM_IMAGE_FORMATS): Likewise.
(GRUB_PLATFORM_IMAGE_DEFAULT_FORMAT): Likewise.
(GRUB_PLATFORM_IMAGE_DEFAULT): Likewise.
(GRUB_PLATFORM_IMAGE_RAW): Likewise.
(GRUB_PLATFORM_IMAGE_AOUT): Likewise.
(grub_platform_image_format_t): New type.
* kern/mips/yeeloong/init.c (grub_modules_get_end): Move from here ...
* kern/main.c (grub_modules_get_end)
[GRUB_MACHINE_MIPS_YEELOONG || GRUB_MACHINE_SPARC64]: ... here.
* kern/sparc64/ieee1275/crt0.S: Store firmware entry point in %o0.
(codestart): Switch stacks.
* kern/sparc64/ieee1275/init.c (grub_ieee1275_original_stack): New
variable.
(grub_heap_init): Use grub_modules_get_end.
* loader/sparc64/ieee1275/linux.c (grub_linux_boot): Restore original
stack.
* util/grub-mkrawimage.c (generate_image): Support sparc64.
(main): Likewise.
* util/sparc64/ieee1275/grub-mkimage.c: Removed.
2010-03-14 Thorsten Glaser <tg@mirbsd.org>
* util/grub-mkrescue.in: Base ISO UUID on UTC.
2010-03-08 Matt Kraai <kraai@ftbfs.org>
* util/i386/pc/grub-setup.c (setup): Fix a grammatical error (Debian
bug #559005).
2010-03-07 Vladimir Serbinenko <phcoder@gmail.com>
* genmoddep.awk: Output all missing symbols and not only first.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* NEWS: Put the date of 1.98 release.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Update CPPFLAGS and not CFLAGS when checking for
ft2build.h.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* normal/cmdline.c (grub_cmdline_get): Fix gabled line after
completition in the middle of string.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkrescue.in: Use mktemp with explicit template.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* loader/i386/bsd.c (grub_bsd_get_device): Fix a memory leak.
2010-03-06 Vladimir Serbinenko <phcoder@gmail.com>
* loader/i386/multiboot_mbi.c (grub_multiboot_set_bootdev): Free the
right pointer.
2010-03-05 Vladimir Serbinenko <phcoder@gmail.com>
Fix FreeBSD compilation.
* Makefile.in (TARGET_CPPFLAGS): Remove -nostdinc -isystem.
* configure.ac: Add -nostdinc -isystem to TARGET_CPPFLAGS if it works.
2010-03-05 Vladimir Serbinenko <phcoder@gmail.com>
* util/import_gcry.py: Add autogenerated files to MAINTAINER_CLEANFILES.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* gettext/gettext.c (grub_gettext_init_ext): Fix a memory leak.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* disk/scsi.c (grub_scsi_iterate): Fix a memory leak.
2010-03-04 Robert Millan <rmh.grub@aybabtu.com>
Support relative image path in theme file.
* gfxmenu/gui_image.c (grub_gui_image): New member theme_dir.
(image_set_property): Handle theme_dir and relative path.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Alias amd64 to x86_64.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* NEWS: mention multiboot on EFI.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* kern/main.c (grub_load_modules): Handle errors from init functions of
embeded modules.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* normal/autofs.c (autoload_fs_module): Handle errors.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
Disable linux.mod on qemu-mips since it's not functional and leads
to compilation failure.
* conf/mips.rmk (pkglib_MODULES): Remove linux.mod.
* conf/mips-yeeloong.rmk (pkglib_MODULES): Add linux.mod.
* conf/mips.rmk (linux_mod_SOURCES): Move from here ...
* conf/mips-yeeloong.rmk (linux_mod_SOURCES): ... here
* conf/mips.rmk (linux_mod_CFLAGS): Move from here ...
* conf/mips-yeeloong.rmk (linux_mod_CFLAGS): ... here
* conf/mips.rmk (linux_mod_ASFLAGS): Move from here ...
* conf/mips-yeeloong.rmk (linux_mod_ASFLAGS): ... here
* conf/mips.rmk (linux_mod_LDFLAGS): Move from here ...
* conf/mips-yeeloong.rmk (linux_mod_LDFLAGS): ... here
Reported by: BVK Chaitanya
2010-03-04 Jordan Uggla <jordan.uggla@gmail.com>
* INSTALL: Add gettext as a dependency and add qemu to a new section
"Prerequisites for make-check".
2010-03-04 Christian Franke <franke@computer.org>
* util/grub-pe2elf.c: Add missing include "progname.h".
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* normal/crypto.c (read_crypto_list): Fix a typo.
Reported by: Seth Goldberg.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* Makefile.in (DISTCLEANFILES): Add stamp-h1.
Reported by: Seth Goldberg.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* Makefile.in (CLEANFILES) [FONT_SOURCE && grub_mkfont]: Add
ascii.bitmaps.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* genmk.rb: Remove terminal*.lst in make clean.
Reported by: Seth Goldberg.
2010-03-04 Vladimir Serbinenko <phcoder@gmail.com>
* util/i386/efi/grub-install.in: Copy gettext files.
2010-03-01 Vladimir Serbinenko <phcoder@gmail.com>
* fs/ext2.c (grub_ext2_read_block): Fix an integer overflow.
2010-03-01 Vladimir Serbinenko <phcoder@gmail.com>
Wait for user entry basing on presence of output rather than on errors.
* include/grub/normal.h (grub_normal_get_line_counter): New proto.
(grub_install_newline_hook): Likewise.
* normal/main.c (GRUB_MOD_INIT): Call grub_install_newline_hook.
* normal/menu.c (show_menu): Check line_counter to determine presence
of output.
* normal/term.c (grub_normal_line_counter): New variable.
(grub_normal_get_line_counter): New function.
(grub_install_newline_hook): Likewise.
2010-03-01 Vladimir Serbinenko <phcoder@gmail.com>
* commands/cat.c (grub_cmd_cat): Propagate grub_gzfile_open error.
2010-03-01 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Update version to 1.98.
2010-02-26 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub.d/10_linux.in (linux_entry): Don't default to
gfxpayload=keep if Linux doesn't support video handover.
2010-02-25 Vladimir Serbinenko <phcoder@gmail.com>
Don't compile video modules on yeeloong since video subsystem is part
of kernel.
* conf/common.rmk (pkglib_MODULES) [yeeloong]: Remove video.mod,
video_fb.mod, bitmap.mod, font.mod, gfxterm.mod and bufio.mod
* conf/mips-yeeloong.rmk (kernel_img_HEADERS): Add bitmap.h,
video.h, gfxterm.h, font.h, bitmap_scale.h and bufio.h.
* conf/mips.rmk (kernel_img_HEADERS): Add values instead of overwriting.
* include/grub/bitmap.h: Add EXPORT_FUNC and EXPORT_VAR.
* include/grub/bitmap_scale.h: Likewise.
* include/grub/bufio.h: Likewise.
* include/grub/font.h: Likewise.
* include/grub/gfxterm.h: Likewise.
* include/grub/video.h: Likewise.
* include/grub/vbe.h: Don't include video_fb.h.
* video/i386/pc/vbe.c: Include video_fb.h.
* commands/i386/pc/vbetest.c: Include video.h.
2010-02-25 Jordan Uggla <jordan.uggla@gmail.com>
* util/grub-mkconfig.in (GRUB_SAVEDEFAULT): Export new variable.
* util/grub-mkconfig_lib.in (save_default_entry): Only save a new
default entry if GRUB_SAVEDEFAULT=true. This allows using
GRUB_DEFAULT=saved on its own to let grub-reboot work, without
saving a new default on every boot.
2010-02-24 Vladimir Serbinenko <phcoder@gmail.com>
* normal/crypto.c (read_crypto_list): Fix a memory leak.
* normal/term.c (read_terminal_list): Likewise.
* normal/main.c (grub_normal_init_page): Likewise.
(grub_normal_read_line_real): Likewise.
2010-02-24 Vladimir Serbinenko <phcoder@gmail.com>
* loader/i386/multiboot_mbi.c (grub_multiboot_set_bootdev): Fix a
memory leak.
Reported by: Seth Goldberg.
2010-02-24 Joey Korkames <joey+lists@kidfixit.com>
* term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Remove
duplicate declaration of `start'.
2010-02-20 Vladimir Serbinenko <phcoder@gmail.com>
* fs/iso9660.c (grub_iso9660_iterate_dir): Strip version from joliet
filename.
Reported by: Georgy Buranov
2010-02-20 Carles Pina i Estany <carles@pina.cat>
* util/grub-mkrawimage.c (usage): Change string formatting to
improve gettext.
2010-02-20 Manoel Rebelo Abranches <mrabran@br.ibm.com>
* term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Add delete and
backspace keys.
2010-02-20 Vladimir Serbinenko <phcoder@gmail.com>
* video/fb/video_fb.c (grub_video_fb_scroll): Fix a pixel size bug.
Reported by: Michael Suchanek.
2010-02-18 Samuel Thibault <samuel.thibault@ens-lyon.org>
* util/grub-mkconfig.in: Export GRUB_INIT_TUNE.
* util/grub.d/00_header.in: Handle GRUB_INIT_TUNE.
2010-02-16 Vladimir Serbinenko <phcoder@gmail.com>
Remove any reference to non-free fonts.
* commands/videotest.c (grub_cmd_videotest): Use unifont by default.
* docs/gfxmenu-theme-example.txt: Removed. It's both outdated and
uses non-free components.
* font/font.c (grub_font_get_name): Remove example name.
* gfxmenu/gui_label.c (grub_gui_label_new): Use unifont by default.
* gfxmenu/gui_list.c (grub_gui_list_new): Likewise.
* gfxmenu/gui_progress_bar.c (grub_gui_progress_bar_new): Likewise.
* gfxmenu/view.c (grub_gfxmenu_view_new): Likewise.
2010-02-16 Georgy Buranov <gburanov@gmail.com>
* disk/efi/efidisk.c (grub_efidisk_get_device_name): Fix a typo.
2010-02-15 Vladimir Serbinenko <phcoder@gmail.com>
* term/serial.c (serial_get_divisor) [GRUB_MACHINE_MIPS_YEELOONG]:
Double divisor.
(serial_hw_init) [GRUB_MACHINE_MIPS_YEELOONG]: Don't enable advanced
features.
(GRUB_MOD_INIT) [GRUB_MACHINE_MIPS_YEELOONG]: Default to 115200.
2010-02-15 Vladimir Serbinenko <phcoder@gmail.com>
* gensymlist.sh.in: Use TARGET_CC instead of CC.
2010-02-14 Samuel Thibault <samuel.thibault@ens-lyon.org>
* commands/i386/pc/play.c (GRUB_MOD_INIT(play)): Fix help.
* docs/grub.texi (Command-line and menu entry commands): Document play
command.
2010-02-14 Samuel Thibault <samuel.thibault@ens-lyon.org>
* commands/i386/pc/play.c (grub_cmd_play): If grub_file_open fails,
parse arguments as inline tempo and notes. Move code for playing notes
to...
(play): ... new function.
2010-02-14 Samuel Thibault <samuel.thibault@ens-lyon.org>
* commands/i386/pc/play.c (T_REST, T_FINE, struct note, beep_on): Use
grub_uint16_t instead of short.
(grub_cmd_play): Use grub_uint32_t instead of int, convert data from
disk from little endian to cpu endianness.
2010-02-07 Samuel Thibault <samuel.thibault@ens-lyon.org>
* commands/i386/pc/play.c (BASE_TEMPO): Set to 60 *
GRUB_TICKS_PER_SECOND instead of 120.
2010-02-14 Vladimir Serbinenko <phcoder@gmail.com>
* term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Wait for possible
escape sequence after \e.
2010-02-14 Vladimir Serbinenko <phcoder@gmail.com>
* term/ieee1275/ofconsole.c (grub_ofconsole_putchar): Don't output
non-ASCII characters.
2010-02-14 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Enclose
set root in single quotes to prevent \, from being unescaped.
2010-02-14 Vladimir Serbinenko <phcoder@gmail.com>
Prevent unknown commands from stopping menuentry execution.
* script/execute.c (grub_script_execute_cmdline): Print error after
unknown command.
2010-02-14 Vladimir Serbinenko <phcoder@gmail.com>
* fs/i386/pc/pxe.c (GRUB_MOD_INIT): Fix typo.
Reported by: Pavel Pisa.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* io/gzio.c (grub_gzio_open): Use grub_zalloc.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
Merge grub_ieee1275_map_physical into grub_map and rename to
grub_ieee1275_map
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_map): New proto.
* include/grub/sparc64/ieee1275/ieee1275.h (grub_ieee1275_map_physical):
Remove.
* kern/ieee1275/openfw.c (grub_map): Rename to ...
(grub_ieee1275_map): ... this. All users updated. Add phys_lo when
necessary.
* kern/sparc64/ieee1275/ieee1275.c (grub_ieee1275_map_physical): Remove.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* disk/ieee1275/ofdisk.c (grub_ofdisk_open): Check device type before
opening and not after.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Macroify
constants.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* loader/sparc64/ieee1275/linux.c (align_addr): Remove.
(alloc_phys): Use ALIGN_UP instead of align_addr.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* loader/sparc64/ieee1275/linux.c (alloc_phys): Correct bounds checking.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* kern/sparc64/ieee1275/crt0.S (codestart): Move modules backwards.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* disk/ieee1275/ofdisk.c (grub_ofdisk_read): Remove excessively
verbose dprintf.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
Fix over-4GiB seek on sparc64.
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_seek):
Replace pos_i and pos_lo with pos. All users updated.
* include/grub/powerpc/ieee1275/ieee1275.h (GRUB_IEEE1275_CELL_SIZEOF):
New constant.
* include/grub/sparc64/ieee1275/ieee1275.h (GRUB_IEEE1275_CELL_SIZEOF):
Likewise.
* kern/ieee1275/ieee1275.c (grub_ieee1275_seek): Split pos into pos_hi
and pos_lo.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkrawimage.c (main): Call set_program_name.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
Properly align 64-bit targets.
* util/grub-mkrawimage.c (ALIGN_ADDR): New macro.
(generate_image): Use ALIGN_ADDR.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
Properly create cross-endian images.
* include/grub/types.h (grub_host_to_target_addr): New macro
* util/grub-mkrawimage.c (generate_image): Add missing host_to_target.
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkrawimage.c (generate_image): Add forgotten ALIGN_UP.
2010-02-10 Vladimir Serbinenko <phcoder@gmail.com>
Pass SIMPLE framebuffer size in bytes and not 64K blocks.
* loader/i386/efi/linux.c (grub_linux_setup_video): Don't divide by 64K.
* loader/i386/linux.c (grub_linux_setup_video): Likewise.
(grub_linux_boot): Divide by 64K when on VESA.
2010-02-10 Vladimir Serbinenko <phcoder@gmail.com>
Support GRUB_GFXPAYLOAD_LINUX.
* util/grub-mkconfig.in: Export GRUB_GFXPAYLOAD_LINUX.
* util/grub.d/10_linux.in (linux_entry): Handle GRUB_GFXPAYLOAD_LINUX.
2010-02-10 Vladimir Serbinenko <phcoder@gmail.com>
* script/execute.c (grub_script_execute_cmdline): Use grub_print_error
to show messages instead of discarding them.
Process errors after executing command and not before. Keep old method
too as precaution.
2010-02-09 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Check for ft2build.h.
2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
* kern/ieee1275/openfw.c (grub_halt): Try executing "poweroff".
2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
* genkernsyms.sh.in: Use TARGET_CC.
2010-02-07 Colin Watson <cjwatson@ubuntu.com>
* NEWS: Update.
2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/multiboot2.h: Remove leftover file.
* include/grub/normal.h [GRUB_UTIL]: Remove leftover declarations.
* include/grub/partition.h [GRUB_UTIL]: Likewise.
2010-02-07 Yves Blusseau <blusseau@zetam.org>
* gnulib/getdelim.c: add missing header (type ssize_t must be defined).
2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
Fix warnings in grub-emu when compiling with maximum warning options.
* util/grub-emu.c (ENABLE_RELOCATABLE): New definition.
(grub_arch_modules_addr): Return 0 and not NULL.
* util/misc.c (ENABLE_RELOCATABLE): New definition.
(xstrdup): Use newstr instead of dup.
* util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Rename one instance
of disk to dsk to avoid shadowing.
(find_free_slot): Fix prototype.
* util/getroot.c (grub_util_is_dmraid): Make static.
* include/grub/time.h (grub_get_rtc) [GRUB_MACHINE_EMU || GRUB_UTIL]:
Add missing prototype.
* util/sdl.c (grub_video_sdl_set_viewport): Remove.
2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
* loader/i386/linux.c (grub_linux_setup_video): Handle error
appropriately.
2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
* fs/reiserfs.c (grub_reiserfs_read): Use #if 0 instead of commenting
code out.
2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/cache.h (grub_arch_sync_caches) [i386 || x86_64]: Inline.
* kern/i386/coreboot/init.c (grub_arch_sync_caches): Remove.
* kern/i386/efi/init.c (grub_arch_sync_caches): Likewise.
* kern/i386/ieee1275/init.c (grub_arch_sync_caches): Likewise.
* kern/i386/pc/init.c (grub_arch_sync_caches): Likewise.
* util/misc.c (grub_arch_sync_caches) [i386 || x86_64]: Likewise.
2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/err.h (grub_err_printf): Don't export.
2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/dl.h (grub_dl_register_symbol): Don't export.
2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/i18n.h (grub_gettext_dummy): Removed.
* kern/misc.c (grub_gettext_dummy): Make static.
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
* kern/misc.c (grub_utf8_to_ucs4): Don't eat valid characters preceeded
by non-valid ones.
* kern/term.c (grub_putchar): Likewise.
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
* partmap/sun.c (sun_partition_map_iterate): Restructure flow to fix

View file

@ -14,6 +14,7 @@ configuring the GRUB.
* GCC 4.1.3 or later
* GNU Make
* GNU Bison 2.3 or later
* GNU gettext 0.17 or later
* GNU binutils 2.9.1.0.23 or later
* Other standard GNU/Unix tools
@ -25,6 +26,10 @@ need the following.
* Autoconf 2.60 or later
* Automake 1.10.1 or later
Prerequisites for make-check:
* qemu, specifically the binary 'qemu-system-i386'
Configuring the GRUB
====================

View file

@ -84,16 +84,16 @@ LDFLAGS = @LDFLAGS@ $(LIBS)
CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/gnulib -I$(srcdir)/include -Wall -W \
-DGRUB_LIBDIR=\"$(pkglibdir)\" -DLOCALEDIR=\"$(localedir)\"
TARGET_CC = @TARGET_CC@
TARGET_CFLAGS = @TARGET_CFLAGS@
TARGET_ASFLAGS = @TARGET_ASFLAGS@
TARGET_CFLAGS = -ffreestanding @TARGET_CFLAGS@
TARGET_ASFLAGS = -nostdinc -fno-builtin @TARGET_ASFLAGS@
TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@
TARGET_APPLE_CC = @TARGET_APPLE_CC@
OBJCONV = @OBJCONV@
TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include) -I$(srcdir)/include -I$(builddir) -I$(builddir)/include \
TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(srcdir)/include -I$(builddir) -I$(builddir)/include \
-Wall -W
TARGET_LDFLAGS = @TARGET_LDFLAGS@
TARGET_LDFLAGS = -nostdlib @TARGET_LDFLAGS@
TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@
TARGET_IMG_LDFLAGS = @TARGET_IMG_LDFLAGS@
TARGET_IMG_LDFLAGS = -nostdlib @TARGET_IMG_LDFLAGS@
TARGET_IMG_CFLAGS = @TARGET_IMG_CFLAGS@
TARGET_OBJ2ELF = @TARGET_OBJ2ELF@
EXEEXT = @EXEEXT@
@ -147,7 +147,7 @@ INFOS = $(info_INFOS)
CLEANFILES =
MOSTLYCLEANFILES =
DISTCLEANFILES = config.status config.cache config.log config.h \
Makefile stamp-h include/grub/cpu include/grub/machine \
Makefile stamp-h stamp-h1 include/grub/cpu include/grub/machine \
gensymlist.sh genkernsyms.sh build_env.mk \
docs/grub.info docs/version.texi docs/stamp-vti
@ -178,7 +178,9 @@ endif
### General targets.
CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) po/*.mo
ifneq ($(platform), emu)
pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst
endif
moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk
cat $(DEFSYMFILES) /dev/null \
| $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \
@ -239,6 +241,7 @@ else
ifeq ($(enable_grub_mkfont),yes)
pkgdata_DATA += unicode.pf2 ascii.pf2 ascii.h
CLEANFILES += ascii.bitmaps
# Arrows and lines are needed to draw the menu, so we always include them
UNICODE_ARROWS=0x2190-0x2193
@ -278,7 +281,7 @@ build_env.mk: Makefile
) > $@
pkglib_BUILDDIR += config.h grub_script.tab.h
all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(INFOS) $(MKFILES) $(foreach lang, $(LINGUAS), po/$(lang).mo)
all-local: $(PROGRAMS) $(GRUB_EMU) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(INFOS) $(MKFILES) $(foreach lang, $(LINGUAS), po/$(lang).mo)
install: install-local
@ -299,7 +302,7 @@ install-local: all
$(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkgdatadir)/$$dest; \
done
$(SHELL) $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
@list='$(bin_UTILITIES)'; for file in $$list; do \
@list='$(bin_UTILITIES) $(GRUB_EMU)'; for file in $$list; do \
if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
$(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \
@ -375,7 +378,7 @@ uninstall:
dest="`echo $$file | sed 's,.*/,,'`"; \
rm -f $(DESTDIR)$(pkgdatadir)/$$dest; \
done
@list='$(bin_UTILITIES) $(bin_SCRIPTS)'; for file in $$list; do \
@list='$(bin_UTILITIES) $(bin_SCRIPTS) $(GRUB_EMU)'; for file in $$list; do \
dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \
rm -f $(DESTDIR)$(bindir)/$$dest; \
rm -f $(DESTDIR)$(mandir)/man1/$$dest.1; \

19
NEWS
View file

@ -1,4 +1,21 @@
New in 1.98:
New in 1.98 - 2010-03-06:
* Multiboot on EFI support.
* Graphical menu support.
* MIPS support.
* Saved default menu entry support, with new utilities `grub-reboot' and
`grub-set-default'.
* Unit testing framework.
* Support for multiple terminals.
* Encrypted password support, with a new utility `grub-mkpasswd-pbkdf2'.
* `grub-mkfloppy' removed; use `grub-mkrescue' to create floppy images.
* Add grub-probe support for GNU/Hurd.

View file

@ -27,6 +27,7 @@
/* Print message string */
#define MSG(x) movw $x, %si; call LOCAL(message)
#define ERR(x) movw $x, %si; jmp LOCAL(error_message)
.file "boot.S"
@ -233,7 +234,7 @@ LOCAL(chs_mode):
jz LOCAL(floppy_probe)
/* Nope, we definitely have a hard disk, and we're screwed. */
jmp LOCAL(hd_probe_error)
ERR(hd_probe_error_string)
LOCAL(final_init):
/* set the mode to zero */
@ -360,22 +361,15 @@ LOCAL(copy_buffer):
* BIOS Geometry translation error (past the end of the disk geometry!).
*/
LOCAL(geometry_error):
MSG(geometry_error_string)
jmp LOCAL(general_error)
/*
* Disk probe failure.
*/
LOCAL(hd_probe_error):
MSG(hd_probe_error_string)
jmp LOCAL(general_error)
ERR(geometry_error_string)
/*
* Read error on the disk.
*/
LOCAL(read_error):
MSG(read_error_string)
movw $read_error_string, %si
LOCAL(error_message):
call LOCAL(message)
LOCAL(general_error):
MSG(general_error_string)

View file

@ -118,7 +118,7 @@ prom_call:
boot_continue:
mov %o7, PIC_REG /* PIC base */
sethi %hi(SCRATCH_PAD), %l1 /* OF argument slots */
sethi %hi(SCRATCH_PAD_BOOT), %l1 /* OF argument slots */
/* Find the /chosen node so we can fetch the stdout handle,
* and thus perform console output.

View file

@ -81,7 +81,7 @@ prom_call:
after_info_block:
sethi %hi(SCRATCH_PAD), %l1 /* OF argument slots */
sethi %hi(SCRATCH_PAD_DISKBOOT), %l1 /* OF argument slots */
GET_ABS(notification_string, %o2)
call console_write
@ -129,7 +129,7 @@ bootit:
mov NOTIFICATION_DONE_LEN, %o3
sethi %hi(GRUB_BOOT_MACHINE_IMAGE_ADDRESS), %o2
jmpl %o2 + %lo(GRUB_BOOT_MACHINE_IMAGE_ADDRESS), %o7
mov CIF_REG, %o0
mov CIF_REG, %o4
1: ba,a 1b
lastlist:

View file

@ -41,7 +41,7 @@ grub_cmd_cat (grub_command_t cmd __attribute__ ((unused)),
file = grub_gzfile_open (args[0], 1);
if (! file)
return 0;
return grub_errno;
while ((size = grub_file_read (file, buf, sizeof (buf))) > 0
&& key != GRUB_TERM_ESC)

View file

@ -29,7 +29,7 @@
#include <grub/command.h>
#include <grub/i18n.h>
#define BASE_TEMPO 120
#define BASE_TEMPO (60 * GRUB_TICKS_PER_SECOND)
/* The speaker port. */
#define SPEAKER 0x61
@ -101,13 +101,13 @@
#define PIT_CTRL_COUNT_BINARY 0x00 /* 16-bit binary counter. */
#define PIT_CTRL_COUNT_BCD 0x01 /* 4-decade BCD counter. */
#define T_REST ((short) 0)
#define T_FINE ((short) -1)
#define T_REST ((grub_uint16_t) 0)
#define T_FINE ((grub_uint16_t) -1)
struct note
{
short pitch;
short duration;
grub_uint16_t pitch;
grub_uint16_t duration;
};
static void
@ -120,7 +120,7 @@ beep_off (void)
}
static void
beep_on (short pitch)
beep_on (grub_uint16_t pitch)
{
unsigned char status;
unsigned int counter;
@ -143,60 +143,111 @@ beep_on (short pitch)
grub_outb (status | SPEAKER_TMR2 | SPEAKER_DATA, SPEAKER);
}
/* Returns whether playing should continue. */
static int
play (unsigned tempo, struct note *note)
{
unsigned int to;
if (note->pitch == T_FINE || grub_checkkey () >= 0)
return 1;
grub_dprintf ("play", "pitch = %d, duration = %d\n", note->pitch,
note->duration);
switch (note->pitch)
{
case T_REST:
beep_off ();
break;
default:
beep_on (note->pitch);
break;
}
to = grub_get_rtc () + BASE_TEMPO * note->duration / tempo;
while (((unsigned int) grub_get_rtc () <= to) && (grub_checkkey () < 0))
;
return 0;
}
static grub_err_t
grub_cmd_play (grub_command_t cmd __attribute__ ((unused)),
int argc, char **args)
{
grub_file_t file;
struct note buf;
int tempo;
unsigned int to;
if (argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
if (argc < 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name or tempo and notes required");
file = grub_file_open (args[0]);
if (! file)
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
if (grub_file_read (file, &tempo, sizeof(tempo)) != sizeof(tempo))
if (file)
{
grub_file_close (file);
return grub_error (GRUB_ERR_FILE_READ_ERROR,
"file doesn't even contains a full tempo record");
}
struct note buf;
grub_uint32_t tempo;
grub_dprintf ("play","tempo = %d\n", tempo);
while (grub_file_read (file, &buf,
sizeof (struct note)) == sizeof (struct note)
&& buf.pitch != T_FINE && grub_checkkey () < 0)
{
grub_dprintf ("play", "pitch = %d, duration = %d\n", buf.pitch,
buf.duration);
switch (buf.pitch)
if (grub_file_read (file, &tempo, sizeof (tempo)) != sizeof (tempo))
{
case T_REST:
beep_off ();
break;
grub_file_close (file);
return grub_error (GRUB_ERR_FILE_READ_ERROR,
"file doesn't even contains a full tempo record");
}
default:
beep_on (buf.pitch);
tempo = grub_le_to_cpu32 (tempo);
grub_dprintf ("play","tempo = %d\n", tempo);
while (grub_file_read (file, &buf,
sizeof (struct note)) == sizeof (struct note))
{
buf.pitch = grub_le_to_cpu16 (buf.pitch);
buf.duration = grub_le_to_cpu16 (buf.duration);
if (play (tempo, &buf))
break;
}
to = grub_get_rtc () + BASE_TEMPO * buf.duration / tempo;
while (((unsigned int) grub_get_rtc () <= to) && (grub_checkkey () < 0))
;
grub_file_close (file);
}
else
{
char *end;
unsigned tempo;
struct note note;
int i;
tempo = grub_strtoul (args[0], &end, 0);
if (*end)
/* Was not a number either, assume it was supposed to be a file name. */
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
grub_dprintf ("play","tempo = %d\n", tempo);
for (i = 1; i + 1 < argc; i += 2)
{
note.pitch = grub_strtoul (args[i], &end, 0);
if (*end)
{
grub_error (GRUB_ERR_BAD_NUMBER, "bogus pitch number");
break;
}
note.duration = grub_strtoul (args[i + 1], &end, 0);
if (*end)
{
grub_error (GRUB_ERR_BAD_NUMBER, "bogus duration number");
break;
}
if (play (tempo, &note))
break;
}
}
beep_off ();
grub_file_close (file);
while (grub_checkkey () > 0)
grub_getkey ();
@ -208,7 +259,8 @@ static grub_command_t cmd;
GRUB_MOD_INIT(play)
{
cmd = grub_register_command ("play", grub_cmd_play,
N_("FILE"), N_("Play a tune."));
N_("FILE | TEMPO [PITCH1 DURATION1] [PITCH2 DURATION2] ... "),
N_("Play a tune."));
}
GRUB_MOD_FINI(play)

View file

@ -24,6 +24,7 @@
#include <grub/term.h>
#include <grub/machine/init.h>
#include <grub/machine/vbe.h>
#include <grub/video.h>
#include <grub/err.h>
#include <grub/i18n.h>

View file

@ -16,7 +16,9 @@
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRUB_MACHINE_EMU
#include <grub/machine/memory.h>
#endif
#include <grub/dl.h>
#include <grub/misc.h>
#include <grub/command.h>
@ -34,7 +36,9 @@ grub_cmd_lsmmap (grub_command_t cmd __attribute__ ((unused)),
(long long) addr, (long long) size, type);
return 0;
}
#ifndef GRUB_MACHINE_EMU
grub_machine_mmap_iterate (hook);
#endif
return 0;
}

View file

@ -175,7 +175,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
}
/* Load modules. */
#ifndef GRUB_UTIL
#if GRUB_NO_MODULES
{
const char *prefix;
prefix = grub_env_get ("prefix");

View file

@ -149,11 +149,11 @@ grub_cmd_do_search (grub_command_t cmd __attribute__ ((unused)), int argc,
static grub_command_t cmd;
#ifdef DO_SEARCH_FILE
GRUB_MOD_INIT(search_file)
GRUB_MOD_INIT(search_fs_file)
#elif defined (DO_SEARCH_FS_UUID)
GRUB_MOD_INIT(search_fs_uuid)
#else
GRUB_MOD_INIT(search_fs_label)
GRUB_MOD_INIT(search_label)
#endif
{
cmd =
@ -163,11 +163,11 @@ GRUB_MOD_INIT(search_fs_label)
}
#ifdef DO_SEARCH_FILE
GRUB_MOD_FINI(search_file)
GRUB_MOD_FINI(search_fs_file)
#elif defined (DO_SEARCH_FS_UUID)
GRUB_MOD_FINI(search_fs_uuid)
#else
GRUB_MOD_FINI(search_fs_label)
GRUB_MOD_FINI(search_label)
#endif
{
grub_unregister_command (cmd);

View file

@ -22,7 +22,6 @@
#include <grub/time.h>
#include <grub/types.h>
#include <grub/misc.h>
#include <grub/machine/time.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>

View file

@ -69,9 +69,9 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
color = grub_video_map_rgb (0, 255, 255);
grub_video_fill_rect (color, 100, 100, 100, 100);
sansbig = grub_font_get ("Helvetica Bold 24");
sans = grub_font_get ("Helvetica Bold 14");
sanssmall = grub_font_get ("Helvetica 8");
sansbig = grub_font_get ("Unknown Regular 16");
sans = grub_font_get ("Unknown Regular 16");
sanssmall = grub_font_get ("Unknown Regular 16");
fixed = grub_font_get ("Fixed 20");
if (! sansbig || ! sans || ! sanssmall || ! fixed)
return grub_error (GRUB_ERR_BAD_FONT, "no font loaded");
@ -126,11 +126,6 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
grub_font_draw_string (str, fixed, color, 16, texty);
texty += grub_font_get_descent (fixed) + grub_font_get_leading (fixed);
/* Some character don't exist in the Helvetica font, so the font engine
will fall back to using glyphs from another font that does contain them.
TODO The font engine should be smart about selecting a replacement font
and prioritize fonts with similar sizes. */
texty += grub_font_get_ascent(sansbig);
grub_font_draw_string (str, sansbig, color, 16, texty);
texty += grub_font_get_descent (sansbig) + grub_font_get_leading (sansbig);

View file

@ -1,129 +1,95 @@
# -*- makefile -*-
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
COMMON_LDFLAGS += -nostdlib
COMMON_CFLAGS += -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include) -fno-builtin
sbin_UTILITIES += grub-emu
util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
commands/configfile.c commands/echo.c commands/help.c \
commands/handler.c commands/ls.c commands/test.c \
commands/search_wrap.c commands/search_file.c \
commands/search_label.c commands/search_uuid.c \
commands/blocklist.c commands/hexdump.c \
lib/hexdump.c commands/halt.c commands/reboot.c \
lib/envblk.c commands/loadenv.c \
commands/gptsync.c commands/probe.c commands/xnu_uuid.c \
commands/password.c commands/keystatus.c \
disk/host.c disk/loopback.c disk/scsi.c \
fs/fshelp.c \
\
io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \
kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \
kern/partition.c kern/term.c \
kernel_img_RELOCATABLE = yes
pkglib_PROGRAMS = kernel.img
kernel_img_SOURCES = kern/device.c kern/disk.c kern/dl.c kern/env.c \
kern/err.c kern/list.c kern/handler.c kern/command.c \
kern/corecmd.c kern/file.c kern/fs.c kern/main.c kern/misc.c \
kern/parser.c kern/partition.c kern/term.c \
kern/rescue_reader.c kern/rescue_parser.c \
lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \
normal/handler.c normal/auth.c lib/crypto.c normal/autofs.c \
normal/completion.c normal/main.c normal/color.c \
normal/menu.c normal/menu_entry.c \
normal/menu_text.c normal/crypto.c normal/term.c \
commands/terminal.c normal/context.c lib/charset.c \
script/main.c script/execute.c script/function.c \
script/lexer.c script/script.c grub_script.tab.c \
partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
partmap/acorn.c partmap/gpt.c partmap/bsdlabel.c \
\
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \
fs/befs.c fs/befs_be.c fs/tar.c \
\
video/video.c video/fb/video_fb.c video/fb/fbblit.c \
video/fb/fbfill.c video/fb/fbutil.c commands/videotest.c \
video/bitmap.c video/bitmap_scale.c video/readers/tga.c \
video/readers/jpeg.c video/readers/png.c font/font_cmd.c \
font/font.c term/gfxterm.c io/bufio.c \
\
gfxmenu/gfxmenu.c gfxmenu/model.c gfxmenu/view.c \
gfxmenu/icon_manager.c gfxmenu/theme_loader.c \
gfxmenu/widget-box.c gfxmenu/gui_canvas.c \
gfxmenu/gui_circular_progress.c gfxmenu/gui_box.c \
gfxmenu/gui_label.c gfxmenu/gui_list.c gfxmenu/gui_image.c \
gfxmenu/gui_progress_bar.c gfxmenu/gui_util.c \
gfxmenu/gui_string_util.c gfxmenu/named_colors.c trigtables.c \
\
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
util/hostdisk.c util/getroot.c \
\
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
commands/parttool.c parttool/msdospart.c \
lib/libgcrypt-grub/cipher/md5.c \
grub_emu_init.c gnulib/progname.c
grub_emu_CFLAGS += -Wno-missing-field-initializers -Wno-error -I$(srcdir)/lib/libgcrypt_wrap
\
util/console.c util/grub-emu.c util/misc.c util/hostdisk.c \
util/getroot.c util/time.c \
\
grub_emu_init.c gnulib/progname.c util/hostfs.c disk/host.c
kernel_img_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-undef -I$(srcdir)/gnulib
kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
TARGET_NO_STRIP = yes
TARGET_NO_DYNAMIC_MODULES = yes
# For halt.mod.
pkglib_MODULES += halt.mod
halt_mod_SOURCES = commands/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
ifeq ($(target_cpu), i386)
grub_emu_SOURCES += commands/i386/cpuid.c
pkglib_MODULES += cpuid.mod
cpuid_mod_SOURCES = commands/i386/cpuid.c
cpuid_mod_CFLAGS = $(COMMON_CFLAGS)
cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS)
endif
grub_emu_LDFLAGS = $(LIBCURSES)
ifeq ($(enable_grub_emu_usb), yes)
grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c \
commands/usbtest.c
grub_emu_LDFLAGS += $(LIBCURSES) $(LIBUSB)
pkglib_MODULES += libusb.mod
libusb_mod_SOURCES = util/usb.c
libusb_mod_CFLAGS =
libusb_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For usb.mod
pkglib_MODULES += usb.mod
usb_mod_SOURCES = bus/usb/usb.c
usb_mod_CFLAGS = $(COMMON_CFLAGS)
usb_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For usbtest.mod
pkglib_MODULES += usbtest.mod
usbtest_mod_SOURCES = commands/usbtest.c
usbtest_mod_CFLAGS = $(COMMON_CFLAGS)
usbtest_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For usbms.mod
pkglib_MODULES += usbms.mod
usbms_mod_SOURCES = disk/usbms.c
usbms_mod_CFLAGS = $(COMMON_CFLAGS)
usbms_mod_LDFLAGS = $(COMMON_LDFLAGS)
grub_emu_LDFLAGS += $(LIBUSB)
endif
ifeq ($(enable_grub_emu_sdl), yes)
grub_emu_SOURCES += util/sdl.c
pkglib_MODULES += sdl.mod
sdl_mod_SOURCES = util/sdl.c
sdl_mod_CFLAGS =
sdl_mod_LDFLAGS = $(COMMON_LDFLAGS)
grub_emu_LDFLAGS += $(LIBSDL)
endif
ifeq ($(enable_grub_emu_pci), yes)
grub_emu_SOURCES += util/pci.c commands/lspci.c
pkglib_MODULES += pci.mod
pci_mod_SOURCES = util/pci.c commands/lspci.c
pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
grub_emu_LDFLAGS += $(LIBPCIACCESS)
endif
grub_emu_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES))
rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
DISTCLEANFILES += grub_emu_init.lst
include $(srcdir)/conf/common.mk
grub_emu_init.h: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh
rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@
grub_emu_init.h: genemuinitheader.sh $(pkglib_MODULES)
rm -f $@; echo $(pkglib_MODULES) | sh $(srcdir)/genemuinitheader.sh $(NM) > $@
DISTCLEANFILES += grub_emu_init.h
grub_emu_init.c: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_emu_init.h
rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
grub_emu_init.c: genemuinit.sh $(pkglib_MODULES)
rm -f $@; echo $(pkglib_MODULES) | sh $(srcdir)/genemuinit.sh $(NM) > $@
DISTCLEANFILES += grub_emu_init.c
CLEANFILES += grub-emu
grub-emu: $(pkglib_MODULES) $(pkglib_PROGRAMS)
$(CC) -o $@ $(pkglib_MODULES) $(pkglib_PROGRAMS) $(grub_emu_LDFLAGS) $(LDFLAGS)
GRUB_EMU=grub-emu
# FIXME: this could be shared with common.rmk
trigtables.c: gentrigtables
./gentrigtables > $@
DISTCLEANFILES += trigtables.c
gentrigtables: gentrigtables.c
$(CC) -o $@ $^ $(CPPFLAGS) -lm
DISTCLEANFILES += gentrigtables
# For grub-mkfont.
ifeq ($(enable_grub_mkfont), yes)
bin_UTILITIES += grub-mkfont
grub_mkfont_SOURCES = gnulib/progname.c util/grub-mkfont.c util/misc.c
grub_mkfont_CFLAGS = $(freetype_cflags)
grub_mkfont_LDFLAGS = $(freetype_libs)
endif
grub_script.tab.c grub_script.tab.h: script/parser.y
$(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/parser.y
DISTCLEANFILES += grub_script.tab.c grub_script.tab.h
bin_UTILITIES += grub-bin2h
grub_bin2h_SOURCES = gnulib/progname.c util/bin2h.c

View file

@ -1,5 +1,8 @@
# -*- makefile -*-
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
sbin_UTILITIES += grub-mkdevicemap
grub_mkdevicemap_SOURCES = gnulib/progname.c util/grub-mkdevicemap.c \
util/deviceiter.c \
@ -24,7 +27,7 @@ util/grub-probe.c_DEPENDENCIES = grub_probe_init.h
grub_probe_SOURCES = gnulib/progname.c util/grub-probe.c \
util/hostdisk.c util/misc.c util/getroot.c \
kern/device.c kern/disk.c kern/err.c kern/misc.c \
kern/parser.c kern/partition.c kern/file.c kern/list.c \
kern/parser.c kern/partition.c kern/file.c kern/list.c \
\
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
@ -92,6 +95,13 @@ grub_mkrelpath_SOURCES = gnulib/progname.c util/grub-mkrelpath.c util/misc.c
bin_UTILITIES += grub-bin2h
grub_bin2h_SOURCES = gnulib/progname.c util/bin2h.c
# For the lexer.
grub_script.yy.c grub_script.yy.h: script/yylex.l
$(LEX) -o grub_script.yy.c --header-file=grub_script.yy.h $(srcdir)/script/yylex.l
sed -i 's/^#include.*\(<stdio\.h>\|<string\.h>\|<errno\.h>\|<stdlib\.h>\|<unistd\.h>\)//g' grub_script.yy.h
sed -i 's/^#include.*\(<stdio\.h>\|<string\.h>\|<errno\.h>\|<stdlib\.h>\|<unistd\.h>\)//g' grub_script.yy.c
DISTCLEANFILES += grub_script.yy.c grub_script.yy.h
# For grub-script-check.
bin_UTILITIES += grub-script-check
util/grub-script-check.c_DEPENDENCIES = grub_script_check_init.h
@ -99,7 +109,23 @@ grub_script_check_SOURCES = gnulib/progname.c gnulib/getdelim.c gnulib/getline.c
util/grub-script-check.c util/misc.c \
script/main.c script/script.c script/function.c script/lexer.c \
kern/handler.c kern/err.c kern/parser.c kern/list.c \
kern/misc.c kern/env.c grub_script_check_init.c grub_script.tab.c
kern/misc.c kern/env.c grub_script_check_init.c grub_script.tab.c \
grub_script.yy.c
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst
kernel_img_HEADERS += boot.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 msdos_partition.h reader.h symbol.h term.h time.h types.h \
machine/memory.h machine/loader.h machine/kernel.h \
list.h handler.h command.h i18n.h env_private.h
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# For the parser.
grub_script.tab.c grub_script.tab.h: script/parser.y
@ -623,30 +649,32 @@ normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For sh.mod.
sh_mod_SOURCES = script/main.c script/script.c script/execute.c \
script/function.c script/lexer.c grub_script.tab.c
script/function.c script/lexer.c grub_script.tab.c grub_script.yy.c
sh_mod_CFLAGS = $(COMMON_CFLAGS)
sh_mod_LDFLAGS = $(COMMON_LDFLAGS)
ifneq (, $(FONT_SOURCE))
font/font.c_DEPENDENCIES = ascii.h
endif
# Common Video Subsystem specific modules.
pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \
png.mod gfxterm.mod video_fb.mod
# On Yeeloong it's part of kernel
ifneq ($(platform), yeeloong)
# For video.mod.
pkglib_MODULES += video.mod
video_mod_SOURCES = video/video.c
video_mod_CFLAGS = $(COMMON_CFLAGS)
video_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += video_fb.mod
video_fb_mod_SOURCES = video/fb/video_fb.c video/fb/fbblit.c \
video/fb/fbfill.c video/fb/fbutil.c
video_fb_mod_CFLAGS = $(COMMON_CFLAGS)
video_fb_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For videotest.mod.
videotest_mod_SOURCES = commands/videotest.c
videotest_mod_CFLAGS = $(COMMON_CFLAGS)
videotest_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For bitmap.mod
pkglib_MODULES += bitmap.mod
bitmap_mod_SOURCES = video/bitmap.c
bitmap_mod_CFLAGS = $(COMMON_CFLAGS)
bitmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
@ -657,36 +685,46 @@ bitmap_scale_mod_SOURCES = video/bitmap_scale.c
bitmap_scale_mod_CFLAGS = $(COMMON_CFLAGS)
bitmap_scale_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For tga.mod
tga_mod_SOURCES = video/readers/tga.c
tga_mod_CFLAGS = $(COMMON_CFLAGS)
tga_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For jpeg.mod.
jpeg_mod_SOURCES = video/readers/jpeg.c
jpeg_mod_CFLAGS = $(COMMON_CFLAGS)
jpeg_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For png.mod.
png_mod_SOURCES = video/readers/png.c
png_mod_CFLAGS = $(COMMON_CFLAGS)
png_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += font.mod
ifneq (, $(FONT_SOURCE))
font/font.c_DEPENDENCIES = ascii.h
endif
font_mod_SOURCES = font/font_cmd.c font/font.c
font_mod_CFLAGS = $(COMMON_CFLAGS)
font_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For gfxterm.mod.
pkglib_MODULES += gfxterm.mod
gfxterm_mod_SOURCES = term/gfxterm.c
gfxterm_mod_CFLAGS = $(COMMON_CFLAGS)
gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS)
endif
# For videotest.mod.
pkglib_MODULES += videotest.mod
videotest_mod_SOURCES = commands/videotest.c
videotest_mod_CFLAGS = $(COMMON_CFLAGS)
videotest_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For tga.mod
pkglib_MODULES += tga.mod
tga_mod_SOURCES = video/readers/tga.c
tga_mod_CFLAGS = $(COMMON_CFLAGS)
tga_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For jpeg.mod.
pkglib_MODULES += jpeg.mod
jpeg_mod_SOURCES = video/readers/jpeg.c
jpeg_mod_CFLAGS = $(COMMON_CFLAGS)
jpeg_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For png.mod.
pkglib_MODULES += png.mod
png_mod_SOURCES = video/readers/png.c
png_mod_CFLAGS = $(COMMON_CFLAGS)
png_mod_LDFLAGS = $(COMMON_LDFLAGS)
# Misc.
pkglib_MODULES += gzio.mod bufio.mod elf.mod
pkglib_MODULES += gzio.mod elf.mod
# For elf.mod.
elf_mod_SOURCES = kern/elf.c
@ -698,10 +736,14 @@ gzio_mod_SOURCES = io/gzio.c
gzio_mod_CFLAGS = $(COMMON_CFLAGS)
gzio_mod_LDFLAGS = $(COMMON_LDFLAGS)
# On Yeeloong it's part of kernel
ifneq ($(platform), yeeloong)
# For bufio.mod.
pkglib_MODULES += bufio.mod
bufio_mod_SOURCES = io/bufio.c
bufio_mod_CFLAGS = $(COMMON_CFLAGS)
bufio_mod_LDFLAGS = $(COMMON_LDFLAGS)
endif
# For gettext.mod.
pkglib_MODULES += gettext.mod
@ -765,6 +807,42 @@ password_pbkdf2_mod_SOURCES = commands/password_pbkdf2.c
password_pbkdf2_mod_CFLAGS = $(COMMON_CFLAGS)
password_pbkdf2_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For memdisk.mod.
pkglib_MODULES += memdisk.mod
memdisk_mod_SOURCES = disk/memdisk.c
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For reboot.mod.
pkglib_MODULES += reboot.mod
reboot_mod_SOURCES = commands/reboot.c
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For date.mod
pkglib_MODULES += date.mod
date_mod_SOURCES = commands/date.c
date_mod_CFLAGS = $(COMMON_CFLAGS)
date_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datehook.mod
pkglib_MODULES += datehook.mod
datehook_mod_SOURCES = hook/datehook.c
datehook_mod_CFLAGS = $(COMMON_CFLAGS)
datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lsmmap.mod
pkglib_MODULES += lsmmap.mod
lsmmap_mod_SOURCES = commands/lsmmap.c
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For boot.mod.
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
bin_UTILITIES += grub-mkpasswd-pbkdf2
grub_mkpasswd_pbkdf2_SOURCES = gnulib/progname.c gnulib/getdelim.c gnulib/getline.c util/grub-mkpasswd-pbkdf2.c lib/crypto.c lib/libgcrypt-grub/cipher/sha512.c lib/pbkdf2.c util/misc.c kern/err.c
grub_mkpasswd_pbkdf2_CFLAGS += -Wno-missing-field-initializers -Wno-error -I$(srcdir)/lib/libgcrypt_wrap -DGRUB_MKPASSWD=1

View file

@ -1,18 +1,11 @@
# -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -fno-builtin -m32
COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
COMMON_LDFLAGS = -m32 -nostdlib
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
COMMON_CFLAGS = -mrtd -mregparm=3
# Images.
GRUB_KERNEL_MACHINE_LINK_ADDR = 0x8200
ifeq ($(platform), coreboot)
pkglib_PROGRAMS += kernel.img
kernel_img_SOURCES = kern/i386/coreboot/startup.S \
kern/i386/misc.S \
@ -31,74 +24,10 @@ kernel_img_SOURCES = kern/i386/coreboot/startup.S \
kern/env.c \
term/i386/pc/vga_text.c term/i386/vga_common.c \
symlist.c
kernel_img_HEADERS = boot.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 msdos_partition.h reader.h symbol.h term.h time.h types.h \
machine/boot.h machine/console.h machine/init.h \
machine/memory.h machine/loader.h list.h handler.h command.h i18n.h \
env_private.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,$(GRUB_KERNEL_MACHINE_LINK_ADDR),-Bstatic
endif
ifeq ($(platform), qemu)
GRUB_BOOT_MACHINE_LINK_ADDR = 0xffe00
pkglib_IMAGES += boot.img
boot_img_SOURCES = boot/i386/qemu/boot.S
boot_img_ASFLAGS = $(COMMON_ASFLAGS) -DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)
boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_BOOT_MACHINE_LINK_ADDR)
boot_img_FORMAT = binary
bin_UTILITIES += grub-mkimage
grub_mkimage_SOURCES = util/grub-mkrawimage.c util/misc.c \
util/resolve.c gnulib/progname.c
grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR)
util/grub-mkrawimage.c_DEPENDENCIES = Makefile
pkglib_IMAGES += kernel.img
kernel_img_SOURCES = kern/i386/qemu/startup.S \
kern/i386/misc.S \
kern/i386/coreboot/init.c \
kern/i386/qemu/mmap.c \
kern/i386/halt.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/term.c \
kern/rescue_parser.c kern/rescue_reader.c \
kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/$(target_cpu)/dl.c kern/parser.c kern/partition.c \
kern/i386/tsc.c kern/i386/pit.c \
kern/generic/rtc_get_time_ms.c \
kern/generic/millisleep.c \
kern/env.c \
term/i386/pc/vga_text.c term/i386/vga_common.c \
symlist.c
kernel_img_HEADERS = boot.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 msdos_partition.h reader.h symbol.h term.h time.h types.h \
machine/boot.h machine/console.h machine/init.h \
machine/memory.h machine/loader.h list.h handler.h command.h i18n.h \
env_private.h
kernel_img_CFLAGS = $(COMMON_CFLAGS) -DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR)
kernel_img_FORMAT = binary
endif
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
sbin_SCRIPTS += grub-install
grub_install_SOURCES = util/grub-install.in
@ -106,17 +35,7 @@ bin_SCRIPTS += grub-mkrescue
grub_mkrescue_SOURCES = util/grub-mkrescue.in
# Modules.
pkglib_MODULES = linux.mod \
aout.mod play.mod serial.mod \
memdisk.mod pci.mod lspci.mod reboot.mod \
halt.mod datetime.mod date.mod datehook.mod \
lsmmap.mod mmap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES = linux.mod aout.mod halt.mod datetime.mod mmap.mod
# For mmap.mod.
mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c
@ -129,21 +48,11 @@ linux_mod_SOURCES = loader/i386/linux.c
linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For reboot.mod.
reboot_mod_SOURCES = commands/reboot.c
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
halt_mod_SOURCES = commands/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For serial.mod.
serial_mod_SOURCES = term/serial.c
serial_mod_CFLAGS = $(COMMON_CFLAGS)
serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For aout.mod.
aout_mod_SOURCES = loader/aout.c
aout_mod_CFLAGS = $(COMMON_CFLAGS)
@ -156,45 +65,10 @@ bsd_mod_CFLAGS = $(COMMON_CFLAGS)
bsd_mod_LDFLAGS = $(COMMON_LDFLAGS)
bsd_mod_ASFLAGS = $(COMMON_ASFLAGS)
# For play.mod.
play_mod_SOURCES = commands/i386/pc/play.c
play_mod_CFLAGS = $(COMMON_CFLAGS)
play_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For memdisk.mod.
memdisk_mod_SOURCES = disk/memdisk.c
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For pci.mod
pci_mod_SOURCES = bus/pci.c
pci_mod_CFLAGS = $(COMMON_CFLAGS)
pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lspci.mod
lspci_mod_SOURCES = commands/lspci.c
lspci_mod_CFLAGS = $(COMMON_CFLAGS)
lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datetime.mod
datetime_mod_SOURCES = lib/cmos_datetime.c
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For date.mod
date_mod_SOURCES = commands/date.c
date_mod_CFLAGS = $(COMMON_CFLAGS)
date_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datehook.mod
datehook_mod_SOURCES = hook/datehook.c
datehook_mod_CFLAGS = $(COMMON_CFLAGS)
datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lsmmap.mod
lsmmap_mod_SOURCES = commands/lsmmap.c
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
include $(srcdir)/conf/i386.mk
include $(srcdir)/conf/common.mk

View file

@ -1,166 +1,5 @@
# -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -fno-builtin -m32
COMMON_CFLAGS = -fno-builtin -m32
COMMON_LDFLAGS = -melf_i386 -nostdlib
COMMON_LDFLAGS = -melf_i386
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
# Utilities.
bin_UTILITIES = grub-mkimage
# For grub-mkimage.
grub_mkimage_SOURCES = gnulib/progname.c util/i386/efi/grub-mkimage.c \
util/misc.c util/resolve.c
util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile
# For grub-setup.
#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.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 fs/xfs.c fs/affs.c \
# fs/sfs.c kern/parser.c kern/partition.c partmap/msdos.c \
# fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \
# kern/fs.c kern/env.c fs/fshelp.c
# Scripts.
sbin_SCRIPTS = grub-install
# For grub-install.
grub_install_SOURCES = util/i386/efi/grub-install.in
# Modules.
pkglib_PROGRAMS = kernel.img
pkglib_MODULES = chain.mod appleldr.mod \
linux.mod halt.mod reboot.mod pci.mod lspci.mod \
datetime.mod date.mod datehook.mod loadbios.mod \
fixvideo.mod mmap.mod acpi.mod
# For kernel.img.
kernel_img_RELOCATABLE = yes
kernel_img_SOURCES = kern/i386/efi/startup.S 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/term.c \
kern/rescue_parser.c kern/rescue_reader.c \
kern/$(target_cpu)/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
term/efi/console.c disk/efi/efidisk.c \
kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/i386/tsc.c kern/i386/pit.c \
kern/generic/rtc_get_time_ms.c \
kern/generic/millisleep.c
kernel_img_HEADERS = boot.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 msdos_partition.h reader.h symbol.h term.h time.h types.h \
efi/efi.h efi/time.h efi/disk.h i386/pit.h list.h handler.h command.h \
i18n.h env_private.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
MOSTLYCLEANFILES += symlist.c
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# For boot.mod.
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For acpi.mod.
acpi_mod_SOURCES = commands/acpi.c commands/efi/acpi.c
acpi_mod_CFLAGS = $(COMMON_CFLAGS)
acpi_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For mmap.mod.
mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \
mmap/efi/mmap.c
mmap_mod_CFLAGS = $(COMMON_CFLAGS)
mmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For chain.mod.
chain_mod_SOURCES = loader/efi/chainloader.c
chain_mod_CFLAGS = $(COMMON_CFLAGS)
chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For appleldr.mod.
appleldr_mod_SOURCES = loader/efi/appleloader.c
appleldr_mod_CFLAGS = $(COMMON_CFLAGS)
appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For linux.mod.
linux_mod_SOURCES = loader/i386/efi/linux.c
linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
halt_mod_SOURCES = commands/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For reboot.mod.
reboot_mod_SOURCES = commands/reboot.c
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For pci.mod
pci_mod_SOURCES = bus/pci.c
pci_mod_CFLAGS = $(COMMON_CFLAGS)
pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lspci.mod
lspci_mod_SOURCES = commands/lspci.c
lspci_mod_CFLAGS = $(COMMON_CFLAGS)
lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datetime.mod
datetime_mod_SOURCES = lib/efi/datetime.c
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For date.mod
date_mod_SOURCES = commands/date.c
date_mod_CFLAGS = $(COMMON_CFLAGS)
date_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datehook.mod
datehook_mod_SOURCES = hook/datehook.c
datehook_mod_CFLAGS = $(COMMON_CFLAGS)
datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For loadbios.mod
loadbios_mod_SOURCES = commands/efi/loadbios.c
loadbios_mod_CFLAGS = $(COMMON_CFLAGS)
loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For fixvideo.mod
fixvideo_mod_SOURCES = commands/efi/fixvideo.c
fixvideo_mod_CFLAGS = $(COMMON_CFLAGS)
fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += efi_uga.mod
efi_uga_mod_SOURCES = video/efi_uga.c
efi_uga_mod_CFLAGS = $(COMMON_CFLAGS)
efi_uga_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += efi_gop.mod
efi_gop_mod_SOURCES = video/efi_gop.c
efi_gop_mod_CFLAGS = $(COMMON_CFLAGS)
efi_gop_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += xnu.mod
xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c \
loader/macho32.c loader/macho64.c loader/macho.c loader/xnu.c
xnu_mod_CFLAGS = $(COMMON_CFLAGS)
xnu_mod_LDFLAGS = $(COMMON_LDFLAGS)
xnu_mod_ASFLAGS = $(COMMON_ASFLAGS)
include $(srcdir)/conf/i386.mk
include $(srcdir)/conf/common.mk
include $(srcdir)/conf/x86-efi.mk

View file

@ -1,11 +1,6 @@
# -*- makefile -*-
COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin
COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3
COMMON_LDFLAGS = -nostdlib
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
COMMON_CFLAGS = -mrtd -mregparm=3
# Images.
pkglib_PROGRAMS = kernel.img
@ -29,24 +24,11 @@ kernel_img_SOURCES = kern/i386/ieee1275/startup.S \
term/ieee1275/ofconsole.c \
disk/ieee1275/ofdisk.c \
symlist.c
kernel_img_HEADERS = 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 msdos_partition.h reader.h symbol.h term.h time.h types.h \
ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \
list.h handler.h command.h i18n.h env_private.h
kernel_img_HEADERS += ieee1275/ieee1275.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_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_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# Scripts.
sbin_SCRIPTS = grub-install
@ -54,16 +36,10 @@ sbin_SCRIPTS = grub-install
grub_install_SOURCES = util/ieee1275/grub-install.in
# Modules.
pkglib_MODULES = halt.mod reboot.mod suspend.mod \
aout.mod serial.mod linux.mod \
nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \
date.mod datehook.mod lsmmap.mod mmap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES = halt.mod suspend.mod \
aout.mod linux.mod \
nand.mod datetime.mod \
mmap.mod
# For mmap.mod.
mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c
@ -81,21 +57,11 @@ suspend_mod_SOURCES = commands/ieee1275/suspend.c
suspend_mod_CFLAGS = $(COMMON_CFLAGS)
suspend_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For reboot.mod
reboot_mod_SOURCES = commands/reboot.c
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod
halt_mod_SOURCES = commands/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For serial.mod.
serial_mod_SOURCES = term/serial.c
serial_mod_CFLAGS = $(COMMON_CFLAGS)
serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For linux.mod.
linux_mod_SOURCES = loader/i386/ieee1275/linux.c
linux_mod_CFLAGS = $(COMMON_CFLAGS)
@ -106,40 +72,10 @@ nand_mod_SOURCES = disk/ieee1275/nand.c
nand_mod_CFLAGS = $(COMMON_CFLAGS)
nand_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For memdisk.mod.
memdisk_mod_SOURCES = disk/memdisk.c
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For pci.mod
pci_mod_SOURCES = bus/pci.c
pci_mod_CFLAGS = $(COMMON_CFLAGS)
pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lspci.mod
lspci_mod_SOURCES = commands/lspci.c
lspci_mod_CFLAGS = $(COMMON_CFLAGS)
lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datetime.mod
datetime_mod_SOURCES = lib/cmos_datetime.c
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For date.mod
date_mod_SOURCES = commands/date.c
date_mod_CFLAGS = $(COMMON_CFLAGS)
date_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datehook.mod
datehook_mod_SOURCES = hook/datehook.c
datehook_mod_CFLAGS = $(COMMON_CFLAGS)
datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lsmmap.mod
lsmmap_mod_SOURCES = commands/lsmmap.c
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
include $(srcdir)/conf/i386.mk
include $(srcdir)/conf/common.mk

View file

@ -2,12 +2,7 @@
GRUB_KERNEL_MACHINE_LINK_ADDR = 0x8200
COMMON_ASFLAGS = -nostdinc -fno-builtin -m32
COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
COMMON_LDFLAGS = -m32 -nostdlib
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
COMMON_CFLAGS = -mrtd -mregparm=3
# Images.
pkglib_IMAGES = boot.img cdboot.img diskboot.img kernel.img lnxboot.img \
@ -59,27 +54,13 @@ kernel_img_SOURCES = kern/i386/pc/startup.S \
kern/env.c \
term/i386/pc/console.c term/i386/vga_common.c \
symlist.c
kernel_img_HEADERS = boot.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 msdos_partition.h reader.h symbol.h term.h time.h types.h \
machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \
machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \
machine/kernel.h machine/pxe.h i386/pit.h list.h handler.h command.h \
i18n.h env_private.h
kernel_img_HEADERS += machine/biosdisk.h machine/vga.h machine/vbe.h \
machine/pxe.h i386/pit.h machine/init.h
kernel_img_CFLAGS = $(COMMON_CFLAGS) $(TARGET_IMG_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR) $(COMMON_CFLAGS)
kernel_img_FORMAT = binary
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# Utilities.
bin_UTILITIES = grub-mkimage
sbin_UTILITIES = grub-setup
@ -94,9 +75,10 @@ util/grub-mkrawimage.c_DEPENDENCIES = Makefile
util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h
grub_setup_SOURCES = gnulib/progname.c \
util/i386/pc/grub-setup.c util/hostdisk.c \
util/misc.c util/getroot.c kern/device.c kern/disk.c \
kern/err.c kern/misc.c kern/parser.c kern/partition.c \
kern/file.c kern/list.c kern/fs.c kern/env.c fs/fshelp.c \
util/misc.c util/getroot.c kern/device.c kern/disk.c \
kern/err.c kern/misc.c kern/parser.c kern/partition.c \
kern/file.c kern/fs.c kern/env.c kern/list.c \
fs/fshelp.c \
\
fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
@ -107,7 +89,7 @@ grub_setup_SOURCES = gnulib/progname.c \
partmap/msdos.c partmap/bsdlabel.c partmap/gpt.c \
\
disk/raid.c disk/mdraid_linux.c disk/lvm.c \
util/raid.c util/lvm.c \
util/raid.c util/lvm.c \
grub_setup_init.c
sbin_SCRIPTS += grub-install
@ -117,20 +99,14 @@ bin_SCRIPTS += grub-mkrescue
grub_mkrescue_SOURCES = util/grub-mkrescue.in
pkglib_MODULES = biosdisk.mod chain.mod \
reboot.mod halt.mod \
vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \
vga.mod memdisk.mod pci.mod lspci.mod \
aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \
datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \
halt.mod \
vbe.mod vbetest.mod vbeinfo.mod \
vga.mod \
aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod \
ata_pthru.mod hdparm.mod \
usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod \
efiemu.mod mmap.mod acpi.mod drivemap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For drivemap.mod.
drivemap_mod_SOURCES = commands/i386/pc/drivemap.c \
commands/i386/pc/drivemap_int13h.S
@ -187,21 +163,11 @@ xnu_mod_CFLAGS = $(COMMON_CFLAGS)
xnu_mod_LDFLAGS = $(COMMON_LDFLAGS)
xnu_mod_ASFLAGS = $(COMMON_ASFLAGS)
# For reboot.mod.
reboot_mod_SOURCES = commands/reboot.c
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
halt_mod_SOURCES = commands/i386/pc/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For serial.mod.
serial_mod_SOURCES = term/serial.c
serial_mod_CFLAGS = $(COMMON_CFLAGS)
serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For vbe.mod.
vbe_mod_SOURCES = video/i386/pc/vbe.c
vbe_mod_CFLAGS = $(COMMON_CFLAGS)
@ -217,31 +183,11 @@ vbetest_mod_SOURCES = commands/i386/pc/vbetest.c
vbetest_mod_CFLAGS = $(COMMON_CFLAGS)
vbetest_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For play.mod.
play_mod_SOURCES = commands/i386/pc/play.c
play_mod_CFLAGS = $(COMMON_CFLAGS)
play_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For vga.mod.
vga_mod_SOURCES = term/i386/pc/vga.c
vga_mod_CFLAGS = $(COMMON_CFLAGS)
vga_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For memdisk.mod.
memdisk_mod_SOURCES = disk/memdisk.c
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For pci.mod
pci_mod_SOURCES = bus/pci.c
pci_mod_CFLAGS = $(COMMON_CFLAGS)
pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lspci.mod
lspci_mod_SOURCES = commands/lspci.c
lspci_mod_CFLAGS = $(COMMON_CFLAGS)
lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For aout.mod
aout_mod_SOURCES = loader/aout.c
aout_mod_CFLAGS = $(COMMON_CFLAGS)
@ -298,21 +244,6 @@ datetime_mod_SOURCES = lib/cmos_datetime.c
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For date.mod
date_mod_SOURCES = commands/date.c
date_mod_CFLAGS = $(COMMON_CFLAGS)
date_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datehook.mod
datehook_mod_SOURCES = hook/datehook.c
datehook_mod_CFLAGS = $(COMMON_CFLAGS)
datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lsmmap.mod
lsmmap_mod_SOURCES = commands/lsmmap.c
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For ata_pthru.mod.
ata_pthru_mod_SOURCES = disk/ata_pthru.c
ata_pthru_mod_CFLAGS = $(COMMON_CFLAGS)

View file

@ -1,2 +1,88 @@
# -*- makefile -*-
include $(srcdir)/conf/i386-coreboot.mk
COMMON_CFLAGS = -mrtd -mregparm=3
# Images.
GRUB_KERNEL_MACHINE_LINK_ADDR = 0x8200
GRUB_BOOT_MACHINE_LINK_ADDR = 0xffe00
pkglib_IMAGES += boot.img
boot_img_SOURCES = boot/i386/qemu/boot.S
boot_img_ASFLAGS = $(COMMON_ASFLAGS) -DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)
boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_BOOT_MACHINE_LINK_ADDR)
boot_img_FORMAT = binary
bin_UTILITIES += grub-mkimage
grub_mkimage_SOURCES = util/grub-mkrawimage.c util/misc.c \
util/resolve.c gnulib/progname.c
grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR)
util/grub-mkrawimage.c_DEPENDENCIES = Makefile
pkglib_IMAGES += kernel.img
kernel_img_SOURCES = kern/i386/qemu/startup.S \
kern/i386/misc.S \
kern/i386/coreboot/init.c \
kern/i386/qemu/mmap.c \
kern/i386/halt.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/term.c \
kern/rescue_parser.c kern/rescue_reader.c \
kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/$(target_cpu)/dl.c kern/parser.c kern/partition.c \
kern/i386/tsc.c kern/i386/pit.c \
kern/generic/rtc_get_time_ms.c \
kern/generic/millisleep.c \
kern/env.c \
term/i386/pc/vga_text.c term/i386/vga_common.c \
symlist.c
kernel_img_CFLAGS = $(COMMON_CFLAGS) -DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR)
kernel_img_FORMAT = binary
sbin_SCRIPTS += grub-install
grub_install_SOURCES = util/grub-install.in
bin_SCRIPTS += grub-mkrescue
grub_mkrescue_SOURCES = util/grub-mkrescue.in
# Modules.
pkglib_MODULES = linux.mod aout.mod halt.mod datetime.mod mmap.mod
# For mmap.mod.
mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c
mmap_mod_CFLAGS = $(COMMON_CFLAGS)
mmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
mmap_mod_ASFLAGS = $(COMMON_ASFLAGS)
# For linux.mod.
linux_mod_SOURCES = loader/i386/linux.c
linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
halt_mod_SOURCES = commands/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For aout.mod.
aout_mod_SOURCES = loader/aout.c
aout_mod_CFLAGS = $(COMMON_CFLAGS)
aout_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For bsd.mod
pkglib_MODULES += bsd.mod
bsd_mod_SOURCES = loader/i386/bsd.c loader/i386/bsd32.c loader/i386/bsd64.c loader/i386/bsd_helper.S loader/i386/bsd_trampoline.S
bsd_mod_CFLAGS = $(COMMON_CFLAGS)
bsd_mod_LDFLAGS = $(COMMON_LDFLAGS)
bsd_mod_ASFLAGS = $(COMMON_ASFLAGS)
# For datetime.mod
datetime_mod_SOURCES = lib/cmos_datetime.c
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
include $(srcdir)/conf/i386.mk
include $(srcdir)/conf/common.mk

View file

@ -47,3 +47,28 @@ multiboot2_mod_SOURCES = loader/i386/multiboot.c \
multiboot2_mod_CFLAGS = $(COMMON_CFLAGS) -DGRUB_USE_MULTIBOOT2
multiboot2_mod_LDFLAGS = $(COMMON_LDFLAGS)
multiboot2_mod_ASFLAGS = $(COMMON_ASFLAGS)
# For serial.mod.
pkglib_MODULES += serial.mod
serial_mod_SOURCES = term/serial.c
serial_mod_CFLAGS = $(COMMON_CFLAGS)
serial_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For pci.mod
pkglib_MODULES += pci.mod
pci_mod_SOURCES = bus/pci.c
pci_mod_CFLAGS = $(COMMON_CFLAGS)
pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lspci.mod
pkglib_MODULES += lspci.mod
lspci_mod_SOURCES = commands/lspci.c
lspci_mod_CFLAGS = $(COMMON_CFLAGS)
lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For play.mod.
pkglib_MODULES += play.mod
play_mod_SOURCES = commands/i386/pc/play.c
play_mod_CFLAGS = $(COMMON_CFLAGS)
play_mod_LDFLAGS = $(COMMON_LDFLAGS)

View file

@ -3,6 +3,9 @@ LINK_BASE = 0x80200000
target_machine=yeeloong
COMMON_CFLAGS += -march=mips3
COMMON_ASFLAGS += -march=mips3
kernel_img_HEADERS += pci.h bitmap.h video.h gfxterm.h font.h bitmap_scale.h bufio.h
include $(srcdir)/conf/mips.mk
pkglib_IMAGES = kernel.img
@ -61,19 +64,11 @@ datetime_mod_SOURCES = lib/cmos_datetime.c
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For date.mod
pkglib_MODULES += date.mod
date_mod_SOURCES = commands/date.c
date_mod_CFLAGS = $(COMMON_CFLAGS)
date_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datehook.mod
pkglib_MODULES += datehook.mod
datehook_mod_SOURCES = hook/datehook.c
datehook_mod_CFLAGS = $(COMMON_CFLAGS)
datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += linux.mod
linux_mod_SOURCES = loader/$(target_cpu)/linux.c
linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_ASFLAGS = $(COMMON_ASFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
sbin_SCRIPTS += grub-install
grub_install_SOURCES = util/grub-install.in

View file

@ -1,33 +1,10 @@
# -*- makefile -*-
COMMON_ASFLAGS += -nostdinc
COMMON_CFLAGS += -ffreestanding -mexplicit-relocs -mflush-func=grub_cpu_flush_cache
COMMON_LDFLAGS += -nostdlib
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
COMMON_CFLAGS += -mexplicit-relocs -mflush-func=grub_cpu_flush_cache
# Images.
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst
kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \
symbol.h term.h time.h types.h loader.h partition.h \
msdos_partition.h machine/kernel.h handler.h list.h \
command.h machine/memory.h cpu/libgcc.h cpu/cache.h i18n.h env_private.h
ifeq ($(platform), yeeloong)
kernel_img_HEADERS += pci.h
endif
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_img_HEADERS += cpu/libgcc.h cpu/cache.h
# Scripts.
sbin_SCRIPTS =
@ -40,26 +17,6 @@ grub_mkimage_SOURCES = gnulib/progname.c util/grub-mkrawimage.c util/misc.c \
grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(LINK_BASE)
util/grub-mkrawimage.c_DEPENDENCIES = Makefile
# Modules.
pkglib_MODULES = memdisk.mod \
lsmmap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For memdisk.mod.
memdisk_mod_SOURCES = disk/memdisk.c
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lsmmap.mod
lsmmap_mod_SOURCES = commands/lsmmap.c
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For serial.mod.
pkglib_MODULES += serial.mod
serial_mod_SOURCES = term/serial.c
@ -73,10 +30,4 @@ relocator_mod_CFLAGS = $(COMMON_CFLAGS)
relocator_mod_ASFLAGS = $(COMMON_ASFLAGS)
relocator_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += linux.mod
linux_mod_SOURCES = loader/$(target_cpu)/linux.c
linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_ASFLAGS = $(COMMON_ASFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
include $(srcdir)/conf/common.mk

View file

@ -1,29 +1,9 @@
# -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__
COMMON_CFLAGS = -ffreestanding
COMMON_LDFLAGS += -nostdlib
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
# Images.
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst
kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \
symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \
msdos_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \
command.h i18n.h env_private.h
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_img_HEADERS += cpu/libgcc.h ieee1275/ieee1275.h
# Programs
pkglib_PROGRAMS = kernel.img
@ -57,47 +37,33 @@ grub_install_SOURCES = util/ieee1275/grub-install.in
grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in
# Modules.
pkglib_MODULES = halt.mod \
linux.mod \
reboot.mod \
suspend.mod \
memdisk.mod \
lsmmap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += ieee1275_fb.mod
ieee1275_fb_mod_SOURCES = video/ieee1275.c
ieee1275_fb_mod_CFLAGS = $(COMMON_CFLAGS)
ieee1275_fb_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For linux.mod.
pkglib_MODULES += linux.mod
linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c
linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For suspend.mod
pkglib_MODULES += 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/reboot.c
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod
pkglib_MODULES += halt.mod
halt_mod_SOURCES = commands/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For memdisk.mod.
memdisk_mod_SOURCES = disk/memdisk.c
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lsmmap.mod
lsmmap_mod_SOURCES = commands/lsmmap.c
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datetime.mod
pkglib_MODULES += datetime.mod
datetime_mod_SOURCES = lib/ieee1275/datetime.c
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
include $(srcdir)/conf/common.mk

View file

@ -1,12 +1,8 @@
# -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -m64
COMMON_CFLAGS = -ffreestanding -m64 -mno-app-regs
COMMON_LDFLAGS = -melf64_sparc -nostdlib -mno-relax
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
COMMON_CFLAGS = -mno-app-regs
COMMON_LDFLAGS = -melf64_sparc -mno-relax
# Images.
pkglib_IMAGES = boot.img diskboot.img kernel.img
@ -23,15 +19,7 @@ diskboot_img_ASFLAGS = $(COMMON_ASFLAGS)
diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,0x4200
diskboot_img_FORMAT = binary
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst
kernel_img_HEADERS = boot.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 msdos_partition.h reader.h symbol.h term.h time.h types.h \
list.h handler.h command.h i18n.h \
sparc64/libgcc.h ieee1275/ieee1275.h machine/kernel.h \
sparc64/ieee1275/ieee1275.h env_private.h
kernel_img_HEADERS += cpu/libgcc.h ieee1275/ieee1275.h cpu/ieee1275/ieee1275.h
kernel_img_SOURCES = kern/sparc64/ieee1275/crt0.S kern/ieee1275/cmain.c \
kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \
@ -48,29 +36,24 @@ kernel_img_SOURCES = kern/sparc64/ieee1275/crt0.S kern/ieee1275/cmain.c \
symlist.c kern/$(target_cpu)/cache.S
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc -static-libgcc -lgcc
kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,0x4400,-Bstatic,-melf64_sparc -static-libgcc -lgcc
kernel_img_FORMAT = binary
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# Utilities.
bin_UTILITIES = grub-mkimage
sbin_UTILITIES = grub-setup grub-ofpathname
# For grub-mkimage.
grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \
grub_mkimage_SOURCES = util/grub-mkrawimage.c util/misc.c \
util/resolve.c gnulib/progname.c
# For grub-setup.
util/sparc64/ieee1275/grub-setup.c_DEPENDENCIES = grub_setup_init.h
grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \
util/misc.c util/getroot.c kern/device.c kern/disk.c \
kern/err.c kern/misc.c kern/parser.c kern/partition.c \
kern/file.c kern/fs.c kern/env.c kern/list.c fs/fshelp.c \
util/misc.c util/getroot.c kern/device.c kern/disk.c \
kern/err.c kern/misc.c kern/parser.c kern/partition.c \
kern/file.c kern/fs.c kern/env.c kern/list.c \
fs/fshelp.c \
\
fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
@ -82,7 +65,7 @@ grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \
partmap/bsdlabel.c partmap/sun.c partmap/acorn.c \
\
disk/raid.c disk/mdraid_linux.c disk/lvm.c \
util/raid.c util/lvm.c gnulib/progname.c \
util/raid.c util/lvm.c gnulib/progname.c \
grub_setup_init.c
# For grub-ofpathname.
@ -96,41 +79,27 @@ sbin_SCRIPTS = grub-install
grub_install_SOURCES = util/grub-install.in
# Modules.
pkglib_MODULES = halt.mod \
linux.mod \
reboot.mod \
memdisk.mod \
lsmmap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += ieee1275_fb.mod
ieee1275_fb_mod_SOURCES = video/ieee1275.c
ieee1275_fb_mod_CFLAGS = $(COMMON_CFLAGS)
ieee1275_fb_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For linux.mod.
pkglib_MODULES += linux.mod
linux_mod_SOURCES = loader/sparc64/ieee1275/linux.c
linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For reboot.mod.
reboot_mod_SOURCES = commands/reboot.c
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
pkglib_MODULES += halt.mod
halt_mod_SOURCES = commands/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For memdisk.mod.
memdisk_mod_SOURCES = disk/memdisk.c
memdisk_mod_CFLAGS = $(COMMON_CFLAGS)
memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lsmmap.mod
lsmmap_mod_SOURCES = commands/lsmmap.c
lsmmap_mod_CFLAGS = $(COMMON_CFLAGS)
lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datetime.mod
pkglib_MODULES += datetime.mod
datetime_mod_SOURCES = lib/ieee1275/datetime.c
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
include $(srcdir)/conf/common.mk

View file

@ -37,12 +37,28 @@ example_scripted_test_SOURCES = tests/example_scripted_test.in
check_SCRIPTS += example_grub_script_test
example_grub_script_test_SOURCES = tests/example_grub_script_test.in
#
# Rules for real tests
#
check_SCRIPTS += grub_script_echo1
grub_script_echo1_SOURCES = tests/grub_script_echo1.in
check_SCRIPTS += grub_script_echo_keywords
grub_script_echo_keywords_SOURCES = tests/grub_script_echo_keywords.in
check_SCRIPTS += grub_script_vars1
grub_script_vars1_SOURCES = tests/grub_script_vars1.in
# List of tests to execute on "make check"
SCRIPTED_TESTS = example_scripted_test
SCRIPTED_TESTS += example_grub_script_test
UNIT_TESTS = example_unit_test
FUNCTIONAL_TESTS = example_functional_test.mod
# SCRIPTED_TESTS = example_scripted_test
# SCRIPTED_TESTS += example_grub_script_test
# UNIT_TESTS = example_unit_test
# FUNCTIONAL_TESTS = example_functional_test.mod
SCRIPTED_TESTS = grub_script_echo1
SCRIPTED_TESTS += grub_script_echo_keywords
SCRIPTED_TESTS += grub_script_vars1
# dependencies between tests and testing-tools
$(SCRIPTED_TESTS): grub-shell grub-shell-tester

113
conf/x86-efi.rmk Normal file
View file

@ -0,0 +1,113 @@
# -*- makefile -*-
# Utilities.
bin_UTILITIES = grub-mkimage
# For grub-mkimage.
grub_mkimage_SOURCES = gnulib/progname.c util/i386/efi/grub-mkimage.c \
util/misc.c util/resolve.c
util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile
# Scripts.
sbin_SCRIPTS = grub-install
# For grub-install.
grub_install_SOURCES = util/i386/efi/grub-install.in
# Modules.
pkglib_PROGRAMS = kernel.img
pkglib_MODULES = chain.mod appleldr.mod \
linux.mod halt.mod \
datetime.mod loadbios.mod \
fixvideo.mod mmap.mod acpi.mod
# For kernel.img.
kernel_img_RELOCATABLE = yes
kernel_img_SOURCES = kern/$(target_cpu)/efi/startup.S 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/term.c \
kern/rescue_parser.c kern/rescue_reader.c \
kern/$(target_cpu)/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
term/efi/console.c disk/efi/efidisk.c \
kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/i386/tsc.c kern/i386/pit.c \
kern/generic/rtc_get_time_ms.c \
kern/generic/millisleep.c
ifeq ($(target_cpu),x86_64)
kernel_img_SOURCES += kern/x86_64/efi/callwrap.S
endif
kernel_img_HEADERS += efi/efi.h efi/time.h efi/disk.h i386/pit.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
# For acpi.mod.
acpi_mod_SOURCES = commands/acpi.c commands/efi/acpi.c
acpi_mod_CFLAGS = $(COMMON_CFLAGS)
acpi_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For mmap.mod.
mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \
mmap/efi/mmap.c
mmap_mod_CFLAGS = $(COMMON_CFLAGS)
mmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For chain.mod.
chain_mod_SOURCES = loader/efi/chainloader.c
chain_mod_CFLAGS = $(COMMON_CFLAGS)
chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For appleldr.mod.
appleldr_mod_SOURCES = loader/efi/appleloader.c
appleldr_mod_CFLAGS = $(COMMON_CFLAGS)
appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For linux.mod.
linux_mod_SOURCES = loader/i386/efi/linux.c
ifeq ($(target_cpu), x86_64)
linux_mod_SOURCES += loader/i386/linux_trampoline.S
endif
linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_ASFLAGS = $(COMMON_ASFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
halt_mod_SOURCES = commands/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datetime.mod
datetime_mod_SOURCES = lib/efi/datetime.c
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For loadbios.mod
loadbios_mod_SOURCES = commands/efi/loadbios.c
loadbios_mod_CFLAGS = $(COMMON_CFLAGS)
loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For fixvideo.mod
fixvideo_mod_SOURCES = commands/efi/fixvideo.c
fixvideo_mod_CFLAGS = $(COMMON_CFLAGS)
fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += efi_uga.mod
efi_uga_mod_SOURCES = video/efi_uga.c
efi_uga_mod_CFLAGS = $(COMMON_CFLAGS)
efi_uga_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += efi_gop.mod
efi_gop_mod_SOURCES = video/efi_gop.c
efi_gop_mod_CFLAGS = $(COMMON_CFLAGS)
efi_gop_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += xnu.mod
xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c \
loader/macho32.c loader/macho64.c loader/macho.c loader/xnu.c
xnu_mod_CFLAGS = $(COMMON_CFLAGS)
xnu_mod_LDFLAGS = $(COMMON_LDFLAGS)
xnu_mod_ASFLAGS = $(COMMON_ASFLAGS)
include $(srcdir)/conf/i386.mk
include $(srcdir)/conf/common.mk

View file

@ -1,166 +1,5 @@
# -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -fno-builtin -m64
COMMON_CFLAGS = -fno-builtin -m64
COMMON_LDFLAGS = -melf_x86_64 -nostdlib
COMMON_LDFLAGS = -melf_x86_64
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
# Utilities.
bin_UTILITIES = grub-mkimage
# For grub-mkimage.
grub_mkimage_SOURCES = gnulib/progname.c util/i386/efi/grub-mkimage.c \
util/misc.c util/resolve.c
# For grub-setup.
#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.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 fs/xfs.c fs/affs.c \
# fs/sfs.c kern/parser.c kern/partition.c partmap/msdos.c \
# fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \
# kern/fs.c kern/env.c fs/fshelp.c
# Scripts.
sbin_SCRIPTS = grub-install
# For grub-install.
grub_install_SOURCES = util/i386/efi/grub-install.in
# Modules.
pkglib_PROGRAMS = kernel.img
pkglib_MODULES = chain.mod appleldr.mod \
halt.mod reboot.mod linux.mod pci.mod lspci.mod \
datetime.mod date.mod datehook.mod loadbios.mod \
fixvideo.mod mmap.mod acpi.mod
# For kernel.img.
kernel_img_RELOCATABLE = yes
kernel_img_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \
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/term.c \
kern/rescue_parser.c kern/rescue_reader.c \
kern/$(target_cpu)/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \
kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \
kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \
kern/i386/tsc.c kern/i386/pit.c \
kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \
term/efi/console.c disk/efi/efidisk.c
kernel_img_HEADERS = boot.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 msdos_partition.h reader.h symbol.h term.h time.h types.h \
efi/efi.h efi/time.h efi/disk.h machine/loader.h i386/pit.h list.h \
handler.h command.h i18n.h env_private.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
MOSTLYCLEANFILES += symlist.c
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# For boot.mod.
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For acpi.mod.
acpi_mod_SOURCES = commands/acpi.c commands/efi/acpi.c
acpi_mod_CFLAGS = $(COMMON_CFLAGS)
acpi_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For mmap.mod.
mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \
mmap/efi/mmap.c
mmap_mod_CFLAGS = $(COMMON_CFLAGS)
mmap_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For chain.mod.
chain_mod_SOURCES = loader/efi/chainloader.c
chain_mod_CFLAGS = $(COMMON_CFLAGS)
chain_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For appleldr.mod.
appleldr_mod_SOURCES = loader/efi/appleloader.c
appleldr_mod_CFLAGS = $(COMMON_CFLAGS)
appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For linux.mod.
linux_mod_SOURCES = loader/i386/efi/linux.c loader/i386/linux_trampoline.S
linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_ASFLAGS = $(COMMON_ASFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
halt_mod_SOURCES = commands/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For reboot.mod.
reboot_mod_SOURCES = commands/reboot.c
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For pci.mod
pci_mod_SOURCES = bus/pci.c
pci_mod_CFLAGS = $(COMMON_CFLAGS)
pci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For lspci.mod
lspci_mod_SOURCES = commands/lspci.c
lspci_mod_CFLAGS = $(COMMON_CFLAGS)
lspci_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datetime.mod
datetime_mod_SOURCES = lib/efi/datetime.c
datetime_mod_CFLAGS = $(COMMON_CFLAGS)
datetime_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For date.mod
date_mod_SOURCES = commands/date.c
date_mod_CFLAGS = $(COMMON_CFLAGS)
date_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For datehook.mod
datehook_mod_SOURCES = hook/datehook.c
datehook_mod_CFLAGS = $(COMMON_CFLAGS)
datehook_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For loadbios.mod
loadbios_mod_SOURCES = commands/efi/loadbios.c
loadbios_mod_CFLAGS = $(COMMON_CFLAGS)
loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For fixvideo.mod
fixvideo_mod_SOURCES = commands/efi/fixvideo.c
fixvideo_mod_CFLAGS = $(COMMON_CFLAGS)
fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += efi_uga.mod
efi_uga_mod_SOURCES = video/efi_uga.c
efi_uga_mod_CFLAGS = $(COMMON_CFLAGS)
efi_uga_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += efi_gop.mod
efi_gop_mod_SOURCES = video/efi_gop.c
efi_gop_mod_CFLAGS = $(COMMON_CFLAGS)
efi_gop_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += xnu.mod
xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c \
loader/macho32.c loader/macho64.c loader/macho.c loader/xnu.c
xnu_mod_CFLAGS = $(COMMON_CFLAGS)
xnu_mod_LDFLAGS = $(COMMON_LDFLAGS)
xnu_mod_ASFLAGS = $(COMMON_ASFLAGS)
include $(srcdir)/conf/i386.mk
include $(srcdir)/conf/common.mk
include $(srcdir)/conf/x86-efi.mk

View file

@ -31,7 +31,7 @@ dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
dnl type.
AC_INIT([GRUB],[1.97],[bug-grub@gnu.org])
AC_INIT([GRUB],[1.98],[bug-grub@gnu.org])
AM_INIT_AUTOMAKE()
AC_PREREQ(2.60)
AC_CONFIG_SRCDIR([include/grub/dl.h])
@ -51,6 +51,7 @@ fi
case "$target_cpu" in
i[[3456]]86) target_cpu=i386 ;;
amd64) target_cpu=x86_64 ;;
sparc) target_cpu=sparc64 ;;
mipsel|mips64el)
target_cpu=mips;
@ -90,6 +91,7 @@ fi
if test -z "$target_alias"; then
case "$target_cpu"-"$platform" in
x86_64-efi) ;;
x86_64-emu) ;;
x86_64-*) target_cpu=i386 ;;
powerpc64-ieee1275) target_cpu=powerpc ;;
esac
@ -138,9 +140,14 @@ case "$platform" in
qemu) machine_CFLAGS="-DGRUB_MACHINE_QEMU=1" ;;
pc) machine_CFLAGS="-DGRUB_MACHINE_PCBIOS=1" ;;
emu) machine_CFLAGS="-DGRUB_MACHINE_EMU=1" ;;
yeeloong) machine_CFLAGS="-DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
qemu-mips) machine_CFLAGS="-DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
yeeloong) machine_CFLAGS="-DGRUB_MACHINE_MIPS_YEELOONG=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
qemu-mips) machine_CFLAGS="-DGRUB_MACHINE_MIPS_QEMU_MIPS=1 -DGRUB_MACHINE_MIPS_BONITO=1" ;;
esac
case "$target_cpu" in
mips) machine_CFLAGS="$machine_CFLAGS -DGRUB_MACHINE_MIPS=1" ;;
sparc64) machine_CFLAGS="$machine_CFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
esac
CFLAGS="$CFLAGS $machine_CFLAGS"
TARGET_ASFLAGS="$TARGET_ASFLAGS $machine_CFLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS $machine_CFLAGS"
@ -163,6 +170,11 @@ if test "x$CMP" = x; then
AC_MSG_ERROR([cmp is not found])
fi
AC_CHECK_PROGS([LEX], [flex])
if test "x$LEX" = x; then
AC_MSG_ERROR([flex is not found])
fi
AC_CHECK_PROGS([YACC], [bison])
if test "x$YACC" = x; then
AC_MSG_ERROR([bison is not found])
@ -352,6 +364,7 @@ AC_MSG_RESULT([$TARGET_OBJ2ELF])
if test "x$target_m32" = x1; then
# Force 32-bit mode.
TARGET_CFLAGS="$TARGET_CFLAGS -m32"
TARGET_ASFLAGS="$TARGET_CFLAGS -m32"
TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
TARGET_MODULE_FORMAT="elf32"
fi
@ -359,6 +372,7 @@ fi
if test "x$target_m64" = x1; then
# Force 64-bit mode.
TARGET_CFLAGS="$TARGET_CFLAGS -m64"
TARGET_ASFLAGS="$TARGET_ASFLAGS -m64"
TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
TARGET_MODULE_FORMAT="elf64"
fi
@ -516,6 +530,21 @@ enable_efiemu=no
fi
AC_SUBST([enable_efiemu])
if test "$platform" != emu; then
AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [
SAVED_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
int va_arg_func (int fixed, va_list args);]], [[]])],
[grub_cv_cc_isystem=yes],
[grub_cv_cc_isystem=no])
CPPFLAGS="$SAVED_CPPFLAGS"
])
if test x"$grub_cv_cc_isystem" = xyes ; then
TARGET_CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
fi
fi
# Restore the flags.
CC="$tmp_CC"
@ -679,6 +708,16 @@ if test x"$grub_mkfont_excuse" = x ; then
freetype_cflags=`freetype-config --cflags`
freetype_libs=`freetype-config --libs`
fi
if test x"$grub_mkfont_excuse" = x ; then
# Check for freetype libraries.
SAVED_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $freetype_cflags"
AC_CHECK_HEADERS([ft2build.h], [],
[grub_mkfont_excuse=["need freetype2 headers"]])
CPPFLAGS="$SAVED_CPPFLAGS"
fi
if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then
AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled])
fi

View file

@ -825,7 +825,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle)
if (! disk)
return 1;
if (disk->id == GRUB_DISK_DEVICE_EFIDISK_ID)
if (disk->dev->id == GRUB_DISK_DEVICE_EFIDISK_ID)
{
struct grub_efidisk_data *d;

View file

@ -172,16 +172,6 @@ grub_ofdisk_open (const char *name, grub_disk_t disk)
grub_dprintf ("disk", "Opening `%s'.\n", op->devpath);
grub_ieee1275_open (op->devpath, &dev_ihandle);
if (! dev_ihandle)
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
goto fail;
}
grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath,
(void *) (unsigned long) dev_ihandle);
if (grub_ieee1275_finddevice (op->devpath, &dev))
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't read device properties");
@ -201,6 +191,16 @@ grub_ofdisk_open (const char *name, grub_disk_t disk)
goto fail;
}
grub_ieee1275_open (op->devpath, &dev_ihandle);
if (! dev_ihandle)
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
goto fail;
}
grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath,
(void *) (unsigned long) dev_ihandle);
/* XXX: There is no property to read the number of blocks. There
should be a property `#blocks', but it is not there. Perhaps it
is possible to use seek for this. */
@ -234,14 +234,10 @@ grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
grub_ssize_t status, actual;
unsigned long long pos;
grub_dprintf ("disk",
"Reading handle %p: sector 0x%llx, size 0x%lx, buf %p.\n",
(void *) disk->data, (long long) sector, (long) size, buf);
pos = sector * 512UL;
grub_ieee1275_seek ((grub_ieee1275_ihandle_t) (unsigned long) disk->data,
(int) (pos >> 32), (int) pos & 0xFFFFFFFFUL, &status);
pos, &status);
if (status < 0)
return grub_error (GRUB_ERR_READ_ERROR,
"seek error, can't seek block %llu",

View file

@ -242,7 +242,7 @@ static struct grub_disk_dev grub_loopback_dev =
static grub_extcmd_t cmd;
GRUB_MOD_INIT(loop)
GRUB_MOD_INIT(loopback)
{
cmd = grub_register_extcmd ("loopback", grub_cmd_loopback,
GRUB_COMMAND_FLAG_BOTH,
@ -251,7 +251,7 @@ GRUB_MOD_INIT(loop)
grub_disk_dev_register (&grub_loopback_dev);
}
GRUB_MOD_FINI(loop)
GRUB_MOD_FINI(loopback)
{
grub_unregister_extcmd (cmd);
grub_disk_dev_unregister (&grub_loopback_dev);

View file

@ -23,7 +23,6 @@
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/types.h>
#include <grub/machine/kernel.h>
static char *memdisk_addr;
static grub_off_t memdisk_size = 0;

View file

@ -208,12 +208,14 @@ grub_scsi_iterate (int (*hook) (const char *name))
for (i = 0; i < luns; i++)
{
char *sname;
int ret;
sname = grub_xasprintf ("%s%c", name, 'a' + i);
if (!sname)
return 1;
if (hook (sname))
return 1;
ret = hook (sname);
grub_free (sname);
if (ret)
return 1;
}
return 0;
}

View file

@ -1,128 +0,0 @@
# GRUB gfxmenu theme "winter".
# Uses background image from:
# http://www.cyberpunkcafe.com/e107_plugins/autogallery/autogallery.php?show=1.Open%20Source%20Wallpaper
# "without-leaves.png" was called "Without Leafs in Winter.png"
lua-script: "winter.lua"
title-text: ""
title-font: "Helvetica Bold 18"
status-font: "Helvetica 8"
terminal-font: "Fixed 9"
title-color: "40, 40, 40"
status-color: "#FFF"
status-bg-color: "0, 166, 183, 128"
desktop-image: "without-leaves.png"
desktop-color: "0, 154, 183"
terminal-box: "terminal_*.png"
+ boot_menu {
position = (120, 60)
preferred_size = (400, -1)
item_font = "Helvetica Bold 14"
selected_item_font = "Helvetica Bold 14"
item_color = "0, 0, 0"
selected_item_color = "203, 251, 255"
menu_pixmap_style = "menu_*.png"
selected_item_pixmap_style = "select_*.png"
icon_width = 44
icon_height = 44
item_height = 32
item_padding = 0
item_icon_space = 3
item_spacing = 11
}
# You can add text at arbitrary locations on the screen.
# The specification within the "+label {...}" block is free-form,
# so you can use as much or as little white space as you like.
+ label {
position = (170, 50)
font = "smoothansi 13"
color = "0,0,128"
text = "This is the Winter theme ... brought to you by GRUB!"
}
# Show the text alignment supported by labels.
+ vbox {
position = (220, 347)
preferred_size = (200, -1) # A preferred size of -1 means automatic.
+ label { text="Text alignment demo" align="center" font="aqui 11" }
+ label { text="Left" align="left" font="cure 11" }
+ label { text="Center" align="center" font="cure 11" }
+ label { text="Right" align="right" font="cure 11" }
}
+ vbox {
position = (580, 10)
+ label { text="GNU" font="gelly 11" color="0, 0, 0" }
+ label { text="GRUB" font="aqui 11" color="0, 0, 0" }
+ label { text="boot loader" font="cure 11" color="0, 0, 0" }
}
+ hbox {
position = (80, 10)
+ label { text="GNU" font="gelly 11" color="0, 0, 0" }
+ label { text="GRUB" font="aqui 11" color="0, 0, 0" }
+ label { text="boot loader" font="cure 11" color="0, 0, 0" }
}
# Demonstration of a compound layout: boxes within boxes.
+ hbox
{
position = (480, 3)
+ vbox
{
# Note: We can't just use 'size' to set the image's size,
# since the vbox will resize the component according to its
# preferred size, which for images is the native image size.
+ image { file="/boot/grub/themes/icons/ubuntu.png"
preferred_size = (20, 20) }
+ image { file="/boot/grub/themes/icons/gentoo.png"
preferred_size = (20, 20) }
}
+ vbox
{
+ label { text="GRand" font="cure 11" color=#99F }
+ label { text="Unified" font="cure 11" color=#BBF }
+ label { text="Bootloader" font="cure 11" color=#DDF }
}
}
# By defining a 'progress_bar' type component with an ID of '__timeout__',
# the progress bar will be used to display the time remaining before an
# the default entry is automatically booted.
+ progress_bar
{
id = "__timeout__"
position = (80, 393)
preferred_size = (500, 24)
font = "cure 11"
text_color = #000
fg_color = #CCF
bg_color = #66B
border_color = #006
show_text = false
}
# Although the progress_bar component is normally used to indicate the
# time remaining, it's also possible to create other components with an ID
# of '__timeout__'. All components with and ID of 'timeout_bar' will have
# the following properties set based on the timeout value:
# text, value, start, end, visible.
# In this case, we have set 'show_text=false' on the progress bar, and use
# the following label's 'text' property to display the message.
+ label
{
id = "__timeout__"
position = (80, 420)
preferred_size = (500, 24)
font = "lime 11"
color = #117
align = "center"
}

View file

@ -1126,6 +1126,7 @@ you forget a command, you can run the command @command{help}
* insmod:: Insert a module
* keystatus:: Check key modifier status
* ls:: List devices or files
* play:: Play a tune
* reboot:: Reboot your computer
* set:: Set an environment variable
* unset:: Unset an environment variable
@ -1364,6 +1365,24 @@ name syntax}), then list the contents of that directory.
@end deffn
@node play
@subsection play
@deffn Command play file | tempo [pitch1 duration1] [pitch2 duration2] ...
Plays a tune
If the argument is a file name (@pxref{File name syntax}), play the tune
recorded in it. The file format is first the tempo as an unsigned 32bit
little-endian number, then pairs of unsigned 16bit little-endian numbers for
pitch and duration pairs.
If the arguments are a series of numbers, play the inline tune.
The tempo is the base for all note durations. 60 gives a 1-second base, 120
gives a half-second base, etc. Pitches are Hz.
@end deffn
@node reboot
@subsection reboot

View file

@ -265,7 +265,7 @@ grub_efiemu_autocore (void)
grub_free (filename);
if (err)
return err;
#ifndef GRUB_UTIL
#ifndef GRUB_MACHINE_EMU
err = grub_machine_efiemu_init_tables ();
if (err)
return err;
@ -313,7 +313,7 @@ grub_cmd_efiemu_load (grub_command_t cmd __attribute__ ((unused)),
err = grub_efiemu_load_file (args[0]);
if (err)
return err;
#ifndef GRUB_UTIL
#ifndef GRUB_MACHINE_EMU
err = grub_machine_efiemu_init_tables ();
if (err)
return err;

View file

@ -281,7 +281,7 @@ grub_efiemu_mmap_init (void)
// the place for memory used by efiemu itself
mmap_reserved_size = GRUB_EFI_MAX_MEMORY_TYPE + 1;
#ifndef GRUB_UTIL
#ifndef GRUB_MACHINE_EMU
grub_machine_mmap_iterate (bounds_hook);
#endif
@ -394,7 +394,7 @@ grub_efiemu_mmap_fill (void)
}
}
#ifndef GRUB_UTIL
#ifndef GRUB_MACHINE_EMU
grub_machine_mmap_iterate (fill_hook);
#endif

View file

@ -862,7 +862,7 @@ grub_font_get (const char *font_name)
return &null_font;
}
/* Get the full name of the font. For instance, "Helvetica Bold 12". */
/* Get the full name of the font. */
const char *
grub_font_get_name (grub_font_t font)
{

View file

@ -56,7 +56,7 @@ lsfonts_command (grub_command_t cmd __attribute__ ((unused)),
static grub_command_t cmd_loadfont, cmd_lsfonts;
GRUB_MOD_INIT(font_manager)
GRUB_MOD_INIT(font)
{
grub_font_loader_init ();
@ -69,7 +69,7 @@ GRUB_MOD_INIT(font_manager)
0, "List the loaded fonts.");
}
GRUB_MOD_FINI(font_manager)
GRUB_MOD_FINI(font)
{
/* TODO: Determine way to free allocated resources.
Warning: possible pointer references could be in use. */

View file

@ -436,7 +436,8 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
grub_uint32_t indir[blksz / 4];
if (grub_disk_read (data->disk,
grub_le_to_cpu32 (inode->blocks.indir_block)
((grub_disk_addr_t)
grub_le_to_cpu32 (inode->blocks.indir_block))
<< log2_blksz,
0, blksz, indir))
return grub_errno;
@ -452,13 +453,15 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
grub_uint32_t indir[blksz / 4];
if (grub_disk_read (data->disk,
grub_le_to_cpu32 (inode->blocks.double_indir_block)
((grub_disk_addr_t)
grub_le_to_cpu32 (inode->blocks.double_indir_block))
<< log2_blksz,
0, blksz, indir))
return grub_errno;
if (grub_disk_read (data->disk,
grub_le_to_cpu32 (indir[rblock / perblock])
((grub_disk_addr_t)
grub_le_to_cpu32 (indir[rblock / perblock]))
<< log2_blksz,
0, blksz, indir))
return grub_errno;

View file

@ -568,21 +568,21 @@ GRUB_MOD_INIT(pxe)
buf = grub_xasprintf ("%d", grub_pxe_blksize);
if (buf)
grub_env_set ("net_pxe_blksize", buf);
grub_env_set ("pxe_blksize", buf);
grub_free (buf);
set_ip_env ("pxe_default_server", grub_pxe_default_server_ip);
set_ip_env ("pxe_default_gateway", grub_pxe_default_gateway_ip);
set_ip_env ("net_pxe_ip", grub_pxe_your_ip);
grub_register_variable_hook ("net_pxe_default_server", 0,
grub_register_variable_hook ("pxe_default_server", 0,
grub_env_write_pxe_default_server);
grub_register_variable_hook ("net_pxe_default_gateway", 0,
grub_register_variable_hook ("pxe_default_gateway", 0,
grub_env_write_pxe_default_gateway);
/* XXX: Is it possible to change IP in PXE? */
grub_register_variable_hook ("net_pxe_ip", 0,
grub_env_write_readonly);
grub_register_variable_hook ("net_pxe_blksize", 0,
grub_register_variable_hook ("pxe_blksize", 0,
grub_env_write_pxe_blocksize);
grub_disk_dev_register (&grub_pxe_dev);
grub_fs_register (&grub_pxefs_fs);

View file

@ -629,12 +629,16 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
if (dir->data->joliet)
{
char *oldname;
char *oldname, *semicolon;
oldname = filename;
filename = grub_iso9660_convert_string
((grub_uint16_t *) oldname, dirent.namelen >> 1);
semicolon = grub_strrchr (filename, ';');
if (semicolon)
*semicolon = '\0';
if (filename_alloc)
grub_free (oldname);

View file

@ -1189,7 +1189,8 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len)
(unsigned long long) (current_position - initial_position),
(unsigned long) len);
return current_position - initial_position;
/*
#if 0
switch (found.type)
{
case GRUB_REISERFS_DIRECT:
@ -1232,7 +1233,8 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len)
goto fail;
}
return read_length;*/
return read_length;
#endif
fail:
grub_free (indirect_block_ptr);

72
genemuinit.sh Normal file
View file

@ -0,0 +1,72 @@
#! /bin/sh
#
# Copyright (C) 2002,2005,2007 Free Software Foundation, Inc.
#
# This gensymlist.sh is free software; the author
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
nm="$1"
shift
cat <<EOF
/* This file is automatically generated by geninit.sh. DO NOT EDIT! */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2005,2007 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_emu_init.h"
EOF
cat <<EOF
void
grub_init_all (void)
{
EOF
read mods
for line in $mods; do
if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
echo "grub_${line}_init ();" | sed 's,\.mod,,g;'
fi
done
cat <<EOF
}
EOF
cat <<EOF
void
grub_fini_all (void)
{
EOF
for line in $mods; do
if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
echo "grub_${line}_fini ();" | sed 's,\.mod,,g;'
fi
done
cat <<EOF
}
EOF

52
genemuinitheader.sh Normal file
View file

@ -0,0 +1,52 @@
#! /bin/sh
#
# Copyright (C) 2005,2007 Free Software Foundation, Inc.
#
# This gensymlist.sh is free software; the author
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
nm="$1"
shift
cat <<EOF
/* This file is automatically generated by gensymlist.sh. DO NOT EDIT! */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2007 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/>.
*/
EOF
cat <<EOF
void grub_init_all (void);
void grub_fini_all (void);
EOF
read mods
for line in $mods; do
if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
echo "void grub_${line}_init (void);" | sed 's,\.mod,,g;'
fi
if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
echo "void grub_${line}_fini (void);" | sed 's,\.mod,,g;'
fi
done

View file

@ -14,7 +14,7 @@
### The configure script will replace these variables.
: ${srcdir=@srcdir@}
: ${CC=@CC@}
: ${CC=@TARGET_CC@}
u=
grep "^#define HAVE_ASM_USCORE" config.h >/dev/null 2>&1 && u="_"

View file

@ -143,12 +143,19 @@ mostlyclean-module-#{@name}.#{@rule_count}:
MOSTLYCLEAN_MODULE_TARGETS += mostlyclean-module-#{@name}.#{@rule_count}
UNDSYMFILES += #{undsym}
ifeq ($(TARGET_NO_DYNAMIC_MODULES), yes)
#{@name}: #{pre_obj} $(TARGET_OBJ2ELF)
-rm -f $@
$(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj}
if test ! -z \"$(TARGET_OBJ2ELF)\"; then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi
if test x$(TARGET_NO_STRIP) != xyes ; then $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@; fi
else
ifneq ($(TARGET_APPLE_CC),1)
#{@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF)
-rm -f $@
$(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj} #{mod_obj}
if test ! -z \"$(TARGET_OBJ2ELF)\"; then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi
$(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@
if test x$(TARGET_NO_STRIP) != xyes ; then $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@; fi
else
#{@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF)
-rm -f $@
@ -157,6 +164,7 @@ else
$(OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -wd1106 -nu -nd $@.bin $@
-rm -f $@.bin
endif
endif
#{pre_obj}: $(#{prefix}_DEPENDENCIES) #{objs_str}
-rm -f $@
@ -201,7 +209,7 @@ endif
-include #{dep}
clean-module-#{extra_target}.#{@rule_count}:
rm -f #{command} #{fs} #{partmap} #{handler} #{parttool} #{video}
rm -f #{command} #{fs} #{partmap} #{handler} #{parttool} #{video} #{terminal}
CLEAN_MODULE_TARGETS += clean-module-#{extra_target}.#{@rule_count}
@ -330,11 +338,11 @@ MOSTLYCLEANFILES += #{deps_str}
ifeq ($(#{prefix}_RELOCATABLE),yes)
#{@name}: $(#{prefix}_DEPENDENCIES) #{objs_str}
$(TARGET_CC) -Wl,-r,-d -o $@ #{objs_str} $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
$(STRIP) --strip-unneeded -K start -R .note -R .comment $@
if test x$(TARGET_NO_STRIP) != xyes ; then $(STRIP) --strip-unneeded -K start -R .note -R .comment $@; fi
else
#{@name}: $(#{prefix}_DEPENDENCIES) #{objs_str}
$(TARGET_CC) -o $@ #{objs_str} $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
$(STRIP) -R .rel.dyn -R .reginfo -R .note -R .comment $@
if test x$(TARGET_NO_STRIP) != xyes ; then $(STRIP) -R .rel.dyn -R .reginfo -R .note -R .comment $@; fi
endif
" + objs.collect_with_index do |obj, i|

View file

@ -32,13 +32,12 @@ FNR == 1 {
else if ($1 != "__gnu_local_gp") {
printf "%s in %s is not defined\n", $1, module >"/dev/stderr";
error++;
exit;
}
}
# Output the result.
END {
if (error == 1)
if (error >= 1)
exit 1;
for (mod in modtab) {

View file

@ -14,7 +14,7 @@
### The configure script will replace these variables.
: ${srcdir=@srcdir@}
: ${CC=@CC@}
: ${CC=@TARGET_CC@}
cat <<EOF
@ -37,6 +37,7 @@ cat <<EOF
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/symbol.h>
EOF
for i in $*; do

View file

@ -279,13 +279,6 @@ grub_gettext_init_ext (const char *lang)
/* mo_file e.g.: /boot/grub/locale/ca.mo */
mo_file =
grub_malloc (grub_strlen (locale_dir) + grub_strlen ("/") +
grub_strlen (lang) + grub_strlen (".mo") + 1);
/* Warning: if changing some paths in the below line, change the grub_malloc
contents below. */
mo_file = grub_xasprintf ("%s/%s.mo", locale_dir, lang);
if (!mo_file)
return;

View file

@ -31,6 +31,7 @@ struct grub_gui_image
grub_gui_container_t parent;
grub_video_rect_t bounds;
char *id;
char *theme_dir;
struct grub_video_bitmap *raw_bitmap;
struct grub_video_bitmap *bitmap;
};
@ -208,8 +209,28 @@ static grub_err_t
image_set_property (void *vself, const char *name, const char *value)
{
grub_gui_image_t self = vself;
if (grub_strcmp (name, "file") == 0)
return load_image (self, value);
if (grub_strcmp (name, "theme_dir") == 0)
{
grub_free (self->theme_dir);
self->theme_dir = grub_strdup (value);
}
else if (grub_strcmp (name, "file") == 0)
{
char *absvalue;
grub_err_t err;
/* Resolve to an absolute path. */
if (! self->theme_dir)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "unspecified theme_dir");
absvalue = grub_resolve_relative_path (self->theme_dir, value);
if (! absvalue)
return grub_errno;
err = load_image (self, absvalue);
grub_free (absvalue);
return err;
}
else if (grub_strcmp (name, "id") == 0)
{
grub_free (self->id);

View file

@ -216,7 +216,7 @@ grub_gui_label_new (void)
label->comp.ops = &label_ops;
label->visible = 1;
label->text = grub_strdup ("");
label->font = grub_font_get ("Helvetica 10");
label->font = grub_font_get ("Unknown Regular 16");
label->color.red = 0;
label->color.green = 0;
label->color.blue = 0;

View file

@ -566,7 +566,7 @@ grub_gui_list_new (void)
self->visible = 1;
default_font = grub_font_get ("Helvetica 12");
default_font = grub_font_get ("Unknown Regular 16");
default_fg_color = grub_gui_color_rgb (0, 0, 0);
default_bg_color = grub_gui_color_rgb (255, 255, 255);

View file

@ -371,7 +371,7 @@ grub_gui_progress_bar_new (void)
self->progress.ops = &progress_bar_pb_ops;
self->progress.component.ops = &progress_bar_ops;
self->visible = 1;
self->font = grub_font_get ("Helvetica 10");
self->font = grub_font_get ("Unknown Regular 16");
grub_gui_color_t black = { .red = 0, .green = 0, .blue = 0, .alpha = 255 };
grub_gui_color_t gray = { .red = 128, .green = 128, .blue = 128, .alpha = 255 };
grub_gui_color_t lightgray = { .red = 200, .green = 200, .blue = 200, .alpha = 255 };

View file

@ -66,7 +66,7 @@ grub_gfxmenu_view_new (const char *theme_path,
view->screen.width = width;
view->screen.height = height;
default_font = grub_font_get ("Helvetica 12");
default_font = grub_font_get ("Unknown Regular 16");
default_fg_color = grub_gui_color_rgb (0, 0, 0);
default_bg_color = grub_gui_color_rgb (255, 255, 255);

View file

@ -27,6 +27,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#ifndef SSIZE_MAX
# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))

View file

@ -84,7 +84,7 @@ grub_read_hook_datetime (struct grub_env_var *var,
return buf;
}
GRUB_MOD_INIT(datetime)
GRUB_MOD_INIT(datehook)
{
int i;
@ -93,7 +93,7 @@ GRUB_MOD_INIT(datetime)
grub_read_hook_datetime, 0);
}
GRUB_MOD_FINI(datetime)
GRUB_MOD_FINI(datehook)
{
int i;

View file

@ -102,6 +102,7 @@ union grub_aout_header
#define AOUT_MID_I386 134 /* i386 BSD binary */
#define AOUT_MID_SPARC 138 /* sparc */
#define AOUT_MID_HP200 200 /* hp200 (68010) BSD binary */
#define AOUT_MID_SUN 0x103
#define AOUT_MID_HP300 300 /* hp300 (68020+68881) BSD binary */
#define AOUT_MID_HPUX 0x20C /* hp200/300 HP-UX binary */
#define AOUT_MID_HPUX800 0x20B /* hp800 HP-UX binary */
@ -114,10 +115,14 @@ union grub_aout_header
#define AOUT_GETMID(header) ((header).a_midmag >> 16) & 0x03ff)
#define AOUT_GETFLAG(header) ((header).a_midmag >> 26) & 0x3f)
#ifndef GRUB_UTIL
int EXPORT_FUNC(grub_aout_get_type) (union grub_aout_header *header);
grub_err_t EXPORT_FUNC(grub_aout_load) (grub_file_t file, int offset,
grub_addr_t load_addr, int load_size,
grub_addr_t bss_end_addr);
#endif
#endif /* ! GRUB_AOUT_HEADER */

View file

@ -47,24 +47,24 @@ struct grub_video_bitmap_reader
};
typedef struct grub_video_bitmap_reader *grub_video_bitmap_reader_t;
void grub_video_bitmap_reader_register (grub_video_bitmap_reader_t reader);
void grub_video_bitmap_reader_unregister (grub_video_bitmap_reader_t reader);
void EXPORT_FUNC (grub_video_bitmap_reader_register) (grub_video_bitmap_reader_t reader);
void EXPORT_FUNC (grub_video_bitmap_reader_unregister) (grub_video_bitmap_reader_t reader);
grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap,
unsigned int width, unsigned int height,
enum grub_video_blit_format blit_format);
grub_err_t EXPORT_FUNC (grub_video_bitmap_create) (struct grub_video_bitmap **bitmap,
unsigned int width, unsigned int height,
enum grub_video_blit_format blit_format);
grub_err_t grub_video_bitmap_destroy (struct grub_video_bitmap *bitmap);
grub_err_t EXPORT_FUNC (grub_video_bitmap_destroy) (struct grub_video_bitmap *bitmap);
grub_err_t grub_video_bitmap_load (struct grub_video_bitmap **bitmap,
const char *filename);
grub_err_t EXPORT_FUNC (grub_video_bitmap_load) (struct grub_video_bitmap **bitmap,
const char *filename);
unsigned int grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap);
unsigned int grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap);
unsigned int EXPORT_FUNC (grub_video_bitmap_get_width) (struct grub_video_bitmap *bitmap);
unsigned int EXPORT_FUNC (grub_video_bitmap_get_height) (struct grub_video_bitmap *bitmap);
void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap,
struct grub_video_mode_info *mode_info);
void EXPORT_FUNC (grub_video_bitmap_get_mode_info) (struct grub_video_bitmap *bitmap,
struct grub_video_mode_info *mode_info);
void *grub_video_bitmap_get_data (struct grub_video_bitmap *bitmap);
void *EXPORT_FUNC (grub_video_bitmap_get_data) (struct grub_video_bitmap *bitmap);
#endif /* ! GRUB_BITMAP_HEADER */

View file

@ -39,10 +39,11 @@ enum grub_video_bitmap_scale_method
};
grub_err_t
grub_video_bitmap_create_scaled (struct grub_video_bitmap **dst,
int dst_width, int dst_height,
struct grub_video_bitmap *src,
enum
grub_video_bitmap_scale_method scale_method);
EXPORT_FUNC (grub_video_bitmap_create_scaled) (struct grub_video_bitmap **dst,
int dst_width, int dst_height,
struct grub_video_bitmap *src,
enum
grub_video_bitmap_scale_method
scale_method);
#endif /* ! GRUB_BITMAP_SCALE_HEADER */

View file

@ -22,7 +22,7 @@
#include <grub/file.h>
grub_file_t grub_bufio_open (grub_file_t io, int size);
grub_file_t grub_buffile_open (const char *name, int size);
grub_file_t EXPORT_FUNC (grub_bufio_open) (grub_file_t io, int size);
grub_file_t EXPORT_FUNC (grub_buffile_open) (const char *name, int size);
#endif /* ! GRUB_BUFIO_H */

View file

@ -23,6 +23,14 @@
#include <grub/symbol.h>
#include <grub/types.h>
#if defined (__i386__) || defined (__x86_64__)
static inline void
grub_arch_sync_caches (void *address __attribute__ ((unused)),
grub_size_t len __attribute__ ((unused)))
{
}
#else
void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t len);
#endif
#endif /* ! GRUB_CACHE_HEADER */

View file

@ -33,10 +33,17 @@ struct grub_datetime
};
/* Return date and time. */
#ifdef GRUB_MACHINE_EMU
grub_err_t EXPORT_FUNC(grub_get_datetime) (struct grub_datetime *datetime);
/* Set date and time. */
grub_err_t EXPORT_FUNC(grub_set_datetime) (struct grub_datetime *datetime);
#else
grub_err_t grub_get_datetime (struct grub_datetime *datetime);
/* Set date and time. */
grub_err_t grub_set_datetime (struct grub_datetime *datetime);
#endif
int grub_get_weekday (struct grub_datetime *datetime);
char *grub_get_weekday_name (struct grub_datetime *datetime);

View file

@ -91,7 +91,12 @@ grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
int EXPORT_FUNC(grub_dl_unload) (grub_dl_t mod);
void grub_dl_unload_unneeded (void);
void grub_dl_unload_all (void);
#ifdef GRUB_UTIL
#if defined (GRUB_MACHINE_EMU) || defined (GRUB_UTIL)
#define GRUB_NO_MODULES 1
#else
#define GRUB_NO_MODULES 0
#endif
#if GRUB_NO_MODULES
static inline int
grub_dl_ref (grub_dl_t mod)
{
@ -110,13 +115,13 @@ int EXPORT_FUNC(grub_dl_unref) (grub_dl_t mod);
#endif
void EXPORT_FUNC(grub_dl_iterate) (int (*hook) (grub_dl_t mod));
grub_dl_t EXPORT_FUNC(grub_dl_get) (const char *name);
grub_err_t EXPORT_FUNC(grub_dl_register_symbol) (const char *name, void *addr,
grub_dl_t mod);
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
grub_dl_t mod);
grub_err_t grub_arch_dl_check_header (void *ehdr);
grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr);
#if defined (_mips) && ! defined (GRUB_UTIL)
#if defined (_mips) && ! defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
#define GRUB_LINKER_HAVE_INIT 1
void grub_arch_dl_init_linker (void);
#endif

View file

@ -66,7 +66,7 @@ void EXPORT_FUNC(grub_fatal) (const char *fmt, ...) __attribute__ ((noreturn));
void EXPORT_FUNC(grub_error_push) (void);
int EXPORT_FUNC(grub_error_pop) (void);
void EXPORT_FUNC(grub_print_error) (void);
int EXPORT_FUNC(grub_err_printf) (const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
int grub_err_printf (const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
#endif /* ! GRUB_ERR_HEADER */

View file

@ -81,36 +81,38 @@ int grub_font_load (const char *filename);
"Family Name Bold Italic 14", where Bold and Italic are optional.
If no font matches the name specified, the most recently loaded font
is returned as a fallback. */
grub_font_t grub_font_get (const char *font_name);
grub_font_t EXPORT_FUNC (grub_font_get) (const char *font_name);
const char *grub_font_get_name (grub_font_t font);
const char *EXPORT_FUNC (grub_font_get_name) (grub_font_t font);
int grub_font_get_max_char_width (grub_font_t font);
int EXPORT_FUNC (grub_font_get_max_char_width) (grub_font_t font);
int grub_font_get_max_char_height (grub_font_t font);
int EXPORT_FUNC (grub_font_get_max_char_height) (grub_font_t font);
int grub_font_get_ascent (grub_font_t font);
int EXPORT_FUNC (grub_font_get_ascent) (grub_font_t font);
int grub_font_get_descent (grub_font_t font);
int EXPORT_FUNC (grub_font_get_descent) (grub_font_t font);
int grub_font_get_leading (grub_font_t font);
int EXPORT_FUNC (grub_font_get_leading) (grub_font_t font);
int grub_font_get_height (grub_font_t font);
int EXPORT_FUNC (grub_font_get_height) (grub_font_t font);
int grub_font_get_string_width (grub_font_t font, const char *str);
int EXPORT_FUNC (grub_font_get_string_width) (grub_font_t font,
const char *str);
struct grub_font_glyph *grub_font_get_glyph (grub_font_t font,
grub_uint32_t code);
struct grub_font_glyph *EXPORT_FUNC (grub_font_get_glyph) (grub_font_t font,
grub_uint32_t code);
struct grub_font_glyph *grub_font_get_glyph_with_fallback (grub_font_t font,
grub_uint32_t code);
struct grub_font_glyph *EXPORT_FUNC (grub_font_get_glyph_with_fallback) (grub_font_t font,
grub_uint32_t code);
grub_err_t grub_font_draw_glyph (struct grub_font_glyph *glyph,
grub_video_color_t color,
int left_x, int baseline_y);
grub_err_t EXPORT_FUNC (grub_font_draw_glyph) (struct grub_font_glyph *glyph,
grub_video_color_t color,
int left_x, int baseline_y);
grub_err_t grub_font_draw_string (const char *str, grub_font_t font,
grub_video_color_t color,
int left_x, int baseline_y);
grub_err_t EXPORT_FUNC (grub_font_draw_string) (const char *str,
grub_font_t font,
grub_video_color_t color,
int left_x, int baseline_y);
#endif /* ! GRUB_FONT_HEADER */

View file

@ -25,20 +25,20 @@
#include <grub/video.h>
grub_err_t
grub_gfxterm_set_window (struct grub_video_render_target *target,
int x, int y, int width, int height,
int double_repaint,
const char *font_name, int border_width);
EXPORT_FUNC (grub_gfxterm_set_window) (struct grub_video_render_target *target,
int x, int y, int width, int height,
int double_repaint,
const char *font_name, int border_width);
typedef void (*grub_gfxterm_repaint_callback_t)(int x, int y,
int width, int height);
void grub_gfxterm_set_repaint_callback (grub_gfxterm_repaint_callback_t func);
void grub_gfxterm_schedule_repaint (void);
void EXPORT_FUNC (grub_gfxterm_schedule_repaint) (void);
grub_err_t grub_gfxterm_fullscreen (void);
grub_err_t EXPORT_FUNC (grub_gfxterm_fullscreen) (void);
extern void (*grub_gfxterm_decorator_hook) (void);
extern void (*EXPORT_VAR (grub_gfxterm_decorator_hook)) (void);
#endif /* ! GRUB_GFXTERM_HEADER */

View file

@ -22,7 +22,6 @@
#include <config.h>
#include <grub/symbol.h>
const char *EXPORT_FUNC(grub_gettext_dummy) (const char *s);
extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
/* NLS can be disabled through the configure --disable-nls option. */

View file

@ -0,0 +1 @@
#include <grub/i386/coreboot/serial.h>

View file

@ -19,8 +19,6 @@
#ifndef GRUB_VBE_MACHINE_HEADER
#define GRUB_VBE_MACHINE_HEADER 1
#include <grub/video_fb.h>
/* Default video mode to be used. */
#define GRUB_VBE_DEFAULT_VIDEO_MODE 0x101

View file

@ -138,7 +138,7 @@ int EXPORT_FUNC(grub_ieee1275_read) (grub_ieee1275_ihandle_t ihandle,
void *buffer, grub_size_t len,
grub_ssize_t *actualp);
int EXPORT_FUNC(grub_ieee1275_seek) (grub_ieee1275_ihandle_t ihandle,
int pos_hi, int pos_lo,
grub_disk_addr_t pos,
grub_ssize_t *result);
int EXPORT_FUNC(grub_ieee1275_peer) (grub_ieee1275_phandle_t node,
grub_ieee1275_phandle_t *result);
@ -173,7 +173,15 @@ grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate)
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
int EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size);
int
EXPORT_FUNC(grub_ieee1275_map) (grub_addr_t phys, grub_addr_t virt,
grub_size_t size, grub_uint32_t mode);
char *EXPORT_FUNC(grub_ieee1275_encode_devname) (const char *path);
char *EXPORT_FUNC(grub_ieee1275_get_filename) (const char *path);
int EXPORT_FUNC(grub_ieee1275_devices_iterate) (int (*hook)
(struct grub_ieee1275_devalias *
alias));
#endif /* ! GRUB_IEEE1275_HEADER */

View file

@ -59,6 +59,8 @@ extern grub_addr_t grub_arch_modules_addr (void);
extern void EXPORT_FUNC(grub_module_iterate) (int (*hook) (struct grub_module_header *));
grub_addr_t grub_modules_get_end (void);
/* The start point of the C code. */
void grub_main (void);

View file

@ -36,7 +36,7 @@ void *EXPORT_FUNC(grub_realloc) (void *ptr, grub_size_t size);
void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size);
/* For debugging. */
#if defined(MM_DEBUG) && !defined(GRUB_UTIL)
#if defined(MM_DEBUG) && !defined(GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
/* Set this variable to 1 when you want to trace all memory function calls. */
extern int EXPORT_VAR(grub_mm_debug);

View file

@ -1,70 +0,0 @@
/* multiboot2.h - multiboot2 header file with grub definitions. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2007 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/>.
*/
#ifndef GRUB_MULTIBOOT2_HEADER
#define GRUB_MULTIBOOT2_HEADER 1
#include <grub/types.h>
#include <grub/err.h>
#include <grub/elf.h>
#ifndef GRUB_UTIL
typedef grub_uint32_t uint32_t;
typedef grub_uint64_t uint64_t;
#define __WORDSIZE GRUB_TARGET_WORDSIZE
#endif
struct multiboot2_tag_header;
grub_err_t
grub_mb2_tag_alloc (grub_addr_t *addr, int key, grub_size_t len);
grub_err_t
grub_mb2_tags_arch_create (void);
void
grub_mb2_arch_boot (grub_addr_t entry, void *tags);
void
grub_mb2_arch_unload (struct multiboot2_tag_header *tags);
grub_err_t
grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, grub_addr_t *addr, int *do_load);
grub_err_t
grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load);
grub_err_t
grub_mb2_arch_module_alloc (grub_size_t size, grub_addr_t *addr);
grub_err_t
grub_mb2_arch_module_free (grub_addr_t addr, grub_size_t size);
void
grub_multiboot2 (int argc, char *argv[]);
void
grub_module2 (int argc, char *argv[]);
#define for_each_tag(tag, tags) \
for (tag = tags; \
tag && tag->key != MULTIBOOT2_TAG_END; \
tag = (struct multiboot2_tag_header *)((char *)tag + tag->len))
#endif /* ! GRUB_MULTIBOOT2_HEADER */

View file

@ -110,37 +110,7 @@ void read_terminal_list (void);
void grub_set_more (int onoff);
#ifdef GRUB_UTIL
void grub_normal_init (void);
void grub_normal_fini (void);
void grub_hello_init (void);
void grub_hello_fini (void);
void grub_ls_init (void);
void grub_ls_fini (void);
void grub_cat_init (void);
void grub_cat_fini (void);
void grub_boot_init (void);
void grub_boot_fini (void);
void grub_cmp_init (void);
void grub_cmp_fini (void);
void grub_terminal_init (void);
void grub_terminal_fini (void);
void grub_loop_init (void);
void grub_loop_fini (void);
void grub_help_init (void);
void grub_help_fini (void);
void grub_halt_init (void);
void grub_halt_fini (void);
void grub_reboot_init (void);
void grub_reboot_fini (void);
void grub_configfile_init (void);
void grub_configfile_fini (void);
void grub_search_init (void);
void grub_search_fini (void);
void grub_test_init (void);
void grub_test_fini (void);
void grub_blocklist_init (void);
void grub_blocklist_fini (void);
#endif
int grub_normal_get_line_counter (void);
void grub_install_newline_hook (void);
#endif /* ! GRUB_NORMAL_HEADER */

View file

@ -93,20 +93,6 @@ grub_partition_map_unregister (grub_partition_map_t partmap)
#define FOR_PARTITION_MAPS(var) for (var = grub_partition_map_list; var; var = var->next)
#ifdef GRUB_UTIL
void grub_msdos_partition_map_init (void);
void grub_msdos_partition_map_fini (void);
void grub_amiga_partition_map_init (void);
void grub_amiga_partition_map_fini (void);
void grub_apple_partition_map_init (void);
void grub_apple_partition_map_fini (void);
void grub_sun_partition_map_init (void);
void grub_sun_partition_map_fini (void);
void grub_gpt_partition_map_init (void);
void grub_gpt_partition_map_fini (void);
void grub_apple_partition_map_init (void);
void grub_apple_partition_map_fini (void);
#endif
static inline grub_disk_addr_t
grub_partition_get_start (const grub_partition_t p)

View file

@ -68,7 +68,7 @@
typedef grub_uint32_t grub_pci_id_t;
#ifdef GRUB_UTIL
#ifdef GRUB_MACHINE_EMU
#include <grub/pciutils.h>
#else
typedef grub_uint32_t grub_pci_address_t;

View file

@ -22,6 +22,7 @@
#include <grub/types.h>
#define GRUB_IEEE1275_CELL_SIZEOF 4
typedef grub_uint32_t grub_ieee1275_cell_t;
#endif /* ! GRUB_IEEE1275_MACHINE_HEADER */

View file

@ -1,7 +1,7 @@
/* normal_parser.h */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2007,2009 Free Software Foundation, Inc.
* Copyright (C) 2005,2007,2009,2010 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
@ -45,8 +45,11 @@ struct grub_script
typedef enum
{
GRUB_SCRIPT_ARG_TYPE_STR,
GRUB_SCRIPT_ARG_TYPE_VAR
GRUB_SCRIPT_ARG_TYPE_VAR,
GRUB_SCRIPT_ARG_TYPE_TEXT,
GRUB_SCRIPT_ARG_TYPE_DQVAR,
GRUB_SCRIPT_ARG_TYPE_DQSTR,
GRUB_SCRIPT_ARG_TYPE_SQSTR
} grub_script_arg_type_t;
/* A part of an argument. */
@ -121,12 +124,6 @@ struct grub_script_cmd_menuentry
/* State of the lexer as passed to the lexer. */
struct grub_lexer_param
{
/* Set to 0 when the lexer is done. */
int done;
/* State of the state machine. */
grub_parser_state_t state;
/* Function used by the lexer to get a new line when more input is
expected, but not available. */
grub_reader_getline_t getline;
@ -137,10 +134,6 @@ struct grub_lexer_param
depleted. */
int refs;
/* The character stream that has to be parsed. */
char *script;
char *newscript; /* XXX */
/* While walking through the databuffer, `record' the characters to
this other buffer. It can be used to edit the menu entry at a
later moment. */
@ -157,13 +150,31 @@ struct grub_lexer_param
/* Size of RECORDING. */
int recordlen;
/* The token that is already parsed but not yet returned. */
int tokenonhold;
/* End of file reached. */
int eof;
/* Was the last token a newline? */
int was_newline;
/* Merge multiple word tokens. */
int merge_start;
int merge_end;
/* Part of a multi-part token. */
char *text;
unsigned used;
unsigned size;
/* Type of text. */
grub_script_arg_type_t type;
/* Flex scanner. */
void *yyscanner;
/* Flex scanner buffer. */
void *buffer;
};
#define GRUB_LEXER_INITIAL_TEXT_SIZE 32
#define GRUB_LEXER_INITIAL_RECORD_SIZE 256
/* State of the parser as passes to the parser. */
struct grub_parser_param
{
@ -223,12 +234,16 @@ void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
struct grub_script_mem *mem);
struct grub_lexer_param *grub_script_lexer_init (char *s,
struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
char *script,
grub_reader_getline_t getline);
void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (struct grub_lexer_param *);
void grub_script_lexer_record_start (struct grub_lexer_param *);
char *grub_script_lexer_record_stop (struct grub_lexer_param *);
void grub_script_lexer_record_start (struct grub_parser_param *);
char *grub_script_lexer_record_stop (struct grub_parser_param *);
int grub_script_lexer_yywrap (struct grub_parser_param *);
void grub_script_lexer_record (struct grub_parser_param *, char *);
/* Functions to track allocated memory. */
struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state);
@ -284,7 +299,7 @@ int grub_script_function_iterate (int (*iterate) (grub_script_function_t));
int grub_script_function_call (grub_script_function_t func,
int argc, char **args);
char *
grub_script_execute_argument_to_string (struct grub_script_arg *arg);
char **
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);
#endif /* ! GRUB_NORMAL_PARSER_HEADER */

View file

@ -25,7 +25,8 @@
#define BOOTDEV_REG %l6
#define PIC_REG %l7
#define SCRATCH_PAD 0x10000
#define SCRATCH_PAD_BOOT 0x5000
#define SCRATCH_PAD_DISKBOOT 0x4000
#define GET_ABS(symbol, reg) \
add PIC_REG, (symbol - pic_base), reg
@ -51,7 +52,7 @@
#define GRUB_BOOT_MACHINE_LIST_SIZE 12
#define GRUB_BOOT_MACHINE_IMAGE_ADDRESS 0x200000
#define GRUB_BOOT_MACHINE_IMAGE_ADDRESS 0x4400
#define GRUB_BOOT_MACHINE_KERNEL_ADDR 0x4200

View file

@ -22,6 +22,7 @@
#include <grub/types.h>
#define GRUB_IEEE1275_CELL_SIZEOF 8
typedef grub_uint64_t grub_ieee1275_cell_t;
/* Encoding of 'mode' argument to grub_ieee1275_map_physical() */
@ -36,14 +37,12 @@ typedef grub_uint64_t grub_ieee1275_cell_t;
#define IEEE1275_MAP_DEFAULT (IEEE1275_MAP_WRITE | IEEE1275_MAP_READ | \
IEEE1275_MAP_EXEC | IEEE1275_MAP_CACHED)
extern int EXPORT_FUNC(grub_ieee1275_map_physical) (grub_addr_t paddr,
grub_addr_t vaddr,
grub_size_t size,
grub_uint32_t mode);
extern int EXPORT_FUNC(grub_ieee1275_claim_vaddr) (grub_addr_t vaddr,
grub_size_t size);
extern int EXPORT_FUNC(grub_ieee1275_alloc_physmem) (grub_addr_t *paddr,
grub_size_t size,
grub_uint32_t align);
extern grub_addr_t EXPORT_VAR (grub_ieee1275_original_stack);
#endif /* ! GRUB_IEEE1275_MACHINE_HEADER */

View file

@ -39,8 +39,24 @@
/* End of the data section. */
#define GRUB_KERNEL_MACHINE_DATA_END 0x114
#define GRUB_KERNEL_MACHINE_RAW_SIZE 0
#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000
#define GRUB_PLATFORM_IMAGE_FORMATS "raw, aout"
#define GRUB_PLATFORM_IMAGE_DEFAULT_FORMAT "raw"
#define GRUB_PLATFORM_IMAGE_DEFAULT GRUB_PLATFORM_IMAGE_RAW
#ifndef ASM_FILE
typedef enum {
GRUB_PLATFORM_IMAGE_RAW,
GRUB_PLATFORM_IMAGE_AOUT
}
grub_platform_image_format_t;
#define GRUB_PLATFORM_IMAGE_RAW GRUB_PLATFORM_IMAGE_RAW
#define GRUB_PLATFORM_IMAGE_AOUT GRUB_PLATFORM_IMAGE_AOUT
#include <grub/symbol.h>
#include <grub/types.h>

View file

@ -25,6 +25,8 @@
#if defined (GRUB_MACHINE_EMU) || defined (GRUB_UTIL)
#define GRUB_TICKS_PER_SECOND 100000
/* Return the real time in ticks. */
grub_uint32_t EXPORT_FUNC (grub_get_rtc) (void);
#else
#include <grub/machine/time.h>
#endif

View file

@ -223,4 +223,10 @@ static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
# endif
#endif /* ! WORDS_BIGENDIAN */
#if GRUB_TARGET_SIZEOF_VOID_P == 8
# define grub_host_to_target_addr(x) grub_host_to_target64(x)
#else
# define grub_host_to_target_addr(x) grub_host_to_target32(x)
#endif
#endif /* ! GRUB_TYPES_HEADER */

View file

@ -259,13 +259,13 @@ struct grub_video_adapter
};
typedef struct grub_video_adapter *grub_video_adapter_t;
void grub_video_register (grub_video_adapter_t adapter);
void EXPORT_FUNC (grub_video_register) (grub_video_adapter_t adapter);
void grub_video_unregister (grub_video_adapter_t adapter);
void grub_video_iterate (int (*hook) (grub_video_adapter_t adapter));
grub_err_t grub_video_restore (void);
grub_err_t EXPORT_FUNC (grub_video_restore) (void);
grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info);
grub_err_t EXPORT_FUNC (grub_video_get_info) (struct grub_video_mode_info *mode_info);
/* Framebuffer address may change as a part of normal operation
(e.g. double buffering). That's why you need to stop video subsystem to be
@ -283,57 +283,71 @@ grub_err_t grub_video_set_palette (unsigned int start, unsigned int count,
grub_err_t grub_video_get_palette (unsigned int start, unsigned int count,
struct grub_video_palette_data *palette_data);
grub_err_t grub_video_set_viewport (unsigned int x, unsigned int y,
unsigned int width, unsigned int height);
grub_err_t EXPORT_FUNC (grub_video_set_viewport) (unsigned int x,
unsigned int y,
unsigned int width,
unsigned int height);
grub_err_t grub_video_get_viewport (unsigned int *x, unsigned int *y,
unsigned int *width, unsigned int *height);
grub_err_t EXPORT_FUNC (grub_video_get_viewport) (unsigned int *x,
unsigned int *y,
unsigned int *width,
unsigned int *height);
grub_video_color_t grub_video_map_color (grub_uint32_t color_name);
grub_video_color_t EXPORT_FUNC (grub_video_map_color) (grub_uint32_t color_name);
grub_video_color_t grub_video_map_rgb (grub_uint8_t red, grub_uint8_t green,
grub_uint8_t blue);
grub_video_color_t EXPORT_FUNC (grub_video_map_rgb) (grub_uint8_t red,
grub_uint8_t green,
grub_uint8_t blue);
grub_video_color_t grub_video_map_rgba (grub_uint8_t red, grub_uint8_t green,
grub_uint8_t blue, grub_uint8_t alpha);
grub_video_color_t EXPORT_FUNC (grub_video_map_rgba) (grub_uint8_t red,
grub_uint8_t green,
grub_uint8_t blue,
grub_uint8_t alpha);
grub_err_t grub_video_unmap_color (grub_video_color_t color,
grub_uint8_t *red, grub_uint8_t *green,
grub_uint8_t *blue, grub_uint8_t *alpha);
grub_err_t EXPORT_FUNC (grub_video_unmap_color) (grub_video_color_t color,
grub_uint8_t *red,
grub_uint8_t *green,
grub_uint8_t *blue,
grub_uint8_t *alpha);
grub_err_t grub_video_fill_rect (grub_video_color_t color, int x, int y,
unsigned int width, unsigned int height);
grub_err_t EXPORT_FUNC (grub_video_fill_rect) (grub_video_color_t color,
int x, int y,
unsigned int width,
unsigned int height);
grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap,
enum grub_video_blit_operators oper,
int x, int y, int offset_x, int offset_y,
unsigned int width, unsigned int height);
grub_err_t EXPORT_FUNC (grub_video_blit_bitmap) (struct grub_video_bitmap *bitmap,
enum grub_video_blit_operators oper,
int x, int y,
int offset_x, int offset_y,
unsigned int width,
unsigned int height);
grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source,
enum grub_video_blit_operators oper,
int x, int y,
int offset_x, int offset_y,
unsigned int width,
unsigned int height);
grub_err_t EXPORT_FUNC (grub_video_blit_render_target) (struct grub_video_render_target *source,
enum grub_video_blit_operators oper,
int x, int y,
int offset_x,
int offset_y,
unsigned int width,
unsigned int height);
grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy);
grub_err_t grub_video_swap_buffers (void);
grub_err_t EXPORT_FUNC (grub_video_swap_buffers) (void);
grub_err_t grub_video_create_render_target (struct grub_video_render_target **result,
unsigned int width,
unsigned int height,
unsigned int mode_type);
grub_err_t EXPORT_FUNC (grub_video_create_render_target) (struct grub_video_render_target **result,
unsigned int width,
unsigned int height,
unsigned int mode_type);
grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target);
grub_err_t EXPORT_FUNC (grub_video_delete_render_target) (struct grub_video_render_target *target);
grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target);
grub_err_t EXPORT_FUNC (grub_video_set_active_render_target) (struct grub_video_render_target *target);
grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target);
grub_err_t grub_video_set_mode (const char *modestring,
unsigned int modemask,
unsigned int modevalue);
grub_err_t EXPORT_FUNC (grub_video_set_mode) (const char *modestring,
unsigned int modemask,
unsigned int modevalue);
static inline int
grub_video_check_mode_flag (unsigned int flags, unsigned int mask,

View file

@ -0,0 +1 @@
#include <grub/i386/coreboot/serial.h>

View file

@ -1121,14 +1121,13 @@ grub_gzio_open (grub_file_t io, int transparent)
if (! file)
return 0;
gzio = grub_malloc (sizeof (*gzio));
gzio = grub_zalloc (sizeof (*gzio));
if (! gzio)
{
grub_free (file);
return 0;
}
grub_memset (gzio, 0, sizeof (*gzio));
gzio->file = io;
file->device = io->device;

View file

@ -152,7 +152,7 @@ grub_device_iterate (int (*hook) (const char *name))
grub_free (partition_name);
grub_free (p);
return 1;
}
}
grub_free (partition_name);
p->next = ents;

View file

@ -348,7 +348,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e)
sym->st_value = (Elf_Addr) grub_dl_resolve_symbol (name);
if (! sym->st_value)
return grub_error (GRUB_ERR_BAD_MODULE,
"the symbol `%s' not found", name);
"symbol not found: `%s'", name);
}
else
{
@ -469,7 +469,7 @@ grub_dl_resolve_dependencies (grub_dl_t mod, Elf_Ehdr *e)
return GRUB_ERR_NONE;
}
#ifndef GRUB_UTIL
#if !GRUB_NO_MODULES
int
grub_dl_ref (grub_dl_t mod)
{

View file

@ -67,12 +67,6 @@ grub_exit (void)
grub_cpu_idle ();
}
void
grub_arch_sync_caches (void *address __attribute__ ((unused)),
grub_size_t len __attribute__ ((unused)))
{
}
void
grub_machine_init (void)
{

View file

@ -45,9 +45,3 @@ grub_machine_set_prefix (void)
{
grub_efi_set_prefix ();
}
void
grub_arch_sync_caches (void *address __attribute__ ((unused)),
grub_size_t len __attribute__ ((unused)))
{
}

View file

@ -26,9 +26,3 @@ void
grub_stop_floppy (void)
{
}
void
grub_arch_sync_caches (void *address __attribute__ ((unused)),
grub_size_t len __attribute__ ((unused)))
{
}

View file

@ -47,12 +47,6 @@ static int num_regions;
grub_addr_t grub_os_area_addr;
grub_size_t grub_os_area_size;
void
grub_arch_sync_caches (void *address __attribute__ ((unused)),
grub_size_t len __attribute__ ((unused)))
{
}
static char *
make_install_device (void)
{

View file

@ -284,8 +284,8 @@ grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer,
}
int
grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, int pos_hi,
int pos_lo, grub_ssize_t *result)
grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, grub_disk_addr_t pos,
grub_ssize_t *result)
{
struct write_args
{
@ -299,8 +299,15 @@ grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, int pos_hi,
INIT_IEEE1275_COMMON (&args.common, "seek", 3, 1);
args.ihandle = ihandle;
args.pos_hi = (grub_ieee1275_cell_t) pos_hi;
args.pos_lo = (grub_ieee1275_cell_t) pos_lo;
/* To prevent stupid gcc warning. */
#if GRUB_IEEE1275_CELL_SIZEOF >= 8
args.pos_hi = 0;
args.pos_lo = pos;
#else
args.pos_hi = (grub_ieee1275_cell_t) (pos >> (8 * GRUB_IEEE1275_CELL_SIZEOF));
args.pos_lo = (grub_ieee1275_cell_t)
(pos & ((1ULL << (8 * GRUB_IEEE1275_CELL_SIZEOF)) - 1));
#endif
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;

View file

@ -38,11 +38,11 @@
#define HEAP_MIN_SIZE (unsigned long) (2 * 1024 * 1024)
/* The maximum heap size we're going to claim */
#define HEAP_MAX_SIZE (unsigned long) (4 * 1024 * 1024)
#define HEAP_MAX_SIZE (unsigned long) (32 * 1024 * 1024)
/* If possible, we will avoid claiming heap above this address, because it
seems to cause relocation problems with OSes that link at 4 MiB */
#define HEAP_MAX_ADDR (unsigned long) (4 * 1024 * 1024)
#define HEAP_MAX_ADDR (unsigned long) (32 * 1024 * 1024)
extern char _start[];
extern char _end[];

View file

@ -68,11 +68,10 @@ grub_children_iterate (char *devpath,
{
struct grub_ieee1275_devalias alias;
grub_ssize_t actual;
char *fullname;
if (grub_ieee1275_get_property (child, "device_type", childtype,
IEEE1275_MAX_PROP_LEN, &actual))
continue;
childtype[0] = 0;
if (grub_ieee1275_package_to_path (child, childpath,
IEEE1275_MAX_PATH_LEN, &actual))
@ -82,24 +81,14 @@ grub_children_iterate (char *devpath,
IEEE1275_MAX_PROP_LEN, &actual))
continue;
fullname = grub_xasprintf ("%s/%s", devpath, childname);
if (!fullname)
{
grub_free (childname);
grub_free (childpath);
grub_free (childtype);
return 0;
}
alias.type = childtype;
alias.path = childpath;
alias.name = fullname;
alias.name = childname;
ret = hook (&alias);
grub_free (fullname);
if (ret)
break;
}
while (grub_ieee1275_peer (child, &child));
while (grub_ieee1275_peer (child, &child) != -1);
grub_free (childname);
grub_free (childpath);
@ -108,6 +97,20 @@ grub_children_iterate (char *devpath,
return ret;
}
int
grub_ieee1275_devices_iterate (int (*hook) (struct grub_ieee1275_devalias *alias))
{
auto int it_through (struct grub_ieee1275_devalias *alias);
int it_through (struct grub_ieee1275_devalias *alias)
{
if (hook (alias))
return 1;
return grub_children_iterate (alias->path, it_through);
}
return grub_children_iterate ("/", it_through);
}
/* Iterate through all device aliases. This function can be used to
find a device of a specific type. */
int
@ -199,9 +202,9 @@ nextprop:
}
/* Call the "map" method of /chosen/mmu. */
static int
grub_map (grub_addr_t phys, grub_addr_t virt, grub_uint32_t size,
grub_uint8_t mode)
int
grub_ieee1275_map (grub_addr_t phys, grub_addr_t virt, grub_size_t size,
grub_uint32_t mode)
{
struct map_args {
struct grub_ieee1275_common_hdr common;
@ -210,17 +213,30 @@ grub_map (grub_addr_t phys, grub_addr_t virt, grub_uint32_t size,
grub_ieee1275_cell_t mode;
grub_ieee1275_cell_t size;
grub_ieee1275_cell_t virt;
grub_ieee1275_cell_t phys;
#ifdef GRUB_MACHINE_SPARC64
grub_ieee1275_cell_t phys_high;
#endif
grub_ieee1275_cell_t phys_low;
grub_ieee1275_cell_t catch_result;
} args;
INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1);
INIT_IEEE1275_COMMON (&args.common, "call-method",
#ifdef GRUB_MACHINE_SPARC64
7,
#else
6,
#endif
1);
args.method = (grub_ieee1275_cell_t) "map";
args.ihandle = grub_ieee1275_mmu;
args.phys = phys;
#ifdef GRUB_MACHINE_SPARC64
args.phys_high = 0;
#endif
args.phys_low = phys;
args.virt = virt;
args.size = size;
args.mode = mode; /* Format is WIMG0PP. */
args.catch_result = (grub_ieee1275_cell_t) -1;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
@ -235,7 +251,7 @@ grub_claimmap (grub_addr_t addr, grub_size_t size)
return -1;
if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_REAL_MODE)
&& grub_map (addr, addr, size, 0x00))
&& grub_ieee1275_map (addr, addr, size, 0x00))
{
grub_printf ("map failed: address 0x%llx, size 0x%llx\n",
(long long) addr, (long long) size);
@ -405,8 +421,9 @@ grub_reboot (void)
void
grub_halt (void)
{
/* Not standardized. We try both known commands. */
/* Not standardized. We try three known commands. */
grub_ieee1275_interpret ("shut-down", 0);
grub_ieee1275_interpret ("power-off", 0);
grub_ieee1275_interpret ("poweroff", 0);
}

Some files were not shown because too many files have changed in this diff Show more