Commit graph

2311 commits

Author SHA1 Message Date
Aleš Nesrsta
1515ec8684 2010-06-02 Aleš Nesrsta <starous@volny.cz>
Finally make USB usable.

	* bus/usb/ohci.c (grub_ohci_reg_t): Add missing values.
	(GRUB_OHCI_RHUB_PORT_POWER_MASK): New macro.
	(GRUB_OHCI_RHUB_PORT_ALL_POWERED): Likewise.
	(GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_MASK): Likewise.
	(GRUB_OHCI_REG_FRAME_INTERVAL_FSMPS_SHIFT): Likewise.
	(GRUB_OHCI_REG_FRAME_INTERVAL_FI_SHIFT): Likewise.
	(GRUB_OHCI_FSMPS): Likewise.
	(GRUB_OHCI_PERIODIC_START): Likewise.
	(GRUB_OHCI_FRAME_INTERVAL): Likewise.
	(GRUB_OHCI_SET_PORT_ENABLE): Likewise.
	(GRUB_OHCI_CLEAR_PORT_ENABLE): Likewise.
	(GRUB_OHCI_SET_PORT_RESET): Likewise.
	(GRUB_OHCI_SET_PORT_RESET_STATUS_CHANGE): Likewise.
	* bus/usb/ohci.c (grub_ohci_pci_iter): Various important fixups.
	(grub_ohci_transaction): Likewise.
	(grub_ohci_transfer): Improve condition detection algorithms.
	Handle toggle property. Program the transactions correctly.
	Improve error handling. Various important fixups.
	(grub_ohci_portstatus): Put register writes in right order.
	* bus/usb/uhci.c (grub_free_queue): Compute last_trans.
	(grub_uhci_transfer): Don't show "failed" message on success.
	* bus/usb/usb.c (grub_usb_set_configuration): Zero-fill whole "toggle"
	array.
	(grub_usb_device_initialize): Read first 8 bytes of descriptor to
	determine its size.
	* bus/usb/usbtrans.c (grub_usb_control_msg): Use descdev.maxsize0 even
	before initialization is completed. Use IN direction for empty
	transfers. Use last_trans and compute toggle.
	* include/grub/usbtrans.h (grub_usb_transfer): New field last_trans.
	(GRUB_USB_FEATURE_ENDP_HALT): Correct the value.
	(GRUB_USB_FEATURE_DEV_REMOTE_WU): Likewise.
	(GRUB_USB_FEATURE_TEST_MODE): Likewise.
	* include/grub/usb.h (grub_usb_err_t): New value GRUB_USB_ERR_UNRECOVERABLE.
	(grub_usb_device): Increase toggle to 256.
	(grub_usbms_subclass_t): New values GRUB_USBMS_SUBCLASS_RBC,
	GRUB_USBMS_SUBCLASS_MMC2, GRUB_USBMS_SUBCLASS_UFI and
	GRUB_USBMS_SUBCLASS_SFF8070.
	* include/grub/scsicmd.h (grub_scsi_test_unit_ready): New structure.
	(grub_scsi_inquiry): New member page and alloc_length.
	(grub_scsi_request_sense): New structure.
	(grub_scsi_request_sense_data): Likewise.
	(grub_scsi_read_capacity): New fields logical_block_addr, PMI and
	control.
	* disk/scsi.c (grub_scsi_request_sense): New function.
	(grub_scsi_test_unit_ready): Likewise.
	(grub_scsi_inquiry): Fill new fields.
	(grub_scsi_read_capacity): Likewise.
	(grub_scsi_read10): Add request sense at the end.
	(grub_scsi_read12): Likewise.
	(grub_scsi_write10): Likewise.
	(grub_scsi_write12): Likewise.
	(grub_scsi_open): Add Test Unit Ready.
	* disk/usbms.c (grub_usbms_finddevs): Check configcnt.
	Support additional subclasses. Con't clear halt yet. Activate the
	proper config. Calculate LUNs correctly.
	(grub_usbms_transfer): Various important fixups.

2010-06-02  Vladimir Serbinenko  <phcoder@gmail.com>

	* bus/pci.c (grub_pci_iterate) [GRUB_MACHINE_MIPS_YEELOONG]: Skip ghosts.
	* bus/usb/ohci.c (grub_ohci_portstatus): Handle R/WC correctly.
	(grub_ohci_fini_hw): New function.
	(grub_ohci_restore_hw): Likewise.
	(GRUB_MOD_INIT(ohci)): Register preboot hook.
	(GRUB_MOD_FINI(ohci)): Shutdown OHCI.
	* term/usb_keyboard.c: Remove include of grub/machine/console.h.

2010-06-02  Vladimir Serbinenko  <phcoder@gmail.com>

	Dedicated DMA allocations.

	* bus/pci.c (grub_memalign_dma32): New function
	(grub_dma_free): Likewise.
	(grub_dma_get_virt): Likewise.
	(grub_dma_get_phys): Likewise.
	* bus/usb/ohci.c (grub_ohci): New members hcca_addr and hcca_chunk.
	(grub_ohci_pci_iter): Use dma32_alloc.
	(grub_ohci_transfer): Likewise.
	* bus/usb/usbtrans.c (grub_usb_control_msg): Likewise.
	(grub_usb_bulk_readwrite): Likewise.
	* include/grub/pci.h: Add declarations.

2010-06-02  Vladimir Serbinenko  <phcoder@gmail.com>

	CS5536 support.

	* bus/cs5536.c: New file.
	* bus/usb/ohci.c (grub_ohci_pci_iter): Check for CS5536.
	* conf/i386.rmk (pkglib_MODULES): Add cs5536.mod.
	(cs5536_mod_SOURCES): New variable.
	(cs5536_mod_CFLAGS): Likewise.
	(cs5536_mod_LDFLAGS): Likewise.
	* conf/mips-yeeloong.rmk (kernel_img_HEADERS): Add cs5536.h and
	machine/pci.h.
	(kernel_img_SOURCES): Add bus/cs5536.c.
	(pkglib_MODULES): Add usb.mod, usbtest.mod, ohci.mod, usbms.mod and
	usb_keyboard.mod.
	(usb_mod_SOURCES): New variable.
	(usb_mod_CFLAGS): New variable.
	(usb_mod_LDFLAGS): New variable.
	(usbtest_mod_SOURCES): New variable.
	(usbtest_mod_CFLAGS): New variable.
	(usbtest_mod_LDFLAGS): New variable.
	(ohci_mod_SOURCES): New variable.
	(ohci_mod_CFLAGS): New variable.
	(ohci_mod_LDFLAGS): New variable.
	(usbms_mod_SOURCES): New variable.
	(usbms_mod_CFLAGS): New variable.
	(usbms_mod_LDFLAGS): New variable.
	(usb_keyboard_mod_SOURCES): New variable.
	(usb_keyboard_mod_CFLAGS): New variable.
	(usb_keyboard_mod_LDFLAGS): New variable.
	* include/grub/smbus.h: New file.
	* include/grub/cs5536.h: New file.

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2010-06-02 17:16:20 +02:00
Vladimir 'phcoder' Serbinenko
49396b4f61 Add ChangeLog 2010-06-02 16:52:16 +02:00
Colin Watson
0b35b2a921 * util/grub.d/00_header.in: Add safety check to make sure that
${locale_dir} exists before trying to probe it.
2010-06-02 13:57:13 +01:00
Colin Watson
ca0afd5bab * docs/grub.texi (SCO UnixWare): Remove, at Vladimir's request and
per the GNU Coding Standards; this is now too obscure to be worth
documenting.
(QNX): Likewise.
(chainloader): Remove cross-reference to `SCO UnixWare'.
2010-06-02 13:11:33 +01:00
Colin Watson
1c41aa7883 * docs/grub.texi (Chain-loading): New section.
(DOS/Windows): New section, borrowed from GRUB Legacy with details
adjusted for GRUB 2.
(SCO UnixWare): Likewise.
(QNX): Likewise.
(chainloader): Add reference to `Block list syntax'.
(drivemap): New section.
(parttool): New section.
2010-06-02 12:47:11 +01:00
Colin Watson
bb8ea0f5c3 * docs/grub.texi (GNU GRUB manual): Remove reference to `Invoking
the grub shell'.
(Installation): Add reference to `Making a GRUB bootable CD-ROM'.
(Installing GRUB using grub-install): Remove reference to the grub
shell; mention `grub-mkimage' and `grub-setup' instead.
(Invoking grub-install): Likewise.
(Interface): Add reference to `Menu entry editor'.
(serial): Remove `--device' option.
2010-06-02 11:26:28 +01:00
Colin Watson
288dd6ed3d * docs/grub.texi (Configuration): New section, documenting
configuration file generation using grub-mkconfig.  I've left a slot
for documenting the full shell scripting format but have not yet
started on writing that up.
(Invoking grub-mkconfig): New section.
2010-06-02 11:14:02 +01:00
Colin Watson
34c9f0e949 * docs/grub.texi (direntry): Remove grub-terminfo reference.
(GNU GRUB manual): Likewise.
(General commands): Update description of `terminfo' for GRUB 2.
2010-06-02 02:50:04 +01:00
Colin Watson
9121567e16 * commands/gptsync.c (grub_cmd_gptsync): Fix typos.
(GRUB_MOD_INIT): Fix capitalisation.
* docs/grub.texi (Command-line and menu entry commands): Document
gettext and gptsync commands.
2010-06-02 02:37:55 +01:00
Colin Watson
ab6316112c * conf/any-emu.rmk (kernel_img_SOURCES) [!x86]: Include
kern/$(target_cpu)/cache.S even if TARGET_NO_MODULES = yes.
2010-06-02 01:23:34 +01:00
Colin Watson
bde4a9ac1d Add btrfs probing support, currently only in the single-device case.
* kern/emu/getroot.c (find_root_device_from_mountinfo): New
function.
(grub_guess_root_device): Call find_root_device_from_mountinfo
before looking in /dev.
2010-06-01 18:30:20 +01:00
Vladimir 'phcoder' Serbinenko
b1d17e10e0 * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Use
GRUB_DISK_SIZE_UNKNOWN.
	* disk/ieee1275/ofdisk.c (grub_ofdisk_open): Likewise.
2010-05-31 21:01:01 +02:00
Jiro SEKIBA
dfbfe00473 * include/grub/disk.h (GRUB_DISK_SIZE_UNKNOWN): New macro.
* fs/nilfs.c: Support 2nd super block in case 1st one is accidently
	corrupted or not synced properly.
2010-05-31 20:49:42 +02:00
Vladimir 'phcoder' Serbinenko
c2ffc8e956 * normal/main.c (grub_normal_add_menu_entry): Avoid going out of args.
Reported by: Seth Goldberg.
2010-05-31 20:46:16 +02:00
Vladimir 'phcoder' Serbinenko
5629316656 * loader/multiboot_mbi2.c (grub_multiboot_make_mbi): Fix incorrect
addition of dest.
	Reported by: Seth Goldberg.
2010-05-31 20:43:28 +02:00
Vladimir 'phcoder' Serbinenko
7620e7debd * commands/setpci.c (grub_setpci_iter): Fix an incorrect function check.
Reported by: Seth Goldberg.
2010-05-31 20:40:42 +02:00
Vladimir 'phcoder' Serbinenko
c837af3f38 * loader/multiboot_elfxx.c (grub_multiboot_load_elfXX) [__mips]: Check
64-bit address as signed on MIPS.
2010-05-31 20:23:51 +02:00
Colin Watson
c7c75cf4cb * configure.ac: AC_PROG_LEX sets LEX to ":" if lex is missing, not
to the empty string.
2010-05-28 18:13:48 +01:00
BVK Chaitanya
fa4b84900a Fix grub-emu issues on NetBSD, with gcc 4.1.3.
* conf/any-emu.rmk: Remove unnecessary COMMON_CFLAGS.
	* include/grub/emu/misc.h (canonicalize_file_name): New Prototype.
	* kern/misc.c (__enable_execute_stack): Disable on
	GRUB_MACHINE_EMU.
2010-05-28 19:18:45 +05:30
Colin Watson
a33075b941 Make grub-probe work with symbolic links under /dev/mapper as well
as with real block devices.  The Linux world seems to be (at best)
in transition here, and GRUB shouldn't get caught in the middle.
* kern/emu/getroot.c (find_root_device): Follow symbolic links under
/dev/mapper.
2010-05-28 13:21:30 +01:00
Colin Watson
d870813427 * util/grub-script-check.c (main): Ensure defined behaviour on empty
input files (in which case exit zero).
2010-05-27 15:54:18 +01:00
Colin Watson
db2102a046 * kern/emu/misc.c (canonicalize_file_name): realpath can still
return NULL for various reasons even if it has a maximum-length
buffer: for example, there might be a symlink loop, or the path
might exceed PATH_MAX.  If this happens, return NULL.
2010-05-27 15:45:41 +01:00
Robert Millan
5fdba519bb 2010-05-27 Robert Millan <rmh@gnu.org>
* util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Insert
	partmap module to handle cross-partmap setups.
	Reported by Orestes Mas.  Gràcies!
2010-05-27 16:38:16 +02:00
Colin Watson
d1d368e426 * util/grub-mkrescue.in: Initialise override_dir rather than
assuming that it's unset or empty in the environment.
2010-05-27 12:43:22 +01:00
Grégoire Sutre
95ac3c730c Fix -Wshadow warning with emu build on NetBSD. 2010-05-26 23:49:52 +02:00
BVK Chaitanya
7d8c021353 * INSTALL: Added flex >= 2.5.35 requirement. 2010-05-25 18:24:46 +05:30
Vladimir 'phcoder' Serbinenko
db4d5813e3 * commands/usbtest.c (grub_usb_get_string): Properly support UTF-16. 2010-05-23 14:37:28 +02:00
Vladimir 'phcoder' Serbinenko
f24f430030 cmostest support.
* commands/i386/cmostest.c: New file.
	* conf/i386-coreboot.rmk (pkglib_MODULES): Add cmostest.mod.
	(cmostest_mod_SOURCES): New variable.
	(cmostest_mod_CFLAGS): Likewise.
	(cmostest_mod_LDFLAGS): Likewise.
	* conf/i386-pc.rmk: Likewise.
	* docs/grub.texi (Vendor power-on keys): New section.
	* util/grub-mkconfig.in: export GRUB_DEFAULT_BUTTON,
	GRUB_HIDDEN_TIMEOUT_BUTTON, GRUB_TIMEOUT_BUTTON
	and GRUB_BUTTON_CMOS_ADDRESS.
	* util/grub.d/00_header.in: Handle powering-on by separate button.
2010-05-23 14:16:17 +02:00
Vladimir 'phcoder' Serbinenko
ad603f61a5 * gfxmenu/gui_list.c (draw_menu): Don't add scrollbar width to padding.
Removed drawing_scrollbar argument. All users updated
	Fixes #29792.
	Reported by Jo Shields
2010-05-23 13:59:50 +02:00
Vladimir 'phcoder' Serbinenko
3ecb080a33 * gfxmenu/view.c (grub_gfxmenu_draw_terminal_box): Apply only to current
buffer since gfxterm handles double repaint.
2010-05-23 13:43:38 +02:00
Vladimir 'phcoder' Serbinenko
5f2316c1fe * gfxmenu/gfxmenu.c (grub_gfxmenu_try): Change viewport on both buffers.
* term/gfxterm.c (real_scroll): Likewise.
2010-05-23 13:42:16 +02:00
Vladimir 'phcoder' Serbinenko
9a25f885d3 * kern/i386/pc/mmap.c (grub_machine_mmap_iterate): Zero-fill entry
before calling BIOS.
2010-05-21 20:22:29 +02:00
Vladimir 'phcoder' Serbinenko
39fbb79aa1 * include/grub/i18n.h: Always enable grub_gettext. 2010-05-21 20:12:41 +02:00
Vladimir 'phcoder' Serbinenko
228cfa97ca * kern/i386/pc/init.c (make_install_device): Fix a leftover usage of old
partition naming style.
2010-05-21 20:08:48 +02:00
Colin Watson
21717c8fca * util/grub-mkconfig.in: Fix handling of -o so that it works when
not the first option.
2010-05-21 14:17:15 +01:00
Colin Watson
c0f48e654d * util/grub-mkrelpath.c (usage): Remove excess apostrophe. 2010-05-20 23:27:15 +01:00
Colin Watson
96779aec8e * util/misc.c: Move inclusion of <limits.h> to ...
* kern/emu/misc.c: ... here.  Needed for canonicalize_file_name.
2010-05-20 23:16:10 +01:00
Grégoire Sutre
fa9d256ee4 Fix merge error in NetBSD code. 2010-05-20 02:05:43 +02:00
BVK Chaitanya
123b7a8571 Fix grub-mkrescue usage unit testing.
* tests/util/grub-shell.in: Use --grub-mkimage with grub-mkrescue.
2010-05-19 14:31:43 +05:30
Christian Franke
74276c0df7 * util/grub.d/10_windows.in: Use path names instead of
drive letters to prevent warning from Cygwin 1.7.
	Add drivemap command to menuentry if needed.
2010-05-18 21:58:49 +02:00
Samuel Thibault
c4f7b52359 2010-05-18 Justus Winter <4winter@informatik.uni-hamburg.de>
* util/grub.d/10_hurd.in: Include all gnumach* kernels, not only
	gnumach and gnumach.gz.
2010-05-18 20:10:37 +02:00
Vladimir 'phcoder' Serbinenko
95b97950e2 * include/grub/i18n.h (gettext): Inline instead of using #define.
(grub_gettext): Likewise.
	(_): Likewise.
2010-05-18 14:00:51 +02:00
Vladimir 'phcoder' Serbinenko
01b8d2d787 * Makefile.in (CPPFLAGS): Replace -DGRUB_LIBDIR with
-DGRUB_PKGLIBROOTDIR= and prepend @PACKAGE_TARNAME@. All users updated.
	* util/grub-mkimage.c (image_targets): Add i386-multiboot.
	(main): Add a slash after pkglibdirroot.
2010-05-18 13:55:26 +02:00
Vladimir 'phcoder' Serbinenko
654e1d1e0e * util/grub-install.in: Add missing "in" keyword. 2010-05-18 13:45:25 +02:00
Vladimir 'phcoder' Serbinenko
26966aeba7 2010-05-18 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkrescue.in: Remove -O i386-pc duplication.
	Reported by: Seth Goldberg.
2010-05-18 14:21:15 +02:00
Vladimir 'phcoder' Serbinenko
7500674773 * po/POTFILES: Rename util/grub-mkrawimage.c to util/grub-mkimage.c. 2010-05-18 14:20:00 +02:00
Colin Watson
74cbf5bdcb * configure.ac: Check for Linux device-mapper support.
* util/hostdisk.c (device_is_mapped): New function.
(find_partition_start): New function, partly broken out from
linux_find_partition and grub_util_biosdisk_get_grub_dev but with
device-mapper support added.
(linux_find_partition): Use find_partition_start.
(convert_system_partition_to_system_disk): Add `st' argument.
Support Linux /dev/mapper/* devices if device-mapper support is
available; only DM-RAID devices are understood at present.
(find_system_device): Add `st' argument.  Pass it to
convert_system_partition_to_system_disk.
(grub_util_biosdisk_get_grub_dev): Pass stat result to
find_system_device and convert_system_partition_to_system_disk.  Use
find_partition_start.
* conf/common.rmk (grub_mkdevicemap_SOURCES): Add kern/env.c,
kern/err.c, kern/list.c, kern/misc.c, and kern/emu/mm.c.
* util/deviceiter.c [__linux__]: Define MINOR.
(grub_util_iterate_devices): Add support for DM-RAID disk devices.
* util/mkdevicemap.c (grub_putchar): New function.
(grub_getkey): New function.
(grub_refresh): New function.
(main): Set debug=all if -v -v is used.
2010-05-18 12:33:35 +01:00
Colin Watson
355b51e9b5 Fix build with non-GNU libcs.
* util/misc.c (canonicalize_file_name): Move to ...
* kern/emu/misc.c (canonicalize_file_name): ... here.  Needed by
grub_make_system_path_relative_to_its_root.
2010-05-18 11:57:31 +01:00
Colin Watson
7fb5c25fd0 * util/grub-mkrescue.in: Sync up with grub-install in terms of how
we handle finding grub-mkimage.  Default to finding grub-mkimage in
${bindir} with program_transform_name applied, and provide a
--grub-mkimage option to override this.
2010-05-18 11:51:37 +01:00
Vladimir 'phcoder' Serbinenko
1d3293d67d Remove grub-mkisofs.
* conf/common.rmk (bin_UTILITIES): Remove grub-mkisofs.
	(grub_mkisofs_SOURCES): Removed.
	(grub_mkisofs_CFLAGS): Removed.
	* util/mkisofs/defaults.h: Removed.
	* util/mkisofs/eltorito.c: Likewise.
	* util/mkisofs/exclude.h: Likewise.
	* util/mkisofs/hash.c: Likewise.
	* util/mkisofs/include/: Likewise.
	* util/mkisofs/include/fctldefs.h: Likewise.
	* util/mkisofs/include/mconfig.h: Likewise.
	* util/mkisofs/include/prototyp.h: Likewise.
	* util/mkisofs/include/statdefs.h: Likewise.
	* util/mkisofs/iso9660.h: Likewise.
	* util/mkisofs/joliet.c: Likewise.
	* util/mkisofs/match.c: Likewise.
	* util/mkisofs/match.h: Likewise.
	* util/mkisofs/mkisofs.c: Likewise.
	* util/mkisofs/mkisofs.h: Likewise.
	* util/mkisofs/msdos_partition.h: Likewise.
	* util/mkisofs/multi.c: Likewise.
	* util/mkisofs/name.c: Likewise.
	* util/mkisofs/rock.c: Likewise.
	* util/mkisofs/tree.c: Likewise.
	* util/mkisofs/write.c: Likewise.
2010-05-17 23:33:03 +02:00