Commit graph

89 commits

Author SHA1 Message Date
Vladimir Serbinenko
37353f0ae5 i386: Remove needless ADDR32 prefixes when address is known and fixed.
Shaves off 6 bytes in lzma_decompress.img.
2015-02-21 17:38:56 +01:00
Vladimir Serbinenko
1998d63688 i386-pc/boot: Explicitly mark kernel_address[_high] as local.
Otherwise apple asm might try to make accesses relocatable.
2015-02-21 17:20:10 +01:00
Vladimir Serbinenko
bc29c6d019 Change dot assignmnet to more portable .org.
Binary is unchanged (verified)
2015-02-21 17:19:01 +01:00
Vladimir Serbinenko
f571dc1af8 i386: Move from explicit ADDR32/DATA32 prefixes to instruction suffixes.
Is more portable.
Binary is unchanged (verified).
2015-02-21 17:13:23 +01:00
Vladimir Serbinenko
e5851b63e0 mips/startup_raw: Use more portable .asciz 2015-02-21 16:09:46 +01:00
Allen Pais
ee281fd0c6 * grub-core/boot/sparc64/ieee1275/boot.S: Fix order of fields.
Also-By: Bob Picco <bob.picco@oracle.com>
2013-12-19 01:53:56 +01:00
Vladimir Serbinenko
fd4650a556 Add bonito 3A support. 2013-12-17 22:49:27 +01:00
Vladimir Serbinenko
bc8fcf4bd3 * grub-core/boot/i386/qemu/boot.S: Add missing EXT_C. 2013-12-14 23:13:42 +01:00
Vladimir Serbinenko
4a73746a04 * grub-core/boot/sparc64/ieee1275/boot.S [CDBOOT]: Move scratchpad
so it doesn't land in the middle of loaded image.
2013-12-04 19:54:37 +01:00
Vladimir Serbinenko
5c066a81c2 Apple assembly doesn't handle symbol arithmetic well. So define an
offset symbol in boot.S and use it.
2013-11-24 07:12:12 +01:00
Vladimir Serbinenko
78f961efe9 Apple assembly doesn't handle symbol arithmetic well. So instead
of getting addres of kernel_sector + 4 define kernel_sector_high.
	It also makes code more readable.
2013-11-24 07:11:00 +01:00
Vladimir Serbinenko
09bc0a577d With Apple assembly in .macro environvemnt you have to use $$ instead
of $. So introduce new preprocessor macro MACRO_DOLLAR(x) which expands
	to $$x on Apple and to $x on everything else.
2013-11-24 07:08:18 +01:00
Vladimir Serbinenko
6f2e82be3a * grub-core/boot/i386/pc/boot.S: Fix floppy probe. Due to missing
%dx restore the probe worked on non-existant drive. Reorganize the
	code a little bit to free 2 bytes necessary for push/pop.
2013-11-24 05:05:33 +01:00
Vladimir Serbinenko
1bba40f578 Move common BIOS/coreboot memory map declarations to
include/grub/i386/memory_raw.h and eliminate duplicate declarations.
2013-11-23 12:39:21 +01:00
Vladimir Serbinenko
054efe541f * grub-core/boot/mips/startup_raw.S: Handle the case of gap between
.data and .bss. May happen if compiler and assembly use different
	alignment.
2013-11-22 05:07:32 +01:00
Vladimir Serbinenko
6f4a19f59f Use $t9 for indirect calls from asm to C as PIC ABI requires. 2013-11-22 04:45:05 +01:00
Vladimir Serbinenko
ad2dc00309 * grub-core/boot/i386/pc/startup_raw.S (grub_gate_a20): Remove
argument. We don't disable Gate A20 in this code.
2013-10-25 11:03:39 +02:00
Vladimir Serbinenko
b46684ae53 * grub-core/boot/i386/qemu/boot.S: Ensure that A20 is enabled.
Conceptually based on change in branch "vbe-on-coreboot".
2013-10-25 10:51:58 +02:00
Josh Triplett
68b777070a * grub-core/boot/i386/pc/lnxboot.S: Re-add support for recording the
boot partition.
2013-09-23 14:31:42 +02:00
Vladimir 'phcoder' Serbinenko
9c28da2a89 Remove early sm712 init as there is no reason for it (the "watchdog"
effect was due to wrong GPIO map).
2013-07-11 16:24:35 +02:00
Andrey Borzenkov
cc28411296 Fix make dist on non-pc. 2013-06-07 18:23:08 +02:00
Vladimir 'phcoder' Serbinenko
17f9fd29d3 Implement grub_machine_get_bootlocation for ARC. 2013-04-27 19:12:11 +02:00
Vladimir 'phcoder' Serbinenko
88d2f3022e * grub-core/boot/powerpc/bootinfo.txt.in: Missing update from previous
commit.
2013-04-25 03:26:41 +02:00
Vladimir 'phcoder' Serbinenko
daaa64bd90 Add support for pseries and other bootinfo machines to grub-mkrescue.
Tested by: Paulo Flabiano Smorigo.
2013-04-19 00:36:23 +02:00
Vladimir 'phcoder' Serbinenko
b49fe8792a Move GRUB out of system area when using xorriso 1.2.9 or later. 2013-04-14 18:53:14 +02:00
Vladimir 'phcoder' Serbinenko
8ca86b3a03 Support mkrescue on sparc64. 2013-04-14 17:10:55 +02:00
Vladimir 'phcoder' Serbinenko
a79b8a1584 Merge powerpc grub-mkrescue flavour with common. Use xorriso HFS+
feature for it.
2013-04-11 23:15:26 +02:00
Vladimir 'phcoder' Serbinenko
c50c867da3 Init video early on yeeloong to avoid being rebooted by watchdog.
* grub-core/Makefile.am (gensm712): New target.
	(sm712_start.S): Likewise.
	(boot/mips/loongson/fwstart.S): Depend on sm712_start.S
	* grub-core/boot/mips/loongson/fwstart.S [!FULOONG2F]: Init SM712.
	* grub-core/video/sm712.c [GENINIT]: Generate compact init procedure
	description.
	* include/grub/vga.h: Move registry definitions to...
	* include/grub/vgaregs.h: ... here.
2012-06-26 03:36:14 +02:00
Vladimir 'phcoder' Serbinenko
5f92c8a110 * grub-core/boot/decompressor/minilib.c (grub_memcmp): Fix the compare
signedness.
2012-06-26 03:31:41 +02:00
Vladimir 'phcoder' Serbinenko
2fb97ed37a * grub-core/boot/mips/loongson/fwstart.S: Add missing setting of high
half of $a0.
2012-06-23 11:27:27 +02:00
Vladimir 'phcoder' Serbinenko
f7143efe1b * grub-core/boot/i386/pc/startup_raw.S [__APPLE__]: Add Apple assembly
version.
	* grub-core/commands/i386/pc/drivemap_int13h.S [__APPLE__]: Likewise.
	* grub-core/kern/i386/pc/startup.S [__APPLE__]: Likewise.
	* grub-core/lib/i386/relocator16.S [__APPLE__]: Likewise.
	* grub-core/lib/i386/relocator_common.S [__APPLE__]: Likewise.
	* grub-core/mmap/i386/pc/mmap_helper.S [__APPLE__]: Likewise.
2012-05-28 17:51:57 +02:00
Vladimir 'phcoder' Serbinenko
52bfedfa39 * grub-core/boot/i386/pc/startup_raw.S (multiboot_trampoline): Fix
size calculation.
	* grub-core/kern/i386/realmode.S (realidt): Assume default BIOS IDT if
	none is known.
2012-03-08 18:54:25 +01:00
Vladimir 'phcoder' Serbinenko
ef023e42a2 * grub-core/boot/i386/pc/startup_raw.S: Move decompressor_end to .bss
to ensure that it's after the last byte of .text.
2012-03-02 11:24:24 +01:00
Vladimir 'phcoder' Serbinenko
fa6ec5734f * grub-core/boot/i386/pc/startup_raw.S: Use separate
reed_solomon_size const definition instead of computing it since
	Apple assembler doesn't support the later.
2012-02-29 19:12:16 +01:00
Vladimir 'phcoder' Serbinenko
fb88381212 * grub-core/boot/i386/pc/diskboot.S (firstlist): Rename to ...
(LOCAL(firstlist)): ... this. Move it before the firstlist and not
	after. All users updated.
2012-02-29 15:26:42 +01:00
Vladimir 'phcoder' Serbinenko
94f064b4c9 Fix interrupt mixup from previous commit.
* include/grub/i386/pc/int.h (grub_i386_idt): New struct.
	(grub_realidt): New var.
	* grub-core/lib/i386/relocator16.S (grub_relocator16_idt): New variable
	Load idt.
	* grub-core/lib/i386/relocator.c (grub_relocator16_idt):
	New declaration.
	(grub_relocator16_boot): Set grub_relocator16_idt.
	* grub-core/kern/i386/realmode.S (realidt): Renamed to ...
	(LOCAL(realidt)): ... this.
	* grub-core/boot/i386/pc/startup_raw.S: Pass pointer to realidt in eax.
	* grub-core/kern/i386/pc/startup.S: Save pointer to realidt.
	(grub_realidt): New variable.
2012-02-26 22:10:13 +01:00
Vladimir 'phcoder' Serbinenko
f37c87e1ba * grub-core/boot/i386/pc/lnxboot.S: Use
GRUB_DECOMPRESSOR_MAX_DECOMPRESSOR_SIZE.
	* grub-core/boot/i386/pc/startup_raw.S: Ensure about boot_dev
	location.
	* include/grub/offsets.h (GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE): New
	definition.
	(GRUB_DECOMPRESSOR_I386_PC_MAX_DECOMPRESSOR_SIZE): Likewise.
2012-01-29 23:20:02 +01:00
Vladimir 'phcoder' Serbinenko
2e13ede59e Eliminate fixed limit on reed solomon decoder length.
* grub-core/boot/i386/pc/lnxboot.S: Scan for multiboot signature
	rather than hardcoding the address.
	* grub-core/boot/i386/pc/startup_raw.S: Add new data field
	no_reed_solomon_length.
	Move gate_a20 to no-reed-solomon part.
	Don't force a particular size of no reed-solomon part.
	* include/grub/offsets.h (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART):
	Removed.
	(GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH): New define.
	* util/grub-setup.c (setup): Read no_rs_length from the image itself.
2012-01-24 14:39:29 +01:00
Vladimir 'phcoder' Serbinenko
1f0b1a7730 * grub-core/boot/i386/pc/startup_raw.S: Add missing argument for
_LzmaDecodeA.
2011-12-23 10:21:27 +01:00
Vladimir 'phcoder' Serbinenko
276b7a8bdd * grub-core/boot/i386/pc/startup_raw.S: Clear direction flag for
certainety.
2011-12-15 19:22:36 +01:00
Vladimir 'phcoder' Serbinenko
e3fd394a10 * grub-core/boot/i386/pc/startup_raw.S: Move realmode routines to
non-RS part to avoid RS messing with GDT.
	* include/grub/offsets.h (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART):
	Increase to suit in realmode routines.
2011-12-15 19:20:41 +01:00
Vladimir 'phcoder' Serbinenko
b81d609e4c * grub-core/kern/i386/realmode.S: Increase alignment.
* grub-core/boot/i386/pc/startup_raw.S: Likewise.
2011-12-15 19:17:36 +01:00
Vladimir 'phcoder' Serbinenko
aa94b87027 Fix MIPS compilation.
* grub-core/boot/mips/startup_raw.S: Use GRUB_DECOMPRESSOR_*
	* include/grub/offsets.h: Rename decompressor fields from
	GRUB_KERNEL_* to GRUB_DECOMPRESSOR_*.
	* util/grub-mkimage.c (image_targets): Use new names.
2011-11-12 21:38:04 +01:00
Vladimir 'phcoder' Serbinenko
5fbdac149b Defer multiboot device parsing until we're in compressed part.
* grub-core/boot/i386/pc/lnxboot.S: Remove setting dos_part and
	bsd_part. setdevice has fallen into disuse.
	* grub-core/boot/i386/pc/startup_raw.S (dos_part): Removed.
	(bsd_part): Likewise.
	(boot_dev): New variable.
	(multiboot_trampoline): Don't parse multiboot device.
	Pass multiboot device in %edx.
	* grub-core/disk/i386/pc/biosdisk.c (GRUB_MOD_INIT): Parse
	grub_boot_device.
	* grub-core/kern/i386/pc/init.c (grub_machine_get_bootlocation):
	Likewise.
	* grub-core/kern/i386/pc/startup.S: Save edx.
	(grub_boot_drive): Removed.
	(grub_install_dos_part): Likewise.
	(grub_install_bsd_part): Likewise.
	(grub_boot_device): New variable.
	* include/grub/i386/pc/kernel.h (grub_install_dos_part): Removed.
	(grub_install_bsd_part): Likewise.
	(grub_boot_drive): Likewise.
	(grub_boot_device): New variable.
	* include/grub/offsets.h (GRUB_KERNEL_I386_PC_INSTALL_DOS_PART):
	Removed.
	(GRUB_KERNEL_I386_PC_INSTALL_BSD_PART): Likewise.
	(GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): Moved lower.
	(GRUB_KERNEL_MACHINE_INSTALL_BSD_PART): Removed.
	(GRUB_KERNEL_MACHINE_INSTALL_DOS_PART): Likewise.
	* util/grub-install.in: Remove redundant condition.
2011-11-12 21:12:52 +01:00
Vladimir 'phcoder' Serbinenko
691cbb5816 Fix bug introduced by previous commit.
* grub-core/boot/i386/pc/startup_raw.S: Compute RS start correctly.
2011-11-12 20:53:46 +01:00
Vladimir 'phcoder' Serbinenko
60240b8bc1 Use decompressors framework on i386-pc. It increases core size
by 46 bytes but improves compatibility and maintainability.

	* grub-core/Makefile.core.def (lzma_decompress): New image.
	(kernel): Add i386_pc_ldflags.
	* grub-core/kern/i386/pc/startup.S: Move intial part to ..
	* grub-core/boot/i386/pc/startup_raw.S: ... here. Pass pointers
	to real_to_prot, prot_to_real and device info.
	* include/grub/offsets.h: Renamed decompressor offsets.
	* util/grub-mkimage.c (grub_compression_t): New cmpression lzma.
	(image_target_desc): Remove raw_size and rename decompressor fields.
	(compress_kernel): Handle lzma.
	(generate_image): Handle decompressors on i386-pc.
2011-11-12 19:53:25 +01:00
Vladimir 'phcoder' Serbinenko
de9c615e5c Removed unused GRUB_BOOT_VERSION. Check for kernel version is better
done with a dedicated section.

	* grub-core/boot/sparc64/ieee1275/boot.S: Remove GRUB_BOOT_VERSION.
	Ensure the correct position of boot_path.
	* grub-core/kern/i386/efi/startup.S: Remove GRUB_BOOT_VERSION.
	* grub-core/kern/i386/pc/startup.S: Likewise. Ensure correct position of
	other fields.
	* grub-core/kern/x86_64/efi/startup.S: Remove GRUB_BOOT_VERSION.
	* include/grub/boot.h: Removed. All references removed.
	* include/grub/sparc64/ieee1275/boot.h (GRUB_BOOT_MACHINE_VER_MAJ):
	Removed.
	(GRUB_BOOT_MACHINE_BOOT_DEVPATH): Make it lower.
2011-10-19 23:01:44 +02:00
Vladimir 'phcoder' Serbinenko
14a2562cf7 Rename Fuloong into Fuloong 2F. Add new ID for Fuloong2E.
* grub-core/Makefile.core.def (fwstart_fuloong): Rename fwstart_fuloong
	into fwstart_fuloong2f. Use boot/mips/loongson/fuloong2f.S.
	* grub-core/boot/mips/loongson/fuloong.S: Rename to ...
	* grub-core/boot/mips/loongson/fuloong2f.S: ... this.
	(FULOONG): Rename to ...
	(FULOONG2F): ... this. All users updated.
	* grub-core/boot/mips/startup_raw.S (machtype_fuloong_str): Rename to
	(machtype_fuloong2f_str): ... this.
	(machtype_fuloong2e_str): New string.
	Check for machtype_fuloong2e_str.
	* grub-core/loader/mips/linux.c (loongson_machtypes)
	[GRUB_MACHINE_MIPS_LOONGSON]: Add GRUB_ARCH_MACHINE_FULOONG2E.
	* grub-core/term/serial.c (loongson_defserial)
	[GRUB_MACHINE_MIPS_LOONGSON]: New array.
	(grub_serial_register) [GRUB_MACHINE_MIPS_LOONGSON]: Use
	loongson_defserial.
	* include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_FULOONG):
	Rename to ...
	(GRUB_ARCH_MACHINE_FULOONG2F): ... this.
	(GRUB_ARCH_MACHINE_FULOONG2E): New const.
	* util/grub-mkimage.c (image_target_desc): Rename IMAGE_FULOONG_FLASH
	to IMAGE_FULOONG2F_FLASH. All users updated.
	(image_targets): Rename images.
	* util/grub-mkstandalone.in: Accept fuloong2f and fuloong2e.
2011-08-19 22:46:11 +02:00
Vladimir 'phcoder' Serbinenko
748ccabea1 MIPS qemu flash support.
* grub-core/boot/mips/startup_raw.S [GRUB_MACHINE_MIPS_QEMU_MIPS]: Check
	magic.
	* grub-core/kern/mips/qemu_mips/init.c (probe_mem): New function.
	(grub_machine_init): Probe memory if its size isn't known.
	* util/grub-mkimage.c (image_targets): Add flash targets.
	(generate_image): Handle flash targets.
2011-07-05 21:42:36 +02:00
Vladimir 'phcoder' Serbinenko
35341bbc96 Avoid unnecessary copying on MIPS.
* grub-core/boot/decompressor/none.c (grub_decompress_core): Exit
	early if src == dest.
	* util/grub-mkimage.c (generate_image): Arange for src == dest if
	compression is none.
2011-05-17 21:40:35 +02:00