Commit graph

36 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
84e1569ee4 * grub-core/kern/i386/pc/startup.S [__APPLE__]: Add a workaround for
objconv bug.
2012-05-29 13:54:33 +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
17edc2ba56 * grub-core/kern/i386/pc/startup.S: Define __start. 2012-03-02 11:15: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
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
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
2b23074a0c Move assembly code to C by using intwrap. It increases core size
by 88 bytes but improves compatibility and maintainability.

	* grub-core/kern/i386/pc/startup.S (grub_console_putchar): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_putchar_real):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_getkey): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_getkey):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_getxy): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_getxy):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_gotoxy): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_gotoxy):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_cls): Moved to ...
	* grub-core/term/i386/pc/console.c (grub_console_cls):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_console_setcursor): Moved to ..
	* grub-core/term/i386/pc/console.c (grub_console_setcursor):
	... here. Translated to C.
	* grub-core/kern/i386/pc/startup.S (grub_get_rtc): Moved to ..
	* grub-core/kern/i386/pc/init.c (grub_get_rtc): ... here.
	Translated to C.
	* grub-core/term/i386/pc/console.c (int10_9): New function.
	(grub_console_putchar): Likewise.
	* include/grub/i386/pc/console.h: Removed the not anymore shared
	functions.
2011-11-12 16:29:04 +01:00
Vladimir 'phcoder' Serbinenko
678f4b6713 Move grub_chainloader_real_boot out of the kernel.
* grub-core/Makefile.am: Remove machine/loader.h.
	* grub-core/kern/i386/pc/startup.S (grub_chainloader_real_boot):
	Removed.
	* grub-core/lib/i386/relocator.c (grub_relocator16_esi): New extern
	variable.
	(grub_relocator16_keep_a20_enabled): Likewise.
	(grub_relocator16_boot): Fill new variables.
	* grub-core/lib/i386/relocator16.S: Add gate a20 handling.
	* grub-core/loader/i386/pc/chainloader.c (grub_chainloader_boot): Use
	relocator.
	(grub_chainloader_unload): Likewise.
	(grub_chainloader_cmd): Likewise.
	* include/grub/i386/pc/loader.h: Removed.
	* include/grub/i386/relocator.h (grub_relocator16_state): Add a20
	and esi. All initialisers updated.
2011-11-12 15:46:50 +01:00
Vladimir 'phcoder' Serbinenko
3ce69fc90f * grub-core/kern/i386/pc/startup.S (grub_exit): Add missing zeroing-out.
* grub-core/lib/i386/reboot_trampoline.S (grub_reboot_start):
	Likewise.
2011-10-23 23:04:57 +02:00
Vladimir 'phcoder' Serbinenko
db1326f5fb Move chainloader_real_boot out of the kernel 2011-10-21 00:16:59 +02:00
Vladimir 'phcoder' Serbinenko
766f7d0809 Remove redundant grub_kernel_image_size.
* grub-core/kern/i386/coreboot/init.c (grub_machine_init): Use
	_edata and _start.
	* grub-core/kern/i386/coreboot/startup.S: Move multiboot header after
	the small code. It moves it only by few bytes but simplifies the code.
	* grub-core/kern/i386/pc/init.c (grub_machine_init): Use _edata and
	_start.
	* grub-core/kern/i386/pc/startup.S: Use _edata and _start.
	(grub_kernel_image_size): Removed.
	* grub-core/kern/i386/qemu/startup.S: Use _edata and _start.
	(grub_kernel_image_size): Removed.
	[APPLE_CC]: Remove apple compiler support. i386-qemu port can't be
	compiled with Apple toolchain.
	* grub-core/kern/sparc64/ieee1275/crt0.S: Remove leftover fields.
	* include/grub/i386/pc/kernel.h (grub_kernel_image_size): Removed.
	* include/grub/i386/qemu/kernel.h (grub_kernel_image_size): Removed.
	(grub_total_module_size): Likewise.
	* include/grub/offsets.h (GRUB_KERNEL_I386_PC_KERNEL_IMAGE_SIZE):
	Removed.
	(GRUB_KERNEL_I386_PC_COMPRESSED_SIZE): Put it lower.
	(GRUB_KERNEL_I386_PC_INSTALL_DOS_PART): Likewise.
	(GRUB_KERNEL_I386_PC_INSTALL_BSD_PART): Likewise.
	(GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): Likewise.
	(GRUB_KERNEL_I386_QEMU_KERNEL_IMAGE_SIZE): Removed.
	(GRUB_KERNEL_SPARC64_IEEE1275_KERNEL_IMAGE_SIZE): Likewise.
	(GRUB_KERNEL_SPARC64_IEEE1275_COMPRESSED_SIZE): Likewise.
	* include/grub/sparc64/ieee1275/kernel.h (grub_kernel_image_size):
	Removed.
	(grub_total_module_size): Removed.
	* util/grub-mkimage.c (image_target_desc): Remove image_size.
	(image_targets): Likewise.
	Set .compressed_size to no field on sparc.
	(generate_image): Remove kernel_image_size handling.
2011-10-20 08:13:00 +02: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
544c24876e Move grub_reboot out of the kernel.
* grub-core/Makefile.core.def (reboot): Add platform-specific files.
	* grub-core/kern/efi/efi.c (grub_reboot): Moved to ...
	* grub-core/lib/efi/reboot.c: ... here.
	* grub-core/kern/i386/efi/startup.S: Remove including of realmode.S.
	* grub-core/kern/i386/ieee1275/startup.S: Likewise.
	* grub-core/kern/i386/pc/startup.S (grub_exit): Inline cold_reboot.
	* grub-core/kern/i386/realmode.S (grub_reboot): Moved to...
	* grub-core/lib/i386/reboot_trampoline.S: ... here.
	* grub-core/kern/ieee1275/openfw.c (grub_reboot): Moved to...
	* grub-core/lib/ieee1275/reboot.c: ... here.
	* grub-core/kern/mips/arc/init.c (grub_reboot): Moved to...
	* grub-core/lib/mips/arc/reboot.c: ... here.
	* grub-core/kern/mips/loongson/init.c (grub_reboot): Moved to...
	* grub-core/lib/mips/loongson/reboot.c: ...here.
	* grub-core/kern/mips/qemu_mips/init.c (grub_reboot): Moved to...
	* grub-core/lib/mips/qemu_mips/reboot.c: ... here.
	* include/grub/emu/misc.h (grub_reboot): New function declaration.
	* include/grub/i386/reboot.h: New file.
	* include/grub/mips/loongson/ec.h: Fix includes.
	* include/grub/mips/qemu_mips/kernel.h (grub_reboot): Removed.
	* include/grub/misc.h (grub_reboot): Don't mark as kernel function.
	* grub-core/lib/i386/reboot.c: New file.
2011-10-19 16:53:18 +02:00
Vladimir 'phcoder' Serbinenko
a97501d238 Make grub_prefix into module to fix the arbitrary limit and save
some space.

	* grub-core/kern/emu/main.c (grub_prefix): Removed.
	* grub-core/kern/i386/coreboot/startup.S (grub_prefix): Likewise.
	* grub-core/kern/i386/efi/startup.S (grub_prefix): Likewise.
	* grub-core/kern/i386/ieee1275/startup.S (grub_prefix): Likewise.
	* grub-core/kern/i386/pc/startup.S (grub_prefix): Likewise.
	* grub-core/kern/i386/qemu/startup.S (grub_prefix): Likewise.
	* grub-core/kern/ia64/efi/startup.S (grub_prefix): Likewise.
	* grub-core/kern/mips/startup.S (grub_prefix): Likewise.
	* grub-core/kern/powerpc/ieee1275/startup.S (grub_prefix): Likewise.
	* grub-core/kern/sparc64/ieee1275/crt0.S (grub_prefix): Likewise.
	* grub-core/kern/x86_64/efi/startup.S (grub_prefix): Likewise.
	* include/grub/ia64/efi/kernel.h: Removed.
	* include/grub/kernel.h: New module type OBJ_TYPE_PREFIX.
	(grub_prefix): Removed.
	* include/grub/offsets.h (GRUB_KERNEL_I386_PC_PREFIX): Removed.
	(GRUB_KERNEL_I386_PC_PREFIX_END): Likewise.
	(GRUB_KERNEL_I386_QEMU_PREFIX): Likewise.
	(GRUB_KERNEL_I386_QEMU_PREFIX_END): Likewise.
	(GRUB_KERNEL_SPARC64_IEEE1275_PREFIX): Likewise.
	(GRUB_KERNEL_SPARC64_IEEE1275_PREFIX_END): Likewise.
	(GRUB_KERNEL_POWERPC_IEEE1275_PREFIX): Likewise.
	(GRUB_KERNEL_POWERPC_IEEE1275_PREFIX_END): Likewise.
	(GRUB_KERNEL_MIPS_LOONGSON_PREFIX): Likewise.
	(GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END): Likewise.
	(GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX): Likewise.
	(GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX_END): Likewise.
	(GRUB_KERNEL_MIPS_ARC_PREFIX): Likewise.
	(GRUB_KERNEL_MIPS_ARC_PREFIX_END): Likewise.
	(GRUB_KERNEL_I386_EFI_PREFIX): Likewise.
	(GRUB_KERNEL_I386_EFI_PREFIX_END): Likewise.
	(GRUB_KERNEL_IA64_EFI_PREFIX): Likewise.
	(GRUB_KERNEL_IA64_EFI_PREFIX_END): Likewise.
	(GRUB_KERNEL_X86_64_EFI_PREFIX): Likewise.
	(GRUB_KERNEL_X86_64_EFI_PREFIX_END): Likewise.
	(GRUB_KERNEL_I386_COREBOOT_PREFIX): Likewise.
	(GRUB_KERNEL_I386_COREBOOT_PREFIX_END): Likewise.
	(GRUB_KERNEL_I386_MULTIBOOT_PREFIX): Likewise.
	(GRUB_KERNEL_I386_MULTIBOOT_PREFIX_END): Likewise.
	(GRUB_KERNEL_I386_IEEE1275_PREFIX): Likewise.
	(GRUB_KERNEL_I386_IEEE1275_PREFIX_END): Likewise.
	(GRUB_KERNEL_MACHINE_PREFIX): Likewise.
	(GRUB_KERNEL_MACHINE_PREFIX_END): Likewise.
	* grub-core/kern/main.c (grub_set_prefix_and_root): Retrieve grub_prefix
	from module.
	* util/grub-mkimage.c (image_target_desc): Removed prefix and
	prefix_end.
	(image_targets): Likewise.
	(generate_image): Put prefix as a module.
2011-10-18 15:21:51 +02:00
Vladimir 'phcoder' Serbinenko
9fc9ce3795 Coreboot video support.
* grub-core/Makefile.core.def (vga): Extend to coreboot and multiboot.
	(vbe): Likewise.
	* grub-core/kern/i386/coreboot/startup.S: Include int.S.
	* grub-core/kern/i386/pc/startup.S (grub_bios_interrupt): Moved from
	here ...
	* grub-core/kern/i386/int.S: ... here.
	* grub-core/video/i386/pc/vbe.c: Updated includes.
	* grub-core/video/i386/pc/vga.c: Likewise.
	* include/grub/i386/coreboot/memory.h
	(GRUB_MEMORY_MACHINE_SCRATCH_ADDR): New definition.
	(GRUB_MEMORY_MACHINE_SCRATCH_SEG): Likewise.
	(GRUB_MEMORY_MACHINE_SCRATCH_SIZE): Likewise.
	* include/grub/i386/pc/int.h (GRUB_CPU_INT_FLAGS_DEFAULT) [!PCBIOS]:
	Disable interrupts.
	* include/grub/i386/pc/vga.h: Removed. All users updated.
2011-06-27 08:54:55 +02:00
Vladimir 'phcoder' Serbinenko
c76386454e Avoid using Reed-Solomon with 0 redundancy.
* grub-core/kern/i386/pc/startup.S: Remove 0-data check.
	* grub-core/lib/reed_solomon.c (decode_block): Do not proceed on 0 data
	or 0 redundancy.
	(grub_reed_solomon_add_redundancy): Do not proceed with 0 redundancy.
	(grub_reed_solomon_recover): Likewise.
2010-12-27 07:09:43 +01:00
Colin Watson
24b7938b32 * grub-core/kern/i386/pc/startup.S (grub_console_getkey): Use `>> 1'
rather than `/ 2', as the latter requires -Wa,--divide which would
require bumping our minimum binutils version.
2010-12-04 16:19:26 +00:00
Vladimir 'phcoder' Serbinenko
10001ac54b * grub-core/kern/i386/pc/startup.S (multiboot_trampoline): Add missing
jump.
2010-11-12 08:45:16 +01:00
Vladimir 'phcoder' Serbinenko
7bced4583e * grub-core/kern/i386/pc/startup.S (grub_console_setcursor): Check
cursor shape for sanity.
2010-10-17 01:49:06 +02:00
Vladimir 'phcoder' Serbinenko
d87c681fd4 * grub-core/kern/i386/pc/startup.S (bypass_table): Use 0x1b explicitly
rather than 0x1b.
	(grub_console_getkey): Use correct jae opcode rather than ja.
2010-10-14 15:35:55 +02:00
Vladimir 'phcoder' Serbinenko
74baff844e * grub-core/kern/i386/pc/startup.S (grub_console_getkey): Fix incorrect
handling of special keys.
2010-10-06 19:46:20 +02:00
Vladimir 'phcoder' Serbinenko
25e09515ad Make mb header to protected part 2010-09-25 21:42:13 +02:00
Vladimir 'phcoder' Serbinenko
3ac9e79207 Multiple bugs correction for Reed-Solomon 2010-09-25 20:40:26 +02:00
Vladimir 'phcoder' Serbinenko
419cbeb06d hook Reed-Solomon into startup.S 2010-09-25 19:33:05 +02:00
Vladimir 'phcoder' Serbinenko
4f0de6881c C part of Reed-Solomon 2010-09-24 14:05:47 +02:00
Carles Pina i Estany
1a9130dd3f Add keyboard layouts support.
* Makefile.util.def (grub-mklayout): New file.
	(grub-kbdcomp): New script.
	* grub-core/Makefile.am (KERNEL_HEADER_FILES) [COND_mips_yeeloong]:
	Add keyboard_layouts.h.
	* grub-core/Makefile.core.def (kernel): Add commands/keylayouts.c and
	commands/boot.c on yeeloong.
	(keylayouts): New module.
	* grub-core/bus/usb/ohci.c
	* grub-core/bus/usb/uhci.c
	* grub-core/bus/usb/usbhub.c (rescan): New variable.
	(grub_usb_add_hub): Poll interrupt pipe for device handling.
	(attach_root_port): Likewise.
	(poll_nonroot_hub): Likewise.
	(grub_usb_poll_devices): Likewise.
	(detach_device): Close transfer.
	* grub-core/bus/usb/usbtrans.c (grub_usb_execute_and_wait_transfer): New
	function.
	(grub_usb_bulk_setup_readwrite): Likewise.
	(grub_usb_bulk_finish_readwrite): Likewise.
	* grub-core/commands/keylayouts.c: New file.
	* grub-core/commands/keystatus.c (grub_getkeystatus): New function.
	* grub-core/commands/menuentry.c (hotkey_aliases): All several new
	aliases.
	* grub-core/term/at_keyboard.c: Restructured to use keylayouts and
	support scancode 2.
	* grub-core/term/usb_keyboard.c: Restructured to use keylayouts.
	* include/grub/keyboard_layouts.h: New file.
	* util/grub-mklayout.c: New file.
	* util/grub-kbdcomp.in: Likewise.

	Also-By: Aleš Nesrsta <starous@volny.cz>

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2010-09-19 01:01:35 +02:00
Vladimir 'phcoder' Serbinenko
275433e642 Don't export grub_gate_a20.
* grub-core/kern/i386/pc/init.c: Remove leftovers.
	* grub-core/kern/i386/pc/startup.S (FUNCTION(grub_gate_a20)): Rename
	to ...
	(grub_gate_a20): ... this. All users updated.
	* include/grub/i386/pc/init.h: Removed. All users updated.
2010-09-14 01:08:24 +02:00
Vladimir 'phcoder' Serbinenko
c8e7bf5ff7 Compress grub_prefix.
* grub-core/boot/i386/pc/lnxboot.S: Use
	GRUB_KERNEL_I386_PC_MULTIBOOT_SIGNATURE.
	* grub-core/kern/i386/pc/startup.S: Move grub_prefix to compressed part.
	* include/grub/offsets.h: Rename GRUB_MACHINE_DATA_END to
	GRUB_MACHINE_PREFIX_END. All users updated.
	(GRUB_KERNEL_I386_PC_PREFIX): Set to GRUB_KERNEL_I386_PC_RAW_SIZE.
	(GRUB_KERNEL_I386_PC_PREFIX_END): Set to GRUB_KERNEL_I386_PC_PREFIX
	+ 0x40.
	(GRUB_KERNEL_I386_PC_RAW_SIZE): Decrease.
	* util/grub-mkimage.c (image_target_desc): Change data_end to
	prefix_end. All users updated.
2010-09-03 14:54:04 +02:00
Vladimir 'phcoder' Serbinenko
70770806f3 Merge mainline into keylayouts 2010-08-31 14:12:34 +02:00
Vladimir 'phcoder' Serbinenko
5aaf2c18bd Merge mainline into keylayouts 2010-08-31 14:03:29 +02:00
Vladimir 'phcoder' Serbinenko
069c9c5fda merge mainline into intwrap 2010-08-29 23:21:21 +02:00
Vladimir 'phcoder' Serbinenko
afba9f98ec MErge mainline into intwrap 2010-08-25 23:39:42 +02:00
Vladimir 'phcoder' Serbinenko
89e07694dc Remove grub_dl_unload_all. It's unnecessary and causes trouble 2010-08-25 21:19:45 +02:00
Vladimir 'phcoder' Serbinenko
16bd6cfab2 Merge mainline into newreloc. For now without boot tests 2010-08-25 03:25:18 +02:00
BVK Chaitanya
297f0c2b6e merge with mainline 2010-07-13 00:43:28 +05:30
BVK Chaitanya
8c41176882 automake commit without merge history 2010-05-06 11:34:04 +05:30
Renamed from kern/i386/pc/startup.S (Browse further)