mirror of
http://cgit.git.savannah.gnu.org/git/grub.git
synced 2026-04-28 14:33:34 +00:00
Compare commits
85 Commits
phcoder/xe
...
phcoder/ar
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e4e4ee33f | ||
|
|
e1444e5399 | ||
|
|
ef57ad6164 | ||
|
|
72bd5756af | ||
|
|
295e041189 | ||
|
|
3f6f84f9e0 | ||
|
|
9f8f747605 | ||
|
|
102016960d | ||
|
|
07cd46627b | ||
|
|
9e161d1302 | ||
|
|
06c92907c1 | ||
|
|
74cef4ab78 | ||
|
|
f4116c3a42 | ||
|
|
2d56c1b117 | ||
|
|
1f72ca020d | ||
|
|
3d300d7247 | ||
|
|
03104c2d98 | ||
|
|
40562ddf1e | ||
|
|
1ea06af1ae | ||
|
|
df21b9363d | ||
|
|
8efde40d0c | ||
|
|
d624e04af1 | ||
|
|
bbd85a0292 | ||
|
|
4f06545767 | ||
|
|
66d0e16425 | ||
|
|
a98c706755 | ||
|
|
95f663ec1d | ||
|
|
2b2a338ad6 | ||
|
|
6c9512b610 | ||
|
|
f447b3d2bb | ||
|
|
295fe6c548 | ||
|
|
9cd85f276f | ||
|
|
502a7c48e9 | ||
|
|
418b32f8e9 | ||
|
|
98490fc328 | ||
|
|
3625fdc0b9 | ||
|
|
1ec2b7758b | ||
|
|
f51e8d0dda | ||
|
|
ee52ea80d6 | ||
|
|
c55f74a5c5 | ||
|
|
3b1bb7f3eb | ||
|
|
0b71582111 | ||
|
|
dc491ff04a | ||
|
|
192243b13e | ||
|
|
0f3ae7324a | ||
|
|
ab8770a314 | ||
|
|
f2df41cffa | ||
|
|
b0227ce4b9 | ||
|
|
f900bea454 | ||
|
|
dc51ac70ee | ||
|
|
869a0bc476 | ||
|
|
f9ee0c3e5d | ||
|
|
8af26e386c | ||
|
|
78e9b82d2c | ||
|
|
86139504b7 | ||
|
|
35c1d629f9 | ||
|
|
bacb8f911f | ||
|
|
fbda565356 | ||
|
|
598185f806 | ||
|
|
ca2fd6c93f | ||
|
|
a29fb4722c | ||
|
|
7562f4ab53 | ||
|
|
c7d0aa5450 | ||
|
|
ceb68c6648 | ||
|
|
99291427d2 | ||
|
|
6ffee98e1b | ||
|
|
a6649f5b8e | ||
|
|
c3c14cffef | ||
|
|
84939af253 | ||
|
|
ba6d40e8bb | ||
|
|
2c3a054f4f | ||
|
|
b8eda96422 | ||
|
|
ca3962ca7b | ||
|
|
a4f7d77f7d | ||
|
|
5099975ace | ||
|
|
2f98d7648e | ||
|
|
018e382144 | ||
|
|
f5cba79512 | ||
|
|
46569db585 | ||
|
|
575c7a6e3c | ||
|
|
fc489a889d | ||
|
|
bfb517bc3b | ||
|
|
437dba573f | ||
|
|
974ba94330 | ||
|
|
963d21b76c |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -246,4 +246,3 @@ build-aux/test-driver
|
||||
/garbage-gen
|
||||
/garbage-gen.exe
|
||||
/grub-fs-tester
|
||||
grub-core/build-grub-module-verifier
|
||||
|
||||
7
INSTALL
7
INSTALL
@@ -15,14 +15,15 @@ configuring the GRUB.
|
||||
Note: older versions may work but support is limited
|
||||
|
||||
Experimental support for clang 3.3 or later (results in much bigger binaries)
|
||||
for i386, x86_64, arm (including thumb), arm64, mips(el), powerpc, sparc64
|
||||
for i386, x86_64, arm (except thumb), arm64, mips(el), powerpc, sparc64
|
||||
Note: clang 3.2 or later works for i386 and x86_64 targets but results in
|
||||
much bigger binaries.
|
||||
earlier versions not tested
|
||||
Note: clang 3.2 or later works for arm
|
||||
None of tested clang versions generated usable thumb code
|
||||
earlier versions not tested
|
||||
Note: clang on arm64 is not supported due to
|
||||
https://llvm.org/bugs/show_bug.cgi?id=26030
|
||||
Note: clang 3.3 or later works for arm64
|
||||
earlier versions have no arm64 support
|
||||
Note: clang 3.3 or later works for mips(el)
|
||||
earlier versions fail to generate .reginfo and hence gprel relocations
|
||||
fail.
|
||||
|
||||
60
Makefile.am
60
Makefile.am
@@ -172,82 +172,82 @@ QEMU32=qemu-system-x86_64
|
||||
endif
|
||||
|
||||
linux.init.x86_64: $(srcdir)/grub-core/tests/boot/linux.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -static -m64 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
$(TARGET_CC) -o $@ $< -m64 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux.init.i386: $(srcdir)/grub-core/tests/boot/linux.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -static -m32 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux.init.mips: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
|
||||
$(TARGET_CC) -o $@ $< -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
$(TARGET_CC) -o $@ $< -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux.init.ppc: $(srcdir)/grub-core/tests/boot/linux.init-ppc.S
|
||||
$(TARGET_CC) -o $@ $< -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
$(TARGET_CC) -o $@ $< -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux.init.mipsel: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
|
||||
$(TARGET_CC) -o $@ $< -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
$(TARGET_CC) -o $@ $< -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux.init.loongson: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
|
||||
$(TARGET_CC) -o $@ $< -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -DREBOOT=1
|
||||
$(TARGET_CC) -o $@ $< -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -DREBOOT=1
|
||||
|
||||
multiboot.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -static -ffreestanding -nostdlib -nostdinc -DTARGET_MULTIBOOT=1 -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -DTARGET_MULTIBOOT=1 -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include
|
||||
|
||||
kfreebsd.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -static -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include
|
||||
|
||||
kfreebsd.aout: kfreebsd.elf
|
||||
$(TARGET_OBJCOPY) -O a.out-i386-linux $< $@ -j .text
|
||||
$(TARGET_OBJCOPY) -O a.out-i386-linux $< $@ -R .note.gnu.build-id -R .note.gnu.gold-version
|
||||
|
||||
pc-chainloader.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -static -DTARGET_CHAINLOADER=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x7c00 -m32
|
||||
$(TARGET_CC) -o $@ $< -DTARGET_CHAINLOADER=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x7c00 -m32
|
||||
|
||||
pc-chainloader.bin: pc-chainloader.elf
|
||||
$(TARGET_OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@;
|
||||
|
||||
ntldr.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DTARGET_NTLDR=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -static -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0 -m32
|
||||
$(TARGET_CC) -o $@ $< -DTARGET_NTLDR=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0 -m32
|
||||
|
||||
ntldr.bin: ntldr.elf
|
||||
$(TARGET_OBJCOPY) -O binary --strip-unneeded -j .text $< $@;
|
||||
$(TARGET_OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@;
|
||||
|
||||
multiboot2.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -static -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include -DTARGET_MULTIBOOT2=1
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include -DTARGET_MULTIBOOT2=1
|
||||
|
||||
kfreebsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kfreebsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@
|
||||
$(TARGET_CC) -o $@ $< -m64 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@
|
||||
|
||||
kfreebsd.init.i386: $(srcdir)/grub-core/tests/boot/kfreebsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@
|
||||
|
||||
knetbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -static -nostdlib -nostdinc -DTARGET_NETBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DTARGET_NETBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
kopenbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -static -nostdlib -nostdinc -DTARGET_OPENBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DTARGET_OPENBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
knetbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -DTARGET_NETBSD=1 -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
$(TARGET_CC) -o $@ $< -m64 -DTARGET_NETBSD=1 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
kopenbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -DTARGET_OPENBSD=1 -static -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
$(TARGET_CC) -o $@ $< -m64 -DTARGET_OPENBSD=1 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux-initramfs.mips: linux.init.mips Makefile
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio -R 0:0 --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
|
||||
linux-initramfs.ppc: linux.init.ppc Makefile
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio -R 0:0 --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
|
||||
linux-initramfs.mipsel: linux.init.mipsel Makefile
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio -R 0:0 --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
|
||||
linux-initramfs.loongson: linux.init.loongson Makefile
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio -R 0:0 --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
|
||||
linux-initramfs.i386: linux.init.i386 Makefile
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio -R 0:0 --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
|
||||
linux-initramfs.x86_64: linux.init.x86_64 Makefile
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio -R 0:0 --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && cp $< $$TDIR/init && (cd $$TDIR && echo ./init | cpio --quiet --dereference -o -H newc) | gzip > $@ && rm -rf $$TDIR
|
||||
|
||||
kfreebsd-mfsroot.i386.img: kfreebsd.init.i386 Makefile
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -t ffs -s 30m -f 1000 -o minfree=0,version=1 $@ $$TDIR && rm -rf $$TDIR
|
||||
@@ -306,7 +306,7 @@ bootcheck-knetbsd-x86_64: knetbsd.miniroot-image.x86_64.gz $(GRUB_PAYLOADS_DIR)/
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/miniroot.gz=knetbsd.miniroot-image.x86_64.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-i386: linux-initramfs.i386 $(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg --qemu-opts="-cpu pentium2" | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-x86_64: linux-initramfs.x86_64 $(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
@@ -369,12 +369,6 @@ if COND_i386_coreboot
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386
|
||||
endif
|
||||
|
||||
if COND_i386_ieee1275
|
||||
# *BSD requires ACPI
|
||||
#legacy protocol (linux16) makes early BIOS calls.
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64
|
||||
endif
|
||||
|
||||
if COND_i386_pc
|
||||
#pc chainloader by definition is only for i386-pc
|
||||
#ntldr and bootmgr require BIOS.
|
||||
@@ -416,7 +410,7 @@ bootcheck: $(BOOTCHECKS)
|
||||
|
||||
if COND_i386_coreboot
|
||||
default_payload.elf: grub-mkstandalone grub-mkimage FORCE
|
||||
test -f $@ && rm $@ || true
|
||||
rm $@
|
||||
pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat grub-core/fs.lst) password_pbkdf2 $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg
|
||||
endif
|
||||
|
||||
|
||||
@@ -416,7 +416,7 @@ program = {
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
data = {
|
||||
|
||||
14
NEWS
14
NEWS
@@ -18,7 +18,6 @@ New in 2.02:
|
||||
* ZFS features support.
|
||||
* ZFS LZ4 support.
|
||||
* XFS V5 format support.
|
||||
* LVM RAID1 support.
|
||||
|
||||
* New/improved terminal and video support:
|
||||
* Monochrome text (matching `hercules' in GRUB Legacy).
|
||||
@@ -50,9 +49,6 @@ New in 2.02:
|
||||
* Improve TFTP robustness.
|
||||
* Parse `nd' disk names in GRUB Legacy configuration files.
|
||||
* Issue separate DNS queries for IPv4 and IPv6.
|
||||
* Support IPv6 Router Advertisement to configure default router.
|
||||
* New variable net_<interface>_next_server containing next server
|
||||
from BOOTP reply.
|
||||
|
||||
* Coreboot improvements:
|
||||
* CBFS support both in on-disk images (loopback) and flash.
|
||||
@@ -100,8 +96,6 @@ New in 2.02:
|
||||
EFI Stall. If everything fails, use hardcoded frequency 800MHz.
|
||||
* Support Hyper-V Gen2 platforms which lack PIT for TSC calibration.
|
||||
* Map UEFI Persistent Memory to E820 persistent memory.
|
||||
* New Xen loader on ARM64.
|
||||
* Respect alignment requirement for block device IO buffers on EFI.
|
||||
|
||||
* Security:
|
||||
* Add optional facility to enforce that all files read by the core image
|
||||
@@ -140,11 +134,6 @@ New in 2.02:
|
||||
menu entry immediately.
|
||||
* New `file' command and grub-file utility to check file types.
|
||||
* New syslinux configuration file parser.
|
||||
* Set menu entry class to primary OS name returned by os-prober to display
|
||||
OS specific icon.
|
||||
* On Linux x86 detect EFI word size in grub-install and automatically select
|
||||
correct platform (x86_64-efi or i386-efi) to install. Requires Linux kernel
|
||||
4.0 or higher.
|
||||
|
||||
* Build system:
|
||||
* Remove all uses of nested functions; GRUB no longer requires an
|
||||
@@ -171,9 +160,6 @@ New in 2.02:
|
||||
* emu libusb support removed (was broken and unmaintained).
|
||||
* powerpc64le compile support.
|
||||
* Use fixed timestamp when generating GRUB image for reproducible builds.
|
||||
* Verify at build time that modules contain only supported relocations and their
|
||||
structure matches what boot-time module loader expects.
|
||||
* Do not require fonts on powerpc-ieee1275.
|
||||
|
||||
* Revision control moved to git.
|
||||
|
||||
|
||||
52
acinclude.m4
52
acinclude.m4
@@ -390,58 +390,6 @@ else
|
||||
[fi]
|
||||
])
|
||||
|
||||
AC_DEFUN([grub_CHECK_LINK_PIE],[
|
||||
[# Position independent executable.
|
||||
link_nopie_needed=no]
|
||||
AC_MSG_CHECKING([whether linker needs disabling of PIE to work])
|
||||
AC_LANG_CONFTEST([AC_LANG_SOURCE([[]])])
|
||||
|
||||
[if eval "$ac_compile -Wl,-r,-d -nostdlib -Werror -o conftest.o" 2> /dev/null; then]
|
||||
AC_MSG_RESULT([no])
|
||||
[# Should we clear up other files as well, having called `AC_LANG_CONFTEST'?
|
||||
rm -f conftest.o
|
||||
else
|
||||
link_nopie_needed=yes]
|
||||
AC_MSG_RESULT([yes])
|
||||
[fi]
|
||||
])
|
||||
|
||||
|
||||
dnl Check if the Linker supports `-no-pie'.
|
||||
AC_DEFUN([grub_CHECK_NO_PIE],
|
||||
[AC_MSG_CHECKING([whether linker accepts -no-pie])
|
||||
AC_CACHE_VAL(grub_cv_cc_ld_no_pie,
|
||||
[save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -no-pie -nostdlib -Werror"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[grub_cv_cc_ld_no_pie=yes],
|
||||
[grub_cv_cc_ld_no_pie=no])
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
])
|
||||
AC_MSG_RESULT([$grub_cv_cc_ld_no_pie])
|
||||
nopie_possible=no
|
||||
if test "x$grub_cv_cc_ld_no_pie" = xyes ; then
|
||||
nopie_possible=yes
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([grub_CHECK_NO_PIE_ONEWORD],
|
||||
[AC_MSG_CHECKING([whether linker accepts -nopie])
|
||||
AC_CACHE_VAL(grub_cv_cc_ld_no_pie_oneword,
|
||||
[save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -nopie -nostdlib -Werror"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[grub_cv_cc_ld_no_pie_oneword=yes],
|
||||
[grub_cv_cc_ld_no_pie_oneword=no])
|
||||
LDFLAGS="$save_LDFLAGS"
|
||||
])
|
||||
AC_MSG_RESULT([$grub_cv_cc_ld_no_pie_oneword])
|
||||
nopie_oneword_possible=no
|
||||
if test "x$grub_cv_cc_ld_no_pie_oneword" = xyes ; then
|
||||
nopie_oneword_possible=yes
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Check if the C compiler supports `-fPIC'.
|
||||
AC_DEFUN([grub_CHECK_PIC],[
|
||||
[# Position independent executable.
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
/* on x86 old clang doesn't support .code16
|
||||
newer clang supports it but creates 6-byte jumps instead of 3-byte ones
|
||||
which makes us go over boot sector size.
|
||||
Starting with 3.9 clang emits 3-byte jumps but still creates 8-bytes movl
|
||||
instead of 5-bytes, so code overflows into data. */
|
||||
which makes us go over boot sector size. */
|
||||
|
||||
.code16
|
||||
jmp far
|
||||
.org 4
|
||||
jmp nearer
|
||||
.org 6
|
||||
movl nearer, %ebx
|
||||
.org 11
|
||||
.space 100
|
||||
nearer:
|
||||
.space 200
|
||||
|
||||
@@ -86,9 +86,11 @@ CPPFLAGS_TERMINAL_LIST += '-Dgrub_term_register_output(...)=OUTPUT_TERMINAL_LIST
|
||||
CPPFLAGS_COMMAND_LIST = '-Dgrub_register_command(...)=COMMAND_LIST_MARKER(__VA_ARGS__)'
|
||||
CPPFLAGS_COMMAND_LIST += '-Dgrub_register_extcmd(...)=EXTCOMMAND_LIST_MARKER(__VA_ARGS__)'
|
||||
CPPFLAGS_COMMAND_LIST += '-Dgrub_register_command_p1(...)=P1COMMAND_LIST_MARKER(__VA_ARGS__)'
|
||||
CPPFLAGS_FDT_LIST := '-Dgrub_fdtbus_register(...)=FDT_DRIVER_LIST_MARKER(__VA_ARGS__)'
|
||||
CPPFLAGS_MARKER = $(CPPFLAGS_FS_LIST) $(CPPFLAGS_VIDEO_LIST) \
|
||||
$(CPPFLAGS_PARTTOOL_LIST) $(CPPFLAGS_PARTMAP_LIST) \
|
||||
$(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST)
|
||||
$(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST) \
|
||||
$(CPPFLAGS_FDT_LIST)
|
||||
|
||||
# Define these variables to calm down automake
|
||||
|
||||
|
||||
71
configure.ac
71
configure.ac
@@ -31,7 +31,7 @@ dnl (such as BUILD_CC, BUILD_CFLAGS, etc.) for the build type and variables
|
||||
dnl with the prefix "TARGET_" (such as TARGET_CC, TARGET_CFLAGS, etc.) are
|
||||
dnl used for the target type. See INSTALL for full list of variables.
|
||||
|
||||
AC_INIT([GRUB],[2.02~rc1],[bug-grub@gnu.org])
|
||||
AC_INIT([GRUB],[2.02~beta2],[bug-grub@gnu.org])
|
||||
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
||||
@@ -167,6 +167,7 @@ case "$target_cpu"-"$platform" in
|
||||
mipsel-fuloong) platform=loongson ;;
|
||||
mipsel-loongson) ;;
|
||||
arm-uboot) ;;
|
||||
arm-coreboot) ;;
|
||||
arm-efi) ;;
|
||||
arm64-efi) ;;
|
||||
*-emu) ;;
|
||||
@@ -388,15 +389,7 @@ fi
|
||||
|
||||
# Check for functions and headers.
|
||||
AC_CHECK_FUNCS(posix_memalign memalign getextmntent)
|
||||
AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h)
|
||||
|
||||
# glibc 2.25 still includes sys/sysmacros.h in sys/types.h but emits deprecation
|
||||
# warning which causes compilation failure later with -Werror. So use -Werror here
|
||||
# as well to force proper sys/sysmacros.h detection.
|
||||
SAVED_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$HOST_CFLAGS -Werror"
|
||||
AC_HEADER_MAJOR
|
||||
CFLAGS="$SAVED_CFLAGS"
|
||||
AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
|
||||
|
||||
AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
|
||||
#include <sys/param.h>
|
||||
@@ -1152,23 +1145,14 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then
|
||||
fi
|
||||
|
||||
if test "x$target_cpu" = xarm; then
|
||||
AC_CACHE_CHECK([for options to disable movt and movw], grub_cv_target_cc_mno_movt, [
|
||||
grub_cv_target_cc_mno_movt=no
|
||||
for cand in "-mno-movt" \
|
||||
"-mllvm -arm-use-movt=0"; do
|
||||
if test x"$grub_cv_target_cc_mno_movt" != xno ; then
|
||||
break
|
||||
fi
|
||||
CFLAGS="$TARGET_CFLAGS $cand -Werror"
|
||||
CPPFLAGS="$TARGET_CPPFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[grub_cv_target_cc_mno_movt="$cand"], [])
|
||||
done
|
||||
AC_CACHE_CHECK([whether option -mlong-calls works], grub_cv_cc_mlong_calls, [
|
||||
CFLAGS="$TARGET_CFLAGS -mlong-calls -Werror"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[grub_cv_cc_mlong_calls=yes],
|
||||
[grub_cv_cc_mlong_calls=no])
|
||||
])
|
||||
|
||||
if test x"$grub_cv_target_cc_mno_movt" != xno ; then
|
||||
# A trick so that clang doesn't see it on link stage
|
||||
TARGET_CPPFLAGS="$TARGET_CPPFLAGS $grub_cv_target_cc_mno_movt"
|
||||
if test "x$grub_cv_cc_mlong_calls" = xyes; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -mlong-calls"
|
||||
fi
|
||||
AC_CACHE_CHECK([whether option -mthumb-interwork works], grub_cv_cc_mthumb_interwork, [
|
||||
CFLAGS="$TARGET_CFLAGS -mthumb-interwork -Werror"
|
||||
@@ -1201,26 +1185,13 @@ CFLAGS="$TARGET_CFLAGS"
|
||||
|
||||
# Position independent executable.
|
||||
grub_CHECK_PIE
|
||||
grub_CHECK_NO_PIE
|
||||
grub_CHECK_NO_PIE_ONEWORD
|
||||
grub_CHECK_LINK_PIE
|
||||
[# Need that, because some distributions ship compilers that include
|
||||
# `-fPIE' or '-fpie' and '-pie' in the default specs.
|
||||
# `-fPIE' in the default specs.
|
||||
if [ x"$pie_possible" = xyes ]; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie"
|
||||
fi
|
||||
|
||||
if [ x"$link_nopie_needed" = xyes ] || [ x"$pie_possible" = xyes ]; then
|
||||
if [ x"$nopie_possible" = xyes ]; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -no-pie"
|
||||
fi
|
||||
if [ x"$nopie_oneword_possible" = xyes ]; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -nopie"
|
||||
fi
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
|
||||
fi]
|
||||
|
||||
CFLAGS="$TARGET_CFLAGS"
|
||||
LDFLAGS="$TARGET_LDFLAGS"
|
||||
|
||||
# Position independent executable.
|
||||
grub_CHECK_PIC
|
||||
@@ -1229,12 +1200,9 @@ grub_CHECK_PIC
|
||||
# and reload $gp in every function.
|
||||
# GCC implements it using symbol __gnu_local_gp in non-PIC as well.
|
||||
# However with clang we need PIC for this reloading to happen.
|
||||
# With arm64 we need relocations that are in some way representable in
|
||||
# PE as we need to support arm64-efi. Without -fPIC clang generates
|
||||
# movk's which aren't representable.
|
||||
# Since default varies across dictributions use either -fPIC or -fno-PIC
|
||||
# explicitly.
|
||||
if ( test x$target_cpu = xmips || test x$target_cpu = xmipsel || test x$target_cpu = xarm64 ) && test "x$grub_cv_cc_target_clang" = xyes ; then
|
||||
if ( test x$target_cpu = xmips || test x$target_cpu = xmipsel ) && test "x$grub_cv_cc_target_clang" = xyes ; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -fPIC"
|
||||
elif [ x"$pic_possible" = xyes ]; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIC"
|
||||
@@ -1587,11 +1555,11 @@ if test x"$grub_build_mkfont_excuse" = x ; then
|
||||
else
|
||||
enable_build_grub_mkfont=no
|
||||
fi
|
||||
if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then
|
||||
if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then
|
||||
if test x"$grub_build_mkfont_excuse" = x ; then
|
||||
AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time grub-mkfont])
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont])
|
||||
else
|
||||
AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time grub-mkfont ($grub_build_mkfont_excuse)])
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont ($grub_build_mkfont_excuse)])
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1661,11 +1629,11 @@ if test x"$enable_build_grub_mkfont" = xno ; then
|
||||
FONT_SOURCE=
|
||||
fi
|
||||
|
||||
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then
|
||||
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then
|
||||
if test x"$grub_build_mkfont_excuse" = x ; then
|
||||
AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont])
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont])
|
||||
else
|
||||
AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont ($grub_build_mkfont_excuse)])
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont ($grub_build_mkfont_excuse)])
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1905,6 +1873,7 @@ AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
|
||||
AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
|
||||
AM_CONDITIONAL([COND_arm], [test x$target_cpu = xarm ])
|
||||
AM_CONDITIONAL([COND_arm_uboot], [test x$target_cpu = xarm -a x$platform = xuboot])
|
||||
AM_CONDITIONAL([COND_arm_coreboot], [test x$target_cpu = xarm -a x$platform = xcoreboot])
|
||||
AM_CONDITIONAL([COND_arm_efi], [test x$target_cpu = xarm -a x$platform = xefi])
|
||||
AM_CONDITIONAL([COND_arm64], [test x$target_cpu = xarm64 ])
|
||||
AM_CONDITIONAL([COND_arm64_efi], [test x$target_cpu = xarm64 -a x$platform = xefi])
|
||||
|
||||
@@ -2446,10 +2446,6 @@ The boot file name provided by DHCP. Read-only.
|
||||
The name of the DHCP server responsible for these boot parameters.
|
||||
Read-only.
|
||||
|
||||
@item net_@var{<interface>}_next_server
|
||||
The IP address of the next (usually, TFTP) server provided by DHCP.
|
||||
Read-only.
|
||||
|
||||
@item net_default_interface
|
||||
Initially set to name of network interface that was used to load grub.
|
||||
Read-write, although setting it affects only interpretation of
|
||||
@@ -3066,7 +3062,6 @@ These variables have special meaning to GRUB.
|
||||
* net_@var{<interface>}_hostname::
|
||||
* net_@var{<interface>}_ip::
|
||||
* net_@var{<interface>}_mac::
|
||||
* net_@var{<interface>}_next_server::
|
||||
* net_@var{<interface>}_rootpath::
|
||||
* net_default_interface::
|
||||
* net_default_ip::
|
||||
@@ -3218,10 +3213,9 @@ source for more details.
|
||||
@node default
|
||||
@subsection default
|
||||
|
||||
If this variable is set, it identifies a menu entry that should be
|
||||
selected by default, possibly after a timeout (@pxref{timeout}). The
|
||||
entry may be identified by number (starting from 0 at each level of
|
||||
the hierarchy), by title, or by id.
|
||||
If this variable is set, it identifies a menu entry that should be selected
|
||||
by default, possibly after a timeout (@pxref{timeout}). The entry may be
|
||||
identified by number or by id.
|
||||
|
||||
For example, if you have:
|
||||
|
||||
@@ -3237,26 +3231,24 @@ then you can make this the default using:
|
||||
default=example-gnu-linux
|
||||
@end example
|
||||
|
||||
If the entry is in a submenu, then it must be identified using the
|
||||
number, title, or id of each of the submenus starting from the top
|
||||
level, followed by the number, title, or id of the menu entry itself,
|
||||
with each element separated by @samp{>}. For example, take the
|
||||
following menu structure:
|
||||
If the entry is in a submenu, then it must be identified using the titles of
|
||||
each of the submenus starting from the top level followed by the number or
|
||||
title of the menu entry itself, separated by @samp{>}. For example, take
|
||||
the following menu structure:
|
||||
|
||||
@example
|
||||
GNU/Hurd --id gnu-hurd
|
||||
Standard Boot --id=gnu-hurd-std
|
||||
Rescue shell --id=gnu-hurd-rescue
|
||||
Other platforms --id=other
|
||||
Minix --id=minix
|
||||
Version 3.4.0 --id=minix-3.4.0
|
||||
Version 3.3.0 --id=minix-3.3.0
|
||||
GRUB Invaders --id=grub-invaders
|
||||
Submenu 1
|
||||
Menu Entry 1
|
||||
Menu Entry 2
|
||||
Submenu 2
|
||||
Submenu 3
|
||||
Menu Entry 3
|
||||
Menu Entry 4
|
||||
Menu Entry 5
|
||||
@end example
|
||||
|
||||
The more recent release of Minix would then be identified as
|
||||
@samp{Other platforms>Minix>Version 3.4.0}, or as @samp{1>0>0}, or as
|
||||
@samp{other>minix>minix-3.4.0}.
|
||||
``Menu Entry 3'' would then be identified as
|
||||
@samp{Submenu 2>Submenu 3>Menu Entry 3}.
|
||||
|
||||
This variable is often set by @samp{GRUB_DEFAULT} (@pxref{Simple
|
||||
configuration}), @command{grub-set-default}, or @command{grub-reboot}.
|
||||
@@ -3430,12 +3422,6 @@ The default is the value of @samp{color_normal} (@pxref{color_normal}).
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_@var{<interface>}_next_server
|
||||
@subsection net_@var{<interface>}_next_server
|
||||
|
||||
@xref{Network}.
|
||||
|
||||
|
||||
@node net_@var{<interface>}_rootpath
|
||||
@subsection net_@var{<interface>}_rootpath
|
||||
|
||||
|
||||
10
gentpl.py
10
gentpl.py
@@ -31,7 +31,8 @@ GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot",
|
||||
"i386_xen", "x86_64_xen",
|
||||
"mips_loongson", "sparc64_ieee1275",
|
||||
"powerpc_ieee1275", "mips_arc", "ia64_efi",
|
||||
"mips_qemu_mips", "arm_uboot", "arm_efi", "arm64_efi" ]
|
||||
"mips_qemu_mips", "arm_uboot", "arm_efi", "arm64_efi",
|
||||
"arm_coreboot"]
|
||||
|
||||
GROUPS = {}
|
||||
|
||||
@@ -44,7 +45,7 @@ GROUPS["x86"] = GROUPS["i386"] + GROUPS["x86_64"]
|
||||
GROUPS["mips"] = [ "mips_loongson", "mips_qemu_mips", "mips_arc" ]
|
||||
GROUPS["sparc64"] = [ "sparc64_ieee1275" ]
|
||||
GROUPS["powerpc"] = [ "powerpc_ieee1275" ]
|
||||
GROUPS["arm"] = [ "arm_uboot", "arm_efi" ]
|
||||
GROUPS["arm"] = [ "arm_uboot", "arm_efi", "arm_coreboot" ]
|
||||
GROUPS["arm64"] = [ "arm64_efi" ]
|
||||
|
||||
# Groups based on firmware
|
||||
@@ -52,6 +53,7 @@ GROUPS["efi"] = [ "i386_efi", "x86_64_efi", "ia64_efi", "arm_efi", "arm64_efi"
|
||||
GROUPS["ieee1275"] = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275" ]
|
||||
GROUPS["uboot"] = [ "arm_uboot" ]
|
||||
GROUPS["xen"] = [ "i386_xen", "x86_64_xen" ]
|
||||
GROUPS["coreboot"] = [ "i386_coreboot", "arm_coreboot" ]
|
||||
|
||||
# emu is a special case so many core functionality isn't needed on this platform
|
||||
GROUPS["noemu"] = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu")
|
||||
@@ -61,10 +63,10 @@ GROUPS["cmos"] = GROUPS["x86"][:] + ["mips_loongson", "mips_qemu_mips",
|
||||
"sparc64_ieee1275", "powerpc_ieee1275"]
|
||||
GROUPS["cmos"].remove("i386_efi"); GROUPS["cmos"].remove("x86_64_efi");
|
||||
GROUPS["pci"] = GROUPS["x86"] + ["mips_loongson"]
|
||||
GROUPS["usb"] = GROUPS["pci"]
|
||||
GROUPS["usb"] = GROUPS["pci"] + ["arm_coreboot"]
|
||||
|
||||
# If gfxterm is main output console integrate it into kernel
|
||||
GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot" ]
|
||||
GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot", "arm_coreboot" ]
|
||||
GROUPS["videomodules"] = GRUB_PLATFORMS[:];
|
||||
for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i)
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ endif
|
||||
|
||||
if COND_i386_coreboot
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/coreboot/lbio.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/coreboot/lbio.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
|
||||
@@ -239,6 +239,20 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h
|
||||
endif
|
||||
|
||||
if COND_arm_coreboot
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/system.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fdt.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dma.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/coreboot/kernel.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/fdtbus.h
|
||||
endif
|
||||
|
||||
if COND_arm_efi
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/efi/loader.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
|
||||
@@ -358,6 +372,16 @@ terminal.lst: $(MARKER_FILES)
|
||||
platform_DATA += terminal.lst
|
||||
CLEANFILES += terminal.lst
|
||||
|
||||
fdt.lst: $(MARKER_FILES)
|
||||
(for pp in $^; do \
|
||||
b=`basename $$pp .marker`; \
|
||||
sed -n \
|
||||
-e "/FDT_DRIVER_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $$b/;p;}" \
|
||||
-e "/FDT_DRIVER_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $$b/;p;}" $$pp; \
|
||||
done) | sort -u > $@
|
||||
platform_DATA += fdt.lst
|
||||
CLEANFILES += fdt.lst
|
||||
|
||||
parttool.lst: $(MARKER_FILES)
|
||||
(for pp in $^; do \
|
||||
b=`basename $$pp .marker`; \
|
||||
|
||||
@@ -92,6 +92,8 @@ kernel = {
|
||||
emu_cppflags = '$(CPPFLAGS_GNULIB)';
|
||||
arm_uboot_ldflags = '-Wl,-r,-d';
|
||||
arm_uboot_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
|
||||
arm_coreboot_ldflags = '-Wl,-r,-d';
|
||||
arm_coreboot_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
|
||||
|
||||
i386_pc_startup = kern/i386/pc/startup.S;
|
||||
i386_efi_startup = kern/i386/efi/startup.S;
|
||||
@@ -105,7 +107,8 @@ kernel = {
|
||||
mips_startup = kern/mips/startup.S;
|
||||
sparc64_ieee1275_startup = kern/sparc64/ieee1275/crt0.S;
|
||||
powerpc_ieee1275_startup = kern/powerpc/ieee1275/startup.S;
|
||||
arm_uboot_startup = kern/arm/uboot/startup.S;
|
||||
arm_uboot_startup = kern/arm/startup.S;
|
||||
arm_coreboot_startup = kern/arm/startup.S;
|
||||
arm_efi_startup = kern/arm/efi/startup.S;
|
||||
arm64_efi_startup = kern/arm64/efi/startup.S;
|
||||
|
||||
@@ -149,6 +152,20 @@ kernel = {
|
||||
uboot = kern/uboot/init.c;
|
||||
uboot = kern/uboot/hw.c;
|
||||
uboot = term/uboot/console.c;
|
||||
arm_uboot = kern/arm/uboot/init.c;
|
||||
arm_uboot = kern/arm/uboot/uboot.S;
|
||||
|
||||
arm_coreboot = kern/arm/coreboot/init.c;
|
||||
arm_coreboot = kern/arm/coreboot/timer.c;
|
||||
arm_coreboot = kern/arm/coreboot/coreboot.S;
|
||||
arm_coreboot = lib/fdt.c;
|
||||
arm_coreboot = bus/fdt.c;
|
||||
arm_coreboot = term/ps2.c;
|
||||
arm_coreboot = term/arm/pl050.c;
|
||||
arm_coreboot = term/arm/cros.c;
|
||||
arm_coreboot = term/arm/cros_ec.c;
|
||||
arm_coreboot = commands/keylayouts.c;
|
||||
arm_coreboot = kern/arm/coreboot/dma.c;
|
||||
|
||||
terminfoinkernel = term/terminfo.c;
|
||||
terminfoinkernel = term/tparm.c;
|
||||
@@ -164,7 +181,7 @@ kernel = {
|
||||
i386_multiboot = kern/i386/coreboot/init.c;
|
||||
i386_qemu = kern/i386/qemu/init.c;
|
||||
i386_coreboot_multiboot_qemu = term/i386/pc/vga_text.c;
|
||||
i386_coreboot = video/i386/coreboot/cbfb.c;
|
||||
coreboot = video/coreboot/cbfb.c;
|
||||
|
||||
efi = disk/efi/efidisk.c;
|
||||
efi = kern/efi/efi.c;
|
||||
@@ -212,10 +229,8 @@ kernel = {
|
||||
|
||||
arm_efi = kern/arm/efi/init.c;
|
||||
arm_efi = kern/arm/efi/misc.c;
|
||||
arm_efi = kern/efi/fdt.c;
|
||||
|
||||
arm64_efi = kern/arm64/efi/init.c;
|
||||
arm64_efi = kern/efi/fdt.c;
|
||||
|
||||
i386_pc = kern/i386/pc/init.c;
|
||||
i386_pc = kern/i386/pc/mmap.c;
|
||||
@@ -225,8 +240,9 @@ kernel = {
|
||||
i386_qemu = kern/vga_init.c;
|
||||
i386_qemu = kern/i386/qemu/mmap.c;
|
||||
|
||||
i386_coreboot = kern/i386/coreboot/mmap.c;
|
||||
coreboot = kern/coreboot/mmap.c;
|
||||
i386_coreboot = kern/i386/coreboot/cbtable.c;
|
||||
arm_coreboot = kern/arm/coreboot/cbtable.c;
|
||||
|
||||
i386_multiboot = kern/i386/multiboot_mmap.c;
|
||||
|
||||
@@ -238,6 +254,7 @@ kernel = {
|
||||
mips_qemu_mips = term/ns8250.c;
|
||||
mips_qemu_mips = term/serial.c;
|
||||
mips_qemu_mips = term/at_keyboard.c;
|
||||
mips_qemu_mips = term/ps2.c;
|
||||
mips_qemu_mips = commands/boot.c;
|
||||
mips_qemu_mips = commands/keylayouts.c;
|
||||
mips_qemu_mips = term/i386/pc/vga_text.c;
|
||||
@@ -253,6 +270,7 @@ kernel = {
|
||||
mips_loongson = bus/pci.c;
|
||||
mips_loongson = kern/mips/loongson/init.c;
|
||||
mips_loongson = term/at_keyboard.c;
|
||||
mips_loongson = term/ps2.c;
|
||||
mips_loongson = commands/boot.c;
|
||||
mips_loongson = term/serial.c;
|
||||
mips_loongson = video/sm712.c;
|
||||
@@ -574,7 +592,17 @@ module = {
|
||||
module = {
|
||||
name = ehci;
|
||||
common = bus/usb/ehci.c;
|
||||
arm_coreboot = bus/usb/ehci-fdt.c;
|
||||
pci = bus/usb/ehci-pci.c;
|
||||
enable = pci;
|
||||
enable = arm_coreboot;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = dwc2;
|
||||
common = bus/usb/dwc2.c;
|
||||
arm_coreboot = bus/usb/dwc2-fdt.c;
|
||||
enable = arm_coreboot;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -754,6 +782,7 @@ module = {
|
||||
enable = arm_efi;
|
||||
enable = arm64_efi;
|
||||
enable = arm_uboot;
|
||||
enable = arm_coreboot;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -821,7 +850,7 @@ module = {
|
||||
common = commands/gptsync.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
/*module = {
|
||||
name = halt;
|
||||
nopc = commands/halt.c;
|
||||
i386_pc = commands/i386/pc/halt.c;
|
||||
@@ -856,7 +885,7 @@ module = {
|
||||
xen = lib/xen/reboot.c;
|
||||
uboot = lib/uboot/reboot.c;
|
||||
common = commands/reboot.c;
|
||||
};
|
||||
};*/
|
||||
|
||||
module = {
|
||||
name = hashsum;
|
||||
@@ -1533,7 +1562,6 @@ module = {
|
||||
i386_xen = lib/i386/xen/relocator.S;
|
||||
x86_64_xen = lib/x86_64/xen/relocator.S;
|
||||
xen = lib/i386/relocator_common_c.c;
|
||||
x86_64_efi = lib/x86_64/efi/relocator.c;
|
||||
|
||||
extra_dist = lib/i386/relocator_common.S;
|
||||
extra_dist = kern/powerpc/cache_flush.S;
|
||||
@@ -1549,6 +1577,7 @@ module = {
|
||||
cmos = lib/cmos_datetime.c;
|
||||
efi = lib/efi/datetime.c;
|
||||
uboot = lib/uboot/datetime.c;
|
||||
arm_coreboot = lib/uboot/datetime.c;
|
||||
sparc64_ieee1275 = lib/ieee1275/datetime.c;
|
||||
powerpc_ieee1275 = lib/ieee1275/datetime.c;
|
||||
sparc64_ieee1275 = lib/ieee1275/cmos.c;
|
||||
@@ -1869,6 +1898,7 @@ module = {
|
||||
module = {
|
||||
name = at_keyboard;
|
||||
common = term/at_keyboard.c;
|
||||
common = term/ps2.c;
|
||||
enable = x86;
|
||||
};
|
||||
|
||||
|
||||
255
grub-core/bus/fdt.c
Normal file
255
grub-core/bus/fdt.c
Normal file
@@ -0,0 +1,255 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2016 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/fdtbus.h>
|
||||
#include <grub/fdt.h>
|
||||
#include <grub/term.h>
|
||||
|
||||
static const void *dtb;
|
||||
static grub_size_t root_address_cells, root_size_cells;
|
||||
/* Pointer to this symbol signals invalid mapping. */
|
||||
char grub_fdtbus_invalid_mapping[1];
|
||||
|
||||
struct grub_fdtbus_dev
|
||||
{
|
||||
struct grub_fdtbus_dev *next;
|
||||
struct grub_fdtbus_dev *parent;
|
||||
int node;
|
||||
struct grub_fdtbus_driver *driver;
|
||||
};
|
||||
|
||||
struct grub_fdtbus_dev *devs;
|
||||
struct grub_fdtbus_driver *drivers;
|
||||
|
||||
static int
|
||||
is_compatible (struct grub_fdtbus_driver *driver,
|
||||
int node)
|
||||
{
|
||||
grub_size_t compatible_size;
|
||||
const char *compatible = grub_fdt_get_prop (dtb, node, "compatible",
|
||||
&compatible_size);
|
||||
const char *compatible_end = compatible + compatible_size;
|
||||
while (compatible < compatible_end)
|
||||
{
|
||||
if (grub_strcmp (driver->compatible, compatible) == 0)
|
||||
return 1;
|
||||
compatible += grub_strlen (compatible) + 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
fdtbus_scan (struct grub_fdtbus_dev *parent)
|
||||
{
|
||||
int node;
|
||||
for (node = grub_fdt_first_node (dtb, parent ? parent->node : 0); node >= 0;
|
||||
node = grub_fdt_next_node (dtb, node))
|
||||
{
|
||||
struct grub_fdtbus_dev *dev;
|
||||
struct grub_fdtbus_driver *driver;
|
||||
dev = grub_zalloc (sizeof (*dev));
|
||||
if (!dev)
|
||||
{
|
||||
grub_print_error ();
|
||||
return;
|
||||
}
|
||||
dev->node = node;
|
||||
dev->next = devs;
|
||||
dev->parent = parent;
|
||||
devs = dev;
|
||||
FOR_LIST_ELEMENTS(driver, drivers)
|
||||
if (!dev->driver && is_compatible (driver, node))
|
||||
{
|
||||
if (driver->attach(dev) == GRUB_ERR_NONE)
|
||||
{
|
||||
dev->driver = driver;
|
||||
break;
|
||||
}
|
||||
grub_print_error ();
|
||||
}
|
||||
fdtbus_scan (dev);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grub_fdtbus_register (struct grub_fdtbus_driver *driver)
|
||||
{
|
||||
struct grub_fdtbus_dev *dev;
|
||||
grub_list_push (GRUB_AS_LIST_P (&drivers),
|
||||
GRUB_AS_LIST (driver));
|
||||
for (dev = devs; dev; dev = dev->next)
|
||||
if (!dev->driver && is_compatible (driver, dev->node))
|
||||
{
|
||||
if (driver->attach(dev) == GRUB_ERR_NONE)
|
||||
dev->driver = driver;
|
||||
grub_print_error ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grub_fdtbus_unregister (struct grub_fdtbus_driver *driver)
|
||||
{
|
||||
grub_list_remove (GRUB_AS_LIST (driver));
|
||||
struct grub_fdtbus_dev *dev;
|
||||
for (dev = devs; dev; dev = dev->next)
|
||||
if (dev->driver == driver)
|
||||
{
|
||||
if (driver->detach)
|
||||
driver->detach(dev);
|
||||
dev->driver = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grub_fdtbus_init (const void *dtb_in, grub_size_t size)
|
||||
{
|
||||
if (!dtb_in || grub_fdt_check_header (dtb_in, size) < 0)
|
||||
grub_fatal ("invalid FDT");
|
||||
dtb = dtb_in;
|
||||
const grub_uint32_t *prop = grub_fdt_get_prop (dtb, 0, "#address-cells", 0);
|
||||
if (prop)
|
||||
root_address_cells = grub_be_to_cpu32 (*prop);
|
||||
else
|
||||
root_address_cells = 1;
|
||||
|
||||
prop = grub_fdt_get_prop (dtb, 0, "#size-cells", 0);
|
||||
if (prop)
|
||||
root_size_cells = grub_be_to_cpu32 (*prop);
|
||||
else
|
||||
root_size_cells = 1;
|
||||
|
||||
fdtbus_scan (0);
|
||||
}
|
||||
|
||||
static int
|
||||
get_address_cells (const struct grub_fdtbus_dev *dev)
|
||||
{
|
||||
const grub_uint32_t *prop;
|
||||
if (!dev)
|
||||
return root_address_cells;
|
||||
prop = grub_fdt_get_prop (dtb, dev->node, "#address-cells", 0);
|
||||
if (prop)
|
||||
return grub_be_to_cpu32 (*prop);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
get_size_cells (const struct grub_fdtbus_dev *dev)
|
||||
{
|
||||
const grub_uint32_t *prop;
|
||||
if (!dev)
|
||||
return root_size_cells;
|
||||
prop = grub_fdt_get_prop (dtb, dev->node, "#size-cells", 0);
|
||||
if (prop)
|
||||
return grub_be_to_cpu32 (*prop);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static grub_uint64_t
|
||||
get64 (const grub_uint32_t *reg, grub_size_t cells)
|
||||
{
|
||||
grub_uint64_t val = 0;
|
||||
if (cells >= 1)
|
||||
val = grub_be_to_cpu32 (reg[cells - 1]);
|
||||
if (cells >= 2)
|
||||
val |= ((grub_uint64_t) grub_be_to_cpu32 (reg[cells - 2])) << 32;
|
||||
return val;
|
||||
}
|
||||
|
||||
static volatile void *
|
||||
translate (const struct grub_fdtbus_dev *dev, const grub_uint32_t *reg)
|
||||
{
|
||||
volatile void *ret;
|
||||
const grub_uint32_t *ranges;
|
||||
grub_size_t ranges_size, cells_per_mapping;
|
||||
grub_size_t parent_address_cells, child_address_cells, child_size_cells;
|
||||
grub_size_t nmappings, i;
|
||||
if (dev == 0)
|
||||
{
|
||||
grub_uint64_t val;
|
||||
val = get64 (reg, root_address_cells);
|
||||
if (sizeof (void *) == 4 && (val >> 32))
|
||||
return grub_fdtbus_invalid_mapping;
|
||||
return (void *) (grub_addr_t) val;
|
||||
}
|
||||
ranges = grub_fdt_get_prop (dtb, dev->node, "ranges", &ranges_size);
|
||||
if (!ranges)
|
||||
return grub_fdtbus_invalid_mapping;
|
||||
if (ranges_size == 0)
|
||||
return translate (dev->parent, reg);
|
||||
parent_address_cells = get_address_cells (dev->parent);
|
||||
child_address_cells = get_address_cells (dev);
|
||||
child_size_cells = get_size_cells (dev);
|
||||
cells_per_mapping = parent_address_cells + child_address_cells + child_size_cells;
|
||||
nmappings = ranges_size / 4 / cells_per_mapping;
|
||||
for (i = 0; i < nmappings; i++)
|
||||
{
|
||||
const grub_uint32_t *child_addr = &ranges[i * cells_per_mapping];
|
||||
const grub_uint32_t *parent_addr = child_addr + child_address_cells;
|
||||
grub_uint64_t child_size = get64 (parent_addr + parent_address_cells, child_size_cells);
|
||||
|
||||
if (child_address_cells > 2 && grub_memcmp (reg, child_addr, (child_address_cells - 2) * 4) != 0)
|
||||
continue;
|
||||
if (get64 (reg, child_address_cells) < get64 (child_addr, child_address_cells))
|
||||
continue;
|
||||
|
||||
grub_uint64_t offset = get64 (reg, child_address_cells) - get64 (child_addr, child_address_cells);
|
||||
if (offset >= child_size)
|
||||
continue;
|
||||
|
||||
ret = translate (dev->parent, parent_addr);
|
||||
if (grub_fdtbus_is_mapping_valid (ret))
|
||||
ret = (volatile char *) ret + offset;
|
||||
return ret;
|
||||
}
|
||||
return grub_fdtbus_invalid_mapping;
|
||||
}
|
||||
|
||||
volatile void *
|
||||
grub_fdtbus_map_reg (const struct grub_fdtbus_dev *dev, int regno, grub_size_t *size)
|
||||
{
|
||||
grub_size_t address_cells, size_cells;
|
||||
address_cells = get_address_cells (dev->parent);
|
||||
size_cells = get_size_cells (dev->parent);
|
||||
const grub_uint32_t *reg = grub_fdt_get_prop (dtb, dev->node, "reg", 0);
|
||||
if (size && size_cells)
|
||||
*size = reg[(address_cells + size_cells) * regno + address_cells];
|
||||
if (size && !size_cells)
|
||||
*size = 0;
|
||||
return translate (dev->parent, reg + (address_cells + size_cells) * regno);
|
||||
}
|
||||
|
||||
const char *
|
||||
grub_fdtbus_get_name (const struct grub_fdtbus_dev *dev)
|
||||
{
|
||||
return grub_fdt_get_nodename (dtb, dev->node);
|
||||
}
|
||||
|
||||
const void *
|
||||
grub_fdtbus_get_prop (const struct grub_fdtbus_dev *dev,
|
||||
const char *name,
|
||||
grub_uint32_t *len)
|
||||
{
|
||||
return grub_fdt_get_prop (dtb, dev->node, name, len);
|
||||
}
|
||||
|
||||
const void *
|
||||
grub_fdtbus_get_fdt (void)
|
||||
{
|
||||
return dtb;
|
||||
}
|
||||
45
grub-core/bus/usb/dwc2-fdt.c
Normal file
45
grub-core/bus/usb/dwc2-fdt.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/* ehci.c - EHCI Support. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2011 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/misc.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/usb.h>
|
||||
#include <grub/fdtbus.h>
|
||||
|
||||
static grub_err_t
|
||||
dwc2_attach(const struct grub_fdtbus_dev *dev)
|
||||
{
|
||||
grub_dprintf ("dwc2", "Found snps-dwc2\n");
|
||||
|
||||
grub_dwc2_init_device (grub_fdtbus_map_reg (dev, 0, 0));
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct grub_fdtbus_driver dwc2 =
|
||||
{
|
||||
.compatible = "snps,dwc2",
|
||||
.attach = dwc2_attach
|
||||
};
|
||||
|
||||
void
|
||||
grub_dwc2_pci_scan (void)
|
||||
{
|
||||
grub_fdtbus_register (&dwc2);
|
||||
}
|
||||
1791
grub-core/bus/usb/dwc2.c
Normal file
1791
grub-core/bus/usb/dwc2.c
Normal file
File diff suppressed because it is too large
Load Diff
45
grub-core/bus/usb/ehci-fdt.c
Normal file
45
grub-core/bus/usb/ehci-fdt.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/* ehci.c - EHCI Support. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2011 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/misc.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/usb.h>
|
||||
#include <grub/fdtbus.h>
|
||||
|
||||
static grub_err_t
|
||||
ehci_attach(const struct grub_fdtbus_dev *dev)
|
||||
{
|
||||
grub_dprintf ("ehci", "Found generic-ehci\n");
|
||||
|
||||
grub_ehci_init_device (grub_fdtbus_map_reg (dev, 0, 0));
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct grub_fdtbus_driver ehci =
|
||||
{
|
||||
.compatible = "generic-ehci",
|
||||
.attach = ehci_attach
|
||||
};
|
||||
|
||||
void
|
||||
grub_ehci_pci_scan (void)
|
||||
{
|
||||
grub_fdtbus_register (&ehci);
|
||||
}
|
||||
208
grub-core/bus/usb/ehci-pci.c
Normal file
208
grub-core/bus/usb/ehci-pci.c
Normal file
@@ -0,0 +1,208 @@
|
||||
/* ehci.c - EHCI Support. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2011 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/pci.h>
|
||||
#include <grub/cpu/pci.h>
|
||||
#include <grub/cs5536.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/usb.h>
|
||||
|
||||
#define GRUB_EHCI_PCI_SBRN_REG 0x60
|
||||
#define GRUB_EHCI_ADDR_MEM_MASK (~0xff)
|
||||
|
||||
/* USBLEGSUP bits and related OS OWNED byte offset */
|
||||
enum
|
||||
{
|
||||
GRUB_EHCI_BIOS_OWNED = (1 << 16),
|
||||
GRUB_EHCI_OS_OWNED = (1 << 24)
|
||||
};
|
||||
|
||||
/* PCI iteration function... */
|
||||
static int
|
||||
grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
volatile grub_uint32_t *regs;
|
||||
grub_uint32_t base, base_h;
|
||||
grub_uint32_t eecp_offset;
|
||||
grub_uint32_t usblegsup = 0;
|
||||
grub_uint64_t maxtime;
|
||||
grub_uint32_t interf;
|
||||
grub_uint32_t subclass;
|
||||
grub_uint32_t class;
|
||||
grub_uint8_t release;
|
||||
grub_uint32_t class_code;
|
||||
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: begin\n");
|
||||
|
||||
if (pciid == GRUB_CS5536_PCIID)
|
||||
{
|
||||
grub_uint64_t basereg;
|
||||
|
||||
basereg = grub_cs5536_read_msr (dev, GRUB_CS5536_MSR_USB_EHCI_BASE);
|
||||
if (!(basereg & GRUB_CS5536_MSR_USB_BASE_MEMORY_ENABLE))
|
||||
{
|
||||
/* Shouldn't happen. */
|
||||
grub_dprintf ("ehci", "No EHCI address is assigned\n");
|
||||
return 0;
|
||||
}
|
||||
base = (basereg & GRUB_CS5536_MSR_USB_BASE_ADDR_MASK);
|
||||
basereg |= GRUB_CS5536_MSR_USB_BASE_BUS_MASTER;
|
||||
basereg &= ~GRUB_CS5536_MSR_USB_BASE_PME_ENABLED;
|
||||
basereg &= ~GRUB_CS5536_MSR_USB_BASE_PME_STATUS;
|
||||
basereg &= ~GRUB_CS5536_MSR_USB_BASE_SMI_ENABLE;
|
||||
grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_USB_EHCI_BASE, basereg);
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
|
||||
class_code = grub_pci_read (addr) >> 8;
|
||||
interf = class_code & 0xFF;
|
||||
subclass = (class_code >> 8) & 0xFF;
|
||||
class = class_code >> 16;
|
||||
|
||||
/* If this is not an EHCI controller, just return. */
|
||||
if (class != 0x0c || subclass != 0x03 || interf != 0x20)
|
||||
return 0;
|
||||
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: class OK\n");
|
||||
|
||||
/* Check Serial Bus Release Number */
|
||||
addr = grub_pci_make_address (dev, GRUB_EHCI_PCI_SBRN_REG);
|
||||
release = grub_pci_read_byte (addr);
|
||||
if (release != 0x20)
|
||||
{
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: Wrong SBRN: %0x\n",
|
||||
release);
|
||||
return 0;
|
||||
}
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: bus rev. num. OK\n");
|
||||
|
||||
/* Determine EHCI EHCC registers base address. */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
|
||||
base = grub_pci_read (addr);
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG1);
|
||||
base_h = grub_pci_read (addr);
|
||||
/* Stop if registers are mapped above 4G - GRUB does not currently
|
||||
* work with registers mapped above 4G */
|
||||
if (((base & GRUB_PCI_ADDR_MEM_TYPE_MASK) != GRUB_PCI_ADDR_MEM_TYPE_32)
|
||||
&& (base_h != 0))
|
||||
{
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: registers above 4G are not supported\n");
|
||||
return 0;
|
||||
}
|
||||
base &= GRUB_PCI_ADDR_MEM_MASK;
|
||||
if (!base)
|
||||
{
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI: EHCI is not mapped\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set bus master - needed for coreboot, VMware, broken BIOSes etc. */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
||||
grub_pci_write_word(addr,
|
||||
GRUB_PCI_COMMAND_MEM_ENABLED
|
||||
| GRUB_PCI_COMMAND_BUS_MASTER
|
||||
| grub_pci_read_word(addr));
|
||||
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: 32-bit EHCI OK\n");
|
||||
}
|
||||
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: iobase of EHCC: %08x\n",
|
||||
(base & GRUB_EHCI_ADDR_MEM_MASK));
|
||||
|
||||
regs = grub_pci_device_map_range (dev,
|
||||
(base & GRUB_EHCI_ADDR_MEM_MASK),
|
||||
0x100);
|
||||
|
||||
/* Is there EECP ? */
|
||||
eecp_offset = (grub_le_to_cpu32 (regs[2]) >> 8) & 0xff;
|
||||
|
||||
/* Determine and change ownership. */
|
||||
/* EECP offset valid in HCCPARAMS */
|
||||
/* Ownership can be changed via EECP only */
|
||||
if (pciid != GRUB_CS5536_PCIID && eecp_offset >= 0x40)
|
||||
{
|
||||
grub_pci_address_t pciaddr_eecp;
|
||||
pciaddr_eecp = grub_pci_make_address (dev, eecp_offset);
|
||||
|
||||
usblegsup = grub_pci_read (pciaddr_eecp);
|
||||
if (usblegsup & GRUB_EHCI_BIOS_OWNED)
|
||||
{
|
||||
grub_boot_time ("Taking ownership of EHCI controller");
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: EHCI owned by: BIOS\n");
|
||||
/* Ownership change - set OS_OWNED bit */
|
||||
grub_pci_write (pciaddr_eecp, usblegsup | GRUB_EHCI_OS_OWNED);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
|
||||
/* Wait for finish of ownership change, EHCI specification
|
||||
* doesn't say how long it can take... */
|
||||
maxtime = grub_get_time_ms () + 1000;
|
||||
while ((grub_pci_read (pciaddr_eecp) & GRUB_EHCI_BIOS_OWNED)
|
||||
&& (grub_get_time_ms () < maxtime));
|
||||
if (grub_pci_read (pciaddr_eecp) & GRUB_EHCI_BIOS_OWNED)
|
||||
{
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: EHCI change ownership timeout");
|
||||
/* Change ownership in "hard way" - reset BIOS ownership */
|
||||
grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
}
|
||||
}
|
||||
else if (usblegsup & GRUB_EHCI_OS_OWNED)
|
||||
/* XXX: What to do in this case - nothing ? Can it happen ? */
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: EHCI owned by: OS\n");
|
||||
else
|
||||
{
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: EHCI owned by: NONE\n");
|
||||
/* XXX: What to do in this case ? Can it happen ?
|
||||
* Is code below correct ? */
|
||||
/* Ownership change - set OS_OWNED bit */
|
||||
grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
}
|
||||
|
||||
/* Disable SMI, just to be sure. */
|
||||
pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4);
|
||||
grub_pci_write (pciaddr_eecp, 0);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
}
|
||||
|
||||
grub_dprintf ("ehci", "inithw: EHCI grub_ehci_pci_iter: ownership OK\n");
|
||||
|
||||
grub_ehci_init_device (regs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
grub_ehci_pci_scan (void)
|
||||
{
|
||||
grub_pci_iterate (grub_ehci_pci_iter, NULL);
|
||||
}
|
||||
@@ -22,13 +22,10 @@
|
||||
#include <grub/usb.h>
|
||||
#include <grub/usbtrans.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/pci.h>
|
||||
#include <grub/cpu/pci.h>
|
||||
#include <grub/cpu/io.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/loader.h>
|
||||
#include <grub/cs5536.h>
|
||||
#include <grub/disk.h>
|
||||
#include <grub/dma.h>
|
||||
#include <grub/cache.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
@@ -39,8 +36,6 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
||||
* - is not supporting interrupt transfers
|
||||
*/
|
||||
|
||||
#define GRUB_EHCI_PCI_SBRN_REG 0x60
|
||||
|
||||
/* Capability registers offsets */
|
||||
enum
|
||||
{
|
||||
@@ -54,7 +49,6 @@ enum
|
||||
#define GRUB_EHCI_EECP_MASK (0xff << 8)
|
||||
#define GRUB_EHCI_EECP_SHIFT 8
|
||||
|
||||
#define GRUB_EHCI_ADDR_MEM_MASK (~0xff)
|
||||
#define GRUB_EHCI_POINTER_MASK (~0x1f)
|
||||
|
||||
/* Capability register SPARAMS bits */
|
||||
@@ -85,13 +79,6 @@ enum
|
||||
|
||||
#define GRUB_EHCI_QH_EMPTY 1
|
||||
|
||||
/* USBLEGSUP bits and related OS OWNED byte offset */
|
||||
enum
|
||||
{
|
||||
GRUB_EHCI_BIOS_OWNED = (1 << 16),
|
||||
GRUB_EHCI_OS_OWNED = (1 << 24)
|
||||
};
|
||||
|
||||
/* Operational registers offsets */
|
||||
enum
|
||||
{
|
||||
@@ -455,9 +442,10 @@ grub_ehci_reset (struct grub_ehci *e)
|
||||
|
||||
sync_all_caches (e);
|
||||
|
||||
grub_dprintf ("ehci", "reset\n");
|
||||
|
||||
grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND,
|
||||
GRUB_EHCI_CMD_HC_RESET
|
||||
| grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND));
|
||||
GRUB_EHCI_CMD_HC_RESET);
|
||||
/* Ensure command is written */
|
||||
grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND);
|
||||
/* XXX: How long time could take reset of HC ? */
|
||||
@@ -473,116 +461,24 @@ grub_ehci_reset (struct grub_ehci *e)
|
||||
}
|
||||
|
||||
/* PCI iteration function... */
|
||||
static int
|
||||
grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
void *data __attribute__ ((unused)))
|
||||
void
|
||||
grub_ehci_init_device (volatile void *regs)
|
||||
{
|
||||
grub_uint8_t release;
|
||||
grub_uint32_t class_code;
|
||||
grub_uint32_t interf;
|
||||
grub_uint32_t subclass;
|
||||
grub_uint32_t class;
|
||||
grub_uint32_t base, base_h;
|
||||
struct grub_ehci *e;
|
||||
grub_uint32_t eecp_offset;
|
||||
grub_uint32_t fp;
|
||||
int i;
|
||||
grub_uint32_t usblegsup = 0;
|
||||
grub_uint64_t maxtime;
|
||||
grub_uint32_t n_ports;
|
||||
grub_uint8_t caplen;
|
||||
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: begin\n");
|
||||
|
||||
if (pciid == GRUB_CS5536_PCIID)
|
||||
{
|
||||
grub_uint64_t basereg;
|
||||
|
||||
basereg = grub_cs5536_read_msr (dev, GRUB_CS5536_MSR_USB_EHCI_BASE);
|
||||
if (!(basereg & GRUB_CS5536_MSR_USB_BASE_MEMORY_ENABLE))
|
||||
{
|
||||
/* Shouldn't happen. */
|
||||
grub_dprintf ("ehci", "No EHCI address is assigned\n");
|
||||
return 0;
|
||||
}
|
||||
base = (basereg & GRUB_CS5536_MSR_USB_BASE_ADDR_MASK);
|
||||
basereg |= GRUB_CS5536_MSR_USB_BASE_BUS_MASTER;
|
||||
basereg &= ~GRUB_CS5536_MSR_USB_BASE_PME_ENABLED;
|
||||
basereg &= ~GRUB_CS5536_MSR_USB_BASE_PME_STATUS;
|
||||
basereg &= ~GRUB_CS5536_MSR_USB_BASE_SMI_ENABLE;
|
||||
grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_USB_EHCI_BASE, basereg);
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
|
||||
class_code = grub_pci_read (addr) >> 8;
|
||||
interf = class_code & 0xFF;
|
||||
subclass = (class_code >> 8) & 0xFF;
|
||||
class = class_code >> 16;
|
||||
|
||||
/* If this is not an EHCI controller, just return. */
|
||||
if (class != 0x0c || subclass != 0x03 || interf != 0x20)
|
||||
return 0;
|
||||
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: class OK\n");
|
||||
|
||||
/* Check Serial Bus Release Number */
|
||||
addr = grub_pci_make_address (dev, GRUB_EHCI_PCI_SBRN_REG);
|
||||
release = grub_pci_read_byte (addr);
|
||||
if (release != 0x20)
|
||||
{
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: Wrong SBRN: %0x\n",
|
||||
release);
|
||||
return 0;
|
||||
}
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: bus rev. num. OK\n");
|
||||
|
||||
/* Determine EHCI EHCC registers base address. */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
|
||||
base = grub_pci_read (addr);
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG1);
|
||||
base_h = grub_pci_read (addr);
|
||||
/* Stop if registers are mapped above 4G - GRUB does not currently
|
||||
* work with registers mapped above 4G */
|
||||
if (((base & GRUB_PCI_ADDR_MEM_TYPE_MASK) != GRUB_PCI_ADDR_MEM_TYPE_32)
|
||||
&& (base_h != 0))
|
||||
{
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: registers above 4G are not supported\n");
|
||||
return 0;
|
||||
}
|
||||
base &= GRUB_PCI_ADDR_MEM_MASK;
|
||||
if (!base)
|
||||
{
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI: EHCI is not mapped\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set bus master - needed for coreboot, VMware, broken BIOSes etc. */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
||||
grub_pci_write_word(addr,
|
||||
GRUB_PCI_COMMAND_MEM_ENABLED
|
||||
| GRUB_PCI_COMMAND_BUS_MASTER
|
||||
| grub_pci_read_word(addr));
|
||||
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: 32-bit EHCI OK\n");
|
||||
}
|
||||
|
||||
/* Allocate memory for the controller and fill basic values. */
|
||||
e = grub_zalloc (sizeof (*e));
|
||||
if (!e)
|
||||
return 1;
|
||||
return;
|
||||
e->framelist_chunk = NULL;
|
||||
e->td_chunk = NULL;
|
||||
e->qh_chunk = NULL;
|
||||
e->iobase_ehcc = grub_pci_device_map_range (dev,
|
||||
(base & GRUB_EHCI_ADDR_MEM_MASK),
|
||||
0x100);
|
||||
e->iobase_ehcc = regs;
|
||||
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: iobase of EHCC: %08x\n",
|
||||
(base & GRUB_EHCI_ADDR_MEM_MASK));
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CAPLEN: %02x\n",
|
||||
grub_ehci_ehcc_read8 (e, GRUB_EHCI_EHCC_CAPLEN));
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: VERSION: %04x\n",
|
||||
@@ -598,7 +494,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
if (caplen & (sizeof (grub_uint32_t) - 1))
|
||||
{
|
||||
grub_dprintf ("ehci", "Unaligned caplen\n");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
e->iobase = ((volatile grub_uint32_t *) e->iobase_ehcc
|
||||
+ (caplen / sizeof (grub_uint32_t)));
|
||||
@@ -609,7 +505,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: iobase of oper. regs: %08x\n",
|
||||
(base & GRUB_EHCI_ADDR_MEM_MASK) + caplen);
|
||||
(grub_addr_t) e->iobase_ehcc + caplen);
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: COMMAND: %08x\n",
|
||||
grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND));
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: STATUS: %08x\n",
|
||||
@@ -625,10 +521,6 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CONFIG_FLAG: %08x\n",
|
||||
grub_ehci_oper_read32 (e, GRUB_EHCI_CONFIG_FLAG));
|
||||
|
||||
/* Is there EECP ? */
|
||||
eecp_offset = (grub_ehci_ehcc_read32 (e, GRUB_EHCI_EHCC_CPARAMS)
|
||||
& GRUB_EHCI_EECP_MASK) >> GRUB_EHCI_EECP_SHIFT;
|
||||
|
||||
/* Check format of data structures requested by EHCI */
|
||||
/* XXX: In fact it is not used at any place, it is prepared for future
|
||||
* This implementation uses 32-bits pointers only */
|
||||
@@ -732,65 +624,6 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: QH/TD init. OK\n");
|
||||
|
||||
/* Determine and change ownership. */
|
||||
/* EECP offset valid in HCCPARAMS */
|
||||
/* Ownership can be changed via EECP only */
|
||||
if (pciid != GRUB_CS5536_PCIID && eecp_offset >= 0x40)
|
||||
{
|
||||
grub_pci_address_t pciaddr_eecp;
|
||||
pciaddr_eecp = grub_pci_make_address (dev, eecp_offset);
|
||||
|
||||
usblegsup = grub_pci_read (pciaddr_eecp);
|
||||
if (usblegsup & GRUB_EHCI_BIOS_OWNED)
|
||||
{
|
||||
grub_boot_time ("Taking ownership of EHCI controller");
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: EHCI owned by: BIOS\n");
|
||||
/* Ownership change - set OS_OWNED bit */
|
||||
grub_pci_write (pciaddr_eecp, usblegsup | GRUB_EHCI_OS_OWNED);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
|
||||
/* Wait for finish of ownership change, EHCI specification
|
||||
* doesn't say how long it can take... */
|
||||
maxtime = grub_get_time_ms () + 1000;
|
||||
while ((grub_pci_read (pciaddr_eecp) & GRUB_EHCI_BIOS_OWNED)
|
||||
&& (grub_get_time_ms () < maxtime));
|
||||
if (grub_pci_read (pciaddr_eecp) & GRUB_EHCI_BIOS_OWNED)
|
||||
{
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: EHCI change ownership timeout");
|
||||
/* Change ownership in "hard way" - reset BIOS ownership */
|
||||
grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
}
|
||||
}
|
||||
else if (usblegsup & GRUB_EHCI_OS_OWNED)
|
||||
/* XXX: What to do in this case - nothing ? Can it happen ? */
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: EHCI owned by: OS\n");
|
||||
else
|
||||
{
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: EHCI owned by: NONE\n");
|
||||
/* XXX: What to do in this case ? Can it happen ?
|
||||
* Is code below correct ? */
|
||||
/* Ownership change - set OS_OWNED bit */
|
||||
grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
}
|
||||
|
||||
/* Disable SMI, just to be sure. */
|
||||
pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4);
|
||||
grub_pci_write (pciaddr_eecp, 0);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
|
||||
}
|
||||
|
||||
grub_dprintf ("ehci", "inithw: EHCI grub_ehci_pci_iter: ownership OK\n");
|
||||
|
||||
/* Now we can setup EHCI (maybe...) */
|
||||
|
||||
/* Check if EHCI is halted and halt it if not */
|
||||
@@ -864,7 +697,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: iobase of oper. regs: %08x\n",
|
||||
(base & GRUB_EHCI_ADDR_MEM_MASK));
|
||||
(grub_addr_t) regs);
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: COMMAND: %08x\n",
|
||||
grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND));
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: STATUS: %08x\n",
|
||||
@@ -880,7 +713,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CONFIG_FLAG: %08x\n",
|
||||
grub_ehci_oper_read32 (e, GRUB_EHCI_CONFIG_FLAG));
|
||||
|
||||
return 0;
|
||||
return;
|
||||
|
||||
fail:
|
||||
if (e)
|
||||
@@ -894,7 +727,7 @@ fail:
|
||||
}
|
||||
grub_free (e);
|
||||
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1746,8 +1579,8 @@ grub_ehci_hubports (grub_usb_controller_t dev)
|
||||
}
|
||||
|
||||
static grub_usb_err_t
|
||||
grub_ehci_portstatus (grub_usb_controller_t dev,
|
||||
unsigned int port, unsigned int enable)
|
||||
grub_ehci_reset_port (grub_usb_controller_t dev,
|
||||
unsigned int port)
|
||||
{
|
||||
struct grub_ehci *e = (struct grub_ehci *) dev->data;
|
||||
grub_uint64_t endtime;
|
||||
@@ -1769,14 +1602,6 @@ grub_ehci_portstatus (grub_usb_controller_t dev,
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return GRUB_USB_ERR_TIMEOUT;
|
||||
|
||||
if (!enable) /* We don't need reset port */
|
||||
{
|
||||
grub_dprintf ("ehci", "portstatus: Disabled.\n");
|
||||
grub_dprintf ("ehci", "portstatus: end, status=0x%02x\n",
|
||||
grub_ehci_port_read (e, port));
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
grub_dprintf ("ehci", "portstatus: enable\n");
|
||||
|
||||
grub_boot_time ("Resetting port %d", port);
|
||||
@@ -1891,12 +1716,6 @@ grub_ehci_detect_dev (grub_usb_controller_t dev, int port, int *changed)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
grub_ehci_inithw (void)
|
||||
{
|
||||
grub_pci_iterate (grub_ehci_pci_iter, NULL);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ehci_restore_hw (void)
|
||||
{
|
||||
@@ -1983,7 +1802,7 @@ static struct grub_usb_controller_dev usb_controller = {
|
||||
.check_transfer = grub_ehci_check_transfer,
|
||||
.cancel_transfer = grub_ehci_cancel_transfer,
|
||||
.hubports = grub_ehci_hubports,
|
||||
.portstatus = grub_ehci_portstatus,
|
||||
.reset_port = grub_ehci_reset_port,
|
||||
.detect_dev = grub_ehci_detect_dev,
|
||||
/* estimated max. count of TDs for one bulk transfer */
|
||||
.max_bulk_tds = GRUB_EHCI_N_TD * 3 / 4
|
||||
@@ -1997,7 +1816,7 @@ GRUB_MOD_INIT (ehci)
|
||||
grub_stop_disk_firmware ();
|
||||
|
||||
grub_boot_time ("Initing EHCI hardware");
|
||||
grub_ehci_inithw ();
|
||||
grub_ehci_pci_scan ();
|
||||
grub_boot_time ("Registering EHCI driver");
|
||||
grub_usb_controller_dev_register (&usb_controller);
|
||||
grub_boot_time ("EHCI driver registered");
|
||||
|
||||
@@ -1224,8 +1224,8 @@ grub_ohci_cancel_transfer (grub_usb_controller_t dev,
|
||||
}
|
||||
|
||||
static grub_usb_err_t
|
||||
grub_ohci_portstatus (grub_usb_controller_t dev,
|
||||
unsigned int port, unsigned int enable)
|
||||
grub_ohci_rest_port (grub_usb_controller_t dev,
|
||||
unsigned int port)
|
||||
{
|
||||
struct grub_ohci *o = (struct grub_ohci *) dev->data;
|
||||
grub_uint64_t endtime;
|
||||
@@ -1233,22 +1233,6 @@ grub_ohci_portstatus (grub_usb_controller_t dev,
|
||||
|
||||
grub_dprintf ("ohci", "begin of portstatus=0x%02x\n",
|
||||
grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port));
|
||||
|
||||
if (!enable) /* We don't need reset port */
|
||||
{
|
||||
/* Disable the port and wait for it. */
|
||||
grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port,
|
||||
GRUB_OHCI_CLEAR_PORT_ENABLE);
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port)
|
||||
& (1 << 1)))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return GRUB_USB_ERR_TIMEOUT;
|
||||
|
||||
grub_dprintf ("ohci", "end of portstatus=0x%02x\n",
|
||||
grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port));
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
/* OHCI does one reset signal 10ms long but USB spec.
|
||||
* requests 50ms for root hub (no need to be continuous).
|
||||
@@ -1438,7 +1422,7 @@ static struct grub_usb_controller_dev usb_controller =
|
||||
.check_transfer = grub_ohci_check_transfer,
|
||||
.cancel_transfer = grub_ohci_cancel_transfer,
|
||||
.hubports = grub_ohci_hubports,
|
||||
.portstatus = grub_ohci_portstatus,
|
||||
.reset_port = grub_ohci_reset_port,
|
||||
.detect_dev = grub_ohci_detect_dev,
|
||||
/* estimated max. count of TDs for one bulk transfer */
|
||||
.max_bulk_tds = GRUB_OHCI_TDS * 3 / 4
|
||||
|
||||
@@ -710,8 +710,8 @@ grub_uhci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data)
|
||||
}
|
||||
|
||||
static grub_usb_err_t
|
||||
grub_uhci_portstatus (grub_usb_controller_t dev,
|
||||
unsigned int port, unsigned int enable)
|
||||
grub_uhci_reset_port (grub_usb_controller_t dev,
|
||||
unsigned int port)
|
||||
{
|
||||
struct grub_uhci *u = (struct grub_uhci *) dev->data;
|
||||
int reg;
|
||||
@@ -731,21 +731,6 @@ grub_uhci_portstatus (grub_usb_controller_t dev,
|
||||
|
||||
status = grub_uhci_readreg16 (u, reg);
|
||||
grub_dprintf ("uhci", "detect=0x%02x\n", status);
|
||||
|
||||
if (!enable) /* We don't need reset port */
|
||||
{
|
||||
/* Disable the port. */
|
||||
grub_uhci_writereg16 (u, reg, 0 << 2);
|
||||
grub_dprintf ("uhci", "waiting for the port to be disabled\n");
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((grub_uhci_readreg16 (u, reg) & (1 << 2)))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return GRUB_USB_ERR_TIMEOUT;
|
||||
|
||||
status = grub_uhci_readreg16 (u, reg);
|
||||
grub_dprintf ("uhci", ">3detect=0x%02x\n", status);
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Reset the port. */
|
||||
status = grub_uhci_readreg16 (u, reg) & ~GRUB_UHCI_PORTSC_RWC;
|
||||
@@ -843,7 +828,7 @@ static struct grub_usb_controller_dev usb_controller =
|
||||
.check_transfer = grub_uhci_check_transfer,
|
||||
.cancel_transfer = grub_uhci_cancel_transfer,
|
||||
.hubports = grub_uhci_hubports,
|
||||
.portstatus = grub_uhci_portstatus,
|
||||
.reset_port = grub_uhci_reset_port,
|
||||
.detect_dev = grub_uhci_detect_dev,
|
||||
/* estimated max. count of TDs for one bulk transfer */
|
||||
.max_bulk_tds = N_TD * 3 / 4
|
||||
|
||||
@@ -207,8 +207,8 @@ attach_root_port (struct grub_usb_hub *hub, int portno,
|
||||
|
||||
grub_boot_time ("After detect_dev");
|
||||
|
||||
/* Enable the port. */
|
||||
err = hub->controller->dev->portstatus (hub->controller, portno, 1);
|
||||
/* Reset port. */
|
||||
err = hub->controller->dev->reset_port (hub->controller, portno);
|
||||
if (err)
|
||||
return;
|
||||
hub->controller->dev->pending_reset = grub_get_time_ms () + 5000;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/pci.h>
|
||||
#include <grub/dma.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/usb.h>
|
||||
|
||||
@@ -140,13 +140,10 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
}
|
||||
|
||||
if (utcount)
|
||||
{
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
for (j = 0; j < utcount; j++)
|
||||
grub_printf ("<%x>", (unsigned int) utbuf[j]);
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
}
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
for (j = 0; j < utcount; j++)
|
||||
grub_printf ("<%x>", (unsigned int) utbuf[j]);
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
|
||||
grub_xputs ("\n");
|
||||
grub_refresh ();
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <grub/misc.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/i386/coreboot/lbio.h>
|
||||
#include <grub/coreboot/lbio.h>
|
||||
#include <grub/i386/tsc.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <grub/misc.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/i386/coreboot/lbio.h>
|
||||
#include <grub/coreboot/lbio.h>
|
||||
#include <grub/i386/tsc.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
@@ -64,7 +64,7 @@ iterate_device (const char *name, void *data)
|
||||
/* Skip floppy drives when requested. */
|
||||
if (ctx->no_floppy &&
|
||||
name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9')
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
#ifdef DO_SEARCH_FS_UUID
|
||||
#define compare_fn grub_strcasecmp
|
||||
|
||||
@@ -493,15 +493,8 @@ grub_efidisk_open (const char *name, struct grub_disk *disk)
|
||||
m = d->block_io->media;
|
||||
/* FIXME: Probably it is better to store the block size in the disk,
|
||||
and total sectors should be replaced with total blocks. */
|
||||
grub_dprintf ("efidisk",
|
||||
"m = %p, last block = %llx, block size = %x, io align = %x\n",
|
||||
m, (unsigned long long) m->last_block, m->block_size,
|
||||
m->io_align);
|
||||
|
||||
/* Ensure required buffer alignment is a power of two (or is zero). */
|
||||
if (m->io_align & (m->io_align - 1))
|
||||
return grub_error (GRUB_ERR_IO, "invalid buffer alignment %d", m->io_align);
|
||||
|
||||
grub_dprintf ("efidisk", "m = %p, last block = %llx, block size = %x\n",
|
||||
m, (unsigned long long) m->last_block, m->block_size);
|
||||
disk->total_sectors = m->last_block + 1;
|
||||
/* Don't increase this value due to bug in some EFI. */
|
||||
disk->max_agglomerate = 0xa0000 >> (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS);
|
||||
@@ -531,42 +524,15 @@ grub_efidisk_readwrite (struct grub_disk *disk, grub_disk_addr_t sector,
|
||||
{
|
||||
struct grub_efidisk_data *d;
|
||||
grub_efi_block_io_t *bio;
|
||||
grub_efi_status_t status;
|
||||
grub_size_t io_align, num_bytes;
|
||||
char *aligned_buf;
|
||||
|
||||
d = disk->data;
|
||||
bio = d->block_io;
|
||||
|
||||
/* Set alignment to 1 if 0 specified */
|
||||
io_align = bio->media->io_align ? bio->media->io_align : 1;
|
||||
num_bytes = size << disk->log_sector_size;
|
||||
|
||||
if ((grub_addr_t) buf & (io_align - 1))
|
||||
{
|
||||
aligned_buf = grub_memalign (io_align, num_bytes);
|
||||
if (! aligned_buf)
|
||||
return GRUB_EFI_OUT_OF_RESOURCES;
|
||||
if (wr)
|
||||
grub_memcpy (aligned_buf, buf, num_bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
aligned_buf = buf;
|
||||
}
|
||||
|
||||
status = efi_call_5 ((wr ? bio->write_blocks : bio->read_blocks), bio,
|
||||
bio->media->media_id, (grub_efi_uint64_t) sector,
|
||||
(grub_efi_uintn_t) num_bytes, aligned_buf);
|
||||
|
||||
if ((grub_addr_t) buf & (io_align - 1))
|
||||
{
|
||||
if (!wr)
|
||||
grub_memcpy (buf, aligned_buf, num_bytes);
|
||||
grub_free (aligned_buf);
|
||||
}
|
||||
|
||||
return status;
|
||||
return efi_call_5 ((wr ? bio->write_blocks : bio->read_blocks), bio,
|
||||
bio->media->media_id,
|
||||
(grub_efi_uint64_t) sector,
|
||||
(grub_efi_uintn_t) size << disk->log_sector_size,
|
||||
buf);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
@@ -581,9 +547,7 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector,
|
||||
|
||||
status = grub_efidisk_readwrite (disk, sector, size, buf, 0);
|
||||
|
||||
if (status == GRUB_EFI_NO_MEDIA)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'"), disk->name);
|
||||
else if (status != GRUB_EFI_SUCCESS)
|
||||
if (status != GRUB_EFI_SUCCESS)
|
||||
return grub_error (GRUB_ERR_READ_ERROR,
|
||||
N_("failure reading sector 0x%llx from `%s'"),
|
||||
(unsigned long long) sector,
|
||||
@@ -604,9 +568,7 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector,
|
||||
|
||||
status = grub_efidisk_readwrite (disk, sector, size, (char *) buf, 1);
|
||||
|
||||
if (status == GRUB_EFI_NO_MEDIA)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'"), disk->name);
|
||||
else if (status != GRUB_EFI_SUCCESS)
|
||||
if (status != GRUB_EFI_SUCCESS)
|
||||
return grub_error (GRUB_ERR_WRITE_ERROR,
|
||||
N_("failure writing sector 0x%llx to `%s'"),
|
||||
(unsigned long long) sector, disk->name);
|
||||
|
||||
@@ -189,11 +189,7 @@ struct grub_fshelp_node {
|
||||
struct grub_fat_data *data;
|
||||
|
||||
grub_uint8_t attr;
|
||||
#ifndef MODE_EXFAT
|
||||
grub_uint32_t file_size;
|
||||
#else
|
||||
grub_uint64_t file_size;
|
||||
#endif
|
||||
grub_ssize_t file_size;
|
||||
grub_uint32_t file_cluster;
|
||||
grub_uint32_t cur_cluster_num;
|
||||
grub_uint32_t cur_cluster;
|
||||
|
||||
@@ -750,15 +750,19 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir,
|
||||
|
||||
if (dir->data->joliet && !ctx.filename)
|
||||
{
|
||||
char *semicolon;
|
||||
char *oldname, *semicolon;
|
||||
|
||||
oldname = name;
|
||||
ctx.filename = grub_iso9660_convert_string
|
||||
((grub_uint8_t *) name, dirent.namelen >> 1);
|
||||
((grub_uint8_t *) oldname, dirent.namelen >> 1);
|
||||
|
||||
semicolon = grub_strrchr (ctx.filename, ';');
|
||||
if (semicolon)
|
||||
*semicolon = '\0';
|
||||
|
||||
if (ctx.filename_alloc)
|
||||
grub_free (oldname);
|
||||
|
||||
ctx.filename_alloc = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,13 +76,8 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
/* incompat feature flags */
|
||||
#define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */
|
||||
#define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */
|
||||
#define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */
|
||||
|
||||
/* We do not currently verify metadata UUID so it is safe to read such filesystem */
|
||||
#define XFS_SB_FEAT_INCOMPAT_SUPPORTED \
|
||||
(XFS_SB_FEAT_INCOMPAT_FTYPE | \
|
||||
XFS_SB_FEAT_INCOMPAT_META_UUID)
|
||||
(XFS_SB_FEAT_INCOMPAT_FTYPE)
|
||||
|
||||
struct grub_xfs_sblock
|
||||
{
|
||||
|
||||
@@ -94,6 +94,6 @@ else
|
||||
rm -f $tmpfile.bin
|
||||
fi
|
||||
if test x@platform@ != xemu; then
|
||||
./build-grub-module-verifier@BUILD_EXEEXT@ $tmpfile @target_cpu@ @platform@
|
||||
./build-grub-module-verifier@BUILD_EXEEXT@ $tmpfile @target_cpu@
|
||||
fi
|
||||
mv $tmpfile $outfile
|
||||
|
||||
@@ -29,6 +29,8 @@ void grub_arm_clean_dcache_range_armv6 (grub_addr_t start, grub_addr_t end,
|
||||
grub_addr_t dlinesz);
|
||||
void grub_arm_clean_dcache_range_armv7 (grub_addr_t start, grub_addr_t end,
|
||||
grub_addr_t dlinesz);
|
||||
void grub_arm_clean_dcache_range_poc_armv7 (grub_addr_t start, grub_addr_t end,
|
||||
grub_addr_t dlinesz);
|
||||
void grub_arm_invalidate_icache_range_armv6 (grub_addr_t start, grub_addr_t end,
|
||||
grub_addr_t dlinesz);
|
||||
void grub_arm_invalidate_icache_range_armv7 (grub_addr_t start, grub_addr_t end,
|
||||
@@ -252,6 +254,38 @@ grub_arch_sync_caches (void *address, grub_size_t len)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grub_arch_sync_dma_caches (volatile void *address, grub_size_t len)
|
||||
{
|
||||
grub_addr_t start = (grub_addr_t) address;
|
||||
grub_addr_t end = start + len;
|
||||
|
||||
if (type == ARCH_UNKNOWN)
|
||||
probe_caches ();
|
||||
start = ALIGN_DOWN (start, grub_arch_cache_max_linesz);
|
||||
end = ALIGN_UP (end, grub_arch_cache_max_linesz);
|
||||
switch (type)
|
||||
{
|
||||
case ARCH_ARMV6:
|
||||
grub_arm_clean_dcache_range_armv6 (start, end, grub_arch_cache_dlinesz);
|
||||
grub_arm_invalidate_icache_range_armv6 (start, end,
|
||||
grub_arch_cache_ilinesz);
|
||||
break;
|
||||
case ARCH_ARMV5_WRITE_THROUGH:
|
||||
case ARCH_ARMV6_UNIFIED:
|
||||
grub_arm_clean_dcache_range_armv6 (start, end, grub_arch_cache_dlinesz);
|
||||
break;
|
||||
case ARCH_ARMV7:
|
||||
grub_arm_clean_dcache_range_poc_armv7 (start, end, grub_arch_cache_dlinesz);
|
||||
grub_arm_invalidate_icache_range_armv7 (start, end,
|
||||
grub_arch_cache_ilinesz);
|
||||
break;
|
||||
/* Pacify GCC. */
|
||||
case ARCH_UNKNOWN:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grub_arm_disable_caches_mmu (void)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,18 @@
|
||||
# define ISB isb
|
||||
#define ARMV7 1
|
||||
|
||||
FUNCTION(grub_arm_clean_dcache_range_poc_armv7)
|
||||
DSB
|
||||
@ Clean data cache for range to point-of-coherence
|
||||
1: cmp r0, r1
|
||||
bge 2f
|
||||
mcr p15, 0, r0, c7, c14, 1 @ DCCMVAC
|
||||
add r0, r0, r2 @ Next line
|
||||
b 1b
|
||||
2: DSB
|
||||
bx lr
|
||||
|
||||
|
||||
@ r0 - CLIDR
|
||||
@ r1 - LoC
|
||||
@ r2 - current level
|
||||
@@ -123,4 +135,4 @@ clean_invalidate_dcache:
|
||||
pop {r4-r12, lr}
|
||||
bx lr
|
||||
|
||||
#include "cache.S"
|
||||
#include "cache.S"
|
||||
|
||||
74
grub-core/kern/arm/coreboot/cbtable.c
Normal file
74
grub-core/kern/arm/coreboot/cbtable.c
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2007,2008,2013 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/coreboot/lbio.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/arm/startup.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
/* Helper for grub_linuxbios_table_iterate. */
|
||||
static int
|
||||
check_signature (grub_linuxbios_table_header_t tbl_header)
|
||||
{
|
||||
if (! grub_memcmp (tbl_header->signature, "LBIO", 4))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t,
|
||||
void *),
|
||||
void *hook_data)
|
||||
{
|
||||
grub_linuxbios_table_header_t table_header
|
||||
= (grub_linuxbios_table_header_t) grub_arm_saved_registers.r[0];
|
||||
grub_linuxbios_table_item_t table_item;
|
||||
|
||||
if (!check_signature (table_header))
|
||||
return 0;
|
||||
|
||||
signature_found:
|
||||
table_item =
|
||||
(grub_linuxbios_table_item_t) ((char *) table_header +
|
||||
table_header->header_size);
|
||||
for (; table_item < (grub_linuxbios_table_item_t) ((char *) table_header
|
||||
+ table_header->header_size
|
||||
+ table_header->table_size);
|
||||
table_item = (grub_linuxbios_table_item_t) ((char *) table_item + table_item->size))
|
||||
{
|
||||
if (table_item->tag == GRUB_LINUXBIOS_MEMBER_LINK
|
||||
&& check_signature ((grub_linuxbios_table_header_t) (grub_addr_t)
|
||||
*(grub_uint64_t *) (table_item + 1)))
|
||||
{
|
||||
table_header = (grub_linuxbios_table_header_t) (grub_addr_t)
|
||||
*(grub_uint64_t *) (table_item + 1);
|
||||
goto signature_found;
|
||||
}
|
||||
if (hook (table_item, hook_data))
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
44
grub-core/kern/arm/coreboot/coreboot.S
Normal file
44
grub-core/kern/arm/coreboot/coreboot.S
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2016 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/symbol.h>
|
||||
|
||||
.file "coreboot.S"
|
||||
.text
|
||||
.syntax unified
|
||||
#if !defined (__thumb2__)
|
||||
.arch armv7a
|
||||
.arm
|
||||
#else
|
||||
.arch armv7
|
||||
.thumb
|
||||
#endif
|
||||
|
||||
FUNCTION(grub_arm_pfr1)
|
||||
mrc p15, 0, r0, c0, c1, 1
|
||||
bx lr
|
||||
|
||||
FUNCTION(grub_armv7_get_timer_value)
|
||||
isb
|
||||
mrrc p15, 1, r0, r1, c14
|
||||
bx lr
|
||||
|
||||
FUNCTION(grub_armv7_get_timer_frequency)
|
||||
mrc p15, 0, r0, c14, c0, 0
|
||||
bx lr
|
||||
|
||||
59
grub-core/kern/arm/coreboot/dma.c
Normal file
59
grub-core/kern/arm/coreboot/dma.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2007,2009 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/dl.h>
|
||||
#include <grub/dma.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/mm_private.h>
|
||||
#include <grub/cache.h>
|
||||
|
||||
struct grub_pci_dma_chunk *
|
||||
grub_memalign_dma32 (grub_size_t align, grub_size_t size)
|
||||
{
|
||||
void *ret;
|
||||
if (align < 64)
|
||||
align = 64;
|
||||
size = ALIGN_UP (size, align);
|
||||
ret = grub_memalign (align, size);
|
||||
if (!ret)
|
||||
return 0;
|
||||
grub_arch_sync_dma_caches (ret, size);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
grub_dma_free (struct grub_pci_dma_chunk *ch)
|
||||
{
|
||||
grub_size_t size = (((struct grub_mm_header *) ch) - 1)->size * GRUB_MM_ALIGN;
|
||||
grub_arch_sync_dma_caches (ch, size);
|
||||
grub_free (ch);
|
||||
}
|
||||
|
||||
volatile void *
|
||||
grub_dma_get_virt (struct grub_pci_dma_chunk *ch)
|
||||
{
|
||||
return (void *) ch;
|
||||
}
|
||||
|
||||
grub_uint32_t
|
||||
grub_dma_get_phys (struct grub_pci_dma_chunk *ch)
|
||||
{
|
||||
return (grub_uint32_t) (grub_addr_t) ch;
|
||||
}
|
||||
|
||||
169
grub-core/kern/arm/coreboot/init.c
Normal file
169
grub-core/kern/arm/coreboot/init.c
Normal file
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2013 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/kernel.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/memory.h>
|
||||
#include <grub/machine/console.h>
|
||||
#include <grub/machine/kernel.h>
|
||||
#include <grub/offsets.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/loader.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/cache.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/video.h>
|
||||
#include <grub/coreboot/lbio.h>
|
||||
#include <grub/fdtbus.h>
|
||||
|
||||
extern grub_uint8_t _start[];
|
||||
extern grub_uint8_t _end[];
|
||||
extern grub_uint8_t _edata[];
|
||||
grub_addr_t start_of_ram = ~(grub_addr_t)0;
|
||||
|
||||
void __attribute__ ((noreturn))
|
||||
grub_exit (void)
|
||||
{
|
||||
/* We can't use grub_fatal() in this function. This would create an infinite
|
||||
loop, since grub_fatal() calls grub_abort() which in turn calls grub_exit(). */
|
||||
while (1)
|
||||
grub_cpu_idle ();
|
||||
}
|
||||
|
||||
static grub_uint64_t modend;
|
||||
static int have_memory = 0;
|
||||
|
||||
/* Helper for grub_machine_init. */
|
||||
static int
|
||||
heap_init (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type,
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_uint64_t begin = addr, end = addr + size;
|
||||
|
||||
#if GRUB_CPU_SIZEOF_VOID_P == 4
|
||||
/* Restrict ourselves to 32-bit memory space. */
|
||||
if (begin > GRUB_ULONG_MAX)
|
||||
return 0;
|
||||
if (end > GRUB_ULONG_MAX)
|
||||
end = GRUB_ULONG_MAX;
|
||||
#endif
|
||||
|
||||
if (start_of_ram > begin)
|
||||
start_of_ram = begin;
|
||||
|
||||
if (type != GRUB_MEMORY_AVAILABLE)
|
||||
return 0;
|
||||
|
||||
if (modend && begin < modend)
|
||||
{
|
||||
if (begin < (grub_addr_t)_start)
|
||||
{
|
||||
grub_mm_init_region ((void *) (grub_addr_t) begin, (grub_size_t) ((grub_addr_t)_start - begin));
|
||||
have_memory = 1;
|
||||
}
|
||||
begin = modend;
|
||||
}
|
||||
|
||||
/* Avoid DMA problems. */
|
||||
if (end >= 0xfe000000)
|
||||
end = 0xfe000000;
|
||||
|
||||
if (end <= begin)
|
||||
return 0;
|
||||
|
||||
grub_mm_init_region ((void *) (grub_addr_t) begin, (grub_size_t) (end - begin));
|
||||
|
||||
have_memory = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const void *dtb;
|
||||
static grub_size_t dtb_size;
|
||||
|
||||
static int
|
||||
iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data __attribute__ ((unused)))
|
||||
{
|
||||
if (table_item->tag != GRUB_LINUXBIOS_MEMBER_DTB)
|
||||
return 0;
|
||||
|
||||
if (grub_fdt_check_header (table_item + 1, table_item->size) >= 0)
|
||||
{
|
||||
dtb = table_item + 1;
|
||||
dtb_size = table_item->size;
|
||||
}
|
||||
else
|
||||
grub_printf ("Invalid DTB supplied by coreboot\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
grub_machine_init (void)
|
||||
{
|
||||
struct grub_module_header *header;
|
||||
|
||||
modend = grub_modules_get_end ();
|
||||
|
||||
grub_video_coreboot_fb_early_init ();
|
||||
|
||||
grub_machine_mmap_iterate (heap_init, NULL);
|
||||
if (!have_memory)
|
||||
grub_fatal ("No memory found");
|
||||
|
||||
grub_video_coreboot_fb_late_init ();
|
||||
|
||||
grub_font_init ();
|
||||
grub_gfxterm_init ();
|
||||
|
||||
FOR_MODULES (header)
|
||||
if (header->type == OBJ_TYPE_DTB)
|
||||
{
|
||||
char *dtb_orig_addr, *dtb_copy;
|
||||
dtb_orig_addr = (char *) header + sizeof (struct grub_module_header);
|
||||
|
||||
dtb_size = header->size - sizeof (struct grub_module_header);
|
||||
dtb = dtb_copy = grub_malloc (dtb_size);
|
||||
grub_memmove (dtb_copy, dtb_orig_addr, dtb_size);
|
||||
break;
|
||||
}
|
||||
if (!dtb)
|
||||
grub_linuxbios_table_iterate (iterate_linuxbios_table, 0);
|
||||
if (!dtb)
|
||||
grub_fatal ("No DTB found");
|
||||
grub_fdtbus_init (dtb, dtb_size);
|
||||
|
||||
grub_machine_timer_init ();
|
||||
grub_cros_init ();
|
||||
grub_pl050_init ();
|
||||
}
|
||||
|
||||
void
|
||||
grub_machine_get_bootlocation (char **device __attribute__ ((unused)),
|
||||
char **path __attribute__ ((unused)))
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
grub_machine_fini (int flags __attribute__ ((unused)))
|
||||
{
|
||||
}
|
||||
101
grub-core/kern/arm/coreboot/timer.c
Normal file
101
grub-core/kern/arm/coreboot/timer.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2016 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/mm.h>
|
||||
#include <grub/machine/kernel.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/fdtbus.h>
|
||||
#include <grub/misc.h>
|
||||
|
||||
grub_uint64_t
|
||||
grub_armv7_get_timer_value(void);
|
||||
|
||||
grub_uint32_t
|
||||
grub_armv7_get_timer_frequency(void);
|
||||
|
||||
grub_uint32_t
|
||||
grub_arm_pfr1(void);
|
||||
|
||||
static int have_timer = 0;
|
||||
static volatile grub_uint32_t *sp804_regs;
|
||||
|
||||
static grub_uint64_t
|
||||
sp804_get_time_ms (void)
|
||||
{
|
||||
static grub_uint32_t high, last_low;
|
||||
grub_uint32_t low = ~sp804_regs[1];
|
||||
if (last_low > low)
|
||||
high++;
|
||||
last_low = low;
|
||||
return grub_divmod64 ((((grub_uint64_t) high) << 32) | low,
|
||||
1000, 0);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
sp804_attach(const struct grub_fdtbus_dev *dev)
|
||||
{
|
||||
if (have_timer)
|
||||
return GRUB_ERR_NONE;
|
||||
sp804_regs = grub_fdtbus_map_reg (dev, 0, 0);
|
||||
if (!grub_fdtbus_is_mapping_valid (sp804_regs))
|
||||
return grub_error (GRUB_ERR_IO, "could not map sp804: %p", sp804_regs);
|
||||
grub_install_get_time_ms (sp804_get_time_ms);
|
||||
have_timer = 1;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
struct grub_fdtbus_driver sp804 =
|
||||
{
|
||||
.compatible = "arm,sp804",
|
||||
.attach = sp804_attach
|
||||
};
|
||||
|
||||
static grub_uint32_t timer_frequency_in_khz;
|
||||
|
||||
static grub_uint64_t
|
||||
generic_get_time_ms (void)
|
||||
{
|
||||
return grub_divmod64 (grub_armv7_get_timer_value(), timer_frequency_in_khz, 0);
|
||||
}
|
||||
|
||||
static int
|
||||
try_generic_timer (void)
|
||||
{
|
||||
if (((grub_arm_pfr1 () >> 16) & 0xf) != 1)
|
||||
return 0;
|
||||
grub_printf ("freq = %x\n", grub_armv7_get_timer_frequency());
|
||||
timer_frequency_in_khz = 0x016e3600 / 1000; //grub_armv7_get_timer_frequency() / 1000;
|
||||
if (timer_frequency_in_khz == 0)
|
||||
return 0;
|
||||
grub_install_get_time_ms (generic_get_time_ms);
|
||||
have_timer = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
grub_machine_timer_init (void)
|
||||
{
|
||||
grub_fdtbus_register (&sp804);
|
||||
|
||||
if (!have_timer)
|
||||
try_generic_timer ();
|
||||
if (!have_timer)
|
||||
grub_fatal ("No timer found");
|
||||
}
|
||||
@@ -173,8 +173,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
sym_addr += grub_arm_thm_call_get_offset ((grub_uint16_t *) target);
|
||||
|
||||
grub_dprintf ("dl", " sym_addr = 0x%08x\n", sym_addr);
|
||||
if (ELF_ST_TYPE (sym->st_info) != STT_FUNC)
|
||||
sym_addr |= 1;
|
||||
|
||||
offset = sym_addr - (grub_uint32_t) target;
|
||||
|
||||
@@ -229,16 +227,13 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
|
||||
sym_addr += grub_arm_thm_jump19_get_offset ((grub_uint16_t *) target);
|
||||
|
||||
if (ELF_ST_TYPE (sym->st_info) != STT_FUNC)
|
||||
sym_addr |= 1;
|
||||
|
||||
offset = sym_addr - (grub_uint32_t) target;
|
||||
|
||||
if (!grub_arm_thm_jump19_check_offset (offset)
|
||||
|| !(sym_addr & 1))
|
||||
{
|
||||
struct trampoline_thumb *tp = mod->trampptr;
|
||||
mod->trampptr = tp + 1;
|
||||
struct trampoline_thumb *tp = mod->gotptr;
|
||||
mod->gotptr = tp + 1;
|
||||
grub_memcpy (tp->template, thumb_template, sizeof (tp->template));
|
||||
tp->neg_addr = -sym_addr - 4;
|
||||
offset = ((grub_uint8_t *) tp - (grub_uint8_t *) target - 4) | 1;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
* GRUB is called from U-Boot as a Linux Kernel type image, which
|
||||
* means among other things that it always enters in ARM state.
|
||||
*
|
||||
* coreboot starts in ARM mode as well.
|
||||
*
|
||||
* Overview of GRUB image layout:
|
||||
*
|
||||
@@ -86,7 +87,7 @@ FUNCTION(codestart)
|
||||
@ Stack pointer used as start address for signature probing
|
||||
mov r12, sp
|
||||
adr sp, entry_state
|
||||
push {r1-r12,lr} @ store U-Boot context (sp in r12)
|
||||
push {r0-r12,lr} @ store U-Boot context (sp in r12)
|
||||
|
||||
adr r1, _start
|
||||
ldr r0, bss_start_ptr @ src
|
||||
@@ -127,6 +128,8 @@ reloc_done:
|
||||
|
||||
str r1, EXT_C(grub_modbase)
|
||||
|
||||
/* Coreboot already places modules at right place. */
|
||||
#ifndef GRUB_MACHINE_COREBOOT
|
||||
add r1, r1, r2
|
||||
add r0, r0, r2
|
||||
sub r1, r1, #4
|
||||
@@ -136,6 +139,7 @@ reloc_done:
|
||||
str r3, [r1], #-4 @ *dst-- = r3
|
||||
subs r2, #4 @ remaining -= 4
|
||||
bne 1b @ while remaining != 0
|
||||
#endif
|
||||
|
||||
@ Since we _are_ the C run-time, we need to manually zero the BSS
|
||||
@ region before continuing
|
||||
@@ -153,69 +157,21 @@ reloc_done:
|
||||
|
||||
b EXT_C(grub_main)
|
||||
|
||||
/*
|
||||
* uboot_syscall():
|
||||
* This function is effectively a veneer, so it cannot
|
||||
* modify the stack or corrupt any registers other than
|
||||
* r12 (ip). Furthermore it needs to restore r8 for
|
||||
* U-Boot (Global Data Pointer) and preserve it for Grub.
|
||||
*/
|
||||
FUNCTION(grub_uboot_syscall)
|
||||
str r8, transition_space
|
||||
str lr, transition_space + 4
|
||||
str r9, transition_space + 8
|
||||
|
||||
ldr r8, gd_backup
|
||||
ldr r9, gd_backup + 4
|
||||
|
||||
bl do_syscall
|
||||
|
||||
ldr r8, transition_space
|
||||
ldr lr, transition_space + 4
|
||||
ldr r9, transition_space + 8
|
||||
|
||||
bx lr
|
||||
do_syscall:
|
||||
|
||||
ldr ip, grub_uboot_syscall_ptr
|
||||
bx ip
|
||||
|
||||
FUNCTION(grub_uboot_return)
|
||||
adr sp, entry_state_end
|
||||
pop {r4-r12, lr}
|
||||
mov sp, r12
|
||||
bx lr
|
||||
|
||||
|
||||
.align 3
|
||||
@ U-boot context stack space
|
||||
entry_state_end:
|
||||
VARIABLE(grub_uboot_machine_type)
|
||||
@ U-boot/coreboot context stack space
|
||||
VARIABLE(grub_arm_saved_registers)
|
||||
.long 0 @ r0
|
||||
.long 0 @ r1
|
||||
VARIABLE(grub_uboot_boot_data)
|
||||
.long 0 @ r2
|
||||
.long 0 @ r3
|
||||
.long 0 @ r4
|
||||
.long 0 @ r5
|
||||
.long 0 @ r6
|
||||
.long 0 @ r7
|
||||
gd_backup:
|
||||
.long 0 @ r8 - U-Boot global data pointer up to 2013-09-21
|
||||
.long 0 @ r9 - U-Boot global data pointer 2013-09-21 onwards
|
||||
.long 0 @ r7
|
||||
.long 0 @ r8
|
||||
.long 0 @ r9
|
||||
.long 0 @ r10
|
||||
.long 0 @ r11
|
||||
VARIABLE(grub_uboot_search_hint)@ U-Boot stack pointer -
|
||||
.long 0 @ also API signature address hint.
|
||||
.long 0 @ sp
|
||||
.long 0 @ lr
|
||||
entry_state: @ backup for U-Boot context
|
||||
|
||||
@ GRUB context stack space
|
||||
transition_space:
|
||||
.long 0 @ r8
|
||||
.long 0 @ lr
|
||||
.long 0 @ r9
|
||||
|
||||
VARIABLE(grub_uboot_syscall_ptr)
|
||||
.long 0 @
|
||||
|
||||
END
|
||||
entry_state:
|
||||
70
grub-core/kern/arm/uboot/init.c
Normal file
70
grub-core/kern/arm/uboot/init.c
Normal file
@@ -0,0 +1,70 @@
|
||||
/* init.c - generic U-Boot initialization and finalization */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2016 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/uboot/uboot.h>
|
||||
#include <grub/arm/startup.h>
|
||||
#include <grub/uboot/api_public.h>
|
||||
|
||||
extern int (*grub_uboot_syscall_ptr) (int, int *, ...);
|
||||
|
||||
grub_uint32_t
|
||||
grub_uboot_get_machine_type (void)
|
||||
{
|
||||
return grub_arm_saved_registers.r[1];
|
||||
}
|
||||
|
||||
const void *
|
||||
grub_uboot_get_boot_data (void)
|
||||
{
|
||||
return (const void *) grub_arm_saved_registers.r[2];
|
||||
}
|
||||
|
||||
int
|
||||
grub_uboot_api_init (void)
|
||||
{
|
||||
struct api_signature *start, *end;
|
||||
struct api_signature *p;
|
||||
grub_addr_t grub_uboot_search_hint = grub_arm_saved_registers.sp;
|
||||
if (grub_uboot_search_hint)
|
||||
{
|
||||
/* Extended search range to work around Trim Slice U-Boot issue */
|
||||
start = (struct api_signature *) ((grub_uboot_search_hint & ~0x000fffff)
|
||||
- 0x00500000);
|
||||
end =
|
||||
(struct api_signature *) ((grub_addr_t) start + UBOOT_API_SEARCH_LEN -
|
||||
API_SIG_MAGLEN + 0x00500000);
|
||||
}
|
||||
else
|
||||
{
|
||||
start = 0;
|
||||
end = (struct api_signature *) (256 * 1024 * 1024);
|
||||
}
|
||||
|
||||
/* Structure alignment is (at least) 8 bytes */
|
||||
for (p = start; p < end; p = (void *) ((grub_addr_t) p + 8))
|
||||
{
|
||||
if (grub_memcmp (&(p->magic), API_SIG_MAGIC, API_SIG_MAGLEN) == 0)
|
||||
{
|
||||
grub_uboot_syscall_ptr = p->syscall;
|
||||
return p->version;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
73
grub-core/kern/arm/uboot/uboot.S
Normal file
73
grub-core/kern/arm/uboot/uboot.S
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 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/offsets.h>
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/machine/kernel.h>
|
||||
|
||||
/*
|
||||
* uboot_syscall():
|
||||
* This function is effectively a veneer, so it cannot
|
||||
* modify the stack or corrupt any registers other than
|
||||
* r12 (ip). Furthermore it needs to restore r8 for
|
||||
* U-Boot (Global Data Pointer) and preserve it for Grub.
|
||||
*/
|
||||
FUNCTION(grub_uboot_syscall)
|
||||
str r8, transition_space
|
||||
str lr, transition_space + 4
|
||||
str r9, transition_space + 8
|
||||
|
||||
ldr ip, saved_registers_ptr
|
||||
ldr r8, [ip, #4 * 8]
|
||||
ldr r9, [ip, #4 * 9]
|
||||
|
||||
bl do_syscall
|
||||
|
||||
ldr r8, transition_space
|
||||
ldr lr, transition_space + 4
|
||||
ldr r9, transition_space + 8
|
||||
|
||||
bx lr
|
||||
do_syscall:
|
||||
|
||||
ldr ip, grub_uboot_syscall_ptr
|
||||
bx ip
|
||||
|
||||
FUNCTION(grub_uboot_return)
|
||||
ldr ip, saved_registers_ptr
|
||||
ldr sp, [ip, #4 * 4]
|
||||
pop {r4-r12, lr}
|
||||
mov sp, r12
|
||||
bx lr
|
||||
|
||||
|
||||
.align 3
|
||||
|
||||
@ GRUB context stack space
|
||||
transition_space:
|
||||
.long 0 @ r8
|
||||
.long 0 @ lr
|
||||
.long 0 @ r9
|
||||
|
||||
saved_registers_ptr:
|
||||
.long EXT_C(grub_arm_saved_registers)
|
||||
|
||||
VARIABLE(grub_uboot_syscall_ptr)
|
||||
.long 0 @
|
||||
|
||||
END
|
||||
@@ -25,9 +25,14 @@
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/cpu/reloc.h>
|
||||
|
||||
struct trampoline
|
||||
{
|
||||
#define LDR 0x58000050
|
||||
#define BR 0xd61f0200
|
||||
|
||||
grub_uint32_t ldr; /* ldr x16, 8 */
|
||||
grub_uint32_t br; /* br x16 */
|
||||
grub_uint64_t addr;
|
||||
};
|
||||
|
||||
/*
|
||||
* Check if EHDR is a valid ELF header.
|
||||
@@ -48,6 +53,42 @@ grub_arch_dl_check_header (void *ehdr)
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
grub_err_t
|
||||
grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
|
||||
grub_size_t *got)
|
||||
{
|
||||
const Elf_Ehdr *e = ehdr;
|
||||
const Elf_Shdr *s;
|
||||
unsigned i;
|
||||
|
||||
*tramp = 0;
|
||||
*got = 0;
|
||||
|
||||
for (i = 0, s = (const Elf_Shdr *) ((grub_addr_t) e + e->e_shoff);
|
||||
i < e->e_shnum;
|
||||
i++, s = (const Elf_Shdr *) ((grub_addr_t) s + e->e_shentsize))
|
||||
if (s->sh_type == SHT_REL || s->sh_type == SHT_RELA)
|
||||
{
|
||||
const Elf_Rel *rel, *max;
|
||||
|
||||
for (rel = (const Elf_Rel *) ((grub_addr_t) e + s->sh_offset),
|
||||
max = rel + s->sh_size / s->sh_entsize;
|
||||
rel < max;
|
||||
rel = (const Elf_Rel *) ((grub_addr_t) rel + s->sh_entsize))
|
||||
switch (ELF_R_TYPE (rel->r_info))
|
||||
{
|
||||
case R_AARCH64_CALL26:
|
||||
case R_AARCH64_JUMP26:
|
||||
{
|
||||
*tramp += sizeof (struct trampoline);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unified function for both REL and RELA
|
||||
*/
|
||||
@@ -56,7 +97,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
Elf_Shdr *s, grub_dl_segment_t seg)
|
||||
{
|
||||
Elf_Rel *rel, *max;
|
||||
unsigned unmatched_adr_got_page = 0;
|
||||
|
||||
for (rel = (Elf_Rel *) ((char *) ehdr + s->sh_offset),
|
||||
max = (Elf_Rel *) ((char *) rel + s->sh_size);
|
||||
@@ -105,7 +145,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
|
||||
if (!grub_arm_64_check_xxxx26_offset (offset))
|
||||
{
|
||||
struct grub_arm64_trampoline *tp = mod->trampptr;
|
||||
struct trampoline *tp = mod->trampptr;
|
||||
mod->trampptr = tp + 1;
|
||||
tp->ldr = LDR;
|
||||
tp->br = BR;
|
||||
@@ -120,56 +160,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
grub_arm64_set_xxxx26_offset (place, offset);
|
||||
}
|
||||
break;
|
||||
case R_AARCH64_PREL32:
|
||||
{
|
||||
grub_int64_t value;
|
||||
Elf64_Word *addr32 = place;
|
||||
value = ((grub_int32_t) *addr32) + sym_addr -
|
||||
(Elf64_Xword) (grub_addr_t) seg->addr - rel->r_offset;
|
||||
if (value != (grub_int32_t) value)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range");
|
||||
grub_dprintf("dl", " reloc_prel32 %p => 0x%016llx\n",
|
||||
place, (unsigned long long) sym_addr);
|
||||
*addr32 = value;
|
||||
}
|
||||
break;
|
||||
case R_AARCH64_ADR_GOT_PAGE:
|
||||
{
|
||||
grub_uint64_t *gp = mod->gotptr;
|
||||
Elf_Rela *rel2;
|
||||
grub_int64_t gpoffset = ((grub_uint64_t) gp & ~0xfffULL) - (((grub_uint64_t) place) & ~0xfffULL);
|
||||
*gp = (grub_uint64_t) sym_addr;
|
||||
mod->gotptr = gp + 1;
|
||||
unmatched_adr_got_page++;
|
||||
grub_dprintf("dl", " reloc_got %p => 0x%016llx (0x%016llx)\n",
|
||||
place, (unsigned long long) sym_addr, (unsigned long long) gp);
|
||||
if (!grub_arm64_check_hi21_signed (gpoffset))
|
||||
return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
"HI21 out of range");
|
||||
grub_arm64_set_hi21(place, gpoffset);
|
||||
for (rel2 = (Elf_Rela *) ((char *) rel + s->sh_entsize);
|
||||
rel2 < (Elf_Rela *) max;
|
||||
rel2 = (Elf_Rela *) ((char *) rel2 + s->sh_entsize))
|
||||
if (ELF_R_SYM (rel2->r_info)
|
||||
== ELF_R_SYM (rel->r_info)
|
||||
&& ((Elf_Rela *) rel)->r_addend == rel2->r_addend
|
||||
&& ELF_R_TYPE (rel2->r_info) == R_AARCH64_LD64_GOT_LO12_NC)
|
||||
{
|
||||
grub_arm64_set_abs_lo12_ldst64 ((void *) ((grub_addr_t) seg->addr + rel2->r_offset),
|
||||
(grub_uint64_t)gp);
|
||||
break;
|
||||
}
|
||||
if (rel2 >= (Elf_Rela *) max)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
"ADR_GOT_PAGE without matching LD64_GOT_LO12_NC");
|
||||
}
|
||||
break;
|
||||
case R_AARCH64_LD64_GOT_LO12_NC:
|
||||
if (unmatched_adr_got_page == 0)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
"LD64_GOT_LO12_NC without matching ADR_GOT_PAGE");
|
||||
unmatched_adr_got_page--;
|
||||
break;
|
||||
case R_AARCH64_ADR_PREL_PG_HI21:
|
||||
{
|
||||
grub_int64_t offset = (sym_addr & ~0xfffULL) - (((grub_uint64_t) place) & ~0xfffULL);
|
||||
|
||||
@@ -93,42 +93,3 @@ grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target)
|
||||
*place &= insmask;
|
||||
*place |= grub_cpu_to_le32 (target << 7) & ~insmask;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
grub_err_t
|
||||
grub_arm64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
|
||||
grub_size_t *got)
|
||||
{
|
||||
const Elf64_Ehdr *e = ehdr;
|
||||
const Elf64_Shdr *s;
|
||||
unsigned i;
|
||||
|
||||
*tramp = 0;
|
||||
*got = 0;
|
||||
|
||||
for (i = 0, s = (Elf64_Shdr *) ((char *) e + grub_le_to_cpu64 (e->e_shoff));
|
||||
i < grub_le_to_cpu16 (e->e_shnum);
|
||||
i++, s = (Elf64_Shdr *) ((char *) s + grub_le_to_cpu16 (e->e_shentsize)))
|
||||
if (s->sh_type == grub_cpu_to_le32_compile_time (SHT_REL)
|
||||
|| s->sh_type == grub_cpu_to_le32_compile_time (SHT_RELA))
|
||||
{
|
||||
const Elf64_Rela *rel, *max;
|
||||
|
||||
for (rel = (Elf64_Rela *) ((char *) e + grub_le_to_cpu64 (s->sh_offset)),
|
||||
max = (const Elf64_Rela *) ((char *) rel + grub_le_to_cpu64 (s->sh_size));
|
||||
rel < max; rel = (const Elf64_Rela *) ((char *) rel + grub_le_to_cpu64 (s->sh_entsize)))
|
||||
switch (ELF64_R_TYPE (rel->r_info))
|
||||
{
|
||||
case R_AARCH64_CALL26:
|
||||
case R_AARCH64_JUMP26:
|
||||
*tramp += sizeof (struct grub_arm64_trampoline);
|
||||
break;
|
||||
case R_AARCH64_ADR_GOT_PAGE:
|
||||
*got += 8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/machine/memory.h>
|
||||
#include <grub/machine/lbio.h>
|
||||
#include <grub/memory.h>
|
||||
#include <grub/coreboot/lbio.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/misc.h>
|
||||
@@ -49,6 +49,7 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data)
|
||||
{
|
||||
grub_uint64_t start = mem_region->addr;
|
||||
grub_uint64_t end = mem_region->addr + mem_region->size;
|
||||
#ifdef __i386__
|
||||
/* Mark region 0xa0000 - 0x100000 as reserved. */
|
||||
if (start < 0x100000 && end >= 0xa0000
|
||||
&& mem_region->type == GRUB_MACHINE_MEMORY_AVAILABLE)
|
||||
@@ -75,6 +76,7 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data)
|
||||
if (end <= start)
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (ctx->hook (start, end - start,
|
||||
/* Multiboot mmaps match with the coreboot mmap
|
||||
definition. Therefore, we can just pass type
|
||||
@@ -1,43 +0,0 @@
|
||||
/* fdt.c - EFI Flattened Device Tree interaction */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2006,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/efi/efi.h>
|
||||
#include <grub/mm.h>
|
||||
|
||||
void *
|
||||
grub_efi_get_firmware_fdt (void)
|
||||
{
|
||||
grub_efi_configuration_table_t *tables;
|
||||
grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
|
||||
void *firmware_fdt = NULL;
|
||||
unsigned int i;
|
||||
|
||||
/* Look for FDT in UEFI config tables. */
|
||||
tables = grub_efi_system_table->configuration_table;
|
||||
|
||||
for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
|
||||
if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0)
|
||||
{
|
||||
firmware_fdt = tables[i].vendor_table;
|
||||
grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt);
|
||||
break;
|
||||
}
|
||||
|
||||
return firmware_fdt;
|
||||
}
|
||||
@@ -59,13 +59,10 @@ grub_machine_get_bootlocation (char **device, char **path)
|
||||
if (!image)
|
||||
return;
|
||||
*device = grub_efidisk_get_device_name (image->device_handle);
|
||||
if (!*device && grub_efi_net_config)
|
||||
{
|
||||
grub_efi_net_config (image->device_handle, device, path);
|
||||
return;
|
||||
}
|
||||
|
||||
*path = grub_efi_get_filename (image->file_path);
|
||||
if (!*device && grub_efi_net_config)
|
||||
grub_efi_net_config (image->device_handle, device, path);
|
||||
|
||||
if (*path)
|
||||
{
|
||||
/* Get the directory. */
|
||||
|
||||
@@ -63,7 +63,6 @@ void
|
||||
grub_reboot (void)
|
||||
{
|
||||
longjmp (main_env, 1);
|
||||
grub_fatal ("longjmp failed");
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -127,7 +127,6 @@ xasprintf (const char *fmt, ...)
|
||||
|
||||
va_start (ap, fmt);
|
||||
result = grub_xvasprintf (fmt, ap);
|
||||
va_end (ap);
|
||||
if (!result)
|
||||
grub_util_error ("%s", _("out of memory"));
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
#include <grub/i386/coreboot/memory.h>
|
||||
#include <grub/i386/coreboot/lbio.h>
|
||||
#include <grub/coreboot/lbio.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/misc.h>
|
||||
|
||||
@@ -104,9 +104,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
case R_IA64_PCREL64LSB:
|
||||
*(grub_uint64_t *) addr += value - addr;
|
||||
break;
|
||||
case R_IA64_GPREL64I:
|
||||
grub_ia64_set_immu64 (addr, value - (grub_addr_t) mod->base);
|
||||
break;
|
||||
case R_IA64_GPREL22:
|
||||
if ((value - (grub_addr_t) mod->base) & ~MASK20)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
|
||||
@@ -30,40 +30,6 @@
|
||||
#define MASK20 ((1 << 20) - 1)
|
||||
#define MASK3 (~(grub_addr_t) 3)
|
||||
|
||||
void
|
||||
grub_ia64_set_immu64 (grub_addr_t addr, grub_uint64_t val)
|
||||
{
|
||||
/* Copied from binutils. */
|
||||
grub_uint64_t *ptr = ((grub_uint64_t *) (addr & MASK3));
|
||||
grub_uint64_t t0, t1;
|
||||
|
||||
t0 = grub_le_to_cpu64 (ptr[0]);
|
||||
t1 = grub_le_to_cpu64 (ptr[1]);
|
||||
|
||||
/* tmpl/s: bits 0.. 5 in t0
|
||||
slot 0: bits 5..45 in t0
|
||||
slot 1: bits 46..63 in t0, bits 0..22 in t1
|
||||
slot 2: bits 23..63 in t1 */
|
||||
|
||||
/* First, clear the bits that form the 64 bit constant. */
|
||||
t0 &= ~(0x3ffffLL << 46);
|
||||
t1 &= ~(0x7fffffLL
|
||||
| (( (0x07fLL << 13) | (0x1ffLL << 27)
|
||||
| (0x01fLL << 22) | (0x001LL << 21)
|
||||
| (0x001LL << 36)) << 23));
|
||||
|
||||
t0 |= ((val >> 22) & 0x03ffffLL) << 46; /* 18 lsbs of imm41 */
|
||||
t1 |= ((val >> 40) & 0x7fffffLL) << 0; /* 23 msbs of imm41 */
|
||||
t1 |= ( (((val >> 0) & 0x07f) << 13) /* imm7b */
|
||||
| (((val >> 7) & 0x1ff) << 27) /* imm9d */
|
||||
| (((val >> 16) & 0x01f) << 22) /* imm5c */
|
||||
| (((val >> 21) & 0x001) << 21) /* ic */
|
||||
| (((val >> 63) & 0x001) << 36)) << 23; /* i */
|
||||
|
||||
ptr[0] = t0;
|
||||
ptr[1] = t1;
|
||||
}
|
||||
|
||||
void
|
||||
grub_ia64_add_value_to_slot_20b (grub_addr_t addr, grub_uint32_t value)
|
||||
{
|
||||
@@ -216,11 +182,11 @@ grub_ia64_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
|
||||
i++, s = (Elf64_Shdr *) ((char *) s + grub_le_to_cpu16 (e->e_shentsize)))
|
||||
if (s->sh_type == grub_cpu_to_le32_compile_time (SHT_RELA))
|
||||
{
|
||||
const Elf64_Rela *rel, *max;
|
||||
Elf64_Rela *rel, *max;
|
||||
|
||||
for (rel = (Elf64_Rela *) ((char *) e + grub_le_to_cpu64 (s->sh_offset)),
|
||||
max = (const Elf64_Rela *) ((char *) rel + grub_le_to_cpu64 (s->sh_size));
|
||||
rel < max; rel = (const Elf64_Rela *) ((char *) rel + grub_le_to_cpu64 (s->sh_entsize)))
|
||||
max = rel + grub_le_to_cpu64 (s->sh_size) / grub_le_to_cpu64 (s->sh_entsize);
|
||||
rel < max; rel++)
|
||||
switch (ELF64_R_TYPE (grub_le_to_cpu64 (rel->r_info)))
|
||||
{
|
||||
case R_IA64_PCREL21B:
|
||||
|
||||
@@ -25,7 +25,7 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
|
||||
{
|
||||
grub_ieee1275_phandle_t root;
|
||||
grub_ieee1275_phandle_t memory;
|
||||
grub_uint32_t available[128];
|
||||
grub_uint32_t available[32];
|
||||
grub_ssize_t available_size;
|
||||
grub_uint32_t address_cells = 1;
|
||||
grub_uint32_t size_cells = 1;
|
||||
@@ -49,9 +49,6 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
|
||||
sizeof available, &available_size))
|
||||
return grub_error (GRUB_ERR_UNKNOWN_DEVICE,
|
||||
"couldn't examine /memory/available property");
|
||||
if (available_size < 0 || (grub_size_t) available_size > sizeof (available))
|
||||
return grub_error (GRUB_ERR_UNKNOWN_DEVICE,
|
||||
"/memory response buffer exceeded");
|
||||
|
||||
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS))
|
||||
{
|
||||
|
||||
@@ -36,30 +36,14 @@
|
||||
extern char __bss_start[];
|
||||
extern char _end[];
|
||||
extern grub_size_t grub_total_module_size;
|
||||
extern int (*grub_uboot_syscall_ptr) (int, int *, ...);
|
||||
static unsigned long timer_start;
|
||||
|
||||
extern grub_uint32_t grub_uboot_machine_type;
|
||||
extern grub_addr_t grub_uboot_boot_data;
|
||||
|
||||
void
|
||||
grub_exit (void)
|
||||
{
|
||||
grub_uboot_return (0);
|
||||
}
|
||||
|
||||
grub_uint32_t
|
||||
grub_uboot_get_machine_type (void)
|
||||
{
|
||||
return grub_uboot_machine_type;
|
||||
}
|
||||
|
||||
grub_addr_t
|
||||
grub_uboot_get_boot_data (void)
|
||||
{
|
||||
return grub_uboot_boot_data;
|
||||
}
|
||||
|
||||
static grub_uint64_t
|
||||
uboot_timer_ms (void)
|
||||
{
|
||||
|
||||
@@ -39,48 +39,13 @@
|
||||
* returns: 0 if the call not found, 1 if serviced
|
||||
*/
|
||||
|
||||
extern int (*grub_uboot_syscall_ptr) (int, int *, ...);
|
||||
extern int grub_uboot_syscall (int, int *, ...);
|
||||
extern grub_addr_t grub_uboot_search_hint;
|
||||
|
||||
static struct sys_info uboot_sys_info;
|
||||
static struct mem_region uboot_mem_info[5];
|
||||
static struct device_info * devices;
|
||||
static int num_devices;
|
||||
|
||||
int
|
||||
grub_uboot_api_init (void)
|
||||
{
|
||||
struct api_signature *start, *end;
|
||||
struct api_signature *p;
|
||||
|
||||
if (grub_uboot_search_hint)
|
||||
{
|
||||
/* Extended search range to work around Trim Slice U-Boot issue */
|
||||
start = (struct api_signature *) ((grub_uboot_search_hint & ~0x000fffff)
|
||||
- 0x00500000);
|
||||
end =
|
||||
(struct api_signature *) ((grub_addr_t) start + UBOOT_API_SEARCH_LEN -
|
||||
API_SIG_MAGLEN + 0x00500000);
|
||||
}
|
||||
else
|
||||
{
|
||||
start = 0;
|
||||
end = (struct api_signature *) (256 * 1024 * 1024);
|
||||
}
|
||||
|
||||
/* Structure alignment is (at least) 8 bytes */
|
||||
for (p = start; p < end; p = (void *) ((grub_addr_t) p + 8))
|
||||
{
|
||||
if (grub_memcmp (&(p->magic), API_SIG_MAGIC, API_SIG_MAGLEN) == 0)
|
||||
{
|
||||
grub_uboot_syscall_ptr = p->syscall;
|
||||
return p->version;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* All functions below are wrappers around the grub_uboot_syscall() function
|
||||
|
||||
@@ -102,13 +102,13 @@ static grub_uint32_t *get_next_node (const void *fdt, char *node_name)
|
||||
static int get_mem_rsvmap_size (const void *fdt)
|
||||
{
|
||||
int size = 0;
|
||||
grub_uint64_t *ptr = (void *) ((grub_addr_t) fdt
|
||||
+ grub_fdt_get_off_mem_rsvmap (fdt));
|
||||
grub_unaligned_uint64_t *ptr = (void *) ((grub_addr_t) fdt
|
||||
+ grub_fdt_get_off_mem_rsvmap (fdt));
|
||||
|
||||
do
|
||||
{
|
||||
size += 2 * sizeof(*ptr);
|
||||
if (!*ptr && !*(ptr + 1))
|
||||
if (!ptr[0].val && !ptr[1].val)
|
||||
return size;
|
||||
ptr += 2;
|
||||
} while ((grub_addr_t) ptr <= (grub_addr_t) fdt + grub_fdt_get_totalsize (fdt)
|
||||
@@ -229,7 +229,7 @@ static int rearrange_blocks (void *fdt, unsigned int clearance)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_uint32_t *find_prop (void *fdt, unsigned int nodeoffset,
|
||||
static grub_uint32_t *find_prop (const void *fdt, unsigned int nodeoffset,
|
||||
const char *name)
|
||||
{
|
||||
grub_uint32_t *prop = (void *) ((grub_addr_t) fdt
|
||||
@@ -268,9 +268,9 @@ static grub_uint32_t *find_prop (void *fdt, unsigned int nodeoffset,
|
||||
the size allocated for the FDT; if this function is called before the other
|
||||
functions in this file and returns success, the other functions are
|
||||
guaranteed not to access memory locations outside the allocated memory. */
|
||||
int grub_fdt_check_header_nosize (void *fdt)
|
||||
int grub_fdt_check_header_nosize (const void *fdt)
|
||||
{
|
||||
if (((grub_addr_t) fdt & 0x7) || (grub_fdt_get_magic (fdt) != FDT_MAGIC)
|
||||
if (((grub_addr_t) fdt & 0x3) || (grub_fdt_get_magic (fdt) != FDT_MAGIC)
|
||||
|| (grub_fdt_get_version (fdt) < FDT_SUPPORTED_VERSION)
|
||||
|| (grub_fdt_get_last_comp_version (fdt) > FDT_SUPPORTED_VERSION)
|
||||
|| (grub_fdt_get_off_dt_struct (fdt) & 0x00000003)
|
||||
@@ -286,7 +286,7 @@ int grub_fdt_check_header_nosize (void *fdt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int grub_fdt_check_header (void *fdt, unsigned int size)
|
||||
int grub_fdt_check_header (const void *fdt, unsigned int size)
|
||||
{
|
||||
if (size < sizeof (grub_fdt_header_t)
|
||||
|| (grub_fdt_get_totalsize (fdt) > size)
|
||||
@@ -295,41 +295,29 @@ int grub_fdt_check_header (void *fdt, unsigned int size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Find a direct sub-node of a given parent node. */
|
||||
int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset,
|
||||
const char *name)
|
||||
static const grub_uint32_t *
|
||||
advance_token (const void *fdt, const grub_uint32_t *token, const grub_uint32_t *end, int skip_current)
|
||||
{
|
||||
grub_uint32_t *token, *end;
|
||||
char *node_name;
|
||||
|
||||
if (parentoffset & 0x3)
|
||||
return -1;
|
||||
token = (void *) ((grub_addr_t) fdt + grub_fdt_get_off_dt_struct(fdt)
|
||||
+ parentoffset);
|
||||
end = (void *) struct_end (fdt);
|
||||
if ((token >= end) || (grub_be_to_cpu32(*token) != FDT_BEGIN_NODE))
|
||||
return -1;
|
||||
SKIP_NODE_NAME(node_name, token, end);
|
||||
while (token < end)
|
||||
for (; token < end; skip_current = 0)
|
||||
{
|
||||
switch (grub_be_to_cpu32(*token))
|
||||
switch (grub_be_to_cpu32 (*token))
|
||||
{
|
||||
case FDT_BEGIN_NODE:
|
||||
node_name = (char *) (token + 1);
|
||||
if (node_name + grub_strlen (name) >= (char *) end)
|
||||
return -1;
|
||||
if (!grub_strcmp (node_name, name))
|
||||
return (int) ((grub_addr_t) token - (grub_addr_t) fdt
|
||||
- grub_fdt_get_off_dt_struct (fdt));
|
||||
token = get_next_node (fdt, node_name);
|
||||
if (!token)
|
||||
return -1;
|
||||
break;
|
||||
if (skip_current)
|
||||
{
|
||||
token = get_next_node (fdt, (char *) (token + 1));
|
||||
continue;
|
||||
}
|
||||
char *ptr;
|
||||
for (ptr = (char *) (token + 1); *ptr && ptr < (char *) end; ptr++);
|
||||
if (ptr >= (char *) end)
|
||||
return 0;
|
||||
return token;
|
||||
case FDT_PROP:
|
||||
/* Skip property token and following data (len, nameoff and property
|
||||
value). */
|
||||
if (token >= end - 1)
|
||||
return -1;
|
||||
return 0;
|
||||
token += prop_entry_size(grub_be_to_cpu32(*(token + 1)))
|
||||
/ sizeof(*token);
|
||||
break;
|
||||
@@ -337,10 +325,74 @@ int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset,
|
||||
token++;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int grub_fdt_next_node (const void *fdt, unsigned int currentoffset)
|
||||
{
|
||||
const grub_uint32_t *token = (const grub_uint32_t *) fdt + (currentoffset + grub_fdt_get_off_dt_struct (fdt)) / 4;
|
||||
token = advance_token (fdt, token, (const void *) struct_end (fdt), 1);
|
||||
if (!token)
|
||||
return -1;
|
||||
return (int) ((grub_addr_t) token - (grub_addr_t) fdt
|
||||
- grub_fdt_get_off_dt_struct (fdt));
|
||||
}
|
||||
|
||||
int grub_fdt_first_node (const void *fdt, unsigned int parentoffset)
|
||||
{
|
||||
const grub_uint32_t *token, *end;
|
||||
char *node_name;
|
||||
|
||||
if (parentoffset & 0x3)
|
||||
return -1;
|
||||
token = (const void *) ((grub_addr_t) fdt + grub_fdt_get_off_dt_struct(fdt)
|
||||
+ parentoffset);
|
||||
end = (const void *) struct_end (fdt);
|
||||
if ((token >= end) || (grub_be_to_cpu32(*token) != FDT_BEGIN_NODE))
|
||||
return -1;
|
||||
SKIP_NODE_NAME(node_name, token, end);
|
||||
token = advance_token (fdt, token, end, 0);
|
||||
if (!token)
|
||||
return -1;
|
||||
return (int) ((grub_addr_t) token - (grub_addr_t) fdt
|
||||
- grub_fdt_get_off_dt_struct (fdt));
|
||||
}
|
||||
|
||||
/* Find a direct sub-node of a given parent node. */
|
||||
int grub_fdt_find_subnode (const void *fdt, unsigned int parentoffset,
|
||||
const char *name)
|
||||
{
|
||||
const grub_uint32_t *token, *end;
|
||||
const char *node_name;
|
||||
int skip_current = 0;
|
||||
|
||||
if (parentoffset & 0x3)
|
||||
return -1;
|
||||
token = (const void *) ((grub_addr_t) fdt + grub_fdt_get_off_dt_struct(fdt)
|
||||
+ parentoffset);
|
||||
end = (const void *) struct_end (fdt);
|
||||
if ((token >= end) || (grub_be_to_cpu32(*token) != FDT_BEGIN_NODE))
|
||||
return -1;
|
||||
SKIP_NODE_NAME(node_name, token, end);
|
||||
while (1) {
|
||||
token = advance_token (fdt, token, end, skip_current);
|
||||
if (!token)
|
||||
return -1;
|
||||
skip_current = 1;
|
||||
node_name = (const char *) token + 4;
|
||||
if (grub_strcmp (node_name, name) == 0)
|
||||
return (int) ((grub_addr_t) token - (grub_addr_t) fdt
|
||||
- grub_fdt_get_off_dt_struct (fdt));
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
grub_fdt_get_nodename (const void *fdt, unsigned int nodeoffset)
|
||||
{
|
||||
return (const char *) fdt + grub_fdt_get_off_dt_struct(fdt) + nodeoffset + 4;
|
||||
}
|
||||
|
||||
int grub_fdt_add_subnode (void *fdt, unsigned int parentoffset,
|
||||
@@ -359,6 +411,24 @@ int grub_fdt_add_subnode (void *fdt, unsigned int parentoffset,
|
||||
return add_subnode (fdt, parentoffset, name);
|
||||
}
|
||||
|
||||
const void *
|
||||
grub_fdt_get_prop (const void *fdt, unsigned int nodeoffset, const char *name,
|
||||
grub_uint32_t *len)
|
||||
{
|
||||
grub_uint32_t *prop;
|
||||
if ((nodeoffset >= grub_fdt_get_size_dt_struct (fdt)) || (nodeoffset & 0x3)
|
||||
|| (grub_be_to_cpu32(*(grub_uint32_t *) ((grub_addr_t) fdt
|
||||
+ grub_fdt_get_off_dt_struct (fdt) + nodeoffset))
|
||||
!= FDT_BEGIN_NODE))
|
||||
return 0;
|
||||
prop = find_prop (fdt, nodeoffset, name);
|
||||
if (!prop)
|
||||
return 0;
|
||||
if (len)
|
||||
*len = grub_be_to_cpu32 (*(prop + 1));
|
||||
return prop + 3;
|
||||
}
|
||||
|
||||
int grub_fdt_set_prop (void *fdt, unsigned int nodeoffset, const char *name,
|
||||
const void *val, grub_uint32_t len)
|
||||
{
|
||||
|
||||
@@ -73,22 +73,6 @@ VARIABLE(grub_relocator64_rsp)
|
||||
|
||||
movq %rax, %rsp
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
jmp LOCAL(skip_efi_stack_align)
|
||||
|
||||
/*
|
||||
* Here is grub_relocator64_efi_start() entry point. Most of the
|
||||
* code below is shared between grub_relocator64_efi_start()
|
||||
* and grub_relocator64_start().
|
||||
*
|
||||
* Think twice before changing anything there!!!
|
||||
*/
|
||||
VARIABLE(grub_relocator64_efi_start)
|
||||
/* Align the stack as UEFI spec requires. */
|
||||
andq $~15, %rsp
|
||||
|
||||
LOCAL(skip_efi_stack_align):
|
||||
#endif
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
@@ -136,11 +120,6 @@ LOCAL(jump_addr):
|
||||
VARIABLE(grub_relocator64_rip)
|
||||
.quad 0
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
/* Here grub_relocator64_efi_start() ends. Ufff... */
|
||||
VARIABLE(grub_relocator64_efi_end)
|
||||
#endif
|
||||
|
||||
#ifndef __x86_64__
|
||||
.p2align 4
|
||||
LOCAL(gdt):
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/i386/memory.h>
|
||||
#include <grub/i386/types.h>
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/xen.h>
|
||||
|
||||
@@ -25,86 +23,78 @@
|
||||
|
||||
VARIABLE(grub_relocator_xen_remap_start)
|
||||
LOCAL(base):
|
||||
/* Remap the remapper to it's new address. */
|
||||
/* mov imm32, %ebx - %ebx: new virtual address of remapper */
|
||||
/* mov imm32, %ebx */
|
||||
.byte 0xbb
|
||||
VARIABLE(grub_relocator_xen_remapper_virt)
|
||||
.long 0
|
||||
|
||||
/* mov imm32, %ecx - %ecx: low part of page table entry */
|
||||
/* mov imm32, %ecx */
|
||||
.byte 0xb9
|
||||
VARIABLE(grub_relocator_xen_remapper_map)
|
||||
.long 0
|
||||
|
||||
/* mov imm32, %edx - %edx: high part of page table entry */
|
||||
/* mov imm32, %edx */
|
||||
.byte 0xba
|
||||
VARIABLE(grub_relocator_xen_remapper_map_high)
|
||||
.long 0
|
||||
|
||||
movl %ebx, %ebp /* %ebx is clobbered by hypercall */
|
||||
movl %ebx, %ebp
|
||||
|
||||
movl $UVMF_INVLPG, %esi /* esi: flags (inv. single entry) */
|
||||
movl $2, %esi
|
||||
movl $__HYPERVISOR_update_va_mapping, %eax
|
||||
int $0x82
|
||||
|
||||
movl %ebp, %ebx
|
||||
addl $(LOCAL(cont) - LOCAL(base)), %ebx
|
||||
|
||||
jmp *%ebx /* Continue with new virtual address */
|
||||
jmp *%ebx
|
||||
|
||||
LOCAL(cont):
|
||||
/* Modify mappings of new page tables to be read-only. */
|
||||
/* mov imm32, %eax */
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_paging_areas_addr)
|
||||
.long 0
|
||||
movl %eax, %ebx
|
||||
xorl %eax, %eax
|
||||
movl %eax, %ebp
|
||||
1:
|
||||
movl 0(%ebx), %ebp /* Get start pfn of the current area */
|
||||
movl GRUB_TARGET_SIZEOF_LONG(%ebx), %ecx /* Get # of pg tables */
|
||||
testl %ecx, %ecx /* 0 -> last area reached */
|
||||
jz 3f
|
||||
addl $(2 * GRUB_TARGET_SIZEOF_LONG), %ebx
|
||||
movl %ebx, %esp /* Save current area pointer */
|
||||
|
||||
2:
|
||||
movl %ecx, %edi
|
||||
/* mov imm32, %eax */
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_mfn_list)
|
||||
.long 0
|
||||
movl 0(%eax, %ebp, 4), %ecx /* mfn */
|
||||
movl %ebp, %ebx
|
||||
shll $PAGE_SHIFT, %ebx /* virtual address (1:1 mapping) */
|
||||
movl %eax, %edi
|
||||
movl %ebp, %eax
|
||||
movl 0(%edi, %eax, 4), %ecx
|
||||
|
||||
/* mov imm32, %ebx */
|
||||
.byte 0xbb
|
||||
VARIABLE(grub_relocator_xen_paging_start)
|
||||
.long 0
|
||||
shll $12, %eax
|
||||
addl %eax, %ebx
|
||||
movl %ecx, %edx
|
||||
shll $PAGE_SHIFT, %ecx /* prepare pte low part */
|
||||
shrl $(32 - PAGE_SHIFT), %edx /* pte high part */
|
||||
orl $(GRUB_PAGE_PRESENT | GRUB_PAGE_USER), %ecx /* pte low */
|
||||
movl $UVMF_INVLPG, %esi
|
||||
shll $12, %ecx
|
||||
shrl $20, %edx
|
||||
orl $5, %ecx
|
||||
movl $2, %esi
|
||||
movl $__HYPERVISOR_update_va_mapping, %eax
|
||||
int $0x82 /* parameters: eax, ebx, ecx, edx, esi */
|
||||
int $0x82
|
||||
|
||||
incl %ebp /* next pfn */
|
||||
movl %edi, %ecx
|
||||
incl %ebp
|
||||
/* mov imm32, %ecx */
|
||||
.byte 0xb9
|
||||
VARIABLE(grub_relocator_xen_paging_size)
|
||||
.long 0
|
||||
cmpl %ebp, %ecx
|
||||
|
||||
loop 2b
|
||||
ja 1b
|
||||
|
||||
mov %esp, %ebx /* restore area poniter */
|
||||
jmp 1b
|
||||
|
||||
3:
|
||||
/* Switch page tables: pin new L3 pt, load cr3, unpin old L3. */
|
||||
/* mov imm32, %ebx */
|
||||
.byte 0xbb
|
||||
VARIABLE(grub_relocator_xen_mmu_op_addr)
|
||||
.long 0
|
||||
movl $3, %ecx /* 3 mmu ops */
|
||||
movl $0, %edx /* pdone (not used) */
|
||||
movl $DOMID_SELF, %esi
|
||||
movl $3, %ecx
|
||||
movl $0, %edx
|
||||
movl $0x7FF0, %esi
|
||||
movl $__HYPERVISOR_mmuext_op, %eax
|
||||
int $0x82
|
||||
|
||||
/* Continue in virtual kernel mapping. */
|
||||
/* mov imm32, %eax */
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_remap_continue)
|
||||
@@ -112,9 +102,6 @@ VARIABLE(grub_relocator_xen_remap_continue)
|
||||
|
||||
jmp *%eax
|
||||
|
||||
VARIABLE(grub_relocator_xen_paging_areas)
|
||||
.long 0, 0, 0, 0, 0, 0, 0, 0
|
||||
|
||||
VARIABLE(grub_relocator_xen_mmu_op)
|
||||
.space 256
|
||||
|
||||
@@ -122,7 +109,6 @@ VARIABLE(grub_relocator_xen_remap_end)
|
||||
|
||||
|
||||
VARIABLE(grub_relocator_xen_start)
|
||||
/* Unmap old remapper area. */
|
||||
/* mov imm32, %eax */
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_remapper_virt2)
|
||||
@@ -130,14 +116,14 @@ VARIABLE(grub_relocator_xen_remapper_virt2)
|
||||
|
||||
movl %eax, %edi
|
||||
|
||||
xorl %ecx, %ecx /* Invalid pte */
|
||||
xorl %ecx, %ecx
|
||||
xorl %edx, %edx
|
||||
|
||||
movl $UVMF_INVLPG, %esi
|
||||
movl $2, %esi
|
||||
movl $__HYPERVISOR_update_va_mapping, %eax
|
||||
int $0x82
|
||||
|
||||
/* Prepare registers for starting kernel. */
|
||||
|
||||
/* mov imm32, %eax */
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_stack)
|
||||
@@ -159,7 +145,6 @@ VARIABLE(grub_relocator_xen_start_info)
|
||||
VARIABLE(grub_relocator_xen_entry_point)
|
||||
.long 0
|
||||
|
||||
/* Now start the new kernel. */
|
||||
jmp *%eax
|
||||
|
||||
VARIABLE(grub_relocator_xen_end)
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2016 Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* 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/mm.h>
|
||||
#include <grub/misc.h>
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
|
||||
#include <grub/i386/relocator.h>
|
||||
#include <grub/relocator_private.h>
|
||||
|
||||
extern grub_uint64_t grub_relocator64_rax;
|
||||
extern grub_uint64_t grub_relocator64_rbx;
|
||||
extern grub_uint64_t grub_relocator64_rcx;
|
||||
extern grub_uint64_t grub_relocator64_rdx;
|
||||
extern grub_uint64_t grub_relocator64_rip;
|
||||
extern grub_uint64_t grub_relocator64_rsi;
|
||||
|
||||
extern grub_uint8_t grub_relocator64_efi_start;
|
||||
extern grub_uint8_t grub_relocator64_efi_end;
|
||||
|
||||
#define RELOCATOR_SIZEOF(x) (&grub_relocator##x##_end - &grub_relocator##x##_start)
|
||||
|
||||
grub_err_t
|
||||
grub_relocator64_efi_boot (struct grub_relocator *rel,
|
||||
struct grub_relocator64_efi_state state)
|
||||
{
|
||||
grub_err_t err;
|
||||
void *relst;
|
||||
grub_relocator_chunk_t ch;
|
||||
|
||||
/*
|
||||
* 64-bit relocator code may live above 4 GiB quite well.
|
||||
* However, I do not want ask for problems. Just in case.
|
||||
*/
|
||||
err = grub_relocator_alloc_chunk_align (rel, &ch, 0,
|
||||
0x100000000 - RELOCATOR_SIZEOF (64_efi),
|
||||
RELOCATOR_SIZEOF (64_efi), 16,
|
||||
GRUB_RELOCATOR_PREFERENCE_NONE, 1);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/* Do not touch %rsp! It points to EFI created stack. */
|
||||
grub_relocator64_rax = state.rax;
|
||||
grub_relocator64_rbx = state.rbx;
|
||||
grub_relocator64_rcx = state.rcx;
|
||||
grub_relocator64_rdx = state.rdx;
|
||||
grub_relocator64_rip = state.rip;
|
||||
grub_relocator64_rsi = state.rsi;
|
||||
|
||||
grub_memmove (get_virtual_current_address (ch), &grub_relocator64_efi_start,
|
||||
RELOCATOR_SIZEOF (64_efi));
|
||||
|
||||
err = grub_relocator_prepare_relocs (rel, get_physical_target_address (ch),
|
||||
&relst, NULL);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
((void (*) (void)) relst) ();
|
||||
|
||||
/* Not reached. */
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
@@ -16,85 +16,95 @@
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/x86_64/memory.h>
|
||||
#include <grub/x86_64/types.h>
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/xen.h>
|
||||
|
||||
/* Macro to load an imm64 value stored by the C-part into %rax: */
|
||||
#define MOV_IMM64_RAX(var) .byte 0x48, 0xb8; VARIABLE(var); .quad 0
|
||||
|
||||
.p2align 4 /* force 16-byte alignment */
|
||||
|
||||
VARIABLE(grub_relocator_xen_remap_start)
|
||||
LOCAL(base):
|
||||
/* Remap the remapper to it's new address. */
|
||||
MOV_IMM64_RAX(grub_relocator_xen_remapper_virt)
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_remapper_virt)
|
||||
.quad 0
|
||||
|
||||
movq %rax, %rdi /* %rdi: new virtual address of remapper */
|
||||
movq %rax, %rbx /* Remember new virtual address */
|
||||
movq %rax, %rdi
|
||||
movq %rax, %rbx
|
||||
|
||||
MOV_IMM64_RAX(grub_relocator_xen_remapper_map)
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_remapper_map)
|
||||
.quad 0
|
||||
|
||||
movq %rax, %rsi /* %rsi: page table entry */
|
||||
movq %rax, %rsi
|
||||
|
||||
movq $UVMF_INVLPG, %rdx /* %rdx: flags (inv. single entry) */
|
||||
movq $2, %rdx
|
||||
movq $__HYPERVISOR_update_va_mapping, %rax
|
||||
syscall /* Do the remap operation */
|
||||
syscall
|
||||
|
||||
addq $(LOCAL(cont) - LOCAL(base)), %rbx
|
||||
|
||||
jmp *%rbx /* Continue with new virtual address */
|
||||
jmp *%rbx
|
||||
|
||||
LOCAL(cont):
|
||||
/* Modify mappings of new page tables to be read-only. */
|
||||
MOV_IMM64_RAX(grub_relocator_xen_mfn_list)
|
||||
|
||||
/* mov imm64, %rcx */
|
||||
.byte 0x48
|
||||
.byte 0xb9
|
||||
VARIABLE(grub_relocator_xen_paging_size)
|
||||
.quad 0
|
||||
|
||||
movq %rax, %rbx /* %rbx is the base of the p2m list */
|
||||
leaq EXT_C(grub_relocator_xen_paging_areas) (%rip), %r8
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_paging_start)
|
||||
.quad 0
|
||||
|
||||
movq %rax, %r12
|
||||
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_mfn_list)
|
||||
.quad 0
|
||||
|
||||
movq %rax, %rsi
|
||||
1:
|
||||
movq 0(%r8), %r12 /* Get start pfn of the current area */
|
||||
movq GRUB_TARGET_SIZEOF_LONG(%r8), %rcx /* Get # of pg tables */
|
||||
testq %rcx, %rcx /* 0 -> last area reached */
|
||||
jz 3f
|
||||
2:
|
||||
movq %r12, %rdi
|
||||
shlq $PAGE_SHIFT, %rdi /* virtual address (1:1 mapping) */
|
||||
movq (%rbx, %r12, 8), %rsi /* mfn */
|
||||
shlq $PAGE_SHIFT, %rsi
|
||||
orq $(GRUB_PAGE_PRESENT | GRUB_PAGE_USER), %rsi /* Build pte */
|
||||
movq $UVMF_INVLPG, %rdx
|
||||
movq %rcx, %r9 /* %rcx clobbered by hypercall */
|
||||
movq %rsi, %rbx
|
||||
movq 0(%rsi), %rsi
|
||||
shlq $12, %rsi
|
||||
orq $5, %rsi
|
||||
movq $2, %rdx
|
||||
movq %rcx, %r9
|
||||
movq $__HYPERVISOR_update_va_mapping, %rax
|
||||
syscall
|
||||
|
||||
movq %r9, %rcx
|
||||
incq %r12 /* next pfn */
|
||||
addq $8, %rbx
|
||||
addq $4096, %r12
|
||||
movq %rbx, %rsi
|
||||
|
||||
loop 2b
|
||||
loop 1b
|
||||
|
||||
addq $(2 * GRUB_TARGET_SIZEOF_LONG), %r8 /* next pg table area */
|
||||
jmp 1b
|
||||
|
||||
3:
|
||||
/* Switch page tables: pin new L4 pt, load cr3, unpin old L4. */
|
||||
leaq EXT_C(grub_relocator_xen_mmu_op) (%rip), %rdi
|
||||
movq $3, %rsi /* 3 mmu ops */
|
||||
movq $0, %rdx /* pdone (not used) */
|
||||
movq $DOMID_SELF, %r10
|
||||
leaq LOCAL(mmu_op) (%rip), %rdi
|
||||
movq $3, %rsi
|
||||
movq $0, %rdx
|
||||
movq $0x7FF0, %r10
|
||||
movq $__HYPERVISOR_mmuext_op, %rax
|
||||
syscall
|
||||
|
||||
/* Continue in virtual kernel mapping. */
|
||||
MOV_IMM64_RAX(grub_relocator_xen_remap_continue)
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_remap_continue)
|
||||
.quad 0
|
||||
|
||||
jmp *%rax
|
||||
|
||||
VARIABLE(grub_relocator_xen_paging_areas)
|
||||
/* array of start, size pairs, size 0 is end marker */
|
||||
.quad 0, 0, 0, 0, 0, 0, 0, 0
|
||||
|
||||
LOCAL(mmu_op):
|
||||
VARIABLE(grub_relocator_xen_mmu_op)
|
||||
.space 256
|
||||
|
||||
@@ -102,32 +112,46 @@ VARIABLE(grub_relocator_xen_remap_end)
|
||||
|
||||
|
||||
VARIABLE(grub_relocator_xen_start)
|
||||
/* Unmap old remapper area. */
|
||||
MOV_IMM64_RAX(grub_relocator_xen_remapper_virt2)
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_remapper_virt2)
|
||||
.quad 0
|
||||
|
||||
movq %rax, %rdi
|
||||
|
||||
xorq %rax, %rax /* Invalid pte */
|
||||
xorq %rax, %rax
|
||||
movq %rax, %rsi
|
||||
|
||||
movq $UVMF_INVLPG, %rdx
|
||||
movq $2, %rdx
|
||||
movq $__HYPERVISOR_update_va_mapping, %rax
|
||||
syscall
|
||||
|
||||
/* Prepare registers for starting kernel. */
|
||||
MOV_IMM64_RAX(grub_relocator_xen_stack)
|
||||
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_stack)
|
||||
.quad 0
|
||||
|
||||
movq %rax, %rsp
|
||||
|
||||
MOV_IMM64_RAX(grub_relocator_xen_start_info)
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_start_info)
|
||||
.quad 0
|
||||
|
||||
movq %rax, %rsi
|
||||
|
||||
cld
|
||||
|
||||
MOV_IMM64_RAX(grub_relocator_xen_entry_point)
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
VARIABLE(grub_relocator_xen_entry_point)
|
||||
.quad 0
|
||||
|
||||
/* Now start the new kernel. */
|
||||
jmp *%rax
|
||||
|
||||
VARIABLE(grub_relocator_xen_end)
|
||||
|
||||
@@ -29,11 +29,6 @@
|
||||
|
||||
typedef grub_addr_t grub_xen_reg_t;
|
||||
|
||||
struct grub_relocator_xen_paging_area {
|
||||
grub_xen_reg_t start;
|
||||
grub_xen_reg_t size;
|
||||
} GRUB_PACKED;
|
||||
|
||||
extern grub_uint8_t grub_relocator_xen_start;
|
||||
extern grub_uint8_t grub_relocator_xen_end;
|
||||
extern grub_uint8_t grub_relocator_xen_remap_start;
|
||||
@@ -41,16 +36,15 @@ extern grub_uint8_t grub_relocator_xen_remap_end;
|
||||
extern grub_xen_reg_t grub_relocator_xen_stack;
|
||||
extern grub_xen_reg_t grub_relocator_xen_start_info;
|
||||
extern grub_xen_reg_t grub_relocator_xen_entry_point;
|
||||
extern grub_xen_reg_t grub_relocator_xen_paging_start;
|
||||
extern grub_xen_reg_t grub_relocator_xen_paging_size;
|
||||
extern grub_xen_reg_t grub_relocator_xen_remapper_virt;
|
||||
extern grub_xen_reg_t grub_relocator_xen_remapper_virt2;
|
||||
extern grub_xen_reg_t grub_relocator_xen_remapper_map;
|
||||
extern grub_xen_reg_t grub_relocator_xen_mfn_list;
|
||||
extern struct grub_relocator_xen_paging_area
|
||||
grub_relocator_xen_paging_areas[XEN_MAX_MAPPINGS];
|
||||
extern grub_xen_reg_t grub_relocator_xen_remap_continue;
|
||||
#ifdef __i386__
|
||||
extern grub_xen_reg_t grub_relocator_xen_mmu_op_addr;
|
||||
extern grub_xen_reg_t grub_relocator_xen_paging_areas_addr;
|
||||
extern grub_xen_reg_t grub_relocator_xen_remapper_map_high;
|
||||
#endif
|
||||
extern mmuext_op_t grub_relocator_xen_mmu_op[3];
|
||||
@@ -67,7 +61,6 @@ grub_relocator_xen_boot (struct grub_relocator *rel,
|
||||
{
|
||||
grub_err_t err;
|
||||
void *relst;
|
||||
int i;
|
||||
grub_relocator_chunk_t ch, ch_tramp;
|
||||
grub_xen_mfn_t *mfn_list =
|
||||
(grub_xen_mfn_t *) grub_xen_start_page_addr->mfn_list;
|
||||
@@ -84,11 +77,8 @@ grub_relocator_xen_boot (struct grub_relocator *rel,
|
||||
grub_relocator_xen_stack = state.stack;
|
||||
grub_relocator_xen_start_info = state.start_info;
|
||||
grub_relocator_xen_entry_point = state.entry_point;
|
||||
for (i = 0; i < XEN_MAX_MAPPINGS; i++)
|
||||
{
|
||||
grub_relocator_xen_paging_areas[i].start = state.paging_start[i];
|
||||
grub_relocator_xen_paging_areas[i].size = state.paging_size[i];
|
||||
}
|
||||
grub_relocator_xen_paging_start = state.paging_start << 12;
|
||||
grub_relocator_xen_paging_size = state.paging_size;
|
||||
grub_relocator_xen_remapper_virt = remapper_virt;
|
||||
grub_relocator_xen_remapper_virt2 = remapper_virt;
|
||||
grub_relocator_xen_remap_continue = trampoline_virt;
|
||||
@@ -98,12 +88,10 @@ grub_relocator_xen_boot (struct grub_relocator *rel,
|
||||
grub_relocator_xen_remapper_map_high = (mfn_list[remapper_pfn] >> 20);
|
||||
grub_relocator_xen_mmu_op_addr = (char *) &grub_relocator_xen_mmu_op
|
||||
- (char *) &grub_relocator_xen_remap_start + remapper_virt;
|
||||
grub_relocator_xen_paging_areas_addr =
|
||||
(char *) &grub_relocator_xen_paging_areas
|
||||
- (char *) &grub_relocator_xen_remap_start + remapper_virt;
|
||||
#endif
|
||||
|
||||
grub_relocator_xen_mfn_list = state.mfn_list;
|
||||
grub_relocator_xen_mfn_list = state.mfn_list
|
||||
+ state.paging_start * sizeof (grub_addr_t);
|
||||
|
||||
grub_memset (grub_relocator_xen_mmu_op, 0,
|
||||
sizeof (grub_relocator_xen_mmu_op));
|
||||
@@ -112,9 +100,9 @@ grub_relocator_xen_boot (struct grub_relocator *rel,
|
||||
#else
|
||||
grub_relocator_xen_mmu_op[0].cmd = MMUEXT_PIN_L4_TABLE;
|
||||
#endif
|
||||
grub_relocator_xen_mmu_op[0].arg1.mfn = mfn_list[state.paging_start[0]];
|
||||
grub_relocator_xen_mmu_op[0].arg1.mfn = mfn_list[state.paging_start];
|
||||
grub_relocator_xen_mmu_op[1].cmd = MMUEXT_NEW_BASEPTR;
|
||||
grub_relocator_xen_mmu_op[1].arg1.mfn = mfn_list[state.paging_start[0]];
|
||||
grub_relocator_xen_mmu_op[1].arg1.mfn = mfn_list[state.paging_start];
|
||||
grub_relocator_xen_mmu_op[2].cmd = MMUEXT_UNPIN_TABLE;
|
||||
grub_relocator_xen_mmu_op[2].arg1.mfn =
|
||||
mfn_list[grub_xen_start_page_addr->pt_base >> 12];
|
||||
|
||||
@@ -42,7 +42,7 @@ static grub_size_t linux_size;
|
||||
static char *linux_args;
|
||||
|
||||
static grub_uint32_t machine_type;
|
||||
static void *fdt_addr;
|
||||
static const void *current_fdt;
|
||||
|
||||
typedef void (*kernel_entry_t) (int, unsigned long, void *);
|
||||
|
||||
@@ -54,9 +54,9 @@ typedef void (*kernel_entry_t) (int, unsigned long, void *);
|
||||
#define LINUX_FDT_PHYS_OFFSET (LINUX_INITRD_PHYS_OFFSET - 0x10000)
|
||||
|
||||
static grub_size_t
|
||||
get_atag_size (grub_uint32_t *atag)
|
||||
get_atag_size (const grub_uint32_t *atag)
|
||||
{
|
||||
grub_uint32_t *atag0 = atag;
|
||||
const grub_uint32_t *atag0 = atag;
|
||||
while (atag[0] && atag[1])
|
||||
atag += atag[0];
|
||||
return atag - atag0;
|
||||
@@ -68,10 +68,11 @@ get_atag_size (grub_uint32_t *atag)
|
||||
* Merges in command line parameters and sets up initrd addresses.
|
||||
*/
|
||||
static grub_err_t
|
||||
linux_prepare_atag (void)
|
||||
linux_prepare_atag (void *target_atag)
|
||||
{
|
||||
grub_uint32_t *atag_orig = (grub_uint32_t *) fdt_addr;
|
||||
grub_uint32_t *tmp_atag, *from, *to;
|
||||
const grub_uint32_t *atag_orig = (const grub_uint32_t *) current_fdt;
|
||||
grub_uint32_t *tmp_atag, *to;
|
||||
const grub_uint32_t *from;
|
||||
grub_size_t tmp_size;
|
||||
grub_size_t arg_size = grub_strlen (linux_args);
|
||||
char *cmdline_orig = NULL;
|
||||
@@ -142,7 +143,7 @@ linux_prepare_atag (void)
|
||||
to += 2;
|
||||
|
||||
/* Copy updated FDT to its launch location */
|
||||
grub_memcpy (atag_orig, tmp_atag, sizeof (grub_uint32_t) * (to - tmp_atag));
|
||||
grub_memcpy (target_atag, tmp_atag, sizeof (grub_uint32_t) * (to - tmp_atag));
|
||||
grub_free (tmp_atag);
|
||||
|
||||
grub_dprintf ("loader", "ATAG updated for Linux boot\n");
|
||||
@@ -156,19 +157,19 @@ linux_prepare_atag (void)
|
||||
* Merges in command line parameters and sets up initrd addresses.
|
||||
*/
|
||||
static grub_err_t
|
||||
linux_prepare_fdt (void)
|
||||
linux_prepare_fdt (void *target_fdt)
|
||||
{
|
||||
int node;
|
||||
int retval;
|
||||
int tmp_size;
|
||||
void *tmp_fdt;
|
||||
|
||||
tmp_size = grub_fdt_get_totalsize (fdt_addr) + 0x100 + grub_strlen (linux_args);
|
||||
tmp_size = grub_fdt_get_totalsize (current_fdt) + 0x100 + grub_strlen (linux_args);
|
||||
tmp_fdt = grub_malloc (tmp_size);
|
||||
if (!tmp_fdt)
|
||||
return grub_errno;
|
||||
|
||||
grub_memcpy (tmp_fdt, fdt_addr, grub_fdt_get_totalsize (fdt_addr));
|
||||
grub_memcpy (tmp_fdt, current_fdt, grub_fdt_get_totalsize (current_fdt));
|
||||
grub_fdt_set_totalsize (tmp_fdt, tmp_size);
|
||||
|
||||
/* Find or create '/chosen' node */
|
||||
@@ -209,7 +210,7 @@ linux_prepare_fdt (void)
|
||||
}
|
||||
|
||||
/* Copy updated FDT to its launch location */
|
||||
grub_memcpy (fdt_addr, tmp_fdt, tmp_size);
|
||||
grub_memcpy (target_fdt, tmp_fdt, tmp_size);
|
||||
grub_free (tmp_fdt);
|
||||
|
||||
grub_dprintf ("loader", "FDT updated for Linux boot\n");
|
||||
@@ -226,16 +227,17 @@ linux_boot (void)
|
||||
{
|
||||
kernel_entry_t linuxmain;
|
||||
int fdt_valid, atag_valid;
|
||||
void *target_fdt = 0;
|
||||
|
||||
fdt_valid = (fdt_addr && grub_fdt_check_header_nosize (fdt_addr) == 0);
|
||||
atag_valid = ((((grub_uint16_t *) fdt_addr)[3] & ~3) == 0x5440
|
||||
&& *((grub_uint32_t *) fdt_addr));
|
||||
fdt_valid = (current_fdt && grub_fdt_check_header_nosize (current_fdt) == 0);
|
||||
atag_valid = ((((const grub_uint16_t *) current_fdt)[3] & ~3) == 0x5440
|
||||
&& *((const grub_uint32_t *) current_fdt));
|
||||
grub_dprintf ("loader", "atag: %p, %x, %x, %s, %s\n",
|
||||
fdt_addr,
|
||||
((grub_uint16_t *) fdt_addr)[3],
|
||||
*((grub_uint32_t *) fdt_addr),
|
||||
(char *) fdt_addr,
|
||||
(char *) fdt_addr + 1);
|
||||
current_fdt,
|
||||
((const grub_uint16_t *) current_fdt)[3],
|
||||
*((const grub_uint32_t *) current_fdt),
|
||||
(const char *) current_fdt,
|
||||
(const char *) current_fdt + 1);
|
||||
|
||||
if (!fdt_valid && machine_type == GRUB_ARM_MACHINE_TYPE_FDT)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
|
||||
@@ -245,23 +247,40 @@ linux_boot (void)
|
||||
|
||||
grub_dprintf ("loader", "Kernel at: 0x%x\n", linux_addr);
|
||||
|
||||
if (fdt_valid || atag_valid)
|
||||
{
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
grub_size_t size;
|
||||
if (fdt_valid)
|
||||
size = grub_fdt_get_totalsize (fdt_addr);
|
||||
else
|
||||
size = 4 * get_atag_size (atag_orig);
|
||||
size += grub_strlen (linux_args) + 256;
|
||||
target_fdt = grub_efi_allocate_loader_memory (LINUX_FDT_PHYS_OFFSET, size);
|
||||
if (!fdt_addr)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
|
||||
#else
|
||||
target_fdt = (void *) LINUX_FDT_ADDRESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (fdt_valid)
|
||||
{
|
||||
grub_err_t err;
|
||||
|
||||
err = linux_prepare_fdt ();
|
||||
err = linux_prepare_fdt (target_fdt);
|
||||
if (err)
|
||||
return err;
|
||||
grub_dprintf ("loader", "FDT @ 0x%p\n", fdt_addr);
|
||||
grub_dprintf ("loader", "FDT @ %p\n", target_fdt);
|
||||
}
|
||||
else if (atag_valid)
|
||||
{
|
||||
grub_err_t err;
|
||||
|
||||
err = linux_prepare_atag ();
|
||||
err = linux_prepare_atag (target_fdt);
|
||||
if (err)
|
||||
return err;
|
||||
grub_dprintf ("loader", "ATAG @ 0x%p\n", fdt_addr);
|
||||
grub_dprintf ("loader", "ATAG @ %p\n", target_fdt);
|
||||
}
|
||||
|
||||
grub_dprintf ("loader", "Jumping to Linux...\n");
|
||||
@@ -285,7 +304,7 @@ linux_boot (void)
|
||||
|
||||
grub_arm_disable_caches_mmu ();
|
||||
|
||||
linuxmain (0, machine_type, fdt_addr);
|
||||
linuxmain (0, machine_type, target_fdt);
|
||||
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Linux call returned");
|
||||
}
|
||||
@@ -444,11 +463,26 @@ fail:
|
||||
static grub_err_t
|
||||
load_dtb (grub_file_t dtb, int size)
|
||||
{
|
||||
if ((grub_file_read (dtb, fdt_addr, size) != size)
|
||||
|| (grub_fdt_check_header (fdt_addr, size) != 0))
|
||||
return grub_error (GRUB_ERR_BAD_OS, N_("invalid device tree"));
|
||||
void *new_fdt = grub_zalloc (size);
|
||||
if (!new_fdt)
|
||||
return grub_errno;
|
||||
grub_dprintf ("loader", "Loading device tree to %p\n",
|
||||
new_fdt);
|
||||
if ((grub_file_read (dtb, new_fdt, size) != size)
|
||||
|| (grub_fdt_check_header (new_fdt, size) != 0))
|
||||
{
|
||||
grub_free (new_fdt);
|
||||
return grub_error (GRUB_ERR_BAD_OS, N_("invalid device tree"));
|
||||
}
|
||||
|
||||
grub_fdt_set_totalsize (new_fdt, size);
|
||||
current_fdt = new_fdt;
|
||||
/*
|
||||
* We've successfully loaded an FDT, so any machine type passed
|
||||
* from firmware is now obsolete.
|
||||
*/
|
||||
machine_type = GRUB_ARM_MACHINE_TYPE_FDT;
|
||||
|
||||
grub_fdt_set_totalsize (fdt_addr, size);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
@@ -464,42 +498,13 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)),
|
||||
|
||||
dtb = grub_file_open (argv[0]);
|
||||
if (!dtb)
|
||||
goto out;
|
||||
return grub_errno;
|
||||
|
||||
size = grub_file_size (dtb);
|
||||
if (size == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_OS, "empty file");
|
||||
goto out;
|
||||
}
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
fdt_addr = grub_efi_allocate_loader_memory (LINUX_FDT_PHYS_OFFSET, size);
|
||||
if (!fdt_addr)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
|
||||
goto out;
|
||||
}
|
||||
#else
|
||||
fdt_addr = (void *) LINUX_FDT_ADDRESS;
|
||||
#endif
|
||||
|
||||
grub_dprintf ("loader", "Loading device tree to 0x%08x\n",
|
||||
(grub_addr_t) fdt_addr);
|
||||
load_dtb (dtb, size);
|
||||
if (grub_errno != GRUB_ERR_NONE)
|
||||
{
|
||||
fdt_addr = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* We've successfully loaded an FDT, so any machine type passed
|
||||
* from firmware is now obsolete.
|
||||
*/
|
||||
machine_type = GRUB_ARM_MACHINE_TYPE_FDT;
|
||||
|
||||
out:
|
||||
grub_error (GRUB_ERR_BAD_OS, "empty file");
|
||||
else
|
||||
load_dtb (dtb, size);
|
||||
grub_file_close (dtb);
|
||||
|
||||
return grub_errno;
|
||||
@@ -517,7 +522,7 @@ GRUB_MOD_INIT (linux)
|
||||
/* TRANSLATORS: DTB stands for device tree blob. */
|
||||
0, N_("Load DTB file."));
|
||||
my_mod = mod;
|
||||
fdt_addr = (void *) grub_arm_firmware_get_boot_data ();
|
||||
current_fdt = grub_arm_firmware_get_boot_data ();
|
||||
machine_type = grub_arm_firmware_get_machine_type ();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,28 @@
|
||||
static void *loaded_fdt;
|
||||
static void *fdt;
|
||||
|
||||
static void *
|
||||
get_firmware_fdt (void)
|
||||
{
|
||||
grub_efi_configuration_table_t *tables;
|
||||
grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
|
||||
void *firmware_fdt = NULL;
|
||||
unsigned int i;
|
||||
|
||||
/* Look for FDT in UEFI config tables. */
|
||||
tables = grub_efi_system_table->configuration_table;
|
||||
|
||||
for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
|
||||
if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0)
|
||||
{
|
||||
firmware_fdt = tables[i].vendor_table;
|
||||
grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt);
|
||||
break;
|
||||
}
|
||||
|
||||
return firmware_fdt;
|
||||
}
|
||||
|
||||
void *
|
||||
grub_fdt_load (grub_size_t additional_size)
|
||||
{
|
||||
@@ -43,7 +65,7 @@ grub_fdt_load (grub_size_t additional_size)
|
||||
if (loaded_fdt)
|
||||
raw_fdt = loaded_fdt;
|
||||
else
|
||||
raw_fdt = grub_efi_get_firmware_fdt();
|
||||
raw_fdt = get_firmware_fdt();
|
||||
|
||||
size =
|
||||
raw_fdt ? grub_fdt_get_totalsize (raw_fdt) : GRUB_FDT_EMPTY_TREE_SZ;
|
||||
|
||||
@@ -122,8 +122,6 @@ copy_file_path (grub_efi_file_path_device_path_t *fp,
|
||||
if (*p == '/')
|
||||
*p = '\\';
|
||||
|
||||
/* File Path is NULL terminated */
|
||||
fp->path_name[size++] = '\0';
|
||||
fp->header.length = size * sizeof (grub_efi_char16_t) + sizeof (*fp);
|
||||
}
|
||||
|
||||
@@ -158,10 +156,8 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename)
|
||||
d = GRUB_EFI_NEXT_DEVICE_PATH (d);
|
||||
}
|
||||
|
||||
/* File Path is NULL terminated. Allocate space for 2 extra characters */
|
||||
/* FIXME why we split path in two components? */
|
||||
file_path = grub_malloc (size
|
||||
+ ((grub_strlen (dir_start) + 2)
|
||||
+ ((grub_strlen (dir_start) + 1)
|
||||
* GRUB_MAX_UTF16_PER_UTF8
|
||||
* sizeof (grub_efi_char16_t))
|
||||
+ sizeof (grub_efi_file_path_device_path_t) * 2);
|
||||
|
||||
@@ -1889,10 +1889,6 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)),
|
||||
grub_err_t err;
|
||||
void *src;
|
||||
|
||||
if (! grub_loader_is_loaded ())
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
N_("you need to load the kernel first"));
|
||||
|
||||
if (kernel_type != KERNEL_TYPE_FREEBSD)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no FreeBSD loaded");
|
||||
|
||||
@@ -1996,10 +1992,6 @@ grub_cmd_netbsd_module (grub_command_t cmd,
|
||||
{
|
||||
grub_uint32_t type;
|
||||
|
||||
if (! grub_loader_is_loaded ())
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
N_("you need to load the kernel first"));
|
||||
|
||||
if (kernel_type != KERNEL_TYPE_NETBSD)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no NetBSD loaded");
|
||||
|
||||
@@ -2078,10 +2070,6 @@ grub_cmd_openbsd_ramdisk (grub_command_t cmd __attribute__ ((unused)),
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
if (! grub_loader_is_loaded ())
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
N_("you need to load the kernel first"));
|
||||
|
||||
if (kernel_type != KERNEL_TYPE_OPENBSD)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "no kOpenBSD loaded");
|
||||
|
||||
|
||||
@@ -915,8 +915,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
||||
grub_env_set ("gfxpayload", "text");
|
||||
grub_printf_ (N_("%s is deprecated. "
|
||||
"Use set gfxpayload=%s before "
|
||||
"linux command instead.\n"),
|
||||
argv[i], "text");
|
||||
"linux command instead.\n"), "text",
|
||||
argv[i]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@@ -925,8 +925,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
||||
grub_env_set ("gfxpayload", "text");
|
||||
grub_printf_ (N_("%s is deprecated. "
|
||||
"Use set gfxpayload=%s before "
|
||||
"linux command instead.\n"),
|
||||
argv[i], "text");
|
||||
"linux command instead.\n"), "text",
|
||||
argv[i]);
|
||||
break;
|
||||
default:
|
||||
/* Ignore invalid values. */
|
||||
|
||||
@@ -70,18 +70,9 @@ load_kernel (grub_file_t file, const char *filename,
|
||||
char *buffer, struct multiboot_header *header)
|
||||
{
|
||||
grub_err_t err;
|
||||
mbi_load_data_t mld;
|
||||
|
||||
mld.file = file;
|
||||
mld.filename = filename;
|
||||
mld.buffer = buffer;
|
||||
mld.mbi_ver = 1;
|
||||
mld.relocatable = 0;
|
||||
mld.avoid_efi_boot_services = 0;
|
||||
|
||||
if (grub_multiboot_quirks & GRUB_MULTIBOOT_QUIRK_BAD_KLUDGE)
|
||||
{
|
||||
err = grub_multiboot_load_elf (&mld);
|
||||
err = grub_multiboot_load_elf (file, filename, buffer);
|
||||
if (err == GRUB_ERR_NONE) {
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
@@ -130,7 +121,7 @@ load_kernel (grub_file_t file, const char *filename,
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
return grub_multiboot_load_elf (&mld);
|
||||
return grub_multiboot_load_elf (file, filename, buffer);
|
||||
}
|
||||
|
||||
static struct multiboot_header *
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,8 +26,6 @@ grub_xen_file (grub_file_t file)
|
||||
grub_elf_t elf;
|
||||
struct linux_kernel_header lh;
|
||||
grub_file_t off_file;
|
||||
grub_uint32_t payload_offset, payload_length;
|
||||
grub_uint8_t magic[6];
|
||||
|
||||
elf = grub_elf_file (file, file->name);
|
||||
if (elf)
|
||||
@@ -48,36 +46,20 @@ grub_xen_file (grub_file_t file)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
payload_length = lh.payload_length;
|
||||
payload_offset = (lh.setup_sects + 1) * 512
|
||||
+ lh.payload_offset;
|
||||
|
||||
if (payload_length < sizeof (magic))
|
||||
if (lh.payload_length < 4)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_OS, "payload too short");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
grub_dprintf ("xen", "found bzimage payload 0x%llx-0x%llx\n",
|
||||
(unsigned long long) payload_offset,
|
||||
(unsigned long long) lh.payload_length);
|
||||
(unsigned long long) (lh.setup_sects + 1) * 512
|
||||
+ lh.payload_offset,
|
||||
(unsigned long long) lh.payload_length - 4);
|
||||
|
||||
grub_file_seek (file, payload_offset);
|
||||
|
||||
if (grub_file_read (file, &magic, sizeof (magic)) != sizeof (magic))
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
|
||||
file->name);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Kernel suffixes xz payload with their uncompressed size.
|
||||
Trim it. */
|
||||
if (grub_memcmp (magic, "\3757zXZ\0", 6) == 0)
|
||||
payload_length -= 4;
|
||||
off_file = grub_file_offset_open (file, payload_offset,
|
||||
payload_length);
|
||||
off_file = grub_file_offset_open (file, (lh.setup_sects + 1) * 512
|
||||
+ lh.payload_offset,
|
||||
lh.payload_length - 4);
|
||||
if (!off_file)
|
||||
goto fail;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <grub/xen_file.h>
|
||||
#include <grub/misc.h>
|
||||
#include <xen/elfnote.h>
|
||||
|
||||
static grub_err_t
|
||||
parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi,
|
||||
@@ -27,8 +26,6 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi,
|
||||
char *buf;
|
||||
char *ptr;
|
||||
int has_paddr = 0;
|
||||
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
if (grub_file_seek (elf->file, off) == (grub_off_t) -1)
|
||||
return grub_errno;
|
||||
buf = grub_malloc (sz);
|
||||
@@ -38,8 +35,7 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi,
|
||||
if (grub_file_read (elf->file, buf, sz) != (grub_ssize_t) sz)
|
||||
{
|
||||
if (grub_errno)
|
||||
goto out;
|
||||
grub_free (buf);
|
||||
return grub_errno;
|
||||
return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
|
||||
elf->file->name);
|
||||
}
|
||||
@@ -127,14 +123,14 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi,
|
||||
{
|
||||
xi->virt_base = grub_strtoull (ptr + sizeof ("VIRT_BASE=") - 1, &ptr, 16);
|
||||
if (grub_errno)
|
||||
goto out;
|
||||
return grub_errno;
|
||||
continue;
|
||||
}
|
||||
if (grub_strncmp (ptr, "VIRT_ENTRY=", sizeof ("VIRT_ENTRY=") - 1) == 0)
|
||||
{
|
||||
xi->entry_point = grub_strtoull (ptr + sizeof ("VIRT_ENTRY=") - 1, &ptr, 16);
|
||||
if (grub_errno)
|
||||
goto out;
|
||||
return grub_errno;
|
||||
continue;
|
||||
}
|
||||
if (grub_strncmp (ptr, "HYPERCALL_PAGE=", sizeof ("HYPERCALL_PAGE=") - 1) == 0)
|
||||
@@ -142,7 +138,7 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi,
|
||||
xi->hypercall_page = grub_strtoull (ptr + sizeof ("HYPERCALL_PAGE=") - 1, &ptr, 16);
|
||||
xi->has_hypercall_page = 1;
|
||||
if (grub_errno)
|
||||
goto out;
|
||||
return grub_errno;
|
||||
continue;
|
||||
}
|
||||
if (grub_strncmp (ptr, "ELF_PADDR_OFFSET=", sizeof ("ELF_PADDR_OFFSET=") - 1) == 0)
|
||||
@@ -150,7 +146,7 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi,
|
||||
xi->paddr_offset = grub_strtoull (ptr + sizeof ("ELF_PADDR_OFFSET=") - 1, &ptr, 16);
|
||||
has_paddr = 1;
|
||||
if (grub_errno)
|
||||
goto out;
|
||||
return grub_errno;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -158,11 +154,7 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi,
|
||||
xi->hypercall_page = (xi->hypercall_page << 12) + xi->virt_base;
|
||||
if (!has_paddr)
|
||||
xi->paddr_offset = xi->virt_base;
|
||||
|
||||
out:
|
||||
grub_free (buf);
|
||||
|
||||
return grub_errno;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
@@ -204,35 +196,35 @@ parse_note (grub_elf_t elf, struct grub_xen_file_info *xi,
|
||||
xi->has_note = 1;
|
||||
switch (nh->n_type)
|
||||
{
|
||||
case XEN_ELFNOTE_ENTRY:
|
||||
case 1:
|
||||
xi->entry_point = grub_le_to_cpu_addr (*(Elf_Addr *) desc);
|
||||
break;
|
||||
case XEN_ELFNOTE_HYPERCALL_PAGE:
|
||||
case 2:
|
||||
xi->hypercall_page = grub_le_to_cpu_addr (*(Elf_Addr *) desc);
|
||||
xi->has_hypercall_page = 1;
|
||||
break;
|
||||
case XEN_ELFNOTE_VIRT_BASE:
|
||||
case 3:
|
||||
xi->virt_base = grub_le_to_cpu_addr (*(Elf_Addr *) desc);
|
||||
break;
|
||||
case XEN_ELFNOTE_PADDR_OFFSET:
|
||||
case 4:
|
||||
xi->paddr_offset = grub_le_to_cpu_addr (*(Elf_Addr *) desc);
|
||||
break;
|
||||
case XEN_ELFNOTE_XEN_VERSION:
|
||||
case 5:
|
||||
grub_dprintf ("xen", "xenversion = `%s'\n", (char *) desc);
|
||||
break;
|
||||
case XEN_ELFNOTE_GUEST_OS:
|
||||
case 6:
|
||||
grub_dprintf ("xen", "name = `%s'\n", (char *) desc);
|
||||
break;
|
||||
case XEN_ELFNOTE_GUEST_VERSION:
|
||||
case 7:
|
||||
grub_dprintf ("xen", "version = `%s'\n", (char *) desc);
|
||||
break;
|
||||
case XEN_ELFNOTE_LOADER:
|
||||
case 8:
|
||||
if (descsz < 7
|
||||
|| grub_memcmp (desc, "generic", descsz == 7 ? 7 : 8) != 0)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "invalid loader");
|
||||
break;
|
||||
/* PAE */
|
||||
case XEN_ELFNOTE_PAE_MODE:
|
||||
case 9:
|
||||
grub_dprintf ("xen", "pae = `%s', %d, %d\n", (char *) desc,
|
||||
xi->arch, descsz);
|
||||
if (xi->arch != GRUB_XEN_FILE_I386
|
||||
@@ -261,13 +253,6 @@ parse_note (grub_elf_t elf, struct grub_xen_file_info *xi,
|
||||
descsz == 2 ? 2 : 3) == 0)
|
||||
xi->arch = GRUB_XEN_FILE_I386;
|
||||
break;
|
||||
case XEN_ELFNOTE_INIT_P2M:
|
||||
xi->p2m_base = grub_le_to_cpu_addr (*(Elf_Addr *) desc);
|
||||
xi->has_p2m_base = 1;
|
||||
break;
|
||||
case XEN_ELFNOTE_MOD_START_PFN:
|
||||
xi->unmapped_initrd = !!grub_le_to_cpu32(*(grub_uint32_t *) desc);
|
||||
break;
|
||||
default:
|
||||
grub_dprintf ("xen", "unknown note type %d\n", nh->n_type);
|
||||
break;
|
||||
|
||||
@@ -118,48 +118,6 @@ grub_multiboot_set_video_mode (void)
|
||||
return err;
|
||||
}
|
||||
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
#ifdef __x86_64__
|
||||
#define grub_relocator_efi_boot grub_relocator64_efi_boot
|
||||
#define grub_relocator_efi_state grub_relocator64_efi_state
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef grub_relocator_efi_boot
|
||||
static void
|
||||
efi_boot (struct grub_relocator *rel,
|
||||
grub_uint32_t target)
|
||||
{
|
||||
struct grub_relocator_efi_state state_efi = MULTIBOOT_EFI_INITIAL_STATE;
|
||||
|
||||
state_efi.MULTIBOOT_EFI_ENTRY_REGISTER = grub_multiboot_payload_eip;
|
||||
state_efi.MULTIBOOT_EFI_MBI_REGISTER = target;
|
||||
|
||||
grub_relocator_efi_boot (rel, state_efi);
|
||||
}
|
||||
#else
|
||||
#define grub_efi_is_finished 1
|
||||
static void
|
||||
efi_boot (struct grub_relocator *rel __attribute__ ((unused)),
|
||||
grub_uint32_t target __attribute__ ((unused)))
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (__i386__) || defined (__x86_64__)
|
||||
static void
|
||||
normal_boot (struct grub_relocator *rel, struct grub_relocator32_state state)
|
||||
{
|
||||
grub_relocator32_boot (rel, state, 0);
|
||||
}
|
||||
#else
|
||||
static void
|
||||
normal_boot (struct grub_relocator *rel, struct grub_relocator32_state state)
|
||||
{
|
||||
grub_relocator32_boot (rel, state);
|
||||
}
|
||||
#endif
|
||||
|
||||
static grub_err_t
|
||||
grub_multiboot_boot (void)
|
||||
{
|
||||
@@ -173,10 +131,11 @@ grub_multiboot_boot (void)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (grub_efi_is_finished)
|
||||
normal_boot (grub_multiboot_relocator, state);
|
||||
else
|
||||
efi_boot (grub_multiboot_relocator, state.MULTIBOOT_MBI_REGISTER);
|
||||
#if defined (__i386__) || defined (__x86_64__)
|
||||
grub_relocator32_boot (grub_multiboot_relocator, state, 0);
|
||||
#else
|
||||
grub_relocator32_boot (grub_multiboot_relocator, state);
|
||||
#endif
|
||||
|
||||
/* Not reached. */
|
||||
return GRUB_ERR_NONE;
|
||||
@@ -207,12 +166,13 @@ static grub_uint64_t highest_load;
|
||||
|
||||
/* Load ELF32 or ELF64. */
|
||||
grub_err_t
|
||||
grub_multiboot_load_elf (mbi_load_data_t *mld)
|
||||
grub_multiboot_load_elf (grub_file_t file, const char *filename,
|
||||
void *buffer)
|
||||
{
|
||||
if (grub_multiboot_is_elf32 (mld->buffer))
|
||||
return grub_multiboot_load_elf32 (mld);
|
||||
else if (grub_multiboot_is_elf64 (mld->buffer))
|
||||
return grub_multiboot_load_elf64 (mld);
|
||||
if (grub_multiboot_is_elf32 (buffer))
|
||||
return grub_multiboot_load_elf32 (file, filename, buffer);
|
||||
else if (grub_multiboot_is_elf64 (buffer))
|
||||
return grub_multiboot_load_elf64 (file, filename, buffer);
|
||||
|
||||
return grub_error (GRUB_ERR_UNKNOWN_OS, N_("invalid arch-dependent ELF magic"));
|
||||
}
|
||||
|
||||
@@ -51,15 +51,11 @@ CONCAT(grub_multiboot_is_elf, XX) (void *buffer)
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld)
|
||||
CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, void *buffer)
|
||||
{
|
||||
Elf_Ehdr *ehdr = (Elf_Ehdr *) mld->buffer;
|
||||
Elf_Ehdr *ehdr = (Elf_Ehdr *) buffer;
|
||||
char *phdr_base;
|
||||
grub_err_t err;
|
||||
grub_relocator_chunk_t ch;
|
||||
grub_uint32_t load_offset, load_size;
|
||||
int i;
|
||||
void *source;
|
||||
|
||||
if (ehdr->e_ident[EI_MAG0] != ELFMAG0
|
||||
|| ehdr->e_ident[EI_MAG1] != ELFMAG1
|
||||
@@ -79,86 +75,54 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld)
|
||||
if (ehdr->e_phoff + (grub_uint32_t) ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset");
|
||||
|
||||
phdr_base = (char *) mld->buffer + ehdr->e_phoff;
|
||||
phdr_base = (char *) buffer + ehdr->e_phoff;
|
||||
#define phdr(i) ((Elf_Phdr *) (phdr_base + (i) * ehdr->e_phentsize))
|
||||
|
||||
mld->link_base_addr = ~0;
|
||||
|
||||
/* Calculate lowest and highest load address. */
|
||||
for (i = 0; i < ehdr->e_phnum; i++)
|
||||
if (phdr(i)->p_type == PT_LOAD)
|
||||
{
|
||||
mld->link_base_addr = grub_min (mld->link_base_addr, phdr(i)->p_paddr);
|
||||
highest_load = grub_max (highest_load, phdr(i)->p_paddr + phdr(i)->p_memsz);
|
||||
}
|
||||
|
||||
#ifdef MULTIBOOT_LOAD_ELF64
|
||||
if (highest_load >= 0x100000000)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "segment crosses 4 GiB border");
|
||||
#endif
|
||||
|
||||
load_size = highest_load - mld->link_base_addr;
|
||||
|
||||
if (mld->relocatable)
|
||||
{
|
||||
if (load_size > mld->max_addr || mld->min_addr > mld->max_addr - load_size)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size");
|
||||
|
||||
err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch,
|
||||
mld->min_addr, mld->max_addr - load_size,
|
||||
load_size, mld->align ? mld->align : 1,
|
||||
mld->preference, mld->avoid_efi_boot_services);
|
||||
}
|
||||
else
|
||||
err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, &ch,
|
||||
mld->link_base_addr, load_size);
|
||||
|
||||
if (err)
|
||||
{
|
||||
grub_dprintf ("multiboot_loader", "Cannot allocate memory for OS image\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
mld->load_base_addr = get_physical_target_address (ch);
|
||||
source = get_virtual_current_address (ch);
|
||||
|
||||
grub_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, "
|
||||
"load_size=0x%x, relocatable=%d\n", mld->link_base_addr,
|
||||
mld->load_base_addr, load_size, mld->relocatable);
|
||||
|
||||
if (mld->relocatable)
|
||||
grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n",
|
||||
(long) mld->align, mld->preference, mld->avoid_efi_boot_services);
|
||||
|
||||
/* Load every loadable segment in memory. */
|
||||
for (i = 0; i < ehdr->e_phnum; i++)
|
||||
{
|
||||
if (phdr(i)->p_type == PT_LOAD)
|
||||
{
|
||||
grub_err_t err;
|
||||
void *source;
|
||||
|
||||
if (phdr(i)->p_paddr + phdr(i)->p_memsz > highest_load)
|
||||
highest_load = phdr(i)->p_paddr + phdr(i)->p_memsz;
|
||||
|
||||
grub_dprintf ("multiboot_loader", "segment %d: paddr=0x%lx, memsz=0x%lx, vaddr=0x%lx\n",
|
||||
i, (long) phdr(i)->p_paddr, (long) phdr(i)->p_memsz, (long) phdr(i)->p_vaddr);
|
||||
|
||||
load_offset = phdr(i)->p_paddr - mld->link_base_addr;
|
||||
{
|
||||
grub_relocator_chunk_t ch;
|
||||
err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator,
|
||||
&ch, phdr(i)->p_paddr,
|
||||
phdr(i)->p_memsz);
|
||||
if (err)
|
||||
{
|
||||
grub_dprintf ("multiboot_loader", "Error loading phdr %d\n", i);
|
||||
return err;
|
||||
}
|
||||
source = get_virtual_current_address (ch);
|
||||
}
|
||||
|
||||
if (phdr(i)->p_filesz != 0)
|
||||
{
|
||||
if (grub_file_seek (mld->file, (grub_off_t) phdr(i)->p_offset)
|
||||
if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset)
|
||||
== (grub_off_t) -1)
|
||||
return grub_errno;
|
||||
|
||||
if (grub_file_read (mld->file, (grub_uint8_t *) source + load_offset, phdr(i)->p_filesz)
|
||||
if (grub_file_read (file, source, phdr(i)->p_filesz)
|
||||
!= (grub_ssize_t) phdr(i)->p_filesz)
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
|
||||
mld->filename);
|
||||
filename);
|
||||
return grub_errno;
|
||||
}
|
||||
}
|
||||
|
||||
if (phdr(i)->p_filesz < phdr(i)->p_memsz)
|
||||
grub_memset ((grub_uint8_t *) source + load_offset + phdr(i)->p_filesz, 0,
|
||||
grub_memset ((grub_uint8_t *) source + phdr(i)->p_filesz, 0,
|
||||
phdr(i)->p_memsz - phdr(i)->p_filesz);
|
||||
}
|
||||
}
|
||||
@@ -204,18 +168,18 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld)
|
||||
if (!shdr)
|
||||
return grub_errno;
|
||||
|
||||
if (grub_file_seek (mld->file, ehdr->e_shoff) == (grub_off_t) -1)
|
||||
if (grub_file_seek (file, ehdr->e_shoff) == (grub_off_t) -1)
|
||||
{
|
||||
grub_free (shdr);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
if (grub_file_read (mld->file, shdr, (grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize)
|
||||
if (grub_file_read (file, shdr, (grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize)
|
||||
!= (grub_ssize_t) ehdr->e_shnum * ehdr->e_shentsize)
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
|
||||
mld->filename);
|
||||
filename);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
@@ -225,9 +189,7 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld)
|
||||
Elf_Shdr *sh = (Elf_Shdr *) shdrptr;
|
||||
void *src;
|
||||
grub_addr_t target;
|
||||
|
||||
if (mld->mbi_ver >= 2 && (sh->sh_type == SHT_REL || sh->sh_type == SHT_RELA))
|
||||
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ELF files with relocs are not supported yet");
|
||||
grub_err_t err;
|
||||
|
||||
/* This section is a loaded section,
|
||||
so we don't care. */
|
||||
@@ -238,28 +200,33 @@ CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld)
|
||||
if (sh->sh_size == 0)
|
||||
continue;
|
||||
|
||||
err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, 0,
|
||||
(0xffffffff - sh->sh_size) + 1,
|
||||
sh->sh_size, sh->sh_addralign,
|
||||
GRUB_RELOCATOR_PREFERENCE_NONE,
|
||||
mld->avoid_efi_boot_services);
|
||||
if (err)
|
||||
{
|
||||
grub_dprintf ("multiboot_loader", "Error loading shdr %d\n", i);
|
||||
return err;
|
||||
}
|
||||
src = get_virtual_current_address (ch);
|
||||
target = get_physical_target_address (ch);
|
||||
{
|
||||
grub_relocator_chunk_t ch;
|
||||
err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator,
|
||||
&ch, 0,
|
||||
(0xffffffff - sh->sh_size)
|
||||
+ 1, sh->sh_size,
|
||||
sh->sh_addralign,
|
||||
GRUB_RELOCATOR_PREFERENCE_NONE,
|
||||
0);
|
||||
if (err)
|
||||
{
|
||||
grub_dprintf ("multiboot_loader", "Error loading shdr %d\n", i);
|
||||
return err;
|
||||
}
|
||||
src = get_virtual_current_address (ch);
|
||||
target = get_physical_target_address (ch);
|
||||
}
|
||||
|
||||
if (grub_file_seek (mld->file, sh->sh_offset) == (grub_off_t) -1)
|
||||
if (grub_file_seek (file, sh->sh_offset) == (grub_off_t) -1)
|
||||
return grub_errno;
|
||||
|
||||
if (grub_file_read (mld->file, src, sh->sh_size)
|
||||
if (grub_file_read (file, src, sh->sh_size)
|
||||
!= (grub_ssize_t) sh->sh_size)
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
|
||||
mld->filename);
|
||||
filename);
|
||||
return grub_errno;
|
||||
}
|
||||
sh->sh_addr = target;
|
||||
|
||||
@@ -68,7 +68,6 @@ static grub_size_t elf_sec_num, elf_sec_entsize;
|
||||
static unsigned elf_sec_shstrndx;
|
||||
static void *elf_sections;
|
||||
static int keep_bs = 0;
|
||||
static grub_uint32_t load_base_addr;
|
||||
|
||||
void
|
||||
grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize,
|
||||
@@ -102,40 +101,36 @@ find_header (grub_properly_aligned_t *buffer, grub_ssize_t len)
|
||||
grub_err_t
|
||||
grub_multiboot_load (grub_file_t file, const char *filename)
|
||||
{
|
||||
grub_properly_aligned_t *buffer;
|
||||
grub_ssize_t len;
|
||||
struct multiboot_header *header;
|
||||
grub_err_t err;
|
||||
struct multiboot_header_tag *tag;
|
||||
struct multiboot_header_tag_address *addr_tag = NULL;
|
||||
struct multiboot_header_tag_relocatable *rel_tag;
|
||||
int entry_specified = 0, efi_entry_specified = 0;
|
||||
grub_addr_t entry = 0, efi_entry = 0;
|
||||
int entry_specified = 0;
|
||||
grub_addr_t entry = 0;
|
||||
grub_uint32_t console_required = 0;
|
||||
struct multiboot_header_tag_framebuffer *fbtag = NULL;
|
||||
int accepted_consoles = GRUB_MULTIBOOT_CONSOLE_EGA_TEXT;
|
||||
mbi_load_data_t mld;
|
||||
|
||||
mld.mbi_ver = 2;
|
||||
mld.relocatable = 0;
|
||||
|
||||
mld.buffer = grub_malloc (MULTIBOOT_SEARCH);
|
||||
if (!mld.buffer)
|
||||
buffer = grub_malloc (MULTIBOOT_SEARCH);
|
||||
if (!buffer)
|
||||
return grub_errno;
|
||||
|
||||
len = grub_file_read (file, mld.buffer, MULTIBOOT_SEARCH);
|
||||
len = grub_file_read (file, buffer, MULTIBOOT_SEARCH);
|
||||
if (len < 32)
|
||||
{
|
||||
grub_free (mld.buffer);
|
||||
grub_free (buffer);
|
||||
return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), filename);
|
||||
}
|
||||
|
||||
COMPILE_TIME_ASSERT (MULTIBOOT_HEADER_ALIGN % 4 == 0);
|
||||
|
||||
header = find_header (mld.buffer, len);
|
||||
header = find_header (buffer, len);
|
||||
|
||||
if (header == 0)
|
||||
{
|
||||
grub_free (mld.buffer);
|
||||
grub_free (buffer);
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no multiboot header found");
|
||||
}
|
||||
|
||||
@@ -177,13 +172,10 @@ grub_multiboot_load (grub_file_t file, const char *filename)
|
||||
case MULTIBOOT_TAG_TYPE_NETWORK:
|
||||
case MULTIBOOT_TAG_TYPE_EFI_MMAP:
|
||||
case MULTIBOOT_TAG_TYPE_EFI_BS:
|
||||
case MULTIBOOT_TAG_TYPE_EFI32_IH:
|
||||
case MULTIBOOT_TAG_TYPE_EFI64_IH:
|
||||
case MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR:
|
||||
break;
|
||||
|
||||
default:
|
||||
grub_free (mld.buffer);
|
||||
grub_free (buffer);
|
||||
return grub_error (GRUB_ERR_UNKNOWN_OS,
|
||||
"unsupported information tag: 0x%x",
|
||||
request_tag->requests[i]);
|
||||
@@ -200,13 +192,6 @@ grub_multiboot_load (grub_file_t file, const char *filename)
|
||||
entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr;
|
||||
break;
|
||||
|
||||
case MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64:
|
||||
#if defined (GRUB_MACHINE_EFI) && defined (__x86_64__)
|
||||
efi_entry_specified = 1;
|
||||
efi_entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case MULTIBOOT_HEADER_TAG_CONSOLE_FLAGS:
|
||||
if (!(((struct multiboot_header_tag_console_flags *) tag)->console_flags
|
||||
& MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED))
|
||||
@@ -221,50 +206,27 @@ grub_multiboot_load (grub_file_t file, const char *filename)
|
||||
accepted_consoles |= GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER;
|
||||
break;
|
||||
|
||||
case MULTIBOOT_HEADER_TAG_RELOCATABLE:
|
||||
mld.relocatable = 1;
|
||||
rel_tag = (struct multiboot_header_tag_relocatable *) tag;
|
||||
mld.min_addr = rel_tag->min_addr;
|
||||
mld.max_addr = rel_tag->max_addr;
|
||||
mld.align = rel_tag->align;
|
||||
switch (rel_tag->preference)
|
||||
{
|
||||
case MULTIBOOT_LOAD_PREFERENCE_LOW:
|
||||
mld.preference = GRUB_RELOCATOR_PREFERENCE_LOW;
|
||||
break;
|
||||
|
||||
case MULTIBOOT_LOAD_PREFERENCE_HIGH:
|
||||
mld.preference = GRUB_RELOCATOR_PREFERENCE_HIGH;
|
||||
break;
|
||||
|
||||
default:
|
||||
mld.preference = GRUB_RELOCATOR_PREFERENCE_NONE;
|
||||
}
|
||||
break;
|
||||
|
||||
/* GRUB always page-aligns modules. */
|
||||
case MULTIBOOT_HEADER_TAG_MODULE_ALIGN:
|
||||
break;
|
||||
|
||||
case MULTIBOOT_HEADER_TAG_EFI_BS:
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
keep_bs = 1;
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
if (! (tag->flags & MULTIBOOT_HEADER_TAG_OPTIONAL))
|
||||
{
|
||||
grub_free (mld.buffer);
|
||||
grub_free (buffer);
|
||||
return grub_error (GRUB_ERR_UNKNOWN_OS,
|
||||
"unsupported tag: 0x%x", tag->type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (addr_tag && !entry_specified && !(keep_bs && efi_entry_specified))
|
||||
if (addr_tag && !entry_specified)
|
||||
{
|
||||
grub_free (mld.buffer);
|
||||
grub_free (buffer);
|
||||
return grub_error (GRUB_ERR_UNKNOWN_OS,
|
||||
"load address tag without entry address tag");
|
||||
}
|
||||
@@ -273,8 +235,8 @@ grub_multiboot_load (grub_file_t file, const char *filename)
|
||||
{
|
||||
grub_uint64_t load_addr = (addr_tag->load_addr + 1)
|
||||
? addr_tag->load_addr : (addr_tag->header_addr
|
||||
- ((char *) header - (char *) mld.buffer));
|
||||
int offset = ((char *) header - (char *) mld.buffer -
|
||||
- ((char *) header - (char *) buffer));
|
||||
int offset = ((char *) header - (char *) buffer -
|
||||
(addr_tag->header_addr - load_addr));
|
||||
int load_size = ((addr_tag->load_end_addr == 0) ? file->size - offset :
|
||||
addr_tag->load_end_addr - addr_tag->load_addr);
|
||||
@@ -287,50 +249,27 @@ grub_multiboot_load (grub_file_t file, const char *filename)
|
||||
else
|
||||
code_size = load_size;
|
||||
|
||||
if (mld.relocatable)
|
||||
{
|
||||
if (code_size > mld.max_addr || mld.min_addr > mld.max_addr - code_size)
|
||||
{
|
||||
grub_free (mld.buffer);
|
||||
return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size");
|
||||
}
|
||||
|
||||
err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch,
|
||||
mld.min_addr, mld.max_addr - code_size,
|
||||
code_size, mld.align ? mld.align : 1,
|
||||
mld.preference, keep_bs);
|
||||
}
|
||||
else
|
||||
err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator,
|
||||
&ch, load_addr, code_size);
|
||||
err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator,
|
||||
&ch, load_addr,
|
||||
code_size);
|
||||
if (err)
|
||||
{
|
||||
grub_dprintf ("multiboot_loader", "Error loading aout kludge\n");
|
||||
grub_free (mld.buffer);
|
||||
grub_free (buffer);
|
||||
return err;
|
||||
}
|
||||
mld.link_base_addr = load_addr;
|
||||
mld.load_base_addr = get_physical_target_address (ch);
|
||||
source = get_virtual_current_address (ch);
|
||||
|
||||
grub_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, "
|
||||
"load_size=0x%lx, relocatable=%d\n", mld.link_base_addr,
|
||||
mld.load_base_addr, (long) code_size, mld.relocatable);
|
||||
|
||||
if (mld.relocatable)
|
||||
grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n",
|
||||
(long) mld.align, mld.preference, keep_bs);
|
||||
|
||||
if ((grub_file_seek (file, offset)) == (grub_off_t) -1)
|
||||
{
|
||||
grub_free (mld.buffer);
|
||||
grub_free (buffer);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
grub_file_read (file, source, load_size);
|
||||
if (grub_errno)
|
||||
{
|
||||
grub_free (mld.buffer);
|
||||
grub_free (buffer);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
@@ -340,41 +279,17 @@ grub_multiboot_load (grub_file_t file, const char *filename)
|
||||
}
|
||||
else
|
||||
{
|
||||
mld.file = file;
|
||||
mld.filename = filename;
|
||||
mld.avoid_efi_boot_services = keep_bs;
|
||||
err = grub_multiboot_load_elf (&mld);
|
||||
err = grub_multiboot_load_elf (file, filename, buffer);
|
||||
if (err)
|
||||
{
|
||||
grub_free (mld.buffer);
|
||||
grub_free (buffer);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
load_base_addr = mld.load_base_addr;
|
||||
|
||||
if (keep_bs && efi_entry_specified)
|
||||
grub_multiboot_payload_eip = efi_entry;
|
||||
else if (entry_specified)
|
||||
if (entry_specified)
|
||||
grub_multiboot_payload_eip = entry;
|
||||
|
||||
if (mld.relocatable)
|
||||
{
|
||||
/*
|
||||
* Both branches are mathematically equivalent. However, it looks
|
||||
* that real life (C?) is more complicated. I am trying to avoid
|
||||
* wrap around here if mld.load_base_addr < mld.link_base_addr.
|
||||
* If you look at C operator precedence then everything should work.
|
||||
* However, I am not 100% sure that a given compiler will not
|
||||
* optimize/break this stuff. So, maybe we should use signed
|
||||
* 64-bit int here.
|
||||
*/
|
||||
if (mld.load_base_addr >= mld.link_base_addr)
|
||||
grub_multiboot_payload_eip += mld.load_base_addr - mld.link_base_addr;
|
||||
else
|
||||
grub_multiboot_payload_eip -= mld.link_base_addr - mld.load_base_addr;
|
||||
}
|
||||
|
||||
if (fbtag)
|
||||
err = grub_multiboot_set_console (GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER,
|
||||
accepted_consoles,
|
||||
@@ -462,7 +377,7 @@ static grub_size_t
|
||||
grub_multiboot_get_mbi_size (void)
|
||||
{
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
if (!keep_bs && !efi_mmap_size)
|
||||
if (!efi_mmap_size)
|
||||
find_efi_mmap_size ();
|
||||
#endif
|
||||
return 2 * sizeof (grub_uint32_t) + sizeof (struct multiboot_tag)
|
||||
@@ -481,16 +396,13 @@ grub_multiboot_get_mbi_size (void)
|
||||
+ grub_get_multiboot_mmap_count ()
|
||||
* sizeof (struct multiboot_mmap_entry)), MULTIBOOT_TAG_ALIGN)
|
||||
+ ALIGN_UP (sizeof (struct multiboot_tag_framebuffer), MULTIBOOT_TAG_ALIGN)
|
||||
+ ALIGN_UP (sizeof (struct multiboot_tag_efi32), MULTIBOOT_TAG_ALIGN)
|
||||
+ ALIGN_UP (sizeof (struct multiboot_tag_efi64), MULTIBOOT_TAG_ALIGN)
|
||||
+ ALIGN_UP (sizeof (struct multiboot_tag_old_acpi)
|
||||
+ sizeof (struct grub_acpi_rsdp_v10), MULTIBOOT_TAG_ALIGN)
|
||||
+ ALIGN_UP (sizeof (struct multiboot_tag_load_base_addr), MULTIBOOT_TAG_ALIGN)
|
||||
+ acpiv2_size ()
|
||||
+ net_size ()
|
||||
#ifdef GRUB_MACHINE_EFI
|
||||
+ ALIGN_UP (sizeof (struct multiboot_tag_efi32), MULTIBOOT_TAG_ALIGN)
|
||||
+ ALIGN_UP (sizeof (struct multiboot_tag_efi32_ih), MULTIBOOT_TAG_ALIGN)
|
||||
+ ALIGN_UP (sizeof (struct multiboot_tag_efi64), MULTIBOOT_TAG_ALIGN)
|
||||
+ ALIGN_UP (sizeof (struct multiboot_tag_efi64_ih), MULTIBOOT_TAG_ALIGN)
|
||||
+ ALIGN_UP (sizeof (struct multiboot_tag_efi_mmap)
|
||||
+ efi_mmap_size, MULTIBOOT_TAG_ALIGN)
|
||||
#endif
|
||||
@@ -508,7 +420,6 @@ grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size,
|
||||
(*mmap_entry)->addr = addr;
|
||||
(*mmap_entry)->len = size;
|
||||
(*mmap_entry)->type = type;
|
||||
(*mmap_entry)->zero = 0;
|
||||
(*mmap_entry)++;
|
||||
|
||||
return 0;
|
||||
@@ -766,15 +677,6 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
|
||||
% sizeof (grub_properly_aligned_t) == 0);
|
||||
ptrorig += (2 * sizeof (grub_uint32_t)) / sizeof (grub_properly_aligned_t);
|
||||
|
||||
{
|
||||
struct multiboot_tag_load_base_addr *tag = (struct multiboot_tag_load_base_addr *) ptrorig;
|
||||
tag->type = MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR;
|
||||
tag->size = sizeof (struct multiboot_tag_load_base_addr);
|
||||
tag->load_base_addr = load_base_addr;
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
|
||||
{
|
||||
struct multiboot_tag_string *tag = (struct multiboot_tag_string *) ptrorig;
|
||||
tag->type = MULTIBOOT_TAG_TYPE_CMDLINE;
|
||||
@@ -837,13 +739,12 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
|
||||
}
|
||||
}
|
||||
|
||||
if (!keep_bs)
|
||||
{
|
||||
struct multiboot_tag_mmap *tag = (struct multiboot_tag_mmap *) ptrorig;
|
||||
grub_fill_multiboot_mmap (tag);
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
{
|
||||
struct multiboot_tag_mmap *tag = (struct multiboot_tag_mmap *) ptrorig;
|
||||
grub_fill_multiboot_mmap (tag);
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
|
||||
{
|
||||
struct multiboot_tag_elf_sections *tag
|
||||
@@ -859,19 +760,18 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
|
||||
if (!keep_bs)
|
||||
{
|
||||
struct multiboot_tag_basic_meminfo *tag
|
||||
= (struct multiboot_tag_basic_meminfo *) ptrorig;
|
||||
tag->type = MULTIBOOT_TAG_TYPE_BASIC_MEMINFO;
|
||||
tag->size = sizeof (struct multiboot_tag_basic_meminfo);
|
||||
{
|
||||
struct multiboot_tag_basic_meminfo *tag
|
||||
= (struct multiboot_tag_basic_meminfo *) ptrorig;
|
||||
tag->type = MULTIBOOT_TAG_TYPE_BASIC_MEMINFO;
|
||||
tag->size = sizeof (struct multiboot_tag_basic_meminfo);
|
||||
|
||||
/* Convert from bytes to kilobytes. */
|
||||
tag->mem_lower = grub_mmap_get_lower () / 1024;
|
||||
tag->mem_upper = grub_mmap_get_upper () / 1024;
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
/* Convert from bytes to kilobytes. */
|
||||
tag->mem_lower = grub_mmap_get_lower () / 1024;
|
||||
tag->mem_upper = grub_mmap_get_upper () / 1024;
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
|
||||
{
|
||||
struct grub_net_network_level_interface *net;
|
||||
@@ -970,57 +870,36 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
|
||||
grub_efi_uintn_t efi_desc_size;
|
||||
grub_efi_uint32_t efi_desc_version;
|
||||
|
||||
tag->type = MULTIBOOT_TAG_TYPE_EFI_MMAP;
|
||||
tag->size = sizeof (*tag) + efi_mmap_size;
|
||||
|
||||
if (!keep_bs)
|
||||
err = grub_efi_finish_boot_services (&efi_mmap_size, tag->efi_mmap, NULL,
|
||||
&efi_desc_size, &efi_desc_version);
|
||||
else
|
||||
{
|
||||
tag->type = MULTIBOOT_TAG_TYPE_EFI_MMAP;
|
||||
tag->size = sizeof (*tag) + efi_mmap_size;
|
||||
|
||||
err = grub_efi_finish_boot_services (&efi_mmap_size, tag->efi_mmap, NULL,
|
||||
&efi_desc_size, &efi_desc_version);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
tag->descr_size = efi_desc_size;
|
||||
tag->descr_vers = efi_desc_version;
|
||||
tag->size = sizeof (*tag) + efi_mmap_size;
|
||||
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
if (grub_efi_get_memory_map (&efi_mmap_size, (void *) tag->efi_mmap,
|
||||
NULL,
|
||||
&efi_desc_size, &efi_desc_version) <= 0)
|
||||
err = grub_error (GRUB_ERR_IO, "couldn't retrieve memory map");
|
||||
}
|
||||
if (err)
|
||||
return err;
|
||||
tag->descr_size = efi_desc_size;
|
||||
tag->descr_vers = efi_desc_version;
|
||||
tag->size = sizeof (*tag) + efi_mmap_size;
|
||||
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
|
||||
if (keep_bs)
|
||||
{
|
||||
{
|
||||
struct multiboot_tag *tag = (struct multiboot_tag *) ptrorig;
|
||||
tag->type = MULTIBOOT_TAG_TYPE_EFI_BS;
|
||||
tag->size = sizeof (struct multiboot_tag);
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
|
||||
#ifdef __i386__
|
||||
{
|
||||
struct multiboot_tag_efi32_ih *tag = (struct multiboot_tag_efi32_ih *) ptrorig;
|
||||
tag->type = MULTIBOOT_TAG_TYPE_EFI32_IH;
|
||||
tag->size = sizeof (struct multiboot_tag_efi32_ih);
|
||||
tag->pointer = (grub_addr_t) grub_efi_image_handle;
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __x86_64__
|
||||
{
|
||||
struct multiboot_tag_efi64_ih *tag = (struct multiboot_tag_efi64_ih *) ptrorig;
|
||||
tag->type = MULTIBOOT_TAG_TYPE_EFI64_IH;
|
||||
tag->size = sizeof (struct multiboot_tag_efi64_ih);
|
||||
tag->pointer = (grub_addr_t) grub_efi_image_handle;
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
#endif
|
||||
struct multiboot_tag *tag = (struct multiboot_tag *) ptrorig;
|
||||
tag->type = MULTIBOOT_TAG_TYPE_EFI_BS;
|
||||
tag->size = sizeof (struct multiboot_tag);
|
||||
ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN)
|
||||
/ sizeof (grub_properly_aligned_t);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask)
|
||||
grub_memcpy (&gw.ipv4, ptr, sizeof (gw.ipv4));
|
||||
rname = grub_xasprintf ("%s:default", name);
|
||||
if (rname)
|
||||
grub_net_add_route_gw (rname, target, gw, NULL);
|
||||
grub_net_add_route_gw (rname, target, gw);
|
||||
grub_free (rname);
|
||||
}
|
||||
break;
|
||||
@@ -142,7 +142,6 @@ grub_net_configure_by_dhcp_ack (const char *name,
|
||||
grub_net_link_level_address_t hwaddr;
|
||||
struct grub_net_network_level_interface *inter;
|
||||
int mask = -1;
|
||||
char server_ip[sizeof ("xxx.xxx.xxx.xxx")];
|
||||
|
||||
addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4;
|
||||
addr.ipv4 = bp->your_ip;
|
||||
@@ -158,9 +157,6 @@ grub_net_configure_by_dhcp_ack (const char *name,
|
||||
hwaddr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET;
|
||||
|
||||
inter = grub_net_add_addr (name, card, &addr, &hwaddr, flags);
|
||||
if (!inter)
|
||||
return 0;
|
||||
|
||||
#if 0
|
||||
/* This is likely based on misunderstanding. gateway_ip refers to
|
||||
address of BOOTP relay and should not be used after BOOTP transaction
|
||||
@@ -193,22 +189,15 @@ grub_net_configure_by_dhcp_ack (const char *name,
|
||||
if (size > OFFSET_OF (boot_file, bp))
|
||||
grub_env_set_net_property (name, "boot_file", bp->boot_file,
|
||||
sizeof (bp->boot_file));
|
||||
if (bp->server_ip)
|
||||
{
|
||||
grub_snprintf (server_ip, sizeof (server_ip), "%d.%d.%d.%d",
|
||||
((grub_uint8_t *) &bp->server_ip)[0],
|
||||
((grub_uint8_t *) &bp->server_ip)[1],
|
||||
((grub_uint8_t *) &bp->server_ip)[2],
|
||||
((grub_uint8_t *) &bp->server_ip)[3]);
|
||||
grub_env_set_net_property (name, "next_server", server_ip, sizeof (server_ip));
|
||||
grub_print_error ();
|
||||
}
|
||||
|
||||
if (is_def)
|
||||
grub_net_default_server = 0;
|
||||
if (is_def && !grub_net_default_server && bp->server_ip)
|
||||
{
|
||||
grub_net_default_server = grub_strdup (server_ip);
|
||||
grub_net_default_server = grub_xasprintf ("%d.%d.%d.%d",
|
||||
((grub_uint8_t *) &bp->server_ip)[0],
|
||||
((grub_uint8_t *) &bp->server_ip)[1],
|
||||
((grub_uint8_t *) &bp->server_ip)[2],
|
||||
((grub_uint8_t *) &bp->server_ip)[3]);
|
||||
grub_print_error ();
|
||||
}
|
||||
|
||||
@@ -220,7 +209,11 @@ grub_net_configure_by_dhcp_ack (const char *name,
|
||||
|
||||
if (device && !*device && bp->server_ip)
|
||||
{
|
||||
*device = grub_xasprintf ("tftp,%s", server_ip);
|
||||
*device = grub_xasprintf ("tftp,%d.%d.%d.%d",
|
||||
((grub_uint8_t *) &bp->server_ip)[0],
|
||||
((grub_uint8_t *) &bp->server_ip)[1],
|
||||
((grub_uint8_t *) &bp->server_ip)[2],
|
||||
((grub_uint8_t *) &bp->server_ip)[3]);
|
||||
grub_print_error ();
|
||||
}
|
||||
if (size > OFFSET_OF (server_name, bp)
|
||||
@@ -375,7 +368,6 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)),
|
||||
|
||||
if (grub_strcmp (args[3], "string") == 0)
|
||||
{
|
||||
grub_err_t err = GRUB_ERR_NONE;
|
||||
char *val = grub_malloc (taglength + 1);
|
||||
if (!val)
|
||||
return grub_errno;
|
||||
@@ -384,9 +376,8 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)),
|
||||
if (args[0][0] == '-' && args[0][1] == 0)
|
||||
grub_printf ("%s\n", val);
|
||||
else
|
||||
err = grub_env_set (args[0], val);
|
||||
grub_free (val);
|
||||
return err;
|
||||
return grub_env_set (args[0], val);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[3], "number") == 0)
|
||||
@@ -408,7 +399,6 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)),
|
||||
|
||||
if (grub_strcmp (args[3], "hex") == 0)
|
||||
{
|
||||
grub_err_t err = GRUB_ERR_NONE;
|
||||
char *val = grub_malloc (2 * taglength + 1);
|
||||
int i;
|
||||
if (!val)
|
||||
@@ -422,9 +412,8 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)),
|
||||
if (args[0][0] == '-' && args[0][1] == 0)
|
||||
grub_printf ("%s\n", val);
|
||||
else
|
||||
err = grub_env_set (args[0], val);
|
||||
grub_free (val);
|
||||
return err;
|
||||
return grub_env_set (args[0], val);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
|
||||
@@ -238,15 +238,6 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)),
|
||||
char *redirect_save = NULL;
|
||||
grub_uint32_t ttl_all = ~0U;
|
||||
|
||||
/* Code apparently assumed that only one packet is received as response.
|
||||
We may get multiple responses due to network condition, so check here
|
||||
and quit early. */
|
||||
if (*data->addresses)
|
||||
{
|
||||
grub_netbuff_free (nb);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
head = (struct dns_header *) nb->data;
|
||||
ptr = (grub_uint8_t *) (head + 1);
|
||||
if (ptr >= nb->tail)
|
||||
|
||||
@@ -85,30 +85,24 @@ get_card_packet (struct grub_net_card *dev)
|
||||
grub_uint64_t start_time;
|
||||
struct grub_net_buff *nb;
|
||||
|
||||
start_time = grub_get_time_ms ();
|
||||
do
|
||||
rc = grub_ieee1275_read (data->handle, dev->rcvbuf, dev->rcvbufsize, &actual);
|
||||
while ((actual <= 0 || rc < 0) && (grub_get_time_ms () - start_time < 200));
|
||||
|
||||
if (actual <= 0)
|
||||
return NULL;
|
||||
|
||||
nb = grub_netbuff_alloc (actual + 2);
|
||||
nb = grub_netbuff_alloc (dev->mtu + 64 + 2);
|
||||
if (!nb)
|
||||
return NULL;
|
||||
/* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible
|
||||
by 4. So that IP header is aligned on 4 bytes. */
|
||||
grub_netbuff_reserve (nb, 2);
|
||||
|
||||
grub_memcpy (nb->data, dev->rcvbuf, actual);
|
||||
|
||||
if (grub_netbuff_put (nb, actual))
|
||||
start_time = grub_get_time_ms ();
|
||||
do
|
||||
rc = grub_ieee1275_read (data->handle, nb->data, dev->mtu + 64, &actual);
|
||||
while ((actual <= 0 || rc < 0) && (grub_get_time_ms () - start_time < 200));
|
||||
if (actual > 0)
|
||||
{
|
||||
grub_netbuff_free (nb);
|
||||
return NULL;
|
||||
grub_netbuff_put (nb, actual);
|
||||
return nb;
|
||||
}
|
||||
|
||||
return nb;
|
||||
grub_netbuff_free (nb);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct grub_net_card_driver ofdriver =
|
||||
@@ -157,7 +151,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath,
|
||||
grub_net_network_level_address_t client_addr, gateway_addr, subnet_mask;
|
||||
grub_net_link_level_address_t hw_addr;
|
||||
grub_net_interface_flags_t flags = 0;
|
||||
struct grub_net_network_level_interface *inter = NULL;
|
||||
struct grub_net_network_level_interface *inter;
|
||||
|
||||
hw_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET;
|
||||
|
||||
@@ -227,7 +221,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath,
|
||||
target.ipv4.masksize = 0;
|
||||
rname = grub_xasprintf ("%s:default", ((*card)->name));
|
||||
if (rname)
|
||||
grub_net_add_route_gw (rname, target, gateway_addr, inter);
|
||||
grub_net_add_route_gw (rname, target, gateway_addr);
|
||||
else
|
||||
return grub_errno;
|
||||
}
|
||||
@@ -300,91 +294,6 @@ grub_ieee1275_net_config_real (const char *devpath, char **device, char **path,
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate memory with alloc-mem */
|
||||
static void *
|
||||
grub_ieee1275_alloc_mem (grub_size_t len)
|
||||
{
|
||||
struct alloc_args
|
||||
{
|
||||
struct grub_ieee1275_common_hdr common;
|
||||
grub_ieee1275_cell_t method;
|
||||
grub_ieee1275_cell_t len;
|
||||
grub_ieee1275_cell_t catch;
|
||||
grub_ieee1275_cell_t result;
|
||||
}
|
||||
args;
|
||||
|
||||
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET))
|
||||
{
|
||||
grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("interpret is not supported"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "interpret", 2, 2);
|
||||
args.len = len;
|
||||
args.method = (grub_ieee1275_cell_t) "alloc-mem";
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1 || args.catch)
|
||||
{
|
||||
grub_error (GRUB_ERR_INVALID_COMMAND, N_("alloc-mem failed"));
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
return (void *)args.result;
|
||||
}
|
||||
|
||||
/* Free memory allocated by alloc-mem */
|
||||
static grub_err_t
|
||||
grub_ieee1275_free_mem (void *addr, grub_size_t len)
|
||||
{
|
||||
struct free_args
|
||||
{
|
||||
struct grub_ieee1275_common_hdr common;
|
||||
grub_ieee1275_cell_t method;
|
||||
grub_ieee1275_cell_t len;
|
||||
grub_ieee1275_cell_t addr;
|
||||
grub_ieee1275_cell_t catch;
|
||||
}
|
||||
args;
|
||||
|
||||
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET))
|
||||
{
|
||||
grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("interpret is not supported"));
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "interpret", 3, 1);
|
||||
args.addr = (grub_ieee1275_cell_t)addr;
|
||||
args.len = len;
|
||||
args.method = (grub_ieee1275_cell_t) "free-mem";
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN(&args) == -1 || args.catch)
|
||||
{
|
||||
grub_error (GRUB_ERR_INVALID_COMMAND, N_("free-mem failed"));
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static void *
|
||||
ofnet_alloc_netbuf (grub_size_t len)
|
||||
{
|
||||
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN))
|
||||
return grub_ieee1275_alloc_mem (len);
|
||||
else
|
||||
return grub_zalloc (len);
|
||||
}
|
||||
|
||||
static void
|
||||
ofnet_free_netbuf (void *addr, grub_size_t len)
|
||||
{
|
||||
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN))
|
||||
grub_ieee1275_free_mem (addr, len);
|
||||
else
|
||||
grub_free (addr);
|
||||
}
|
||||
|
||||
static int
|
||||
search_net_devices (struct grub_ieee1275_devalias *alias)
|
||||
{
|
||||
@@ -500,19 +409,40 @@ search_net_devices (struct grub_ieee1275_devalias *alias)
|
||||
card->default_address = lla;
|
||||
|
||||
card->txbufsize = ALIGN_UP (card->mtu, 64) + 256;
|
||||
card->rcvbufsize = ALIGN_UP (card->mtu, 64) + 256;
|
||||
|
||||
card->txbuf = ofnet_alloc_netbuf (card->txbufsize);
|
||||
if (!card->txbuf)
|
||||
goto fail_netbuf;
|
||||
|
||||
card->rcvbuf = ofnet_alloc_netbuf (card->rcvbufsize);
|
||||
if (!card->rcvbuf)
|
||||
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN))
|
||||
{
|
||||
grub_error_push ();
|
||||
ofnet_free_netbuf (card->txbuf, card->txbufsize);
|
||||
grub_error_pop ();
|
||||
goto fail_netbuf;
|
||||
struct alloc_args
|
||||
{
|
||||
struct grub_ieee1275_common_hdr common;
|
||||
grub_ieee1275_cell_t method;
|
||||
grub_ieee1275_cell_t len;
|
||||
grub_ieee1275_cell_t catch;
|
||||
grub_ieee1275_cell_t result;
|
||||
}
|
||||
args;
|
||||
INIT_IEEE1275_COMMON (&args.common, "interpret", 2, 2);
|
||||
args.len = card->txbufsize;
|
||||
args.method = (grub_ieee1275_cell_t) "alloc-mem";
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1
|
||||
|| args.catch)
|
||||
{
|
||||
card->txbuf = 0;
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
|
||||
}
|
||||
else
|
||||
card->txbuf = (void *) args.result;
|
||||
}
|
||||
else
|
||||
card->txbuf = grub_zalloc (card->txbufsize);
|
||||
if (!card->txbuf)
|
||||
{
|
||||
grub_free (ofdata->path);
|
||||
grub_free (ofdata);
|
||||
grub_free (card);
|
||||
grub_print_error ();
|
||||
return 0;
|
||||
}
|
||||
card->driver = NULL;
|
||||
card->data = ofdata;
|
||||
@@ -525,13 +455,6 @@ search_net_devices (struct grub_ieee1275_devalias *alias)
|
||||
card->driver = &ofdriver;
|
||||
grub_net_card_register (card);
|
||||
return 0;
|
||||
|
||||
fail_netbuf:
|
||||
grub_free (ofdata->path);
|
||||
grub_free (ofdata);
|
||||
grub_free (card);
|
||||
grub_print_error ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -381,8 +381,9 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial)
|
||||
ptr = nb->tail;
|
||||
grub_snprintf ((char *) ptr,
|
||||
sizeof ("Range: bytes=XXXXXXXXXXXXXXXXXXXX-"
|
||||
"\r\n"
|
||||
"\r\n"),
|
||||
"Range: bytes=%" PRIuGRUB_UINT64_T "-\r\n",
|
||||
"Range: bytes=%" PRIuGRUB_UINT64_T "-\r\n\r\n",
|
||||
offset);
|
||||
grub_netbuff_put (nb, grub_strlen ((char *) ptr));
|
||||
}
|
||||
@@ -449,7 +450,6 @@ http_seek (struct grub_file *file, grub_off_t off)
|
||||
}
|
||||
|
||||
file->device->net->stall = 0;
|
||||
file->device->net->eof = 0;
|
||||
file->device->net->offset = off;
|
||||
|
||||
data = grub_zalloc (sizeof (*data));
|
||||
|
||||
@@ -115,7 +115,6 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb,
|
||||
grub_uint8_t ttl)
|
||||
{
|
||||
struct icmp_header *icmph;
|
||||
struct grub_net_network_level_interface *orig_inf = inf;
|
||||
grub_err_t err;
|
||||
grub_uint16_t checksum;
|
||||
|
||||
@@ -346,31 +345,14 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb,
|
||||
{
|
||||
grub_uint8_t *ptr;
|
||||
struct option_header *ohdr;
|
||||
struct router_adv *radv;
|
||||
struct grub_net_network_level_interface *route_inf = NULL;
|
||||
int default_route = 0;
|
||||
if (icmph->code)
|
||||
break;
|
||||
radv = (struct router_adv *)nb->data;
|
||||
err = grub_netbuff_pull (nb, sizeof (struct router_adv));
|
||||
if (err)
|
||||
{
|
||||
grub_netbuff_free (nb);
|
||||
return err;
|
||||
}
|
||||
if (grub_be_to_cpu16 (radv->router_lifetime) > 0)
|
||||
{
|
||||
struct grub_net_route *route;
|
||||
|
||||
FOR_NET_ROUTES (route)
|
||||
{
|
||||
if (!grub_memcmp (&route->gw, source, sizeof (route->gw)))
|
||||
break;
|
||||
}
|
||||
if (route == NULL)
|
||||
default_route = 1;
|
||||
}
|
||||
|
||||
for (ptr = (grub_uint8_t *) nb->data; ptr < nb->tail;
|
||||
ptr += ohdr->len * 8)
|
||||
{
|
||||
@@ -431,11 +413,7 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb,
|
||||
/* Update lease time if needed here once we have
|
||||
lease times. */
|
||||
if (inf)
|
||||
{
|
||||
if (!route_inf)
|
||||
route_inf = inf;
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
|
||||
grub_dprintf ("net", "creating slaac\n");
|
||||
|
||||
@@ -451,51 +429,12 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb,
|
||||
inf = grub_net_add_addr (name,
|
||||
card, &addr,
|
||||
&slaac->address, 0);
|
||||
if (!route_inf)
|
||||
route_inf = inf;
|
||||
grub_net_add_route (name, netaddr, inf);
|
||||
grub_free (name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (default_route)
|
||||
{
|
||||
char *name;
|
||||
grub_net_network_level_netaddress_t netaddr;
|
||||
name = grub_xasprintf ("%s:ra:default6", card->name);
|
||||
if (!name)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
goto next;
|
||||
}
|
||||
/* Default routes take alll of the traffic, so make the mask huge */
|
||||
netaddr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6;
|
||||
netaddr.ipv6.masksize = 0;
|
||||
netaddr.ipv6.base[0] = 0;
|
||||
netaddr.ipv6.base[1] = 0;
|
||||
|
||||
/* May not have gotten slaac info, find a global address on this
|
||||
card. */
|
||||
if (route_inf == NULL)
|
||||
{
|
||||
FOR_NET_NETWORK_LEVEL_INTERFACES (inf)
|
||||
{
|
||||
if (inf->card == card && inf != orig_inf
|
||||
&& inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6
|
||||
&& grub_net_hwaddr_cmp(&inf->hwaddress,
|
||||
&orig_inf->hwaddress) == 0)
|
||||
{
|
||||
route_inf = inf;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (route_inf != NULL)
|
||||
grub_net_add_route_gw (name, netaddr, *source, route_inf);
|
||||
grub_free (name);
|
||||
}
|
||||
next:
|
||||
if (ptr != nb->tail)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -363,9 +363,7 @@ static void
|
||||
free_old_fragments (void)
|
||||
{
|
||||
struct reassemble *rsm, **prev;
|
||||
grub_uint64_t limit_time = grub_get_time_ms ();
|
||||
|
||||
limit_time = (limit_time > 90000) ? limit_time - 90000 : 0;
|
||||
grub_uint64_t limit_time = grub_get_time_ms () - 90000;
|
||||
|
||||
for (prev = &reassembles, rsm = *prev; rsm; rsm = *prev)
|
||||
if (rsm->last_time < limit_time)
|
||||
|
||||
@@ -37,6 +37,21 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
char *grub_net_default_server;
|
||||
|
||||
struct grub_net_route
|
||||
{
|
||||
struct grub_net_route *next;
|
||||
struct grub_net_route **prev;
|
||||
grub_net_network_level_netaddress_t target;
|
||||
char *name;
|
||||
struct grub_net_network_level_protocol *prot;
|
||||
int is_gateway;
|
||||
union
|
||||
{
|
||||
struct grub_net_network_level_interface *interface;
|
||||
grub_net_network_level_address_t gw;
|
||||
};
|
||||
};
|
||||
|
||||
struct grub_net_route *grub_net_routes = NULL;
|
||||
struct grub_net_network_level_interface *grub_net_network_level_interfaces = NULL;
|
||||
struct grub_net_card *grub_net_cards = NULL;
|
||||
@@ -395,6 +410,14 @@ grub_cmd_ipv6_autoconf (struct grub_command *cmd __attribute__ ((unused)),
|
||||
return err;
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_net_route_register (struct grub_net_route *route)
|
||||
{
|
||||
grub_list_push (GRUB_AS_LIST_P (&grub_net_routes),
|
||||
GRUB_AS_LIST (route));
|
||||
}
|
||||
|
||||
#define FOR_NET_ROUTES(var) for (var = grub_net_routes; var; var = var->next)
|
||||
|
||||
static int
|
||||
parse_ip (const char *val, grub_uint32_t *ip, const char **rest)
|
||||
@@ -501,8 +524,6 @@ match_net (const grub_net_network_level_netaddress_t *net,
|
||||
case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6:
|
||||
{
|
||||
grub_uint64_t mask[2];
|
||||
if (net->ipv6.masksize == 0)
|
||||
return 1;
|
||||
if (net->ipv6.masksize <= 64)
|
||||
{
|
||||
mask[0] = 0xffffffffffffffffULL << (64 - net->ipv6.masksize);
|
||||
@@ -666,14 +687,7 @@ grub_net_route_address (grub_net_network_level_address_t addr,
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
if (depth == 0)
|
||||
{
|
||||
*gateway = bestroute->gw;
|
||||
if (bestroute->interface != NULL)
|
||||
{
|
||||
*interf = bestroute->interface;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
}
|
||||
*gateway = bestroute->gw;
|
||||
curtarget = bestroute->gw;
|
||||
}
|
||||
|
||||
@@ -1095,8 +1109,7 @@ grub_net_add_route (const char *name,
|
||||
grub_err_t
|
||||
grub_net_add_route_gw (const char *name,
|
||||
grub_net_network_level_netaddress_t target,
|
||||
grub_net_network_level_address_t gw,
|
||||
struct grub_net_network_level_interface *inter)
|
||||
grub_net_network_level_address_t gw)
|
||||
{
|
||||
struct grub_net_route *route;
|
||||
|
||||
@@ -1114,7 +1127,6 @@ grub_net_add_route_gw (const char *name,
|
||||
route->target = target;
|
||||
route->is_gateway = 1;
|
||||
route->gw = gw;
|
||||
route->interface = inter;
|
||||
|
||||
grub_net_route_register (route);
|
||||
|
||||
@@ -1140,7 +1152,7 @@ grub_cmd_addroute (struct grub_command *cmd __attribute__ ((unused)),
|
||||
err = grub_net_resolve_address (args[3], &gw);
|
||||
if (err)
|
||||
return err;
|
||||
return grub_net_add_route_gw (args[0], target, gw, NULL);
|
||||
return grub_net_add_route_gw (args[0], target, gw);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1346,15 +1358,6 @@ grub_net_open_real (const char *name)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (grub_strncmp (prefdev, "pxe", sizeof ("pxe") - 1) == 0 &&
|
||||
(!prefdev[sizeof ("pxe") - 1] || (prefdev[sizeof("pxe") - 1] == ':')))
|
||||
{
|
||||
grub_free (prefdev);
|
||||
prefdev = grub_strdup ("tftp");
|
||||
if (!prefdev)
|
||||
continue;
|
||||
}
|
||||
|
||||
comma = grub_strchr (prefdev, ',');
|
||||
if (comma)
|
||||
*comma = '\0';
|
||||
@@ -1681,7 +1684,6 @@ grub_net_seek_real (struct grub_file *file, grub_off_t offset)
|
||||
file->device->net->packs.last = NULL;
|
||||
file->device->net->offset = 0;
|
||||
file->device->net->eof = 0;
|
||||
file->device->net->stall = 0;
|
||||
err = file->device->net->protocol->open (file, file->device->net->name);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1144,16 +1144,6 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical,
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
is_visible (const struct grub_unicode_glyph *gl)
|
||||
{
|
||||
if (gl->ncomb)
|
||||
return 1;
|
||||
if (gl->base == GRUB_UNICODE_LRM || gl->base == GRUB_UNICODE_RLM)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
grub_ssize_t
|
||||
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
|
||||
grub_size_t logical_len,
|
||||
@@ -1174,7 +1164,6 @@ grub_bidi_logical_to_visual (const grub_uint32_t *logical,
|
||||
if (ptr == logical + logical_len || *ptr == '\n')
|
||||
{
|
||||
grub_ssize_t ret;
|
||||
grub_ssize_t i, j;
|
||||
ret = grub_bidi_line_logical_to_visual (line_start,
|
||||
ptr - line_start,
|
||||
visual_ptr,
|
||||
@@ -1193,10 +1182,7 @@ grub_bidi_logical_to_visual (const grub_uint32_t *logical,
|
||||
grub_free (*visual_out);
|
||||
return ret;
|
||||
}
|
||||
for (i = 0, j = 0; i < ret; i++)
|
||||
if (is_visible(&visual_ptr[i]))
|
||||
visual_ptr[j++] = visual_ptr[i];
|
||||
visual_ptr += j;
|
||||
visual_ptr += ret;
|
||||
line_start = ptr;
|
||||
if (ptr != logical + logical_len)
|
||||
{
|
||||
|
||||
@@ -254,8 +254,6 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
|
||||
mode = ALL_LINES;
|
||||
}
|
||||
|
||||
grub_term_setcursor (term_screen->term, 0);
|
||||
|
||||
if (mode != NO_LINE)
|
||||
{
|
||||
/* Draw lines. This code is tricky, because this must calculate logical
|
||||
@@ -363,8 +361,6 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
|
||||
|
||||
}
|
||||
|
||||
grub_term_setcursor (term_screen->term, 1);
|
||||
|
||||
grub_term_refresh (term_screen->term);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +40,6 @@
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#if defined(MAJOR_IN_MKDEV)
|
||||
#include <sys/mkdev.h>
|
||||
#elif defined(MAJOR_IN_SYSMACROS)
|
||||
#include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
#include <libdevmapper.h>
|
||||
|
||||
#include <grub/types.h>
|
||||
@@ -143,7 +137,7 @@ grub_util_get_dm_abstraction (const char *os_dev)
|
||||
grub_free (uuid);
|
||||
return GRUB_DEV_ABSTRACTION_LVM;
|
||||
}
|
||||
if (strncmp (uuid, "CRYPT-LUKS1-", 12) == 0)
|
||||
if (strncmp (uuid, "CRYPT-LUKS1-", 4) == 0)
|
||||
{
|
||||
grub_free (uuid);
|
||||
return GRUB_DEV_ABSTRACTION_LUKS;
|
||||
|
||||
@@ -24,11 +24,6 @@
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
#if defined(MAJOR_IN_MKDEV)
|
||||
#include <sys/mkdev.h>
|
||||
#elif defined(MAJOR_IN_SYSMACROS)
|
||||
#include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DEVICE_MAPPER
|
||||
# include <libdevmapper.h>
|
||||
|
||||
@@ -35,12 +35,6 @@
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#if defined(MAJOR_IN_MKDEV)
|
||||
#include <sys/mkdev.h>
|
||||
#elif defined(MAJOR_IN_SYSMACROS)
|
||||
#include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <sys/ioctl.h> /* ioctl */
|
||||
#include <sys/mount.h>
|
||||
@@ -380,30 +374,24 @@ get_btrfs_fs_prefix (const char *mount_path)
|
||||
char **
|
||||
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
FILE *fp;
|
||||
char *buf = NULL;
|
||||
size_t len = 0;
|
||||
grub_size_t entry_len, entry_max = 4;
|
||||
grub_size_t entry_len = 0, entry_max = 4;
|
||||
struct mountinfo_entry *entries;
|
||||
struct mountinfo_entry parent_entry = { 0, 0, 0, "", "", "", "" };
|
||||
int i;
|
||||
int retry = 0;
|
||||
int dir_fd = -1;
|
||||
char **ret = NULL;
|
||||
|
||||
if (! *dir)
|
||||
dir = "/";
|
||||
if (relroot)
|
||||
*relroot = NULL;
|
||||
|
||||
entries = xmalloc (entry_max * sizeof (*entries));
|
||||
|
||||
again:
|
||||
fp = grub_util_fopen ("/proc/self/mountinfo", "r");
|
||||
if (! fp)
|
||||
goto out; /* fall through to other methods */
|
||||
return NULL; /* fall through to other methods */
|
||||
|
||||
entry_len = 0;
|
||||
entries = xmalloc (entry_max * sizeof (*entries));
|
||||
|
||||
/* First, build a list of relevant visible mounts. */
|
||||
while (getline (&buf, &len, fp) > 0)
|
||||
@@ -490,6 +478,7 @@ again:
|
||||
/* Now scan visible mounts for the ones we're interested in. */
|
||||
for (i = entry_len - 1; i >= 0; i--)
|
||||
{
|
||||
char **ret = NULL;
|
||||
char *fs_prefix = NULL;
|
||||
if (!*entries[i].device)
|
||||
continue;
|
||||
@@ -520,23 +509,6 @@ again:
|
||||
ret = grub_find_root_devices_from_btrfs (dir);
|
||||
fs_prefix = get_btrfs_fs_prefix (entries[i].enc_path);
|
||||
}
|
||||
else if (!retry && grub_strcmp (entries[i].fstype, "autofs") == 0)
|
||||
{
|
||||
/* If the best match is automounted, try to trigger mount. We cannot
|
||||
simply return here because stat() on automounted directory does not
|
||||
trigger mount and returns bogus (pseudo)device number instead.
|
||||
We keep mountpoint open until end of scan to prevent timeout. */
|
||||
|
||||
int flags = O_RDONLY|O_DIRECTORY;
|
||||
|
||||
fclose (fp);
|
||||
#ifdef O_LARGEFILE
|
||||
flags |= O_LARGEFILE;
|
||||
#endif
|
||||
dir_fd = open (entries[i].enc_path, flags);
|
||||
retry = 1;
|
||||
goto again;
|
||||
}
|
||||
if (!ret)
|
||||
{
|
||||
ret = xmalloc (2 * sizeof (ret[0]));
|
||||
@@ -566,17 +538,16 @@ again:
|
||||
}
|
||||
if (fs_prefix != entries[i].enc_root)
|
||||
free (fs_prefix);
|
||||
break;
|
||||
free (buf);
|
||||
free (entries);
|
||||
fclose (fp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
out:
|
||||
free (buf);
|
||||
free (entries);
|
||||
if (fp)
|
||||
fclose (fp);
|
||||
if (dir_fd != -1)
|
||||
close (dir_fd);
|
||||
return ret;
|
||||
fclose (fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
||||
@@ -51,10 +51,8 @@
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#if defined(MAJOR_IN_MKDEV)
|
||||
#if defined(HAVE_SYS_MKDEV_H)
|
||||
#include <sys/mkdev.h>
|
||||
#elif defined(MAJOR_IN_SYSMACROS)
|
||||
#include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
|
||||
|
||||
117
grub-core/term/arm/cros.c
Normal file
117
grub-core/term/arm/cros.c
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
*
|
||||
* Copyright (C) 2012 Google Inc.
|
||||
* Copyright (C) 2016 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/ps2.h>
|
||||
#include <grub/fdtbus.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/machine/kernel.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/fdtbus.h>
|
||||
#include <grub/arm/cros_ec.h>
|
||||
|
||||
struct grub_ps2_state ps2_state;
|
||||
|
||||
struct grub_cros_ec_keyscan old_scan;
|
||||
|
||||
static grub_uint8_t map_code[GRUB_CROS_EC_KEYSCAN_COLS][GRUB_CROS_EC_KEYSCAN_ROWS];
|
||||
|
||||
static grub_uint8_t e0_translate[16] =
|
||||
{
|
||||
0x1c, 0x1d, 0x35, 0x00,
|
||||
0x38, 0x00, 0x47, 0x48,
|
||||
0x49, 0x4b, 0x4d, 0x4f,
|
||||
0x50, 0x51, 0x52, 0x53,
|
||||
};
|
||||
|
||||
/* If there is a character pending, return it;
|
||||
otherwise return GRUB_TERM_NO_KEY. */
|
||||
static int
|
||||
grub_cros_keyboard_getkey (struct grub_term_input *term __attribute__ ((unused)))
|
||||
{
|
||||
struct grub_cros_ec_keyscan scan;
|
||||
int i, j;
|
||||
if (grub_cros_ec_scan_keyboard(&scan) < 0)
|
||||
return GRUB_TERM_NO_KEY;
|
||||
for (i = 0; i < GRUB_CROS_EC_KEYSCAN_COLS; i++)
|
||||
if (scan.data[i] ^ old_scan.data[i])
|
||||
for (j = 0; j < GRUB_CROS_EC_KEYSCAN_ROWS; j++)
|
||||
if ((scan.data[i] ^ old_scan.data[i]) & (1 << j))
|
||||
{
|
||||
grub_uint8_t code = map_code[i][j];
|
||||
int ret;
|
||||
grub_uint8_t brk = 0;
|
||||
if (!(scan.data[i] & (1 << j)))
|
||||
brk = 0x80;
|
||||
grub_dprintf ("cros_keyboard", "key <%d, %d> code %x\n", i, j, code);
|
||||
if (code < 0x60)
|
||||
ret = grub_ps2_process_incoming_byte (&ps2_state, code | brk);
|
||||
else if (code >= 0x60 && code < 0x70 && e0_translate[code - 0x60])
|
||||
{
|
||||
grub_ps2_process_incoming_byte (&ps2_state, 0xe0);
|
||||
ret = grub_ps2_process_incoming_byte (&ps2_state, e0_translate[code - 0x60] | brk);
|
||||
}
|
||||
else
|
||||
ret = GRUB_TERM_NO_KEY;
|
||||
old_scan.data[i] ^= (1 << j);
|
||||
if (ret != GRUB_TERM_NO_KEY)
|
||||
return ret;
|
||||
}
|
||||
return GRUB_TERM_NO_KEY;
|
||||
}
|
||||
|
||||
static struct grub_term_input grub_cros_keyboard_term =
|
||||
{
|
||||
.name = "cros_keyboard",
|
||||
.getkey = grub_cros_keyboard_getkey
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
cros_attach(const struct grub_fdtbus_dev *dev __attribute__ ((unused)))
|
||||
{
|
||||
grub_size_t keymap_size, i;
|
||||
const grub_uint8_t *keymap = grub_fdtbus_get_prop (dev, "linux,keymap", &keymap_size);
|
||||
|
||||
if (keymap)
|
||||
{
|
||||
for (i = 0; i + 3 < keymap_size; i += 4)
|
||||
if (keymap[i+1] < GRUB_CROS_EC_KEYSCAN_COLS && keymap[i] < GRUB_CROS_EC_KEYSCAN_ROWS
|
||||
&& keymap[i+2] == 0 && keymap[i+3] < 0x80)
|
||||
map_code[keymap[i+1]][keymap[i]] = keymap[i+3];
|
||||
}
|
||||
|
||||
ps2_state.current_set = 1;
|
||||
ps2_state.at_keyboard_status = 0;
|
||||
grub_term_register_input ("cros_keyboard", &grub_cros_keyboard_term);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
struct grub_fdtbus_driver cros =
|
||||
{
|
||||
.compatible = "google,cros-ec-keyb",
|
||||
.attach = cros_attach
|
||||
};
|
||||
|
||||
void
|
||||
grub_cros_init (void)
|
||||
{
|
||||
grub_fdtbus_register (&cros);
|
||||
}
|
||||
270
grub-core/term/arm/cros_ec.c
Normal file
270
grub-core/term/arm/cros_ec.c
Normal file
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
*
|
||||
* Copyright (C) 2012 Google Inc.
|
||||
* Copyright (C) 2016 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/mm.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/arm/cros_ec.h>
|
||||
|
||||
static grub_uint64_t
|
||||
grub_get_time_us (void)
|
||||
{
|
||||
return 1000 * grub_get_time_ms();
|
||||
}
|
||||
|
||||
static void
|
||||
grub_microsleep (grub_uint64_t len)
|
||||
{
|
||||
grub_uint64_t end_time = grub_get_time_us () + len;
|
||||
while (grub_get_time_us () < end_time)
|
||||
grub_cpu_idle ();
|
||||
}
|
||||
|
||||
volatile grub_uint32_t *spi = (volatile grub_uint32_t *) 0xff110000;
|
||||
|
||||
static int
|
||||
spi_send (const void *data, grub_size_t sz)
|
||||
{
|
||||
const grub_uint8_t *ptr = data, *end = ptr + sz;
|
||||
spi[2] = 0;
|
||||
spi[1] = sz - 1;
|
||||
spi[0] = ((1 << 18) | spi[0]) & ~(1 << 19);
|
||||
spi[2] = 1;
|
||||
while (ptr < end)
|
||||
{
|
||||
while (spi[9] & 2);
|
||||
spi[256] = *ptr++;
|
||||
}
|
||||
while (spi[9] & 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spi_read (void *data, grub_size_t sz)
|
||||
{
|
||||
grub_uint8_t *ptr = data, *end = ptr + sz;
|
||||
spi[2] = 0;
|
||||
spi[1] = sz - 1;
|
||||
spi[0] = ((1 << 19) | spi[0]) & ~(1 << 18);
|
||||
spi[2] = 1;
|
||||
while (ptr < end)
|
||||
{
|
||||
while (spi[9] & 8);
|
||||
*ptr++ = spi[512];
|
||||
}
|
||||
while (spi[9] & 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spi_start (void)
|
||||
{
|
||||
spi[3] = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
spi_stop (void)
|
||||
{
|
||||
spi[3] = 0;
|
||||
}
|
||||
|
||||
#define uint8_t grub_uint8_t
|
||||
#define uint16_t grub_uint16_t
|
||||
#define uint32_t grub_uint32_t
|
||||
#define uint64_t grub_uint64_t
|
||||
#define mdelay grub_millisleep
|
||||
#define memcpy grub_memcpy
|
||||
|
||||
static const uint64_t FramingTimeoutUs = 300 * 1000;
|
||||
|
||||
static const uint8_t EcFramingByte = 0xec;
|
||||
|
||||
#define EC_CMD_MKBP_STATE 0x60
|
||||
#define EC_CMD_VERSION0 0xdc
|
||||
|
||||
static uint64_t last_transfer;
|
||||
|
||||
static void stop_bus(void)
|
||||
{
|
||||
spi_stop();
|
||||
last_transfer = grub_get_time_us();
|
||||
}
|
||||
|
||||
static int wait_for_frame(void)
|
||||
{
|
||||
uint64_t start = grub_get_time_us();
|
||||
uint8_t byte;
|
||||
do {
|
||||
if (spi_read(&byte, 1))
|
||||
return -1;
|
||||
if (byte != EcFramingByte &&
|
||||
grub_get_time_us() - start > FramingTimeoutUs) {
|
||||
grub_dprintf("cros", "Timeout waiting for framing byte.\n");
|
||||
return -1;
|
||||
}
|
||||
} while (byte != EcFramingByte);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate a simple 8-bit checksum of a data block
|
||||
*
|
||||
* @param data Data block to checksum
|
||||
* @param size Size of data block in bytes
|
||||
* @return checksum value (0 to 255)
|
||||
*/
|
||||
static uint8_t cros_ec_calc_checksum(const void *data, int size)
|
||||
{
|
||||
uint8_t csum;
|
||||
const uint8_t *bytes = data;
|
||||
int i;
|
||||
|
||||
for (i = csum = 0; i < size; i++)
|
||||
csum += bytes[i];
|
||||
return csum & 0xff;
|
||||
}
|
||||
|
||||
enum {
|
||||
// response, arglen
|
||||
CROS_EC_SPI_IN_HDR_SIZE = 2,
|
||||
// version, cmd, arglen
|
||||
CROS_EC_SPI_OUT_HDR_SIZE = 3
|
||||
};
|
||||
|
||||
static grub_uint8_t busbuf[256];
|
||||
#define MSG_BYTES ((int)sizeof (busbuf))
|
||||
|
||||
static int ec_command(int cmd, int cmd_version,
|
||||
const void *dout, int dout_len,
|
||||
void *din, int din_len)
|
||||
{
|
||||
uint8_t *bytes;
|
||||
|
||||
// Header + data + checksum.
|
||||
uint32_t out_bytes = CROS_EC_SPI_OUT_HDR_SIZE + dout_len + 1;
|
||||
uint32_t in_bytes = CROS_EC_SPI_IN_HDR_SIZE + din_len + 1;
|
||||
|
||||
/*
|
||||
* Sanity-check I/O sizes given transaction overhead in internal
|
||||
* buffers.
|
||||
*/
|
||||
if (out_bytes > MSG_BYTES) {
|
||||
grub_dprintf("cros", "Cannot send %d bytes\n", dout_len);
|
||||
return -1;
|
||||
}
|
||||
if (in_bytes > MSG_BYTES) {
|
||||
grub_dprintf("cros", "Cannot receive %d bytes\n", din_len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Prepare the output.
|
||||
bytes = busbuf;
|
||||
*bytes++ = EC_CMD_VERSION0 + cmd_version;
|
||||
*bytes++ = cmd;
|
||||
*bytes++ = dout_len;
|
||||
memcpy(bytes, dout, dout_len);
|
||||
bytes += dout_len;
|
||||
|
||||
*bytes++ = cros_ec_calc_checksum(busbuf,
|
||||
CROS_EC_SPI_OUT_HDR_SIZE + dout_len);
|
||||
|
||||
while (grub_get_time_us() - last_transfer < 200)
|
||||
;
|
||||
|
||||
if (spi_start())
|
||||
return -1;
|
||||
|
||||
// Allow EC to ramp up clock after being awoken.
|
||||
// See chrome-os-partner:32223 for more details.
|
||||
grub_microsleep (100);
|
||||
|
||||
if (spi_send(busbuf, out_bytes)) {
|
||||
stop_bus();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Wait until the EC is ready.
|
||||
if (wait_for_frame()) {
|
||||
stop_bus();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Read the response code and the data length.
|
||||
bytes = busbuf;
|
||||
if (spi_read(bytes, 2)) {
|
||||
stop_bus();
|
||||
return -1;
|
||||
}
|
||||
uint8_t result = *bytes++;
|
||||
uint8_t length = *bytes++;
|
||||
|
||||
// Make sure there's enough room for the data.
|
||||
if (CROS_EC_SPI_IN_HDR_SIZE + length + 1 > MSG_BYTES) {
|
||||
grub_dprintf("cros", "Received length %#02x too large\n",
|
||||
length);
|
||||
stop_bus();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Read the data and the checksum, and finish up.
|
||||
if (spi_read(bytes, length + 1)) {
|
||||
stop_bus();
|
||||
return -1;
|
||||
}
|
||||
bytes += length;
|
||||
int expected = *bytes++;
|
||||
stop_bus();
|
||||
|
||||
// Check the integrity of the response.
|
||||
if (result != 0) {
|
||||
grub_dprintf("cros", "Received bad result code %d\n", result);
|
||||
return -result;
|
||||
}
|
||||
|
||||
int csum = cros_ec_calc_checksum(busbuf,
|
||||
CROS_EC_SPI_IN_HDR_SIZE + length);
|
||||
|
||||
if (csum != expected) {
|
||||
grub_dprintf("cros", "Invalid checksum rx %#02x, calced %#02x\n",
|
||||
expected, csum);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// If the caller wants the response, copy it out for them.
|
||||
if (length < din_len)
|
||||
din_len = length;
|
||||
if (din) {
|
||||
memcpy(din, (uint8_t *)busbuf + CROS_EC_SPI_IN_HDR_SIZE,
|
||||
din_len);
|
||||
}
|
||||
|
||||
return din_len;
|
||||
}
|
||||
|
||||
int
|
||||
grub_cros_ec_scan_keyboard(struct grub_cros_ec_keyscan *scan)
|
||||
{
|
||||
if (ec_command(EC_CMD_MKBP_STATE, 0, NULL, 0, scan,
|
||||
sizeof(*scan)) < (int)sizeof(*scan))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
189
grub-core/term/arm/pl050.c
Normal file
189
grub-core/term/arm/pl050.c
Normal file
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2007,2008,2009 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/ps2.h>
|
||||
#include <grub/fdtbus.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/machine/kernel.h>
|
||||
#include <grub/at_keyboard.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/ps2.h>
|
||||
#include <grub/fdtbus.h>
|
||||
|
||||
static volatile grub_uint32_t *pl050_regs;
|
||||
|
||||
struct grub_ps2_state ps2_state;
|
||||
|
||||
static void
|
||||
keyboard_controller_wait_until_ready (void)
|
||||
{
|
||||
while (! (pl050_regs[1] & 0x40));
|
||||
}
|
||||
|
||||
static grub_uint8_t
|
||||
wait_ack (void)
|
||||
{
|
||||
grub_uint64_t endtime;
|
||||
grub_uint8_t ack;
|
||||
|
||||
endtime = grub_get_time_ms () + 20;
|
||||
do
|
||||
ack = pl050_regs[2];
|
||||
while (ack != GRUB_AT_ACK && ack != GRUB_AT_NACK
|
||||
&& grub_get_time_ms () < endtime);
|
||||
return ack;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
write_mode (int mode)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < GRUB_AT_TRIES; i++)
|
||||
{
|
||||
grub_uint8_t ack;
|
||||
keyboard_controller_wait_until_ready ();
|
||||
pl050_regs[2] = 0xf0;
|
||||
keyboard_controller_wait_until_ready ();
|
||||
pl050_regs[2] = mode;
|
||||
keyboard_controller_wait_until_ready ();
|
||||
ack = wait_ack ();
|
||||
if (ack == GRUB_AT_NACK)
|
||||
continue;
|
||||
if (ack == GRUB_AT_ACK)
|
||||
break;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (i != GRUB_AT_TRIES);
|
||||
}
|
||||
|
||||
static int
|
||||
query_mode (void)
|
||||
{
|
||||
grub_uint8_t ret;
|
||||
int e;
|
||||
|
||||
e = write_mode (0);
|
||||
if (!e)
|
||||
return 0;
|
||||
|
||||
keyboard_controller_wait_until_ready ();
|
||||
|
||||
do
|
||||
ret = pl050_regs[2];
|
||||
while (ret == GRUB_AT_ACK);
|
||||
|
||||
/* QEMU translates the set even in no-translate mode. */
|
||||
if (ret == 0x43 || ret == 1)
|
||||
return 1;
|
||||
if (ret == 0x41 || ret == 2)
|
||||
return 2;
|
||||
if (ret == 0x3f || ret == 3)
|
||||
return 3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
set_scancodes (void)
|
||||
{
|
||||
write_mode (2);
|
||||
ps2_state.current_set = query_mode ();
|
||||
grub_dprintf ("atkeyb", "returned set %d\n", ps2_state.current_set);
|
||||
if (ps2_state.current_set == 2)
|
||||
return;
|
||||
|
||||
write_mode (1);
|
||||
ps2_state.current_set = query_mode ();
|
||||
grub_dprintf ("atkeyb", "returned set %d\n", ps2_state.current_set);
|
||||
if (ps2_state.current_set == 1)
|
||||
return;
|
||||
grub_dprintf ("atkeyb", "no supported scancode set found\n");
|
||||
}
|
||||
|
||||
static void
|
||||
keyboard_controller_led (grub_uint8_t leds)
|
||||
{
|
||||
keyboard_controller_wait_until_ready ();
|
||||
pl050_regs[2] = 0xed;
|
||||
keyboard_controller_wait_until_ready ();
|
||||
pl050_regs[2] = leds & 0x7;
|
||||
}
|
||||
|
||||
/* If there is a character pending, return it;
|
||||
otherwise return GRUB_TERM_NO_KEY. */
|
||||
static int
|
||||
grub_pl050_keyboard_getkey (struct grub_term_input *term __attribute__ ((unused)))
|
||||
{
|
||||
grub_uint8_t at_key;
|
||||
int ret;
|
||||
grub_uint8_t old_led;
|
||||
|
||||
if (!(pl050_regs[1] & 0x10))
|
||||
return -1;
|
||||
at_key = pl050_regs[2];
|
||||
old_led = ps2_state.led_status;
|
||||
|
||||
ret = grub_ps2_process_incoming_byte (&ps2_state, at_key);
|
||||
if (old_led != ps2_state.led_status)
|
||||
keyboard_controller_led (ps2_state.led_status);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct grub_term_input grub_pl050_keyboard_term =
|
||||
{
|
||||
.name = "pl050_keyboard",
|
||||
.getkey = grub_pl050_keyboard_getkey
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
pl050_attach(const struct grub_fdtbus_dev *dev)
|
||||
{
|
||||
const grub_uint32_t *reg;
|
||||
reg = grub_fdtbus_get_prop (dev, "reg", 0);
|
||||
|
||||
/* Mouse. Nothing to do. */
|
||||
if (grub_be_to_cpu32 (*reg) == 0x7000)
|
||||
return 0;
|
||||
|
||||
pl050_regs = grub_fdtbus_map_reg (dev, 0, 0);
|
||||
|
||||
if (!grub_fdtbus_is_mapping_valid (pl050_regs))
|
||||
return grub_error (GRUB_ERR_IO, "could not map pl050");
|
||||
|
||||
ps2_state.at_keyboard_status = 0;
|
||||
set_scancodes ();
|
||||
keyboard_controller_led (ps2_state.led_status);
|
||||
|
||||
grub_term_register_input ("pl050_keyboard", &grub_pl050_keyboard_term);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
struct grub_fdtbus_driver pl050 =
|
||||
{
|
||||
.compatible = "arm,pl050",
|
||||
.attach = pl050_attach
|
||||
};
|
||||
|
||||
void
|
||||
grub_pl050_init (void)
|
||||
{
|
||||
grub_fdtbus_register (&pl050);
|
||||
}
|
||||
@@ -22,212 +22,21 @@
|
||||
#include <grub/cpu/io.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/keyboard_layouts.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/loader.h>
|
||||
#include <grub/ps2.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static short at_keyboard_status = 0;
|
||||
static int e0_received = 0;
|
||||
static int f0_received = 0;
|
||||
|
||||
static grub_uint8_t led_status;
|
||||
|
||||
#define KEYBOARD_LED_SCROLL (1 << 0)
|
||||
#define KEYBOARD_LED_NUM (1 << 1)
|
||||
#define KEYBOARD_LED_CAPS (1 << 2)
|
||||
|
||||
static grub_uint8_t grub_keyboard_controller_orig;
|
||||
static grub_uint8_t grub_keyboard_orig_set;
|
||||
static grub_uint8_t current_set;
|
||||
struct grub_ps2_state ps2_state;
|
||||
|
||||
static int ping_sent;
|
||||
|
||||
static void
|
||||
grub_keyboard_controller_init (void);
|
||||
|
||||
static const grub_uint8_t set1_mapping[128] =
|
||||
{
|
||||
/* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE,
|
||||
/* 0x02 */ GRUB_KEYBOARD_KEY_1, GRUB_KEYBOARD_KEY_2,
|
||||
/* 0x04 */ GRUB_KEYBOARD_KEY_3, GRUB_KEYBOARD_KEY_4,
|
||||
/* 0x06 */ GRUB_KEYBOARD_KEY_5, GRUB_KEYBOARD_KEY_6,
|
||||
/* 0x08 */ GRUB_KEYBOARD_KEY_7, GRUB_KEYBOARD_KEY_8,
|
||||
/* 0x0a */ GRUB_KEYBOARD_KEY_9, GRUB_KEYBOARD_KEY_0,
|
||||
/* 0x0c */ GRUB_KEYBOARD_KEY_DASH, GRUB_KEYBOARD_KEY_EQUAL,
|
||||
/* 0x0e */ GRUB_KEYBOARD_KEY_BACKSPACE, GRUB_KEYBOARD_KEY_TAB,
|
||||
/* 0x10 */ GRUB_KEYBOARD_KEY_Q, GRUB_KEYBOARD_KEY_W,
|
||||
/* 0x12 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_R,
|
||||
/* 0x14 */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_Y,
|
||||
/* 0x16 */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_I,
|
||||
/* 0x18 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_P,
|
||||
/* 0x1a */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_RBRACKET,
|
||||
/* 0x1c */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_LEFT_CTRL,
|
||||
/* 0x1e */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_S,
|
||||
/* 0x20 */ GRUB_KEYBOARD_KEY_D, GRUB_KEYBOARD_KEY_F,
|
||||
/* 0x22 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_H,
|
||||
/* 0x24 */ GRUB_KEYBOARD_KEY_J, GRUB_KEYBOARD_KEY_K,
|
||||
/* 0x26 */ GRUB_KEYBOARD_KEY_L, GRUB_KEYBOARD_KEY_SEMICOLON,
|
||||
/* 0x28 */ GRUB_KEYBOARD_KEY_DQUOTE, GRUB_KEYBOARD_KEY_RQUOTE,
|
||||
/* 0x2a */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, GRUB_KEYBOARD_KEY_BACKSLASH,
|
||||
/* 0x2c */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_X,
|
||||
/* 0x2e */ GRUB_KEYBOARD_KEY_C, GRUB_KEYBOARD_KEY_V,
|
||||
/* 0x30 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_N,
|
||||
/* 0x32 */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_COMMA,
|
||||
/* 0x34 */ GRUB_KEYBOARD_KEY_DOT, GRUB_KEYBOARD_KEY_SLASH,
|
||||
/* 0x36 */ GRUB_KEYBOARD_KEY_RIGHT_SHIFT, GRUB_KEYBOARD_KEY_NUMMUL,
|
||||
/* 0x38 */ GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_SPACE,
|
||||
/* 0x3a */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_F1,
|
||||
/* 0x3c */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F3,
|
||||
/* 0x3e */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_F5,
|
||||
/* 0x40 */ GRUB_KEYBOARD_KEY_F6, GRUB_KEYBOARD_KEY_F7,
|
||||
/* 0x42 */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F9,
|
||||
/* 0x44 */ GRUB_KEYBOARD_KEY_F10, GRUB_KEYBOARD_KEY_NUM_LOCK,
|
||||
/* 0x46 */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, GRUB_KEYBOARD_KEY_NUM7,
|
||||
/* 0x48 */ GRUB_KEYBOARD_KEY_NUM8, GRUB_KEYBOARD_KEY_NUM9,
|
||||
/* 0x4a */ GRUB_KEYBOARD_KEY_NUMMINUS, GRUB_KEYBOARD_KEY_NUM4,
|
||||
/* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6,
|
||||
/* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1,
|
||||
/* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3,
|
||||
/* 0x52 */ GRUB_KEYBOARD_KEY_NUM0, GRUB_KEYBOARD_KEY_NUMDOT,
|
||||
/* 0x54 */ 0, 0,
|
||||
/* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11,
|
||||
/* 0x58 */ GRUB_KEYBOARD_KEY_F12, 0,
|
||||
/* 0x5a */ 0, 0,
|
||||
/* 0x5c */ 0, 0,
|
||||
/* 0x5e */ 0, 0,
|
||||
/* 0x60 */ 0, 0,
|
||||
/* 0x62 */ 0, 0,
|
||||
/* OLPC keys. Just mapped to normal keys. */
|
||||
/* 0x64 */ 0, GRUB_KEYBOARD_KEY_UP,
|
||||
/* 0x66 */ GRUB_KEYBOARD_KEY_DOWN, GRUB_KEYBOARD_KEY_LEFT,
|
||||
/* 0x68 */ GRUB_KEYBOARD_KEY_RIGHT, 0,
|
||||
/* 0x6a */ 0, 0,
|
||||
/* 0x6c */ 0, 0,
|
||||
/* 0x6e */ 0, 0,
|
||||
/* 0x70 */ 0, 0,
|
||||
/* 0x72 */ 0, GRUB_KEYBOARD_KEY_JP_RO,
|
||||
/* 0x74 */ 0, 0,
|
||||
/* 0x76 */ 0, 0,
|
||||
/* 0x78 */ 0, 0,
|
||||
/* 0x7a */ 0, 0,
|
||||
/* 0x7c */ 0, GRUB_KEYBOARD_KEY_JP_YEN,
|
||||
/* 0x7e */ GRUB_KEYBOARD_KEY_KPCOMMA
|
||||
};
|
||||
|
||||
static const struct
|
||||
{
|
||||
grub_uint8_t from, to;
|
||||
} set1_e0_mapping[] =
|
||||
{
|
||||
{0x1c, GRUB_KEYBOARD_KEY_NUMENTER},
|
||||
{0x1d, GRUB_KEYBOARD_KEY_RIGHT_CTRL},
|
||||
{0x35, GRUB_KEYBOARD_KEY_NUMSLASH },
|
||||
{0x38, GRUB_KEYBOARD_KEY_RIGHT_ALT},
|
||||
{0x47, GRUB_KEYBOARD_KEY_HOME},
|
||||
{0x48, GRUB_KEYBOARD_KEY_UP},
|
||||
{0x49, GRUB_KEYBOARD_KEY_PPAGE},
|
||||
{0x4b, GRUB_KEYBOARD_KEY_LEFT},
|
||||
{0x4d, GRUB_KEYBOARD_KEY_RIGHT},
|
||||
{0x4f, GRUB_KEYBOARD_KEY_END},
|
||||
{0x50, GRUB_KEYBOARD_KEY_DOWN},
|
||||
{0x51, GRUB_KEYBOARD_KEY_NPAGE},
|
||||
{0x52, GRUB_KEYBOARD_KEY_INSERT},
|
||||
{0x53, GRUB_KEYBOARD_KEY_DELETE},
|
||||
};
|
||||
|
||||
static const grub_uint8_t set2_mapping[256] =
|
||||
{
|
||||
/* 0x00 */ 0, GRUB_KEYBOARD_KEY_F9,
|
||||
/* 0x02 */ 0, GRUB_KEYBOARD_KEY_F5,
|
||||
/* 0x04 */ GRUB_KEYBOARD_KEY_F3, GRUB_KEYBOARD_KEY_F1,
|
||||
/* 0x06 */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F12,
|
||||
/* 0x08 */ 0, GRUB_KEYBOARD_KEY_F10,
|
||||
/* 0x0a */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F6,
|
||||
/* 0x0c */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_TAB,
|
||||
/* 0x0e */ GRUB_KEYBOARD_KEY_RQUOTE, 0,
|
||||
/* 0x10 */ 0, GRUB_KEYBOARD_KEY_LEFT_ALT,
|
||||
/* 0x12 */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, 0,
|
||||
/* 0x14 */ GRUB_KEYBOARD_KEY_LEFT_CTRL, GRUB_KEYBOARD_KEY_Q,
|
||||
/* 0x16 */ GRUB_KEYBOARD_KEY_1, 0,
|
||||
/* 0x18 */ 0, 0,
|
||||
/* 0x1a */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_S,
|
||||
/* 0x1c */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_W,
|
||||
/* 0x1e */ GRUB_KEYBOARD_KEY_2, 0,
|
||||
/* 0x20 */ 0, GRUB_KEYBOARD_KEY_C,
|
||||
/* 0x22 */ GRUB_KEYBOARD_KEY_X, GRUB_KEYBOARD_KEY_D,
|
||||
/* 0x24 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_4,
|
||||
/* 0x26 */ GRUB_KEYBOARD_KEY_3, 0,
|
||||
/* 0x28 */ 0, GRUB_KEYBOARD_KEY_SPACE,
|
||||
/* 0x2a */ GRUB_KEYBOARD_KEY_V, GRUB_KEYBOARD_KEY_F,
|
||||
/* 0x2c */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_R,
|
||||
/* 0x2e */ GRUB_KEYBOARD_KEY_5, 0,
|
||||
/* 0x30 */ 0, GRUB_KEYBOARD_KEY_N,
|
||||
/* 0x32 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_H,
|
||||
/* 0x34 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_Y,
|
||||
/* 0x36 */ GRUB_KEYBOARD_KEY_6, 0,
|
||||
/* 0x38 */ 0, 0,
|
||||
/* 0x3a */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_J,
|
||||
/* 0x3c */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_7,
|
||||
/* 0x3e */ GRUB_KEYBOARD_KEY_8, 0,
|
||||
/* 0x40 */ 0, GRUB_KEYBOARD_KEY_COMMA,
|
||||
/* 0x42 */ GRUB_KEYBOARD_KEY_K, GRUB_KEYBOARD_KEY_I,
|
||||
/* 0x44 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_0,
|
||||
/* 0x46 */ GRUB_KEYBOARD_KEY_9, 0,
|
||||
/* 0x48 */ 0, GRUB_KEYBOARD_KEY_DOT,
|
||||
/* 0x4a */ GRUB_KEYBOARD_KEY_SLASH, GRUB_KEYBOARD_KEY_L,
|
||||
/* 0x4c */ GRUB_KEYBOARD_KEY_SEMICOLON, GRUB_KEYBOARD_KEY_P,
|
||||
/* 0x4e */ GRUB_KEYBOARD_KEY_DASH, 0,
|
||||
/* 0x50 */ 0, GRUB_KEYBOARD_KEY_JP_RO,
|
||||
/* 0x52 */ GRUB_KEYBOARD_KEY_DQUOTE, 0,
|
||||
/* 0x54 */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_EQUAL,
|
||||
/* 0x56 */ 0, 0,
|
||||
/* 0x58 */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_RIGHT_SHIFT,
|
||||
/* 0x5a */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_RBRACKET,
|
||||
/* 0x5c */ 0, GRUB_KEYBOARD_KEY_BACKSLASH,
|
||||
/* 0x5e */ 0, 0,
|
||||
/* 0x60 */ 0, GRUB_KEYBOARD_KEY_102ND,
|
||||
/* 0x62 */ 0, 0,
|
||||
/* 0x64 */ 0, 0,
|
||||
/* 0x66 */ GRUB_KEYBOARD_KEY_BACKSPACE, 0,
|
||||
/* 0x68 */ 0, GRUB_KEYBOARD_KEY_NUM1,
|
||||
/* 0x6a */ GRUB_KEYBOARD_KEY_JP_YEN, GRUB_KEYBOARD_KEY_NUM4,
|
||||
/* 0x6c */ GRUB_KEYBOARD_KEY_NUM7, GRUB_KEYBOARD_KEY_KPCOMMA,
|
||||
/* 0x6e */ 0, 0,
|
||||
/* 0x70 */ GRUB_KEYBOARD_KEY_NUM0, GRUB_KEYBOARD_KEY_NUMDOT,
|
||||
/* 0x72 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM5,
|
||||
/* 0x74 */ GRUB_KEYBOARD_KEY_NUM6, GRUB_KEYBOARD_KEY_NUM8,
|
||||
/* 0x76 */ GRUB_KEYBOARD_KEY_ESCAPE, GRUB_KEYBOARD_KEY_NUM_LOCK,
|
||||
/* 0x78 */ GRUB_KEYBOARD_KEY_F11, GRUB_KEYBOARD_KEY_NUMPLUS,
|
||||
/* 0x7a */ GRUB_KEYBOARD_KEY_NUM3, GRUB_KEYBOARD_KEY_NUMMINUS,
|
||||
/* 0x7c */ GRUB_KEYBOARD_KEY_NUMMUL, GRUB_KEYBOARD_KEY_NUM9,
|
||||
/* 0x7e */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, 0,
|
||||
/* 0x80 */ 0, 0,
|
||||
/* 0x82 */ 0, GRUB_KEYBOARD_KEY_F7,
|
||||
};
|
||||
|
||||
static const struct
|
||||
{
|
||||
grub_uint8_t from, to;
|
||||
} set2_e0_mapping[] =
|
||||
{
|
||||
{0x11, GRUB_KEYBOARD_KEY_RIGHT_ALT},
|
||||
{0x14, GRUB_KEYBOARD_KEY_RIGHT_CTRL},
|
||||
{0x4a, GRUB_KEYBOARD_KEY_NUMSLASH},
|
||||
{0x5a, GRUB_KEYBOARD_KEY_NUMENTER},
|
||||
{0x69, GRUB_KEYBOARD_KEY_END},
|
||||
{0x6b, GRUB_KEYBOARD_KEY_LEFT},
|
||||
{0x6c, GRUB_KEYBOARD_KEY_HOME},
|
||||
{0x70, GRUB_KEYBOARD_KEY_INSERT},
|
||||
{0x71, GRUB_KEYBOARD_KEY_DELETE},
|
||||
{0x72, GRUB_KEYBOARD_KEY_DOWN},
|
||||
{0x74, GRUB_KEYBOARD_KEY_RIGHT},
|
||||
{0x75, GRUB_KEYBOARD_KEY_UP},
|
||||
{0x7a, GRUB_KEYBOARD_KEY_NPAGE},
|
||||
{0x7d, GRUB_KEYBOARD_KEY_PPAGE},
|
||||
};
|
||||
|
||||
static int ping_sent;
|
||||
|
||||
static void
|
||||
keyboard_controller_wait_until_ready (void)
|
||||
{
|
||||
@@ -350,12 +159,12 @@ set_scancodes (void)
|
||||
if (!grub_keyboard_orig_set)
|
||||
{
|
||||
grub_dprintf ("atkeyb", "No sets support assumed\n");
|
||||
current_set = 1;
|
||||
ps2_state.current_set = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
#if !USE_SCANCODE_SET
|
||||
current_set = 1;
|
||||
ps2_state.current_set = 1;
|
||||
return;
|
||||
#else
|
||||
|
||||
@@ -363,15 +172,15 @@ set_scancodes (void)
|
||||
& ~KEYBOARD_AT_TRANSLATE);
|
||||
|
||||
write_mode (2);
|
||||
current_set = query_mode ();
|
||||
grub_dprintf ("atkeyb", "returned set %d\n", current_set);
|
||||
if (current_set == 2)
|
||||
ps2_state.current_set = query_mode ();
|
||||
grub_dprintf ("atkeyb", "returned set %d\n", ps2_state.current_set);
|
||||
if (ps2_state.current_set == 2)
|
||||
return;
|
||||
|
||||
write_mode (1);
|
||||
current_set = query_mode ();
|
||||
grub_dprintf ("atkeyb", "returned set %d\n", current_set);
|
||||
if (current_set == 1)
|
||||
ps2_state.current_set = query_mode ();
|
||||
grub_dprintf ("atkeyb", "returned set %d\n", ps2_state.current_set);
|
||||
if (ps2_state.current_set == 1)
|
||||
return;
|
||||
grub_dprintf ("atkeyb", "no supported scancode set found\n");
|
||||
#endif
|
||||
@@ -386,164 +195,10 @@ keyboard_controller_led (grub_uint8_t leds)
|
||||
grub_outb (leds & 0x7, KEYBOARD_REG_DATA);
|
||||
}
|
||||
|
||||
static int
|
||||
fetch_key (int *is_break)
|
||||
{
|
||||
int was_ext = 0;
|
||||
grub_uint8_t at_key;
|
||||
int ret = 0;
|
||||
|
||||
if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
|
||||
return -1;
|
||||
at_key = grub_inb (KEYBOARD_REG_DATA);
|
||||
/* May happen if no keyboard is connected. Just ignore this. */
|
||||
if (at_key == 0xff)
|
||||
return -1;
|
||||
if (at_key == 0xe0)
|
||||
{
|
||||
e0_received = 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((current_set == 2 || current_set == 3) && at_key == 0xf0)
|
||||
{
|
||||
f0_received = 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Setting LEDs may generate ACKs. */
|
||||
if (at_key == GRUB_AT_ACK)
|
||||
return -1;
|
||||
|
||||
was_ext = e0_received;
|
||||
e0_received = 0;
|
||||
|
||||
switch (current_set)
|
||||
{
|
||||
case 1:
|
||||
*is_break = !!(at_key & 0x80);
|
||||
if (!was_ext)
|
||||
ret = set1_mapping[at_key & 0x7f];
|
||||
else
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < ARRAY_SIZE (set1_e0_mapping); i++)
|
||||
if (set1_e0_mapping[i].from == (at_key & 0x7f))
|
||||
{
|
||||
ret = set1_e0_mapping[i].to;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
*is_break = f0_received;
|
||||
f0_received = 0;
|
||||
if (!was_ext)
|
||||
ret = set2_mapping[at_key];
|
||||
else
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < ARRAY_SIZE (set2_e0_mapping); i++)
|
||||
if (set2_e0_mapping[i].from == at_key)
|
||||
{
|
||||
ret = set2_e0_mapping[i].to;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
if (!ret)
|
||||
{
|
||||
if (was_ext)
|
||||
grub_dprintf ("atkeyb", "Unknown key 0xe0+0x%02x from set %d\n",
|
||||
at_key, current_set);
|
||||
else
|
||||
grub_dprintf ("atkeyb", "Unknown key 0x%02x from set %d\n",
|
||||
at_key, current_set);
|
||||
return -1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* FIXME: This should become an interrupt service routine. For now
|
||||
it's just used to catch events from control keys. */
|
||||
static int
|
||||
grub_keyboard_isr (grub_keyboard_key_t key, int is_break)
|
||||
{
|
||||
if (!is_break)
|
||||
switch (key)
|
||||
{
|
||||
case GRUB_KEYBOARD_KEY_LEFT_SHIFT:
|
||||
at_keyboard_status |= GRUB_TERM_STATUS_LSHIFT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_SHIFT:
|
||||
at_keyboard_status |= GRUB_TERM_STATUS_RSHIFT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_LEFT_CTRL:
|
||||
at_keyboard_status |= GRUB_TERM_STATUS_LCTRL;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_CTRL:
|
||||
at_keyboard_status |= GRUB_TERM_STATUS_RCTRL;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_ALT:
|
||||
at_keyboard_status |= GRUB_TERM_STATUS_RALT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_LEFT_ALT:
|
||||
at_keyboard_status |= GRUB_TERM_STATUS_LALT;
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
switch (key)
|
||||
{
|
||||
case GRUB_KEYBOARD_KEY_LEFT_SHIFT:
|
||||
at_keyboard_status &= ~GRUB_TERM_STATUS_LSHIFT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_SHIFT:
|
||||
at_keyboard_status &= ~GRUB_TERM_STATUS_RSHIFT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_LEFT_CTRL:
|
||||
at_keyboard_status &= ~GRUB_TERM_STATUS_LCTRL;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_CTRL:
|
||||
at_keyboard_status &= ~GRUB_TERM_STATUS_RCTRL;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_ALT:
|
||||
at_keyboard_status &= ~GRUB_TERM_STATUS_RALT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_LEFT_ALT:
|
||||
at_keyboard_status &= ~GRUB_TERM_STATUS_LALT;
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* If there is a raw key pending, return it; otherwise return -1. */
|
||||
static int
|
||||
grub_keyboard_getkey (void)
|
||||
{
|
||||
int key;
|
||||
int is_break = 0;
|
||||
|
||||
key = fetch_key (&is_break);
|
||||
if (key == -1)
|
||||
return -1;
|
||||
|
||||
if (grub_keyboard_isr (key, is_break))
|
||||
return -1;
|
||||
if (is_break)
|
||||
return -1;
|
||||
return key;
|
||||
}
|
||||
|
||||
int
|
||||
grub_at_keyboard_is_alive (void)
|
||||
{
|
||||
if (current_set != 0)
|
||||
if (ps2_state.current_set != 0)
|
||||
return 1;
|
||||
if (ping_sent
|
||||
&& KEYBOARD_COMMAND_ISREADY (grub_inb (KEYBOARD_REG_STATUS))
|
||||
@@ -566,51 +221,28 @@ grub_at_keyboard_is_alive (void)
|
||||
static int
|
||||
grub_at_keyboard_getkey (struct grub_term_input *term __attribute__ ((unused)))
|
||||
{
|
||||
int code;
|
||||
grub_uint8_t at_key;
|
||||
int ret;
|
||||
grub_uint8_t old_led;
|
||||
|
||||
if (!grub_at_keyboard_is_alive ())
|
||||
return GRUB_TERM_NO_KEY;
|
||||
|
||||
code = grub_keyboard_getkey ();
|
||||
if (code == -1)
|
||||
return GRUB_TERM_NO_KEY;
|
||||
#ifdef DEBUG_AT_KEYBOARD
|
||||
grub_dprintf ("atkeyb", "Detected key 0x%x\n", code);
|
||||
#endif
|
||||
switch (code)
|
||||
{
|
||||
case GRUB_KEYBOARD_KEY_CAPS_LOCK:
|
||||
at_keyboard_status ^= GRUB_TERM_STATUS_CAPS;
|
||||
led_status ^= KEYBOARD_LED_CAPS;
|
||||
keyboard_controller_led (led_status);
|
||||
if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
|
||||
return -1;
|
||||
at_key = grub_inb (KEYBOARD_REG_DATA);
|
||||
old_led = ps2_state.led_status;
|
||||
|
||||
#ifdef DEBUG_AT_KEYBOARD
|
||||
grub_dprintf ("atkeyb", "caps_lock = %d\n", !!(at_keyboard_status & GRUB_KEYBOARD_STATUS_CAPS_LOCK));
|
||||
#endif
|
||||
return GRUB_TERM_NO_KEY;
|
||||
case GRUB_KEYBOARD_KEY_NUM_LOCK:
|
||||
at_keyboard_status ^= GRUB_TERM_STATUS_NUM;
|
||||
led_status ^= KEYBOARD_LED_NUM;
|
||||
keyboard_controller_led (led_status);
|
||||
|
||||
#ifdef DEBUG_AT_KEYBOARD
|
||||
grub_dprintf ("atkeyb", "num_lock = %d\n", !!(at_keyboard_status & GRUB_KEYBOARD_STATUS_NUM_LOCK));
|
||||
#endif
|
||||
return GRUB_TERM_NO_KEY;
|
||||
case GRUB_KEYBOARD_KEY_SCROLL_LOCK:
|
||||
at_keyboard_status ^= GRUB_TERM_STATUS_SCROLL;
|
||||
led_status ^= KEYBOARD_LED_SCROLL;
|
||||
keyboard_controller_led (led_status);
|
||||
return GRUB_TERM_NO_KEY;
|
||||
default:
|
||||
return grub_term_map_key (code, at_keyboard_status);
|
||||
}
|
||||
ret = grub_ps2_process_incoming_byte (&ps2_state, at_key);
|
||||
if (old_led != ps2_state.led_status)
|
||||
keyboard_controller_led (ps2_state.led_status);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
grub_keyboard_controller_init (void)
|
||||
{
|
||||
at_keyboard_status = 0;
|
||||
ps2_state.at_keyboard_status = 0;
|
||||
/* Drain input buffer. */
|
||||
while (1)
|
||||
{
|
||||
@@ -632,13 +264,13 @@ grub_keyboard_controller_init (void)
|
||||
grub_keyboard_orig_set = query_mode ();
|
||||
#endif
|
||||
set_scancodes ();
|
||||
keyboard_controller_led (led_status);
|
||||
keyboard_controller_led (ps2_state.led_status);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_keyboard_controller_fini (struct grub_term_input *term __attribute__ ((unused)))
|
||||
{
|
||||
if (current_set == 0)
|
||||
if (ps2_state.current_set == 0)
|
||||
return GRUB_ERR_NONE;
|
||||
if (grub_keyboard_orig_set)
|
||||
write_mode (grub_keyboard_orig_set);
|
||||
@@ -655,7 +287,7 @@ grub_at_fini_hw (int noreturn __attribute__ ((unused)))
|
||||
static grub_err_t
|
||||
grub_at_restore_hw (void)
|
||||
{
|
||||
if (current_set == 0)
|
||||
if (ps2_state.current_set == 0)
|
||||
return GRUB_ERR_NONE;
|
||||
|
||||
/* Drain input buffer. */
|
||||
@@ -668,7 +300,7 @@ grub_at_restore_hw (void)
|
||||
grub_inb (KEYBOARD_REG_DATA);
|
||||
}
|
||||
set_scancodes ();
|
||||
keyboard_controller_led (led_status);
|
||||
keyboard_controller_led (ps2_state.led_status);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
@@ -668,7 +668,6 @@ draw_cursor (int show)
|
||||
unsigned int y;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
unsigned int ascent;
|
||||
grub_video_color_t color;
|
||||
|
||||
write_char ();
|
||||
@@ -680,18 +679,13 @@ draw_cursor (int show)
|
||||
>= virtual_screen.rows)
|
||||
return;
|
||||
|
||||
/* Ensure that cursor doesn't go outside of character box. */
|
||||
ascent = grub_font_get_ascent(virtual_screen.font);
|
||||
if (ascent > virtual_screen.normal_char_height - 2)
|
||||
ascent = virtual_screen.normal_char_height - 2;
|
||||
|
||||
/* Determine cursor properties and position on text layer. */
|
||||
x = virtual_screen.cursor_x * virtual_screen.normal_char_width;
|
||||
width = virtual_screen.normal_char_width;
|
||||
color = virtual_screen.fg_color;
|
||||
y = ((virtual_screen.cursor_y + virtual_screen.total_scroll)
|
||||
* virtual_screen.normal_char_height
|
||||
+ ascent);
|
||||
+ grub_font_get_ascent (virtual_screen.font));
|
||||
height = 2;
|
||||
|
||||
/* Render cursor to text layer. */
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <grub/time.h>
|
||||
#include <grub/terminfo.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/i386/coreboot/lbio.h>
|
||||
#include <grub/coreboot/lbio.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/normal.h>
|
||||
|
||||
|
||||
387
grub-core/term/ps2.c
Normal file
387
grub-core/term/ps2.c
Normal file
@@ -0,0 +1,387 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2007,2008,2009 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/dl.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/keyboard_layouts.h>
|
||||
#include <grub/ps2.h>
|
||||
|
||||
#define KEYBOARD_LED_SCROLL (1 << 0)
|
||||
#define KEYBOARD_LED_NUM (1 << 1)
|
||||
#define KEYBOARD_LED_CAPS (1 << 2)
|
||||
|
||||
static const grub_uint8_t set1_mapping[128] =
|
||||
{
|
||||
/* 0x00 */ 0 /* Unused */, GRUB_KEYBOARD_KEY_ESCAPE,
|
||||
/* 0x02 */ GRUB_KEYBOARD_KEY_1, GRUB_KEYBOARD_KEY_2,
|
||||
/* 0x04 */ GRUB_KEYBOARD_KEY_3, GRUB_KEYBOARD_KEY_4,
|
||||
/* 0x06 */ GRUB_KEYBOARD_KEY_5, GRUB_KEYBOARD_KEY_6,
|
||||
/* 0x08 */ GRUB_KEYBOARD_KEY_7, GRUB_KEYBOARD_KEY_8,
|
||||
/* 0x0a */ GRUB_KEYBOARD_KEY_9, GRUB_KEYBOARD_KEY_0,
|
||||
/* 0x0c */ GRUB_KEYBOARD_KEY_DASH, GRUB_KEYBOARD_KEY_EQUAL,
|
||||
/* 0x0e */ GRUB_KEYBOARD_KEY_BACKSPACE, GRUB_KEYBOARD_KEY_TAB,
|
||||
/* 0x10 */ GRUB_KEYBOARD_KEY_Q, GRUB_KEYBOARD_KEY_W,
|
||||
/* 0x12 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_R,
|
||||
/* 0x14 */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_Y,
|
||||
/* 0x16 */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_I,
|
||||
/* 0x18 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_P,
|
||||
/* 0x1a */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_RBRACKET,
|
||||
/* 0x1c */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_LEFT_CTRL,
|
||||
/* 0x1e */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_S,
|
||||
/* 0x20 */ GRUB_KEYBOARD_KEY_D, GRUB_KEYBOARD_KEY_F,
|
||||
/* 0x22 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_H,
|
||||
/* 0x24 */ GRUB_KEYBOARD_KEY_J, GRUB_KEYBOARD_KEY_K,
|
||||
/* 0x26 */ GRUB_KEYBOARD_KEY_L, GRUB_KEYBOARD_KEY_SEMICOLON,
|
||||
/* 0x28 */ GRUB_KEYBOARD_KEY_DQUOTE, GRUB_KEYBOARD_KEY_RQUOTE,
|
||||
/* 0x2a */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, GRUB_KEYBOARD_KEY_BACKSLASH,
|
||||
/* 0x2c */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_X,
|
||||
/* 0x2e */ GRUB_KEYBOARD_KEY_C, GRUB_KEYBOARD_KEY_V,
|
||||
/* 0x30 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_N,
|
||||
/* 0x32 */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_COMMA,
|
||||
/* 0x34 */ GRUB_KEYBOARD_KEY_DOT, GRUB_KEYBOARD_KEY_SLASH,
|
||||
/* 0x36 */ GRUB_KEYBOARD_KEY_RIGHT_SHIFT, GRUB_KEYBOARD_KEY_NUMMUL,
|
||||
/* 0x38 */ GRUB_KEYBOARD_KEY_LEFT_ALT, GRUB_KEYBOARD_KEY_SPACE,
|
||||
/* 0x3a */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_F1,
|
||||
/* 0x3c */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F3,
|
||||
/* 0x3e */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_F5,
|
||||
/* 0x40 */ GRUB_KEYBOARD_KEY_F6, GRUB_KEYBOARD_KEY_F7,
|
||||
/* 0x42 */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F9,
|
||||
/* 0x44 */ GRUB_KEYBOARD_KEY_F10, GRUB_KEYBOARD_KEY_NUM_LOCK,
|
||||
/* 0x46 */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, GRUB_KEYBOARD_KEY_NUM7,
|
||||
/* 0x48 */ GRUB_KEYBOARD_KEY_NUM8, GRUB_KEYBOARD_KEY_NUM9,
|
||||
/* 0x4a */ GRUB_KEYBOARD_KEY_NUMMINUS, GRUB_KEYBOARD_KEY_NUM4,
|
||||
/* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6,
|
||||
/* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1,
|
||||
/* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3,
|
||||
/* 0x52 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUMDOT,
|
||||
/* 0x54 */ 0, 0,
|
||||
/* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11,
|
||||
/* 0x58 */ GRUB_KEYBOARD_KEY_F12, 0,
|
||||
/* 0x5a */ 0, 0,
|
||||
/* 0x5c */ 0, 0,
|
||||
/* 0x5e */ 0, 0,
|
||||
/* 0x60 */ 0, 0,
|
||||
/* 0x62 */ 0, 0,
|
||||
/* OLPC keys. Just mapped to normal keys. */
|
||||
/* 0x64 */ 0, GRUB_KEYBOARD_KEY_UP,
|
||||
/* 0x66 */ GRUB_KEYBOARD_KEY_DOWN, GRUB_KEYBOARD_KEY_LEFT,
|
||||
/* 0x68 */ GRUB_KEYBOARD_KEY_RIGHT, 0,
|
||||
/* 0x6a */ 0, 0,
|
||||
/* 0x6c */ 0, 0,
|
||||
/* 0x6e */ 0, 0,
|
||||
/* 0x70 */ 0, 0,
|
||||
/* 0x72 */ 0, GRUB_KEYBOARD_KEY_JP_RO,
|
||||
/* 0x74 */ 0, 0,
|
||||
/* 0x76 */ 0, 0,
|
||||
/* 0x78 */ 0, 0,
|
||||
/* 0x7a */ 0, 0,
|
||||
/* 0x7c */ 0, GRUB_KEYBOARD_KEY_JP_YEN,
|
||||
/* 0x7e */ GRUB_KEYBOARD_KEY_KPCOMMA
|
||||
};
|
||||
|
||||
static const struct
|
||||
{
|
||||
grub_uint8_t from, to;
|
||||
} set1_e0_mapping[] =
|
||||
{
|
||||
{0x1c, GRUB_KEYBOARD_KEY_NUMENTER},
|
||||
{0x1d, GRUB_KEYBOARD_KEY_RIGHT_CTRL},
|
||||
{0x35, GRUB_KEYBOARD_KEY_NUMSLASH },
|
||||
{0x38, GRUB_KEYBOARD_KEY_RIGHT_ALT},
|
||||
{0x47, GRUB_KEYBOARD_KEY_HOME},
|
||||
{0x48, GRUB_KEYBOARD_KEY_UP},
|
||||
{0x49, GRUB_KEYBOARD_KEY_PPAGE},
|
||||
{0x4b, GRUB_KEYBOARD_KEY_LEFT},
|
||||
{0x4d, GRUB_KEYBOARD_KEY_RIGHT},
|
||||
{0x4f, GRUB_KEYBOARD_KEY_END},
|
||||
{0x50, GRUB_KEYBOARD_KEY_DOWN},
|
||||
{0x51, GRUB_KEYBOARD_KEY_NPAGE},
|
||||
{0x52, GRUB_KEYBOARD_KEY_INSERT},
|
||||
{0x53, GRUB_KEYBOARD_KEY_DELETE},
|
||||
};
|
||||
|
||||
static const grub_uint8_t set2_mapping[256] =
|
||||
{
|
||||
/* 0x00 */ 0, GRUB_KEYBOARD_KEY_F9,
|
||||
/* 0x02 */ 0, GRUB_KEYBOARD_KEY_F5,
|
||||
/* 0x04 */ GRUB_KEYBOARD_KEY_F3, GRUB_KEYBOARD_KEY_F1,
|
||||
/* 0x06 */ GRUB_KEYBOARD_KEY_F2, GRUB_KEYBOARD_KEY_F12,
|
||||
/* 0x08 */ 0, GRUB_KEYBOARD_KEY_F10,
|
||||
/* 0x0a */ GRUB_KEYBOARD_KEY_F8, GRUB_KEYBOARD_KEY_F6,
|
||||
/* 0x0c */ GRUB_KEYBOARD_KEY_F4, GRUB_KEYBOARD_KEY_TAB,
|
||||
/* 0x0e */ GRUB_KEYBOARD_KEY_RQUOTE, 0,
|
||||
/* 0x10 */ 0, GRUB_KEYBOARD_KEY_LEFT_ALT,
|
||||
/* 0x12 */ GRUB_KEYBOARD_KEY_LEFT_SHIFT, 0,
|
||||
/* 0x14 */ GRUB_KEYBOARD_KEY_LEFT_CTRL, GRUB_KEYBOARD_KEY_Q,
|
||||
/* 0x16 */ GRUB_KEYBOARD_KEY_1, 0,
|
||||
/* 0x18 */ 0, 0,
|
||||
/* 0x1a */ GRUB_KEYBOARD_KEY_Z, GRUB_KEYBOARD_KEY_S,
|
||||
/* 0x1c */ GRUB_KEYBOARD_KEY_A, GRUB_KEYBOARD_KEY_W,
|
||||
/* 0x1e */ GRUB_KEYBOARD_KEY_2, 0,
|
||||
/* 0x20 */ 0, GRUB_KEYBOARD_KEY_C,
|
||||
/* 0x22 */ GRUB_KEYBOARD_KEY_X, GRUB_KEYBOARD_KEY_D,
|
||||
/* 0x24 */ GRUB_KEYBOARD_KEY_E, GRUB_KEYBOARD_KEY_4,
|
||||
/* 0x26 */ GRUB_KEYBOARD_KEY_3, 0,
|
||||
/* 0x28 */ 0, GRUB_KEYBOARD_KEY_SPACE,
|
||||
/* 0x2a */ GRUB_KEYBOARD_KEY_V, GRUB_KEYBOARD_KEY_F,
|
||||
/* 0x2c */ GRUB_KEYBOARD_KEY_T, GRUB_KEYBOARD_KEY_R,
|
||||
/* 0x2e */ GRUB_KEYBOARD_KEY_5, 0,
|
||||
/* 0x30 */ 0, GRUB_KEYBOARD_KEY_N,
|
||||
/* 0x32 */ GRUB_KEYBOARD_KEY_B, GRUB_KEYBOARD_KEY_H,
|
||||
/* 0x34 */ GRUB_KEYBOARD_KEY_G, GRUB_KEYBOARD_KEY_Y,
|
||||
/* 0x36 */ GRUB_KEYBOARD_KEY_6, 0,
|
||||
/* 0x38 */ 0, 0,
|
||||
/* 0x3a */ GRUB_KEYBOARD_KEY_M, GRUB_KEYBOARD_KEY_J,
|
||||
/* 0x3c */ GRUB_KEYBOARD_KEY_U, GRUB_KEYBOARD_KEY_7,
|
||||
/* 0x3e */ GRUB_KEYBOARD_KEY_8, 0,
|
||||
/* 0x40 */ 0, GRUB_KEYBOARD_KEY_COMMA,
|
||||
/* 0x42 */ GRUB_KEYBOARD_KEY_K, GRUB_KEYBOARD_KEY_I,
|
||||
/* 0x44 */ GRUB_KEYBOARD_KEY_O, GRUB_KEYBOARD_KEY_0,
|
||||
/* 0x46 */ GRUB_KEYBOARD_KEY_9, 0,
|
||||
/* 0x48 */ 0, GRUB_KEYBOARD_KEY_DOT,
|
||||
/* 0x4a */ GRUB_KEYBOARD_KEY_SLASH, GRUB_KEYBOARD_KEY_L,
|
||||
/* 0x4c */ GRUB_KEYBOARD_KEY_SEMICOLON, GRUB_KEYBOARD_KEY_P,
|
||||
/* 0x4e */ GRUB_KEYBOARD_KEY_DASH, 0,
|
||||
/* 0x50 */ 0, GRUB_KEYBOARD_KEY_JP_RO,
|
||||
/* 0x52 */ GRUB_KEYBOARD_KEY_DQUOTE, 0,
|
||||
/* 0x54 */ GRUB_KEYBOARD_KEY_LBRACKET, GRUB_KEYBOARD_KEY_EQUAL,
|
||||
/* 0x56 */ 0, 0,
|
||||
/* 0x58 */ GRUB_KEYBOARD_KEY_CAPS_LOCK, GRUB_KEYBOARD_KEY_RIGHT_SHIFT,
|
||||
/* 0x5a */ GRUB_KEYBOARD_KEY_ENTER, GRUB_KEYBOARD_KEY_RBRACKET,
|
||||
/* 0x5c */ 0, GRUB_KEYBOARD_KEY_BACKSLASH,
|
||||
/* 0x5e */ 0, 0,
|
||||
/* 0x60 */ 0, GRUB_KEYBOARD_KEY_102ND,
|
||||
/* 0x62 */ 0, 0,
|
||||
/* 0x64 */ 0, 0,
|
||||
/* 0x66 */ GRUB_KEYBOARD_KEY_BACKSPACE, 0,
|
||||
/* 0x68 */ 0, GRUB_KEYBOARD_KEY_NUM1,
|
||||
/* 0x6a */ GRUB_KEYBOARD_KEY_JP_YEN, GRUB_KEYBOARD_KEY_NUM4,
|
||||
/* 0x6c */ GRUB_KEYBOARD_KEY_NUM7, GRUB_KEYBOARD_KEY_KPCOMMA,
|
||||
/* 0x6e */ 0, 0,
|
||||
/* 0x70 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUM0,
|
||||
/* 0x72 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM5,
|
||||
/* 0x74 */ GRUB_KEYBOARD_KEY_NUM6, GRUB_KEYBOARD_KEY_NUM8,
|
||||
/* 0x76 */ GRUB_KEYBOARD_KEY_ESCAPE, GRUB_KEYBOARD_KEY_NUM_LOCK,
|
||||
/* 0x78 */ GRUB_KEYBOARD_KEY_F11, GRUB_KEYBOARD_KEY_NUMPLUS,
|
||||
/* 0x7a */ GRUB_KEYBOARD_KEY_NUM3, GRUB_KEYBOARD_KEY_NUMMINUS,
|
||||
/* 0x7c */ GRUB_KEYBOARD_KEY_NUMMUL, GRUB_KEYBOARD_KEY_NUM9,
|
||||
/* 0x7e */ GRUB_KEYBOARD_KEY_SCROLL_LOCK, 0,
|
||||
/* 0x80 */ 0, 0,
|
||||
/* 0x82 */ 0, GRUB_KEYBOARD_KEY_F7,
|
||||
};
|
||||
|
||||
static const struct
|
||||
{
|
||||
grub_uint8_t from, to;
|
||||
} set2_e0_mapping[] =
|
||||
{
|
||||
{0x11, GRUB_KEYBOARD_KEY_RIGHT_ALT},
|
||||
{0x14, GRUB_KEYBOARD_KEY_RIGHT_CTRL},
|
||||
{0x4a, GRUB_KEYBOARD_KEY_NUMSLASH},
|
||||
{0x5a, GRUB_KEYBOARD_KEY_NUMENTER},
|
||||
{0x69, GRUB_KEYBOARD_KEY_END},
|
||||
{0x6b, GRUB_KEYBOARD_KEY_LEFT},
|
||||
{0x6c, GRUB_KEYBOARD_KEY_HOME},
|
||||
{0x70, GRUB_KEYBOARD_KEY_INSERT},
|
||||
{0x71, GRUB_KEYBOARD_KEY_DELETE},
|
||||
{0x72, GRUB_KEYBOARD_KEY_DOWN},
|
||||
{0x74, GRUB_KEYBOARD_KEY_RIGHT},
|
||||
{0x75, GRUB_KEYBOARD_KEY_UP},
|
||||
{0x7a, GRUB_KEYBOARD_KEY_NPAGE},
|
||||
{0x7d, GRUB_KEYBOARD_KEY_PPAGE},
|
||||
};
|
||||
|
||||
static int
|
||||
fetch_key (struct grub_ps2_state *ps2_state, grub_uint8_t at_key, int *is_break)
|
||||
{
|
||||
int was_ext = 0;
|
||||
int ret = 0;
|
||||
|
||||
/* May happen if no keyboard is connected. Just ignore this. */
|
||||
if (at_key == 0xff)
|
||||
return -1;
|
||||
if (at_key == 0xe0)
|
||||
{
|
||||
ps2_state->e0_received = 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((ps2_state->current_set == 2 || ps2_state->current_set == 3) && at_key == 0xf0)
|
||||
{
|
||||
ps2_state->f0_received = 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Setting LEDs may generate ACKs. */
|
||||
if (at_key == GRUB_AT_ACK)
|
||||
return -1;
|
||||
|
||||
was_ext = ps2_state->e0_received;
|
||||
ps2_state->e0_received = 0;
|
||||
|
||||
switch (ps2_state->current_set)
|
||||
{
|
||||
case 1:
|
||||
*is_break = !!(at_key & 0x80);
|
||||
if (!was_ext)
|
||||
ret = set1_mapping[at_key & 0x7f];
|
||||
else
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < ARRAY_SIZE (set1_e0_mapping); i++)
|
||||
if (set1_e0_mapping[i].from == (at_key & 0x7f))
|
||||
{
|
||||
ret = set1_e0_mapping[i].to;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
*is_break = ps2_state->f0_received;
|
||||
ps2_state->f0_received = 0;
|
||||
if (!was_ext)
|
||||
ret = set2_mapping[at_key];
|
||||
else
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < ARRAY_SIZE (set2_e0_mapping); i++)
|
||||
if (set2_e0_mapping[i].from == at_key)
|
||||
{
|
||||
ret = set2_e0_mapping[i].to;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
if (!ret)
|
||||
{
|
||||
if (was_ext)
|
||||
grub_dprintf ("atkeyb", "Unknown key 0xe0+0x%02x from set %d\n",
|
||||
at_key, ps2_state->current_set);
|
||||
else
|
||||
grub_dprintf ("atkeyb", "Unknown key 0x%02x from set %d\n",
|
||||
at_key, ps2_state->current_set);
|
||||
return -1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* FIXME: This should become an interrupt service routine. For now
|
||||
it's just used to catch events from control keys. */
|
||||
static int
|
||||
grub_keyboard_isr (struct grub_ps2_state *ps2_state,
|
||||
grub_keyboard_key_t key, int is_break)
|
||||
{
|
||||
if (!is_break)
|
||||
switch (key)
|
||||
{
|
||||
case GRUB_KEYBOARD_KEY_LEFT_SHIFT:
|
||||
ps2_state->at_keyboard_status |= GRUB_TERM_STATUS_LSHIFT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_SHIFT:
|
||||
ps2_state->at_keyboard_status |= GRUB_TERM_STATUS_RSHIFT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_LEFT_CTRL:
|
||||
ps2_state->at_keyboard_status |= GRUB_TERM_STATUS_LCTRL;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_CTRL:
|
||||
ps2_state->at_keyboard_status |= GRUB_TERM_STATUS_RCTRL;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_ALT:
|
||||
ps2_state->at_keyboard_status |= GRUB_TERM_STATUS_RALT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_LEFT_ALT:
|
||||
ps2_state->at_keyboard_status |= GRUB_TERM_STATUS_LALT;
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
switch (key)
|
||||
{
|
||||
case GRUB_KEYBOARD_KEY_LEFT_SHIFT:
|
||||
ps2_state->at_keyboard_status &= ~GRUB_TERM_STATUS_LSHIFT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_SHIFT:
|
||||
ps2_state->at_keyboard_status &= ~GRUB_TERM_STATUS_RSHIFT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_LEFT_CTRL:
|
||||
ps2_state->at_keyboard_status &= ~GRUB_TERM_STATUS_LCTRL;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_CTRL:
|
||||
ps2_state->at_keyboard_status &= ~GRUB_TERM_STATUS_RCTRL;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_RIGHT_ALT:
|
||||
ps2_state->at_keyboard_status &= ~GRUB_TERM_STATUS_RALT;
|
||||
return 1;
|
||||
case GRUB_KEYBOARD_KEY_LEFT_ALT:
|
||||
ps2_state->at_keyboard_status &= ~GRUB_TERM_STATUS_LALT;
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* If there is a key pending, return it; otherwise return GRUB_TERM_NO_KEY. */
|
||||
int
|
||||
grub_ps2_process_incoming_byte (struct grub_ps2_state *ps2_state,
|
||||
grub_uint8_t at_key)
|
||||
{
|
||||
int code;
|
||||
int is_break = 0;
|
||||
|
||||
code = fetch_key (ps2_state, at_key, &is_break);
|
||||
if (code == -1)
|
||||
return GRUB_TERM_NO_KEY;
|
||||
|
||||
if (grub_keyboard_isr (ps2_state, code, is_break))
|
||||
return GRUB_TERM_NO_KEY;
|
||||
if (is_break)
|
||||
return GRUB_TERM_NO_KEY;
|
||||
#ifdef DEBUG_AT_KEYBOARD
|
||||
grub_dprintf ("atkeyb", "Detected key 0x%x\n", code);
|
||||
#endif
|
||||
switch (code)
|
||||
{
|
||||
case GRUB_KEYBOARD_KEY_CAPS_LOCK:
|
||||
ps2_state->at_keyboard_status ^= GRUB_TERM_STATUS_CAPS;
|
||||
ps2_state->led_status ^= KEYBOARD_LED_CAPS;
|
||||
|
||||
#ifdef DEBUG_AT_KEYBOARD
|
||||
grub_dprintf ("atkeyb", "caps_lock = %d\n", !!(ps2_state->at_keyboard_status & GRUB_KEYBOARD_STATUS_CAPS_LOCK));
|
||||
#endif
|
||||
return GRUB_TERM_NO_KEY;
|
||||
case GRUB_KEYBOARD_KEY_NUM_LOCK:
|
||||
ps2_state->at_keyboard_status ^= GRUB_TERM_STATUS_NUM;
|
||||
ps2_state->led_status ^= KEYBOARD_LED_NUM;
|
||||
|
||||
#ifdef DEBUG_AT_KEYBOARD
|
||||
grub_dprintf ("atkeyb", "num_lock = %d\n", !!(ps2_state->at_keyboard_status & GRUB_KEYBOARD_STATUS_NUM_LOCK));
|
||||
#endif
|
||||
return GRUB_TERM_NO_KEY;
|
||||
case GRUB_KEYBOARD_KEY_SCROLL_LOCK:
|
||||
ps2_state->at_keyboard_status ^= GRUB_TERM_STATUS_SCROLL;
|
||||
ps2_state->led_status ^= KEYBOARD_LED_SCROLL;
|
||||
return GRUB_TERM_NO_KEY;
|
||||
default:
|
||||
return grub_term_map_key (code, ps2_state->at_keyboard_status);
|
||||
}
|
||||
}
|
||||
@@ -1,101 +1,101 @@
|
||||
{ "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x68f4102c, 0x68f4102c, 0x4f103fc9, 0x4f103fc9, 0x6c3ed233, 0x6c3ed233, 0x8e49f1d4, 0x8e49f1d4, 0x4d27a5fc, 0x4d27a5fc, 0xce4f426c, 0xce4f426c, 0xb86a2d2d, 0xb86a2d2d, 0x72caeded, 0x72caeded, 0x5db992f4, 0x5db992f4, 0xb6a48a57, 0xb6a48a57, 0x8dd9e06c, 0x8dd9e06c, 0xfd0ab0a, 0xfd0ab0a, 0xf0257d88, 0xf0257d88, 0x375c456d, 0x375c456d, 0x6014146b, 0x6014146b, 0xcc3ce19c, 0xcc3ce19c, 0x6df2c13d, 0x6df2c13d, 0x59c1144b, 0x59c1144b, 0x6800bfb6, 0x6800bfb6, 0xfd03649a, 0xfd03649a, 0x654ce0e7, 0xc0cb058d, 0x9e43683f, 0x9e43683f, }, 45 },
|
||||
{ "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x3c2c3e3f, 0x3c2c3e3f, 0x58ab5c00, 0x58ab5c00, 0xba896043, 0xba896043, 0x1e741248, 0x1e741248, 0x48a951b9, 0x48a951b9, 0x569f4d77, 0x569f4d77, 0xf4e8d9bb, 0xf4e8d9bb, 0x80843985, 0x80843985, 0xeae3a0fc, 0xeae3a0fc, 0x137e7ccf, 0x137e7ccf, 0x3f786b6b, 0x3f786b6b, 0x3254e051, 0x3254e051, 0x79be1043, 0x79be1043, 0x4e46907d, 0x4e46907d, 0xd5d6468d, 0xd5d6468d, 0xfec2ff8d, 0xfec2ff8d, 0x13083fb4, 0x13083fb4, 0x35893486, 0x35893486, 0x41508e32, 0x41508e32, 0x26a1eda9, 0x26a1eda9, 0xecdf0a59, 0xcc661ad8, 0xc57d6ccb, 0xc57d6ccb, }, 45 },
|
||||
{ "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xeed4e023, 0xeed4e023, 0x3cafae08, 0x3cafae08, 0xdd7de297, 0xdd7de297, 0x50a0a0e1, 0x50a0a0e1, 0x18e36b82, 0x18e36b82, 0xa4bd0ffe, 0xa4bd0ffe, 0xd4e5aafe, 0xd4e5aafe, 0x2c7e25a5, 0x2c7e25a5, 0xda696881, 0xda696881, 0x237832d8, 0x237832d8, 0x49d7771, 0x49d7771, 0xc30d24a4, 0xc30d24a4, 0x6ab4d024, 0x6ab4d024, 0x7deac66, 0x7deac66, 0x7b3aa1c6, 0x7b3aa1c6, 0x56158612, 0x56158612, 0x4fc63f7a, 0x4fc63f7a, 0x2f4f78d3, 0x2f4f78d3, 0xefa4716d, 0xefa4716d, 0xbecdb635, 0xbecdb635, 0x6f7e9245, 0x836b4134, 0x1229d6ae, 0x1229d6ae, }, 45 },
|
||||
{ "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xddd2650a, 0xddd2650a, 0xceae34fe, 0xceae34fe, 0x61a76c62, 0x61a76c62, 0x88cc6ec7, 0x88cc6ec7, 0xbaf35579, 0xbaf35579, 0xea4b7745, 0xea4b7745, 0x49162f54, 0x49162f54, 0x184d7da3, 0x184d7da3, 0x7545c826, 0x7545c826, 0x70bfbc4f, 0x70bfbc4f, 0x4f61a7d3, 0x4f61a7d3, 0xb3896b4c, 0xb3896b4c, 0x3b75eef4, 0x3b75eef4, 0xb5463daa, 0xb5463daa, 0x243b4ada, 0x243b4ada, 0x4a8fb9e5, 0x4a8fb9e5, 0xeadb8947, 0xeadb8947, 0x4c86692c, 0x4c86692c, 0x4476763e, 0x4476763e, 0xc9d73e67, 0xc9d73e67, 0xb2296bd8, 0xb29699fb, 0x45cb8c3f, 0x45cb8c3f, }, 45 },
|
||||
{ "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xca59adfd, 0xca59adfd, 0x3a82282b, 0x3a82282b, 0x2fdaf106, 0x2fdaf106, 0x26e0f01b, 0x26e0f01b, 0xd88ea764, 0xd88ea764, 0x8e3e3c54, 0x8e3e3c54, 0xf55d50f1, 0xf55d50f1, 0xa2c19d40, 0xa2c19d40, 0xc6be108f, 0xc6be108f, 0x643647a8, 0x643647a8, 0x6fd5f2c, 0x6fd5f2c, 0x1c89092d, 0x1c89092d, 0xc6a89fca, 0xc6a89fca, 0x1646a412, 0x1646a412, 0x74040f03, 0x74040f03, 0x4966c71d, 0x4966c71d, 0x3c7d5a3f, 0x3c7d5a3f, 0x9c091b76, 0x9c091b76, 0xfda8a0ea, 0xfda8a0ea, 0x354452fb, 0x354452fb, 0x3bb9e803, 0x55818eb, 0x86299ae9, 0x86299ae9, }, 45 },
|
||||
{ "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xad0b91c2, 0xad0b91c2, 0x5bf8a72, 0x5bf8a72, 0xd705beec, 0xd705beec, 0x63c6ea8a, 0x63c6ea8a, 0xffedeab0, 0xffedeab0, 0xa657405, 0xa657405, 0xd83d606e, 0xd83d606e, 0x821a2a3a, 0x821a2a3a, 0xf2f5748, 0xf2f5748, 0x87bfe341, 0x87bfe341, 0x72f6f59c, 0x72f6f59c, 0xafab44e5, 0xafab44e5, 0x6c912b9a, 0x6c912b9a, 0x862a8810, 0x862a8810, 0x97b21809, 0x97b21809, 0x2763cfca, 0x2763cfca, 0x56464e5e, 0x56464e5e, 0xc44660d3, 0xc44660d3, 0x10984d6b, 0x10984d6b, 0x24eebfae, 0x24eebfae, 0xc8061900, 0x81675254, 0x9e5f3cc9, 0x9e5f3cc9, }, 45 },
|
||||
{ "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x68ab9311, 0x68ab9311, 0xd717f93c, 0xd717f93c, 0x6984620a, 0x6984620a, 0x152b6d0c, 0x152b6d0c, 0x98b8b84a, 0x98b8b84a, 0xa903181e, 0xa903181e, 0x940e10e6, 0x940e10e6, 0x11cd776b, 0x11cd776b, 0x12624a96, 0x12624a96, 0x4d19f358, 0x4d19f358, 0x82985d2b, 0x82985d2b, 0x1afa0bee, 0x1afa0bee, 0x251e884e, 0x251e884e, 0xd0c023cb, 0xd0c023cb, 0x215e23dc, 0x215e23dc, 0x41da92fc, 0x41da92fc, 0x7d8668b2, 0x7d8668b2, 0xe279755b, 0xe279755b, 0x45ab5067, 0x45ab5067, 0xc2245ac1, 0xc2245ac1, 0x260caee1, 0xcbb70716, 0x11b4a337, 0x11b4a337, }, 45 },
|
||||
{ "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa515d1fe, 0xc3da3d7d, 0xa515d1fe, 0xe6e31cb9, 0x59c36f00, 0x59c36f00, 0x9f7ce1f7, 0x9f7ce1f7, 0x9f7ce1f7, 0xe1fc8c91, 0xe1fc8c91, 0xe1fc8c91, 0x830a9943, 0x830a9943, 0x830a9943, 0x59c36f00, 0xe6e31cb9, 0xe6e31cb9, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x3bcc8944, 0x9fe60efc, 0x3bcc8944, 0x15c90c3b, 0xaa4593fe, 0xaa4593fe, 0x91ef3db0, 0x91ef3db0, 0x91ef3db0, 0x371a30d7, 0x371a30d7, 0x371a30d7, 0x1a229baf, 0x1a229baf, 0x1a229baf, 0xaa4593fe, 0x15c90c3b, 0x15c90c3b, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x4701e2b, 0xbefc41f3, 0x4701e2b, 0x596773af, 0xc9cbf769, 0xc9cbf769, 0x85e9b626, 0x85e9b626, 0x85e9b626, 0x7b3177ea, 0x7b3177ea, 0x7b3177ea, 0x927bc8e2, 0x927bc8e2, 0x927bc8e2, 0xc9cbf769, 0x596773af, 0x596773af, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xe0f4cb75, 0x5354c242, 0xe0f4cb75, 0x4ea282ad, 0x9813a416, 0x9813a416, 0x8acc5af7, 0x8acc5af7, 0x8acc5af7, 0x1b17dcc4, 0x1b17dcc4, 0x1b17dcc4, 0x2ade114, 0x2ade114, 0x2ade114, 0x9813a416, 0x4ea282ad, 0x4ea282ad, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x79bd65d, 0x176dcd3c, 0x79bd65d, 0x713de3ee, 0x5fcf013d, 0x5fcf013d, 0xc848cef3, 0xc848cef3, 0xc848cef3, 0x1a58d685, 0x1a58d685, 0x1a58d685, 0xc2be91a, 0xc2be91a, 0xc2be91a, 0x5fcf013d, 0x713de3ee, 0x713de3ee, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xdaa0c008, 0x8ed864d6, 0xdaa0c008, 0xc1a51a0f, 0xdd28f52b, 0xdd28f52b, 0x673783b0, 0x673783b0, 0x673783b0, 0x460b7a54, 0x460b7a54, 0x460b7a54, 0x3bb3b1d8, 0x3bb3b1d8, 0x3bb3b1d8, 0xdd28f52b, 0xc1a51a0f, 0xc1a51a0f, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xce2d0657, 0x65bcd1ea, 0xce2d0657, 0x31921dd7, 0x43d1f34, 0x43d1f34, 0x7b987b91, 0x7b987b91, 0x7b987b91, 0x492d239, 0x492d239, 0x492d239, 0x9dc3d7bf, 0x9dc3d7bf, 0x9dc3d7bf, 0x43d1f34, 0x31921dd7, 0x31921dd7, 0x43d1f34, }, 20 },
|
||||
{ "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x1027210c, 0x64e51c81, 0x1027210c, 0x45ca4a8a, 0x9a2e0d26, 0xde5d5c76, 0xde5d5c76, 0xde5d5c76, 0x8285aab6, 0x8285aab6, 0x8285aab6, 0xab1d6424, 0xab1d6424, 0xab1d6424, 0x59c36f00, 0x45ca4a8a, 0x45ca4a8a, }, 18 },
|
||||
{ "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x8d12f697, 0xc5b32248, 0x8d12f697, 0x56720aa4, 0xa9d58ccd, 0xebc08e8, 0xebc08e8, 0xebc08e8, 0x5be3a2e2, 0x5be3a2e2, 0x5be3a2e2, 0x32d06aab, 0x32d06aab, 0x32d06aab, 0xaa4593fe, 0x56720aa4, 0x56720aa4, }, 18 },
|
||||
{ "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xa5ec9f45, 0xdb7085d8, 0xa5ec9f45, 0x9caf1d3f, 0x5411be8b, 0xb1733229, 0xb1733229, 0xb1733229, 0xcecd94bd, 0xcecd94bd, 0xcecd94bd, 0x8cb9f4c5, 0x8cb9f4c5, 0x8cb9f4c5, 0xc9cbf769, 0x9caf1d3f, 0x9caf1d3f, }, 18 },
|
||||
{ "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0xce8e83bf, 0xeb96c838, 0xce8e83bf, 0x73cb3bc1, 0x740d78cf, 0x7400503e, 0x7400503e, 0x7400503e, 0x9fa5ba42, 0x9fa5ba42, 0x9fa5ba42, 0x99eebab2, 0x99eebab2, 0x99eebab2, 0x1c3742c9, 0x73cb3bc1, 0x73cb3bc1, }, 18 },
|
||||
{ "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0x56a03e51, 0xee7d8d4b, 0x56a03e51, 0x5bdf9413, 0xbcda144c, 0x46a2d276, 0x46a2d276, 0x46a2d276, 0x29eb0e67, 0x29eb0e67, 0x29eb0e67, 0x241d9064, 0x241d9064, 0x241d9064, 0xcc5a7bed, 0x5bdf9413, 0x5bdf9413, }, 18 },
|
||||
{ "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0xea8a9cf0, 0x8929e522, 0xea8a9cf0, 0x78f3dfbc, 0x5d55a141, 0xfe89652d, 0xfe89652d, 0xfe89652d, 0x383b2133, 0x383b2133, 0x383b2133, 0x2c5ef18c, 0x2c5ef18c, 0x2c5ef18c, 0xef4a3312, 0x78f3dfbc, 0x78f3dfbc, }, 18 },
|
||||
{ "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0x6dcf1d57, 0x925a4c8f, 0x6dcf1d57, 0x69005b38, 0x6d6bb4bc, 0xb646d62d, 0xb646d62d, 0xb646d62d, 0x37b520fc, 0x37b520fc, 0x37b520fc, 0xa1119993, 0xa1119993, 0xa1119993, 0x54e48d80, 0x69005b38, 0x69005b38, }, 18 },
|
||||
{ "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xb59af897, 0xbb7a450f, 0xb59af897, 0xf66c35d0, 0x59c36f00, 0x59c36f00, 0xfb6d6c75, 0xfb6d6c75, 0xfb6d6c75, 0x85ed0113, 0x85ed0113, 0x85ed0113, 0xe71b14c1, 0xe71b14c1, 0xe71b14c1, 0x59c36f00, 0xf66c35d0, 0xf66c35d0, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xcdeaad5f, 0x39f75a73, 0xcdeaad5f, 0xe3ef2820, 0xaa4593fe, 0xaa4593fe, 0x3b858d67, 0x3b858d67, 0x3b858d67, 0x9d708000, 0x9d708000, 0x9d708000, 0xb0482b78, 0xb0482b78, 0xb0482b78, 0xaa4593fe, 0xe3ef2820, 0xe3ef2820, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xbfc1cc02, 0xad4d778f, 0xbfc1cc02, 0xe2d6a186, 0xc9cbf769, 0xc9cbf769, 0xd3fd5934, 0xd3fd5934, 0xd3fd5934, 0x2d2598f8, 0x2d2598f8, 0x2d2598f8, 0xc46f27f0, 0xc46f27f0, 0xc46f27f0, 0xc9cbf769, 0xe2d6a186, 0xe2d6a186, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb4e8961f, 0xa9d9245e, 0xb4e8961f, 0x1abedfc7, 0x9813a416, 0x9813a416, 0x75ea5f6b, 0x75ea5f6b, 0x75ea5f6b, 0xe431d958, 0xe431d958, 0xe431d958, 0xfd8be488, 0xfd8be488, 0xfd8be488, 0x9813a416, 0x1abedfc7, 0x1abedfc7, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xfba9cd4c, 0x3accc3ed, 0xfba9cd4c, 0x8d0ff8ff, 0x5fcf013d, 0x5fcf013d, 0x12029d40, 0x12029d40, 0x12029d40, 0xc0128536, 0xc0128536, 0xc0128536, 0xd661baa9, 0xd661baa9, 0xd661baa9, 0x5fcf013d, 0x8d0ff8ff, 0x8d0ff8ff, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x9afaa18d, 0x5505c090, 0x9afaa18d, 0x81ff7b8a, 0xdd28f52b, 0xdd28f52b, 0xd4c281cf, 0xd4c281cf, 0xd4c281cf, 0xf5fe782b, 0xf5fe782b, 0xf5fe782b, 0x8846b3a7, 0x8846b3a7, 0x8846b3a7, 0xdd28f52b, 0x81ff7b8a, 0x81ff7b8a, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x3af16e43, 0x4b4ee85f, 0x3af16e43, 0xc54e75c3, 0x43d1f34, 0x43d1f34, 0x6a0313f3, 0x6a0313f3, 0x6a0313f3, 0x1509ba5b, 0x1509ba5b, 0x1509ba5b, 0x8c58bfdd, 0x8c58bfdd, 0x8c58bfdd, 0x43d1f34, 0xc54e75c3, 0xc54e75c3, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x49a25e74, 0x3193ac92, 0x49a25e74, 0xa549333, 0x59c36f00, 0x59c36f00, 0xdc6419f, 0xdc6419f, 0xdc6419f, 0x73462cf9, 0x73462cf9, 0x73462cf9, 0x11b0392b, 0x11b0392b, 0x11b0392b, 0x59c36f00, 0xa549333, 0xa549333, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x6485919, 0xa5fc2915, 0x6485919, 0x284ddc66, 0xaa4593fe, 0xaa4593fe, 0x6b2dd2e2, 0x6b2dd2e2, 0x6b2dd2e2, 0xcdd8df85, 0xcdd8df85, 0xcdd8df85, 0xe0e074fd, 0xe0e074fd, 0xe0e074fd, 0xaa4593fe, 0x284ddc66, 0x284ddc66, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x5b7d7c45, 0xf9b8baf8, 0x5b7d7c45, 0x66a11c1, 0xc9cbf769, 0xc9cbf769, 0x57d5ac1f, 0x57d5ac1f, 0x57d5ac1f, 0xa90d6dd3, 0xa90d6dd3, 0xa90d6dd3, 0x4047d2db, 0x4047d2db, 0x4047d2db, 0xc9cbf769, 0x66a11c1, 0x66a11c1, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x6fd2a74d, 0x41fe4726, 0x6fd2a74d, 0xc184ee95, 0x9813a416, 0x9813a416, 0xa132a122, 0xa132a122, 0xa132a122, 0x30e92711, 0x30e92711, 0x30e92711, 0x29531ac1, 0x29531ac1, 0x29531ac1, 0x9813a416, 0xc184ee95, 0xc184ee95, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x69685505, 0xf2c0e268, 0x69685505, 0x1fce60b6, 0x5fcf013d, 0x5fcf013d, 0xd61aeb01, 0xd61aeb01, 0xd61aeb01, 0x40af377, 0x40af377, 0x40af377, 0x1279cce8, 0x1279cce8, 0x1279cce8, 0x5fcf013d, 0x1fce60b6, 0x1fce60b6, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xee7e1be9, 0x7069217c, 0xee7e1be9, 0xf57bc1ee, 0xdd28f52b, 0xdd28f52b, 0x77d02fa2, 0x77d02fa2, 0x77d02fa2, 0x56ecd646, 0x56ecd646, 0x56ecd646, 0x2b541dca, 0x2b541dca, 0x2b541dca, 0xdd28f52b, 0xf57bc1ee, 0xf57bc1ee, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xb5b4521a, 0xf7c443ce, 0xb5b4521a, 0x4a0b499a, 0x43d1f34, 0x43d1f34, 0xd019cfce, 0xd019cfce, 0xd019cfce, 0xaf136666, 0xaf136666, 0xaf136666, 0x364263e0, 0x364263e0, 0x364263e0, 0x43d1f34, 0x4a0b499a, 0x4a0b499a, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x9bdad73f, 0x990f581e, 0x9bdad73f, 0xd82c1a78, 0x59c36f00, 0x59c36f00, 0x663aaa6f, 0x663aaa6f, 0x663aaa6f, 0x18bac709, 0x18bac709, 0x18bac709, 0x7a4cd2db, 0x7a4cd2db, 0x7a4cd2db, 0x59c36f00, 0xd82c1a78, 0xd82c1a78, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xf835ac2, 0xbcd50661, 0xf835ac2, 0x2186dfbd, 0xaa4593fe, 0xaa4593fe, 0x1f1997c1, 0x1f1997c1, 0x1f1997c1, 0xb9ec9aa6, 0xb9ec9aa6, 0xb9ec9aa6, 0x94d431de, 0x94d431de, 0x94d431de, 0xaa4593fe, 0x2186dfbd, 0x2186dfbd, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xa3d7300f, 0x12739a74, 0xa3d7300f, 0xfec05d8b, 0xc9cbf769, 0xc9cbf769, 0x93dd5635, 0x93dd5635, 0x93dd5635, 0x6d0597f9, 0x6d0597f9, 0x6d0597f9, 0x844f28f1, 0x844f28f1, 0x844f28f1, 0xc9cbf769, 0xfec05d8b, 0xfec05d8b, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x32d637b0, 0xc677639b, 0x32d637b0, 0x9c807e68, 0x9813a416, 0x9813a416, 0xa1b8fcf1, 0xa1b8fcf1, 0xa1b8fcf1, 0x30637ac2, 0x30637ac2, 0x30637ac2, 0x29d94712, 0x29d94712, 0x29d94712, 0x9813a416, 0x9c807e68, 0x9c807e68, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x3ec3528b, 0x1e1c878d, 0x3ec3528b, 0x48656738, 0x5fcf013d, 0x5fcf013d, 0x3510cd00, 0x3510cd00, 0x3510cd00, 0xe700d576, 0xe700d576, 0xe700d576, 0xf173eae9, 0xf173eae9, 0xf173eae9, 0x5fcf013d, 0x48656738, 0x48656738, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x50bc4d38, 0x6725a657, 0x50bc4d38, 0x4bb9973f, 0xdd28f52b, 0xdd28f52b, 0x66f52001, 0x66f52001, 0x66f52001, 0x47c9d9e5, 0x47c9d9e5, 0x47c9d9e5, 0x3a711269, 0x3a711269, 0x3a711269, 0xdd28f52b, 0x4bb9973f, 0x4bb9973f, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xc481102d, 0xe22cdb5f, 0xc481102d, 0x3b3e0bad, 0x43d1f34, 0x43d1f34, 0xaf0df118, 0xaf0df118, 0xaf0df118, 0xd00758b0, 0xd00758b0, 0xd00758b0, 0x49565d36, 0x49565d36, 0x49565d36, 0x43d1f34, 0x3b3e0bad, 0x3b3e0bad, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd24e2c02, 0x6e0b3e38, 0xd24e2c02, 0x91b8e145, 0x59c36f00, 0x59c36f00, 0xf6d94324, 0xf6d94324, 0xf6d94324, 0x88592e42, 0x88592e42, 0x88592e42, 0xeaaf3b90, 0xeaaf3b90, 0xeaaf3b90, 0x59c36f00, 0x91b8e145, 0x91b8e145, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x48c95a99, 0xbef981b4, 0x48c95a99, 0x66ccdfe6, 0xaa4593fe, 0xaa4593fe, 0x69f632fe, 0x69f632fe, 0x69f632fe, 0xcf033f99, 0xcf033f99, 0xcf033f99, 0xe23b94e1, 0xe23b94e1, 0xe23b94e1, 0xaa4593fe, 0x66ccdfe6, 0x66ccdfe6, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xdf5958ac, 0x6c53ca72, 0xdf5958ac, 0x824e3528, 0xc9cbf769, 0xc9cbf769, 0x7872f95f, 0x7872f95f, 0x7872f95f, 0x86aa3893, 0x86aa3893, 0x86aa3893, 0x6fe0879b, 0x6fe0879b, 0x6fe0879b, 0xc9cbf769, 0x824e3528, 0x824e3528, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x4e4e65e4, 0x3b08ec97, 0x4e4e65e4, 0xe0182c3c, 0x9813a416, 0x9813a416, 0xd87a3bca, 0xd87a3bca, 0xd87a3bca, 0x49a1bdf9, 0x49a1bdf9, 0x49a1bdf9, 0x501b8029, 0x501b8029, 0x501b8029, 0x9813a416, 0xe0182c3c, 0xe0182c3c, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xa9051255, 0xcbaf6881, 0xa9051255, 0xdfa327e6, 0x5fcf013d, 0x5fcf013d, 0xdc53ce4e, 0xdc53ce4e, 0xdc53ce4e, 0xe43d638, 0xe43d638, 0xe43d638, 0x1830e9a7, 0x1830e9a7, 0x1830e9a7, 0x5fcf013d, 0xdfa327e6, 0xdfa327e6, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xc3280b45, 0xea85a953, 0xc3280b45, 0xd82dd142, 0xdd28f52b, 0xdd28f52b, 0x4f22c62f, 0x4f22c62f, 0x4f22c62f, 0x6e1e3fcb, 0x6e1e3fcb, 0x6e1e3fcb, 0x13a6f447, 0x13a6f447, 0x13a6f447, 0xdd28f52b, 0xd82dd142, 0xd82dd142, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x93f5ee2e, 0x28dc3016, 0x93f5ee2e, 0x6c4af5ae, 0x43d1f34, 0x43d1f34, 0x2e9a92cb, 0x2e9a92cb, 0x2e9a92cb, 0x51903b63, 0x51903b63, 0x51903b63, 0xc8c13ee5, 0xc8c13ee5, 0xc8c13ee5, 0x43d1f34, 0x6c4af5ae, 0x6c4af5ae, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x24539267, 0x1ce59afc, 0x24539267, 0x67a55f20, 0x59c36f00, 0x59c36f00, 0xee51a3ff, 0xee51a3ff, 0xee51a3ff, 0x90d1ce99, 0x90d1ce99, 0x90d1ce99, 0xf227db4b, 0xf227db4b, 0xf227db4b, 0x59c36f00, 0x67a55f20, 0x67a55f20, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x7cb69e26, 0xa3f6f06f, 0x7cb69e26, 0x52b31b59, 0xaa4593fe, 0xaa4593fe, 0x2f6d12b5, 0x2f6d12b5, 0x2f6d12b5, 0x89981fd2, 0x89981fd2, 0x89981fd2, 0xa4a0b4aa, 0xa4a0b4aa, 0xa4a0b4aa, 0xaa4593fe, 0x52b31b59, 0x52b31b59, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9e0eb3da, 0xb0939199, 0x9e0eb3da, 0xc319de5e, 0xc9cbf769, 0xc9cbf769, 0xc9c28f3b, 0xc9c28f3b, 0xc9c28f3b, 0x371a4ef7, 0x371a4ef7, 0x371a4ef7, 0xde50f1ff, 0xde50f1ff, 0xde50f1ff, 0xc9cbf769, 0xc319de5e, 0xc319de5e, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x2bd305d0, 0x593ac70d, 0x2bd305d0, 0x85854c08, 0x9813a416, 0x9813a416, 0xd6c41d1f, 0xd6c41d1f, 0xd6c41d1f, 0x471f9b2c, 0x471f9b2c, 0x471f9b2c, 0x5ea5a6fc, 0x5ea5a6fc, 0x5ea5a6fc, 0x9813a416, 0x85854c08, 0x85854c08, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xd554b2a6, 0xfcb62ffa, 0xd554b2a6, 0xa3f28715, 0x5fcf013d, 0x5fcf013d, 0x49663ae2, 0x49663ae2, 0x49663ae2, 0x9b762294, 0x9b762294, 0x9b762294, 0x8d051d0b, 0x8d051d0b, 0x8d051d0b, 0x5fcf013d, 0xa3f28715, 0xa3f28715, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xcb4a441b, 0x47bfd292, 0xcb4a441b, 0xd04f9e1c, 0xdd28f52b, 0xdd28f52b, 0x1c62c4cf, 0x1c62c4cf, 0x1c62c4cf, 0x3d5e3d2b, 0x3d5e3d2b, 0x3d5e3d2b, 0x40e6f6a7, 0x40e6f6a7, 0x40e6f6a7, 0xdd28f52b, 0xd04f9e1c, 0xd04f9e1c, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x84489cd2, 0x3b86feab, 0x84489cd2, 0x7bf78752, 0x43d1f34, 0x43d1f34, 0xeb4b4093, 0xeb4b4093, 0xeb4b4093, 0x9441e93b, 0x9441e93b, 0x9441e93b, 0xd10ecbd, 0xd10ecbd, 0xd10ecbd, 0x43d1f34, 0x7bf78752, 0x7bf78752, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xdac60224, 0xf1212716, 0xdac60224, 0x9930cf63, 0x59c36f00, 0x59c36f00, 0xd83aedef, 0xd83aedef, 0xd83aedef, 0xa6ba8089, 0xa6ba8089, 0xa6ba8089, 0xc44c955b, 0xc44c955b, 0xc44c955b, 0x59c36f00, 0x9930cf63, 0x9930cf63, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xddb471d2, 0x2a23e66b, 0xddb471d2, 0xf3b1f4ad, 0xaa4593fe, 0xaa4593fe, 0x44e1ed3b, 0x44e1ed3b, 0x44e1ed3b, 0xe214e05c, 0xe214e05c, 0xe214e05c, 0xcf2c4b24, 0xcf2c4b24, 0xcf2c4b24, 0xaa4593fe, 0xf3b1f4ad, 0xf3b1f4ad, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xd3319fed, 0x4fb7eab2, 0xd3319fed, 0x8e26f269, 0xc9cbf769, 0xc9cbf769, 0xb45d8a1a, 0xb45d8a1a, 0xb45d8a1a, 0x4a854bd6, 0x4a854bd6, 0x4a854bd6, 0xa3cff4de, 0xa3cff4de, 0xa3cff4de, 0xc9cbf769, 0x8e26f269, 0x8e26f269, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x73fb17c5, 0x379bd3f4, 0x73fb17c5, 0xddad5e1d, 0x9813a416, 0x9813a416, 0xbd332cdb, 0xbd332cdb, 0xbd332cdb, 0x2ce8aae8, 0x2ce8aae8, 0x2ce8aae8, 0x35529738, 0x35529738, 0x35529738, 0x9813a416, 0xddad5e1d, 0xddad5e1d, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xbb670d35, 0x672cb790, 0xbb670d35, 0xcdc13886, 0x5fcf013d, 0x5fcf013d, 0x14e80d5a, 0x14e80d5a, 0x14e80d5a, 0xc6f8152c, 0xc6f8152c, 0xc6f8152c, 0xd08b2ab3, 0xd08b2ab3, 0xd08b2ab3, 0x5fcf013d, 0xcdc13886, 0xcdc13886, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd2d29462, 0xf9dbf485, 0xd2d29462, 0xc9d74e65, 0xdd28f52b, 0xdd28f52b, 0x92d1dcce, 0x92d1dcce, 0x92d1dcce, 0xb3ed252a, 0xb3ed252a, 0xb3ed252a, 0xce55eea6, 0xce55eea6, 0xce55eea6, 0xdd28f52b, 0xc9d74e65, 0xc9d74e65, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x65d2aa3c, 0xa00491c3, 0x65d2aa3c, 0x9a6db1bc, 0x43d1f34, 0x43d1f34, 0x33df64a1, 0x33df64a1, 0x33df64a1, 0x4cd5cd09, 0x4cd5cd09, 0x4cd5cd09, 0xd584c88f, 0xd584c88f, 0xd584c88f, 0x43d1f34, 0x9a6db1bc, 0x9a6db1bc, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x19f4b551, 0x7f3b59d2, 0x19f4b551, 0x5a027816, 0x59c36f00, 0x59c36f00, 0x9f7ce1f7, 0x9f7ce1f7, 0x9f7ce1f7, 0xe1fc8c91, 0xe1fc8c91, 0xe1fc8c91, 0x830a9943, 0x830a9943, 0x830a9943, 0x59c36f00, 0x5a027816, 0x5a027816, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x82acacc0, 0x26862b78, 0x82acacc0, 0xaca929bf, 0xaa4593fe, 0xaa4593fe, 0x91ef3db0, 0x91ef3db0, 0x91ef3db0, 0x371a30d7, 0x371a30d7, 0x371a30d7, 0x1a229baf, 0x1a229baf, 0x1a229baf, 0xaa4593fe, 0xaca929bf, 0xaca929bf, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x8418ee7d, 0x3e94b1a5, 0x8418ee7d, 0xd90f83f9, 0xc9cbf769, 0xc9cbf769, 0x85e9b626, 0x85e9b626, 0x85e9b626, 0x7b3177ea, 0x7b3177ea, 0x7b3177ea, 0x927bc8e2, 0x927bc8e2, 0x927bc8e2, 0xc9cbf769, 0xd90f83f9, 0xd90f83f9, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x55d57857, 0xe6757160, 0x55d57857, 0xfb83318f, 0x9813a416, 0x9813a416, 0x8acc5af7, 0x8acc5af7, 0x8acc5af7, 0x1b17dcc4, 0x1b17dcc4, 0x1b17dcc4, 0x2ade114, 0x2ade114, 0x2ade114, 0x9813a416, 0xfb83318f, 0xfb83318f, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x45b838a5, 0x554e23c4, 0x45b838a5, 0x331e0d16, 0x5fcf013d, 0x5fcf013d, 0xc848cef3, 0xc848cef3, 0xc848cef3, 0x1a58d685, 0x1a58d685, 0x1a58d685, 0xc2be91a, 0xc2be91a, 0xc2be91a, 0x5fcf013d, 0x331e0d16, 0x331e0d16, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x4e904177, 0x1ae8e5a9, 0x4e904177, 0x55959b70, 0xdd28f52b, 0xdd28f52b, 0x673783b0, 0x673783b0, 0x673783b0, 0x460b7a54, 0x460b7a54, 0x460b7a54, 0x3bb3b1d8, 0x3bb3b1d8, 0x3bb3b1d8, 0xdd28f52b, 0x55959b70, 0x55959b70, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x83e5445a, 0x287493e7, 0x83e5445a, 0x7c5a5fda, 0x43d1f34, 0x43d1f34, 0x7b987b91, 0x7b987b91, 0x7b987b91, 0x492d239, 0x492d239, 0x492d239, 0x9dc3d7bf, 0x9dc3d7bf, 0x9dc3d7bf, 0x43d1f34, 0x7c5a5fda, 0x7c5a5fda, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x43eebd9e, 0xc5e097a, 0x43eebd9e, 0x1870d9, 0x59c36f00, 0x59c36f00, 0x90b8be2f, 0x90b8be2f, 0x90b8be2f, 0xee38d349, 0xee38d349, 0xee38d349, 0x8ccec69b, 0x8ccec69b, 0x8ccec69b, 0x59c36f00, 0x1870d9, 0x1870d9, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd16e76b1, 0xd80a42d2, 0xd16e76b1, 0xff6bf3ce, 0xaa4593fe, 0xaa4593fe, 0xe8b201a3, 0xe8b201a3, 0xe8b201a3, 0x4e470cc4, 0x4e470cc4, 0x4e470cc4, 0x637fa7bc, 0x637fa7bc, 0x637fa7bc, 0xaa4593fe, 0xff6bf3ce, 0xff6bf3ce, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x46c9c0b6, 0x879836ab, 0x46c9c0b6, 0x1bdead32, 0xc9cbf769, 0xc9cbf769, 0x7f3bf79a, 0x7f3bf79a, 0x7f3bf79a, 0x81e33656, 0x81e33656, 0x81e33656, 0x68a9895e, 0x68a9895e, 0x68a9895e, 0xc9cbf769, 0x1bdead32, 0x1bdead32, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xbedd413, 0x570f7ebf, 0xbedd413, 0xa5bb9dcb, 0x9813a416, 0x9813a416, 0x30f35812, 0x30f35812, 0x30f35812, 0xa128de21, 0xa128de21, 0xa128de21, 0xb892e3f1, 0xb892e3f1, 0xb892e3f1, 0x9813a416, 0xa5bb9dcb, 0xa5bb9dcb, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x76ec4315, 0xffca72c, 0x76ec4315, 0x4a76a6, 0x5fcf013d, 0x5fcf013d, 0x7b237d7d, 0x7b237d7d, 0x7b237d7d, 0xa933650b, 0xa933650b, 0xa933650b, 0xbf405a94, 0xbf405a94, 0xbf405a94, 0x5fcf013d, 0x4a76a6, 0x4a76a6, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x75cfd768, 0x1fb76756, 0x75cfd768, 0x6eca0d6f, 0xdd28f52b, 0xdd28f52b, 0xa0ff4b91, 0xa0ff4b91, 0xa0ff4b91, 0x81c3b275, 0x81c3b275, 0x81c3b275, 0xfc7b79f9, 0xfc7b79f9, 0xfc7b79f9, 0xdd28f52b, 0x6eca0d6f, 0x6eca0d6f, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xd5cf1813, 0x2659463a, 0xd5cf1813, 0x2a700393, 0x43d1f34, 0x43d1f34, 0x850afb92, 0x850afb92, 0x850afb92, 0xfa00523a, 0xfa00523a, 0xfa00523a, 0x635157bc, 0x635157bc, 0x635157bc, 0x43d1f34, 0x2a700393, 0x2a700393, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x5d323c44, 0x6f401130, 0x5d323c44, 0x1ec4f103, 0x59c36f00, 0x59c36f00, 0x68eced5a, 0x68eced5a, 0x68eced5a, 0x166c803c, 0x166c803c, 0x166c803c, 0x749a95ee, 0x749a95ee, 0x749a95ee, 0x59c36f00, 0x1ec4f103, 0x1ec4f103, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x984941ed, 0xbbac7b68, 0x984941ed, 0xb64cc492, 0xaa4593fe, 0xaa4593fe, 0x4082ddcb, 0x4082ddcb, 0x4082ddcb, 0xe677d0ac, 0xe677d0ac, 0xe677d0ac, 0xcb4f7bd4, 0xcb4f7bd4, 0xcb4f7bd4, 0xaa4593fe, 0xb64cc492, 0xb64cc492, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xb6d3d3b9, 0x80de2a76, 0xb6d3d3b9, 0xebc4be3d, 0xc9cbf769, 0xc9cbf769, 0xea0ec457, 0xea0ec457, 0xea0ec457, 0x14d6059b, 0x14d6059b, 0x14d6059b, 0xfd9cba93, 0xfd9cba93, 0xfd9cba93, 0xc9cbf769, 0xebc4be3d, 0xebc4be3d, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x4733985d, 0xd2f2adf1, 0x4733985d, 0xe965d185, 0x9813a416, 0x9813a416, 0xa2feabe5, 0xa2feabe5, 0xa2feabe5, 0x33252dd6, 0x33252dd6, 0x33252dd6, 0x2a9f1006, 0x2a9f1006, 0x2a9f1006, 0x9813a416, 0xe965d185, 0xe965d185, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x939ea364, 0x446d09d7, 0x939ea364, 0xe53896d7, 0x5fcf013d, 0x5fcf013d, 0x39f5030f, 0x39f5030f, 0x39f5030f, 0xebe51b79, 0xebe51b79, 0xebe51b79, 0xfd9624e6, 0xfd9624e6, 0xfd9624e6, 0x5fcf013d, 0xe53896d7, 0xe53896d7, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x63d43704, 0xfc83811b, 0x63d43704, 0x78d1ed03, 0xdd28f52b, 0xdd28f52b, 0x9835fc4a, 0x9835fc4a, 0x9835fc4a, 0xb90905ae, 0xb90905ae, 0xb90905ae, 0xc4b1ce22, 0xc4b1ce22, 0xc4b1ce22, 0xdd28f52b, 0x78d1ed03, 0x78d1ed03, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xfc47195d, 0xa0c62a2e, 0xfc47195d, 0x3f802dd, 0x43d1f34, 0x43d1f34, 0x8e86b971, 0x8e86b971, 0x8e86b971, 0xf18c10d9, 0xf18c10d9, 0xf18c10d9, 0x68dd155f, 0x68dd155f, 0x68dd155f, 0x43d1f34, 0x3f802dd, 0x3f802dd, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xc3dd7b3, 0x6af23b30, 0xc3dd7b3, 0x5b10696d, 0x59c36f00, 0x59c36f00, 0xf6ddaf81, 0xf6ddaf81, 0xf6ddaf81, 0x885dc2e7, 0x885dc2e7, 0x885dc2e7, 0xeaabd735, 0xeaabd735, 0xeaabd735, 0x59c36f00, 0x5b10696d, 0x5b10696d, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x28fe03b3, 0x8cd4840b, 0x28fe03b3, 0x9859d9e5, 0xaa4593fe, 0xaa4593fe, 0x1af5874a, 0x1af5874a, 0x1af5874a, 0xbc008a2d, 0xbc008a2d, 0xbc008a2d, 0x91382155, 0x91382155, 0x91382155, 0xaa4593fe, 0x9859d9e5, 0x9859d9e5, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x2d13f9b, 0xb85d6043, 0x2d13f9b, 0x12f42135, 0xc9cbf769, 0xc9cbf769, 0x11cfa191, 0x11cfa191, 0x11cfa191, 0xef17605d, 0xef17605d, 0xef17605d, 0x65ddf55, 0x65ddf55, 0x65ddf55, 0xc9cbf769, 0x12f42135, 0x12f42135, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x6c62d67b, 0xdfc2df4c, 0x6c62d67b, 0x5c132a54, 0x9813a416, 0x9813a416, 0x7e455ca7, 0x7e455ca7, 0x7e455ca7, 0xef9eda94, 0xef9eda94, 0xef9eda94, 0xf624e744, 0xf624e744, 0xf624e744, 0x9813a416, 0x5c132a54, 0x5c132a54, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xbc94f31d, 0xac62e87c, 0xbc94f31d, 0x12931ce8, 0x5fcf013d, 0x5fcf013d, 0x11dc48b3, 0x11dc48b3, 0x11dc48b3, 0xc3cc50c5, 0xc3cc50c5, 0xc3cc50c5, 0xd5bf6f5a, 0xd5bf6f5a, 0xd5bf6f5a, 0x5fcf013d, 0x12931ce8, 0x12931ce8, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x46cc571d, 0x12b4f3c3, 0x46cc571d, 0xc8a89cc7, 0xdd28f52b, 0xdd28f52b, 0xa242e6a5, 0xa242e6a5, 0xa242e6a5, 0x837e1f41, 0x837e1f41, 0x837e1f41, 0xfec6d4cd, 0xfec6d4cd, 0xfec6d4cd, 0xdd28f52b, 0xc8a89cc7, 0xc8a89cc7, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x3b91fa00, 0x90002dbd, 0x3b91fa00, 0xacc97ca0, 0x43d1f34, 0x43d1f34, 0x935e0051, 0x935e0051, 0x935e0051, 0xec54a9f9, 0xec54a9f9, 0xec54a9f9, 0x7505ac7f, 0x7505ac7f, 0x7505ac7f, 0x43d1f34, 0xacc97ca0, 0xacc97ca0, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x361f2fba, 0x50d0c339, 0x361f2fba, 0x8e558070, 0x59c36f00, 0x59c36f00, 0x9f7ce1f7, 0x9f7ce1f7, 0x9f7ce1f7, 0xe1fc8c91, 0xe1fc8c91, 0xe1fc8c91, 0x830a9943, 0x830a9943, 0x830a9943, 0x59c36f00, 0x8e558070, 0x8e558070, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x4a4231ef, 0xee68b657, 0x4a4231ef, 0x89c4f960, 0xaa4593fe, 0xaa4593fe, 0x91ef3db0, 0x91ef3db0, 0x91ef3db0, 0x371a30d7, 0x371a30d7, 0x371a30d7, 0x1a229baf, 0x1a229baf, 0x1a229baf, 0xaa4593fe, 0x89c4f960, 0x89c4f960, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xc07bd682, 0x7af7895a, 0xc07bd682, 0x821e2abf, 0xc9cbf769, 0xc9cbf769, 0x85e9b626, 0x85e9b626, 0x85e9b626, 0x7b3177ea, 0x7b3177ea, 0x7b3177ea, 0x927bc8e2, 0x927bc8e2, 0x927bc8e2, 0xc9cbf769, 0x821e2abf, 0x821e2abf, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x1b63aa4c, 0xa8c3a37b, 0x1b63aa4c, 0x55700805, 0x9813a416, 0x9813a416, 0x8acc5af7, 0x8acc5af7, 0x8acc5af7, 0x1b17dcc4, 0x1b17dcc4, 0x1b17dcc4, 0x2ade114, 0x2ade114, 0x2ade114, 0x9813a416, 0x55700805, 0x55700805, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xc570d6cb, 0xd586cdaa, 0xc570d6cb, 0x5616d9fc, 0x5fcf013d, 0x5fcf013d, 0xc848cef3, 0xc848cef3, 0xc848cef3, 0x1a58d685, 0x1a58d685, 0x1a58d685, 0xc2be91a, 0xc2be91a, 0xc2be91a, 0x5fcf013d, 0x5616d9fc, 0x5616d9fc, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x5b2b8d24, 0xf5329fa, 0x5b2b8d24, 0xbcad497a, 0xdd28f52b, 0xdd28f52b, 0x673783b0, 0x673783b0, 0x673783b0, 0x460b7a54, 0x460b7a54, 0x460b7a54, 0x3bb3b1d8, 0x3bb3b1d8, 0x3bb3b1d8, 0xdd28f52b, 0xbcad497a, 0xbcad497a, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x96edfa54, 0x3d7c2de9, 0x96edfa54, 0xee65a4fb, 0x43d1f34, 0x43d1f34, 0x7b987b91, 0x7b987b91, 0x7b987b91, 0x492d239, 0x492d239, 0x492d239, 0x9dc3d7bf, 0x9dc3d7bf, 0x9dc3d7bf, 0x43d1f34, 0xee65a4fb, 0xee65a4fb, 0x43d1f34, }, 20 },
|
||||
{ "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x24dc7bce, 0x24dc7bce, 0x338542b, 0x338542b, 0x2016b9d1, 0x2016b9d1, 0xc2619a36, 0xc2619a36, 0x10fce1e, 0x10fce1e, 0x8267298e, 0x8267298e, 0xf44246cf, 0xf44246cf, 0x3ee2860f, 0x3ee2860f, 0x1191f916, 0x1191f916, 0xfa8ce1b5, 0xfa8ce1b5, 0xc1f18b8e, 0xc1f18b8e, 0x43f8c0e8, 0x43f8c0e8, 0xbc0d166a, 0xbc0d166a, 0x7b742e8f, 0x7b742e8f, 0x2c3c7f89, 0x2c3c7f89, 0x80148a7e, 0x80148a7e, 0x21daaadf, 0x21daaadf, 0x15e97fa9, 0x15e97fa9, 0x2428d454, 0x2428d454, 0xb12b0f78, 0xb12b0f78, 0x29648b05, 0x8ce36e6f, 0xd26b03dd, 0xd26b03dd, }, 45 },
|
||||
{ "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd09d4d28, 0xd09d4d28, 0xb41a2f17, 0xb41a2f17, 0x56381354, 0x56381354, 0xf2c5615f, 0xf2c5615f, 0xa41822ae, 0xa41822ae, 0xba2e3e60, 0xba2e3e60, 0x1859aaac, 0x1859aaac, 0x6c354a92, 0x6c354a92, 0x652d3eb, 0x652d3eb, 0xffcf0fd8, 0xffcf0fd8, 0xd3c9187c, 0xd3c9187c, 0xdee59346, 0xdee59346, 0x950f6354, 0x950f6354, 0xa2f7e36a, 0xa2f7e36a, 0x3967359a, 0x3967359a, 0x12738c9a, 0x12738c9a, 0xffb94ca3, 0xffb94ca3, 0xd9384791, 0xd9384791, 0xade1fd25, 0xade1fd25, 0xca109ebe, 0xca109ebe, 0x6e794e, 0x20d769cf, 0x29cc1fdc, 0x29cc1fdc, }, 45 },
|
||||
{ "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x6cfe9089, 0x6cfe9089, 0xbe85dea2, 0xbe85dea2, 0x5f57923d, 0x5f57923d, 0xd28ad04b, 0xd28ad04b, 0x9ac91b28, 0x9ac91b28, 0x26977f54, 0x26977f54, 0x56cfda54, 0x56cfda54, 0xae54550f, 0xae54550f, 0x5843182b, 0x5843182b, 0xa1524272, 0xa1524272, 0x86b707db, 0x86b707db, 0x4127540e, 0x4127540e, 0xe89ea08e, 0xe89ea08e, 0x85f4dccc, 0x85f4dccc, 0xf910d16c, 0xf910d16c, 0xd43ff6b8, 0xd43ff6b8, 0xcdec4fd0, 0xcdec4fd0, 0xad650879, 0xad650879, 0x6d8e01c7, 0x6d8e01c7, 0x3ce7c69f, 0x3ce7c69f, 0xed54e2ef, 0x141319e, 0x9003a604, 0x9003a604, }, 45 },
|
||||
{ "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x37f1b28e, 0x37f1b28e, 0x248de37a, 0x248de37a, 0x8b84bbe6, 0x8b84bbe6, 0x62efb943, 0x62efb943, 0x50d082fd, 0x50d082fd, 0x68a0c1, 0x68a0c1, 0xa335f8d0, 0xa335f8d0, 0xf26eaa27, 0xf26eaa27, 0x9f661fa2, 0x9f661fa2, 0x9a9c6bcb, 0x9a9c6bcb, 0xa5427057, 0xa5427057, 0x59aabcc8, 0x59aabcc8, 0xd1563970, 0xd1563970, 0x5f65ea2e, 0x5f65ea2e, 0xce189d5e, 0xce189d5e, 0xa0ac6e61, 0xa0ac6e61, 0xf85ec3, 0xf85ec3, 0xa6a5bea8, 0xa6a5bea8, 0xae55a1ba, 0xae55a1ba, 0x23f4e9e3, 0x23f4e9e3, 0x580abc5c, 0x58b54e7f, 0xafe85bbb, 0xafe85bbb, }, 45 },
|
||||
{ "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x6d4812ec, 0x6d4812ec, 0x9d93973a, 0x9d93973a, 0x88cb4e17, 0x88cb4e17, 0x81f14f0a, 0x81f14f0a, 0x7f9f1875, 0x7f9f1875, 0x292f8345, 0x292f8345, 0x524cefe0, 0x524cefe0, 0x5d02251, 0x5d02251, 0x61afaf9e, 0x61afaf9e, 0xc327f8b9, 0xc327f8b9, 0xa1ece03d, 0xa1ece03d, 0xbb98b63c, 0xbb98b63c, 0x61b920db, 0x61b920db, 0xb1571b03, 0xb1571b03, 0xd315b012, 0xd315b012, 0xee77780c, 0xee77780c, 0x9b6ce52e, 0x9b6ce52e, 0x3b18a467, 0x3b18a467, 0x5ab91ffb, 0x5ab91ffb, 0x9255edea, 0x9255edea, 0x9ca85712, 0xa249a7fa, 0x213825f8, 0x213825f8, }, 45 },
|
||||
{ "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x10bc4224, 0x10bc4224, 0xb8085994, 0xb8085994, 0x6ab26d0a, 0x6ab26d0a, 0xde71396c, 0xde71396c, 0x425a3956, 0x425a3956, 0xb7d2a7e3, 0xb7d2a7e3, 0x658ab388, 0x658ab388, 0x3fadf9dc, 0x3fadf9dc, 0xb29884ae, 0xb29884ae, 0x3a0830a7, 0x3a0830a7, 0xcf41267a, 0xcf41267a, 0x121c9703, 0x121c9703, 0xd126f87c, 0xd126f87c, 0x3b9d5bf6, 0x3b9d5bf6, 0x2a05cbef, 0x2a05cbef, 0x9ad41c2c, 0x9ad41c2c, 0xebf19db8, 0xebf19db8, 0x79f1b335, 0x79f1b335, 0xad2f9e8d, 0xad2f9e8d, 0x99596c48, 0x99596c48, 0x75b1cae6, 0x3cd081b2, 0x23e8ef2f, 0x23e8ef2f, }, 45 },
|
||||
{ "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x8920d2ff, 0x8920d2ff, 0x369cb8d2, 0x369cb8d2, 0x880f23e4, 0x880f23e4, 0xf4a02ce2, 0xf4a02ce2, 0x7933f9a4, 0x7933f9a4, 0x488859f0, 0x488859f0, 0x75855108, 0x75855108, 0xf0463685, 0xf0463685, 0xf3e90b78, 0xf3e90b78, 0xac92b2b6, 0xac92b2b6, 0x63131cc5, 0x63131cc5, 0xfb714a00, 0xfb714a00, 0xc495c9a0, 0xc495c9a0, 0x314b6225, 0x314b6225, 0xc0d56232, 0xc0d56232, 0xa051d312, 0xa051d312, 0x9c0d295c, 0x9c0d295c, 0x3f234b5, 0x3f234b5, 0xa4201189, 0xa4201189, 0x23af1b2f, 0x23af1b2f, 0xc787ef0f, 0x2a3c46f8, 0xf03fe2d9, 0xf03fe2d9, }, 45 },
|
||||
{ "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xdff707ef, 0xb938eb6c, 0xdff707ef, 0x9c01caa8, 0x59c36f00, 0x59c36f00, 0xd3548a15, 0xd3548a15, 0xd3548a15, 0xadd4e773, 0xadd4e773, 0xadd4e773, 0xcf22f2a1, 0xcf22f2a1, 0xcf22f2a1, 0x59c36f00, 0x9c01caa8, 0x9c01caa8, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x59f141e3, 0xfddbc65b, 0x59f141e3, 0x77f4c49c, 0xaa4593fe, 0xaa4593fe, 0x7d5e4ea7, 0x7d5e4ea7, 0x7d5e4ea7, 0xdbab43c0, 0xdbab43c0, 0xdbab43c0, 0xf693e8b8, 0xf693e8b8, 0xf693e8b8, 0xaa4593fe, 0x77f4c49c, 0x77f4c49c, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9ac56bc2, 0x2049341a, 0x9ac56bc2, 0xc7d20646, 0xc9cbf769, 0xc9cbf769, 0x7c3c68c, 0x7c3c68c, 0x7c3c68c, 0xf91b0740, 0xf91b0740, 0xf91b0740, 0x1051b848, 0x1051b848, 0x1051b848, 0xc9cbf769, 0xc7d20646, 0xc7d20646, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xd50b603, 0xbef0bf34, 0xd50b603, 0xa306ffdb, 0x9813a416, 0x9813a416, 0x60ef8d73, 0x60ef8d73, 0x60ef8d73, 0xf1340b40, 0xf1340b40, 0xf1340b40, 0xe88e3690, 0xe88e3690, 0xe88e3690, 0x9813a416, 0xa306ffdb, 0xa306ffdb, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x9408bd4d, 0x84fea62c, 0x9408bd4d, 0xe2ae88fe, 0x5fcf013d, 0x5fcf013d, 0x6f5971e2, 0x6f5971e2, 0x6f5971e2, 0xbd496994, 0xbd496994, 0xbd496994, 0xab3a560b, 0xab3a560b, 0xab3a560b, 0x5fcf013d, 0xe2ae88fe, 0xe2ae88fe, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x8460b76a, 0xd01813b4, 0x8460b76a, 0x9f656d6d, 0xdd28f52b, 0xdd28f52b, 0xda805056, 0xda805056, 0xda805056, 0xfbbca9b2, 0xfbbca9b2, 0xfbbca9b2, 0x8604623e, 0x8604623e, 0x8604623e, 0xdd28f52b, 0x9f656d6d, 0x9f656d6d, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x115542af, 0xbac49512, 0x115542af, 0xeeea592f, 0x43d1f34, 0x43d1f34, 0x9a133a7f, 0x9a133a7f, 0x9a133a7f, 0xe51993d7, 0xe51993d7, 0xe51993d7, 0x7c489651, 0x7c489651, 0x7c489651, 0x43d1f34, 0xeeea592f, 0xeeea592f, 0x43d1f34, }, 20 },
|
||||
{ "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x60e56714, 0x14275a99, 0x60e56714, 0x35080c92, 0x9a2e0d26, 0x35f491f9, 0x35f491f9, 0x35f491f9, 0x692c6739, 0x692c6739, 0x692c6739, 0x40b4a9ab, 0x40b4a9ab, 0x40b4a9ab, 0x59c36f00, 0x35080c92, 0x35080c92, }, 18 },
|
||||
{ "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x33d94a8c, 0x7b789e53, 0x33d94a8c, 0xe8b9b6bf, 0xa9d58ccd, 0xeee84c5, 0xeee84c5, 0xeee84c5, 0x5bb12ecf, 0x5bb12ecf, 0x5bb12ecf, 0x3282e686, 0x3282e686, 0x3282e686, 0xaa4593fe, 0xe8b9b6bf, 0xe8b9b6bf, }, 18 },
|
||||
{ "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe4669404, 0x9afa8e99, 0xe4669404, 0xdd25167e, 0x5411be8b, 0x2cf5262a, 0x2cf5262a, 0x2cf5262a, 0x534b80be, 0x534b80be, 0x534b80be, 0x113fe0c6, 0x113fe0c6, 0x113fe0c6, 0xc9cbf769, 0xdd25167e, 0xdd25167e, }, 18 },
|
||||
{ "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0x37ed1568, 0x12f55eef, 0x37ed1568, 0x8aa8ad16, 0x740d78cf, 0x7bd2e3a3, 0x7bd2e3a3, 0x7bd2e3a3, 0x907709df, 0x907709df, 0x907709df, 0x963c092f, 0x963c092f, 0x963c092f, 0x1c3742c9, 0x8aa8ad16, 0x8aa8ad16, }, 18 },
|
||||
{ "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0xc5315ac9, 0x7dece9d3, 0xc5315ac9, 0xc84ef08b, 0xbcda144c, 0xd45c93dc, 0xd45c93dc, 0xd45c93dc, 0xbb154fcd, 0xbb154fcd, 0xbb154fcd, 0xb6e3d1ce, 0xb6e3d1ce, 0xb6e3d1ce, 0xcc5a7bed, 0xc84ef08b, 0xc84ef08b, }, 18 },
|
||||
{ "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0x40a72ecd, 0x2304571f, 0x40a72ecd, 0xd2de6d81, 0x5d55a141, 0x304db662, 0x304db662, 0x304db662, 0xf6fff27c, 0xf6fff27c, 0xf6fff27c, 0xe29a22c3, 0xe29a22c3, 0xe29a22c3, 0xef4a3312, 0xd2de6d81, 0xd2de6d81, }, 18 },
|
||||
{ "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0xe6143ead, 0x19816f75, 0xe6143ead, 0xe2db78c2, 0xa992f629, 0xe0ddd143, 0xe0ddd143, 0xe0ddd143, 0x612e2792, 0x612e2792, 0x612e2792, 0xf78a9efd, 0xf78a9efd, 0xf78a9efd, 0x54e48d80, 0xe2db78c2, 0xe2db78c2, }, 18 },
|
||||
{ "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x3d69d4f7, 0x5b2df52e, 0x3d69d4f7, 0x7e9f19b0, 0x59c36f00, 0x59c36f00, 0xaa418d14, 0xaa418d14, 0xaa418d14, 0xd4c1e072, 0xd4c1e072, 0xd4c1e072, 0xb637f5a0, 0xb637f5a0, 0xb637f5a0, 0x59c36f00, 0x7e9f19b0, 0x7e9f19b0, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xea153935, 0xadda68ff, 0xea153935, 0xc410bc4a, 0xaa4593fe, 0xaa4593fe, 0x63090f39, 0x63090f39, 0x63090f39, 0xc5fc025e, 0xc5fc025e, 0xc5fc025e, 0xe8c4a926, 0xe8c4a926, 0xe8c4a926, 0xaa4593fe, 0xc410bc4a, 0xc410bc4a, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe677248f, 0x9a146b56, 0xe677248f, 0xbb60490b, 0xc9cbf769, 0xc9cbf769, 0xebd87b6a, 0xebd87b6a, 0xebd87b6a, 0x1500baa6, 0x1500baa6, 0x1500baa6, 0xfc4a05ae, 0xfc4a05ae, 0xfc4a05ae, 0xc9cbf769, 0xbb60490b, 0xbb60490b, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x2fe1d8b3, 0x344dc22f, 0x2fe1d8b3, 0x81b7916b, 0x9813a416, 0x9813a416, 0xb42009b, 0xb42009b, 0xb42009b, 0x9a9986a8, 0x9a9986a8, 0x9a9986a8, 0x8323bb78, 0x8323bb78, 0x8323bb78, 0x9813a416, 0x81b7916b, 0x81b7916b, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x2f2ab760, 0x373afa93, 0x2f2ab760, 0x598c82d3, 0x5fcf013d, 0x5fcf013d, 0x8a9a15e2, 0x8a9a15e2, 0x8a9a15e2, 0x588a0d94, 0x588a0d94, 0x588a0d94, 0x4ef9320b, 0x4ef9320b, 0x4ef9320b, 0x5fcf013d, 0x598c82d3, 0x598c82d3, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xb9de66a8, 0x2b705981, 0xb9de66a8, 0xa2dbbcaf, 0xdd28f52b, 0xdd28f52b, 0x971eb98b, 0x971eb98b, 0x971eb98b, 0xb622406f, 0xb622406f, 0xb622406f, 0xcb9a8be3, 0xcb9a8be3, 0xcb9a8be3, 0xdd28f52b, 0xa2dbbcaf, 0xa2dbbcaf, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x84029f68, 0x7385ec77, 0x84029f68, 0x7bbd84e8, 0x43d1f34, 0x43d1f34, 0x73cb201f, 0x73cb201f, 0x73cb201f, 0xcc189b7, 0xcc189b7, 0xcc189b7, 0x95908c31, 0x95908c31, 0x95908c31, 0x43d1f34, 0x7bbd84e8, 0x7bbd84e8, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xb2446469, 0xca75968f, 0xb2446469, 0xf1b2a92e, 0x59c36f00, 0x59c36f00, 0xc0eac671, 0xc0eac671, 0xc0eac671, 0xbe6aab17, 0xbe6aab17, 0xbe6aab17, 0xdc9cbec5, 0xdc9cbec5, 0xdc9cbec5, 0x59c36f00, 0xf1b2a92e, 0xf1b2a92e, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xe219612c, 0x41ad1120, 0xe219612c, 0xcc1ce453, 0xaa4593fe, 0xaa4593fe, 0x1f05167, 0x1f05167, 0x1f05167, 0xa7055c00, 0xa7055c00, 0xa7055c00, 0x8a3df778, 0x8a3df778, 0x8a3df778, 0xaa4593fe, 0xcc1ce453, 0xcc1ce453, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9f3ca4a3, 0x3df9621e, 0x9f3ca4a3, 0xc22bc927, 0xc9cbf769, 0xc9cbf769, 0x8f0b71ba, 0x8f0b71ba, 0x8f0b71ba, 0x71d3b076, 0x71d3b076, 0x71d3b076, 0x98990f7e, 0x98990f7e, 0x98990f7e, 0xc9cbf769, 0xc22bc927, 0xc22bc927, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x6b1e7755, 0x4532973e, 0x6b1e7755, 0xc5483e8d, 0x9813a416, 0x9813a416, 0xa279dbc8, 0xa279dbc8, 0xa279dbc8, 0x33a25dfb, 0x33a25dfb, 0x33a25dfb, 0x2a18602b, 0x2a18602b, 0x2a18602b, 0x9813a416, 0xc5483e8d, 0xc5483e8d, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xa3774c63, 0x38dffb0e, 0xa3774c63, 0xd5d179d0, 0x5fcf013d, 0x5fcf013d, 0x28872666, 0x28872666, 0x28872666, 0xfa973e10, 0xfa973e10, 0xfa973e10, 0xece4018f, 0xece4018f, 0xece4018f, 0x5fcf013d, 0xd5d179d0, 0xd5d179d0, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe9556aa5, 0x77425030, 0xe9556aa5, 0xf250b0a2, 0xdd28f52b, 0xdd28f52b, 0x938cfa6a, 0x938cfa6a, 0x938cfa6a, 0xb2b0038e, 0xb2b0038e, 0xb2b0038e, 0xcf08c802, 0xcf08c802, 0xcf08c802, 0xdd28f52b, 0xf250b0a2, 0xf250b0a2, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x9adc43d0, 0xd8ac5204, 0x9adc43d0, 0x65635850, 0x43d1f34, 0x43d1f34, 0xc182db12, 0xc182db12, 0xc182db12, 0xbe8872ba, 0xbe8872ba, 0xbe8872ba, 0x27d9773c, 0x27d9773c, 0x27d9773c, 0x43d1f34, 0x65635850, 0x65635850, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x7fd0187d, 0x7d05975c, 0x7fd0187d, 0x3c26d53a, 0x59c36f00, 0x59c36f00, 0xb4fad8de, 0xb4fad8de, 0xb4fad8de, 0xca7ab5b8, 0xca7ab5b8, 0xca7ab5b8, 0xa88ca06a, 0xa88ca06a, 0xa88ca06a, 0x59c36f00, 0x3c26d53a, 0x3c26d53a, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x54f3fad9, 0xe7a5a67a, 0x54f3fad9, 0x7af67fa6, 0xaa4593fe, 0xaa4593fe, 0xcae58c6a, 0xcae58c6a, 0xcae58c6a, 0x6c10810d, 0x6c10810d, 0x6c10810d, 0x41282a75, 0x41282a75, 0x41282a75, 0xaa4593fe, 0x7af67fa6, 0x7af67fa6, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x869916b8, 0x373dbcc3, 0x869916b8, 0xdb8e7b3c, 0xc9cbf769, 0xc9cbf769, 0xaa0c75c1, 0xaa0c75c1, 0xaa0c75c1, 0x54d4b40d, 0x54d4b40d, 0x54d4b40d, 0xbd9e0b05, 0xbd9e0b05, 0xbd9e0b05, 0xc9cbf769, 0xdb8e7b3c, 0xdb8e7b3c, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb2f32f4, 0xff8e66df, 0xb2f32f4, 0xa5797b2c, 0x9813a416, 0x9813a416, 0x9fc65347, 0x9fc65347, 0x9fc65347, 0xe1dd574, 0xe1dd574, 0xe1dd574, 0x17a7e8a4, 0x17a7e8a4, 0x17a7e8a4, 0x9813a416, 0xa5797b2c, 0xa5797b2c, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x26280874, 0x6f7dd72, 0x26280874, 0x508e3dc7, 0x5fcf013d, 0x5fcf013d, 0x197943fe, 0x197943fe, 0x197943fe, 0xcb695b88, 0xcb695b88, 0xcb695b88, 0xdd1a6417, 0xdd1a6417, 0xdd1a6417, 0x5fcf013d, 0x508e3dc7, 0x508e3dc7, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd23ae631, 0xe5a30d5e, 0xd23ae631, 0xc93f3c36, 0xdd28f52b, 0xdd28f52b, 0x7042f8c, 0x7042f8c, 0x7042f8c, 0x2638d668, 0x2638d668, 0x2638d668, 0x5b801de4, 0x5b801de4, 0x5b801de4, 0xdd28f52b, 0xc93f3c36, 0xc93f3c36, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x8d469c0b, 0xabeb5779, 0x8d469c0b, 0x72f9878b, 0x43d1f34, 0x43d1f34, 0xd8397828, 0xd8397828, 0xd8397828, 0xa733d180, 0xa733d180, 0xa733d180, 0x3e62d406, 0x3e62d406, 0x3e62d406, 0x43d1f34, 0x72f9878b, 0x72f9878b, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd668f275, 0x6a2de04f, 0xd668f275, 0x959e3f32, 0x59c36f00, 0x59c36f00, 0xc43520a0, 0xc43520a0, 0xc43520a0, 0xbab54dc6, 0xbab54dc6, 0xbab54dc6, 0xd8435814, 0xd8435814, 0xd8435814, 0x59c36f00, 0x959e3f32, 0x959e3f32, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xe170ffb5, 0x17402498, 0xe170ffb5, 0xcf757aca, 0xaa4593fe, 0xaa4593fe, 0x4ec32c62, 0x4ec32c62, 0x4ec32c62, 0xe8362105, 0xe8362105, 0xe8362105, 0xc50e8a7d, 0xc50e8a7d, 0xc50e8a7d, 0xaa4593fe, 0xcf757aca, 0xcf757aca, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xf4aef2d6, 0x47a46008, 0xf4aef2d6, 0xa9b99f52, 0xc9cbf769, 0xc9cbf769, 0x4f1a5666, 0x4f1a5666, 0x4f1a5666, 0xb1c297aa, 0xb1c297aa, 0xb1c297aa, 0x588828a2, 0x588828a2, 0x588828a2, 0xc9cbf769, 0xa9b99f52, 0xa9b99f52, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xc2ed8f74, 0xb7ab0607, 0xc2ed8f74, 0x6cbbc6ac, 0x9813a416, 0x9813a416, 0x535e7ba8, 0x535e7ba8, 0x535e7ba8, 0xc285fd9b, 0xc285fd9b, 0xc285fd9b, 0xdb3fc04b, 0xdb3fc04b, 0xdb3fc04b, 0x9813a416, 0x6cbbc6ac, 0x6cbbc6ac, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf62383d8, 0x9489f90c, 0xf62383d8, 0x8085b66b, 0x5fcf013d, 0x5fcf013d, 0xb7f78bc2, 0xb7f78bc2, 0xb7f78bc2, 0x65e793b4, 0x65e793b4, 0x65e793b4, 0x7394ac2b, 0x7394ac2b, 0x7394ac2b, 0x5fcf013d, 0x8085b66b, 0x8085b66b, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x753d8bc0, 0x5c9029d6, 0x753d8bc0, 0x6e3851c7, 0xdd28f52b, 0xdd28f52b, 0x1a40e22e, 0x1a40e22e, 0x1a40e22e, 0x3b7c1bca, 0x3b7c1bca, 0x3b7c1bca, 0x46c4d046, 0x46c4d046, 0x46c4d046, 0xdd28f52b, 0x6e3851c7, 0x6e3851c7, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x62a774, 0xbb4b794c, 0x62a774, 0xffddbcf4, 0x43d1f34, 0x43d1f34, 0x83fede87, 0x83fede87, 0x83fede87, 0xfcf4772f, 0xfcf4772f, 0xfcf4772f, 0x65a572a9, 0x65a572a9, 0x65a572a9, 0x43d1f34, 0xffddbcf4, 0xffddbcf4, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x2edc6dc9, 0x166a6552, 0x2edc6dc9, 0x6d2aa08e, 0x59c36f00, 0x59c36f00, 0xd214e1a2, 0xd214e1a2, 0xd214e1a2, 0xac948cc4, 0xac948cc4, 0xac948cc4, 0xce629916, 0xce629916, 0xce629916, 0x59c36f00, 0x6d2aa08e, 0x6d2aa08e, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xc12e1a21, 0x1e6e7468, 0xc12e1a21, 0xef2b9f5e, 0xaa4593fe, 0xaa4593fe, 0x1c792d02, 0x1c792d02, 0x1c792d02, 0xba8c2065, 0xba8c2065, 0xba8c2065, 0x97b48b1d, 0x97b48b1d, 0x97b48b1d, 0xaa4593fe, 0xef2b9f5e, 0xef2b9f5e, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x510524f7, 0x7f9806b4, 0x510524f7, 0xc124973, 0xc9cbf769, 0xc9cbf769, 0x1a561d55, 0x1a561d55, 0x1a561d55, 0xe48edc99, 0xe48edc99, 0xe48edc99, 0xdc46391, 0xdc46391, 0xdc46391, 0xc9cbf769, 0xc124973, 0xc124973, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xa1ee6604, 0xd307a4d9, 0xa1ee6604, 0xfb82fdc, 0x9813a416, 0x9813a416, 0x5b7ed439, 0x5b7ed439, 0x5b7ed439, 0xcaa5520a, 0xcaa5520a, 0xcaa5520a, 0xd31f6fda, 0xd31f6fda, 0xd31f6fda, 0x9813a416, 0xfb82fdc, 0xfb82fdc, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x4e2bb6a8, 0x67c92bf4, 0x4e2bb6a8, 0x388d831b, 0x5fcf013d, 0x5fcf013d, 0xe69beaed, 0xe69beaed, 0xe69beaed, 0x348bf29b, 0x348bf29b, 0x348bf29b, 0x22f8cd04, 0x22f8cd04, 0x22f8cd04, 0x5fcf013d, 0x388d831b, 0x388d831b, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xeb6b461d, 0x679ed094, 0xeb6b461d, 0xf06e9c1a, 0xdd28f52b, 0xdd28f52b, 0xdf34624d, 0xdf34624d, 0xdf34624d, 0xfe089ba9, 0xfe089ba9, 0xfe089ba9, 0x83b05025, 0x83b05025, 0x83b05025, 0xdd28f52b, 0xf06e9c1a, 0xf06e9c1a, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xc486143c, 0x7b487645, 0xc486143c, 0x3b390fbc, 0x43d1f34, 0x43d1f34, 0x9576cd6b, 0x9576cd6b, 0x9576cd6b, 0xea7c64c3, 0xea7c64c3, 0xea7c64c3, 0x732d6145, 0x732d6145, 0x732d6145, 0x43d1f34, 0x3b390fbc, 0x3b390fbc, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa024d435, 0x8bc3f107, 0xa024d435, 0xe3d21972, 0x59c36f00, 0x59c36f00, 0x9412860d, 0x9412860d, 0x9412860d, 0xea92eb6b, 0xea92eb6b, 0xea92eb6b, 0x8864feb9, 0x8864feb9, 0x8864feb9, 0x59c36f00, 0xe3d21972, 0xe3d21972, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xbf89b975, 0x481e2ecc, 0xbf89b975, 0x918c3c0a, 0xaa4593fe, 0xaa4593fe, 0xa8509e2c, 0xa8509e2c, 0xa8509e2c, 0xea5934b, 0xea5934b, 0xea5934b, 0x239d3833, 0x239d3833, 0x239d3833, 0xaa4593fe, 0x918c3c0a, 0x918c3c0a, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x4d84ea04, 0xd1029f5b, 0x4d84ea04, 0x10938780, 0xc9cbf769, 0xc9cbf769, 0x3677fab0, 0x3677fab0, 0x3677fab0, 0xc8af3b7c, 0xc8af3b7c, 0xc8af3b7c, 0x21e58474, 0x21e58474, 0x21e58474, 0xc9cbf769, 0x10938780, 0x10938780, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x9e5f6ab3, 0xda3fae82, 0x9e5f6ab3, 0x3009236b, 0x9813a416, 0x9813a416, 0x5710fb5f, 0x5710fb5f, 0x5710fb5f, 0xc6cb7d6c, 0xc6cb7d6c, 0xc6cb7d6c, 0xdf7140bc, 0xdf7140bc, 0xdf7140bc, 0x9813a416, 0x3009236b, 0x3009236b, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x28f46625, 0xf4bfdc80, 0x28f46625, 0x5e525396, 0x5fcf013d, 0x5fcf013d, 0xb3f9b24b, 0xb3f9b24b, 0xb3f9b24b, 0x61e9aa3d, 0x61e9aa3d, 0x61e9aa3d, 0x779a95a2, 0x779a95a2, 0x779a95a2, 0x5fcf013d, 0x5e525396, 0x5e525396, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x8c12e300, 0xa71b83e7, 0x8c12e300, 0x97173907, 0xdd28f52b, 0xdd28f52b, 0x2f660f28, 0x2f660f28, 0x2f660f28, 0xe5af6cc, 0xe5af6cc, 0xe5af6cc, 0x73e23d40, 0x73e23d40, 0x73e23d40, 0xdd28f52b, 0x97173907, 0x97173907, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xbaaaeec4, 0x7f7cd53b, 0xbaaaeec4, 0x4515f544, 0x43d1f34, 0x43d1f34, 0xd254254f, 0xd254254f, 0xd254254f, 0xad5e8ce7, 0xad5e8ce7, 0xad5e8ce7, 0x340f8961, 0x340f8961, 0x340f8961, 0x43d1f34, 0x4515f544, 0x4515f544, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x63166340, 0x5d98fc3, 0x63166340, 0x20e0ae07, 0x59c36f00, 0x59c36f00, 0xd3548a15, 0xd3548a15, 0xd3548a15, 0xadd4e773, 0xadd4e773, 0xadd4e773, 0xcf22f2a1, 0xcf22f2a1, 0xcf22f2a1, 0x59c36f00, 0x20e0ae07, 0x20e0ae07, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xe0916467, 0x44bbe3df, 0xe0916467, 0xce94e118, 0xaa4593fe, 0xaa4593fe, 0x7d5e4ea7, 0x7d5e4ea7, 0x7d5e4ea7, 0xdbab43c0, 0xdbab43c0, 0xdbab43c0, 0xf693e8b8, 0xf693e8b8, 0xf693e8b8, 0xaa4593fe, 0xce94e118, 0xce94e118, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x1aad9b94, 0xa021c44c, 0x1aad9b94, 0x47baf610, 0xc9cbf769, 0xc9cbf769, 0x7c3c68c, 0x7c3c68c, 0x7c3c68c, 0xf91b0740, 0xf91b0740, 0xf91b0740, 0x1051b848, 0x1051b848, 0x1051b848, 0xc9cbf769, 0x47baf610, 0x47baf610, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb8710521, 0xbd10c16, 0xb8710521, 0x16274cf9, 0x9813a416, 0x9813a416, 0x60ef8d73, 0x60ef8d73, 0x60ef8d73, 0xf1340b40, 0xf1340b40, 0xf1340b40, 0xe88e3690, 0xe88e3690, 0xe88e3690, 0x9813a416, 0x16274cf9, 0x16274cf9, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xd62b53b5, 0xc6dd48d4, 0xd62b53b5, 0xa08d6606, 0x5fcf013d, 0x5fcf013d, 0x6f5971e2, 0x6f5971e2, 0x6f5971e2, 0xbd496994, 0xbd496994, 0xbd496994, 0xab3a560b, 0xab3a560b, 0xab3a560b, 0x5fcf013d, 0xa08d6606, 0xa08d6606, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x10503615, 0x442892cb, 0x10503615, 0xb55ec12, 0xdd28f52b, 0xdd28f52b, 0xda805056, 0xda805056, 0xda805056, 0xfbbca9b2, 0xfbbca9b2, 0xfbbca9b2, 0x8604623e, 0x8604623e, 0x8604623e, 0xdd28f52b, 0xb55ec12, 0xb55ec12, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x5c9d00a2, 0xf70cd71f, 0x5c9d00a2, 0xa3221b22, 0x43d1f34, 0x43d1f34, 0x9a133a7f, 0x9a133a7f, 0x9a133a7f, 0xe51993d7, 0xe51993d7, 0xe51993d7, 0x7c489651, 0x7c489651, 0x7c489651, 0x43d1f34, 0xa3221b22, 0xa3221b22, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xbc89067b, 0xf339b29f, 0xbc89067b, 0xff7fcb3c, 0x59c36f00, 0x59c36f00, 0x5915b839, 0x5915b839, 0x5915b839, 0x2795d55f, 0x2795d55f, 0x2795d55f, 0x4563c08d, 0x4563c08d, 0x4563c08d, 0x59c36f00, 0xff7fcb3c, 0xff7fcb3c, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xb19b98f6, 0xb8ffac95, 0xb19b98f6, 0x9f9e1d89, 0xaa4593fe, 0xaa4593fe, 0x6cb5454, 0x6cb5454, 0x6cb5454, 0xa03e5933, 0xa03e5933, 0xa03e5933, 0x8d06f24b, 0x8d06f24b, 0x8d06f24b, 0xaa4593fe, 0x9f9e1d89, 0x9f9e1d89, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x133d7c3b, 0xd26c8a26, 0x133d7c3b, 0x4e2a11bf, 0xc9cbf769, 0xc9cbf769, 0x36504e54, 0x36504e54, 0x36504e54, 0xc8888f98, 0xc8888f98, 0xc8888f98, 0x21c23090, 0x21c23090, 0x21c23090, 0xc9cbf769, 0x4e2a11bf, 0x4e2a11bf, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xbfc94fbe, 0xe32be512, 0xbfc94fbe, 0x119f0666, 0x9813a416, 0x9813a416, 0x8350694d, 0x8350694d, 0x8350694d, 0x128bef7e, 0x128bef7e, 0x128bef7e, 0xb31d2ae, 0xb31d2ae, 0xb31d2ae, 0x9813a416, 0x119f0666, 0x119f0666, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x9cf25061, 0xe5e2b458, 0x9cf25061, 0xea5465d2, 0x5fcf013d, 0x5fcf013d, 0xa5bfba08, 0xa5bfba08, 0xa5bfba08, 0x77afa27e, 0x77afa27e, 0x77afa27e, 0x61dc9de1, 0x61dc9de1, 0x61dc9de1, 0x5fcf013d, 0xea5465d2, 0xea5465d2, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xc968ecc5, 0xa3105cfb, 0xc968ecc5, 0xd26d36c2, 0xdd28f52b, 0xdd28f52b, 0xff2fd4b8, 0xff2fd4b8, 0xff2fd4b8, 0xde132d5c, 0xde132d5c, 0xde132d5c, 0xa3abe6d0, 0xa3abe6d0, 0xa3abe6d0, 0xdd28f52b, 0xd26d36c2, 0xd26d36c2, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xf17f3c, 0xf3672115, 0xf17f3c, 0xff4e64bc, 0x43d1f34, 0x43d1f34, 0x6ec799ab, 0x6ec799ab, 0x6ec799ab, 0x11cd3003, 0x11cd3003, 0x11cd3003, 0x889c3585, 0x889c3585, 0x889c3585, 0x43d1f34, 0xff4e64bc, 0xff4e64bc, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x20f2a62b, 0x12808b5f, 0x20f2a62b, 0x63046b6c, 0x59c36f00, 0x59c36f00, 0x23e6cac6, 0x23e6cac6, 0x23e6cac6, 0x5d66a7a0, 0x5d66a7a0, 0x5d66a7a0, 0x3f90b272, 0x3f90b272, 0x3f90b272, 0x59c36f00, 0x63046b6c, 0x63046b6c, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x52fcbd8f, 0x7119870a, 0x52fcbd8f, 0x7cf938f0, 0xaa4593fe, 0xaa4593fe, 0x4bb9a19, 0x4bb9a19, 0x4bb9a19, 0xa24e977e, 0xa24e977e, 0xa24e977e, 0x8f763c06, 0x8f763c06, 0x8f763c06, 0xaa4593fe, 0x7cf938f0, 0x7cf938f0, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe4d74d3f, 0xd2dab4f0, 0xe4d74d3f, 0xb9c020bb, 0xc9cbf769, 0xc9cbf769, 0xa4955f92, 0xa4955f92, 0xa4955f92, 0x5a4d9e5e, 0x5a4d9e5e, 0x5a4d9e5e, 0xb3072156, 0xb3072156, 0xb3072156, 0xc9cbf769, 0xb9c020bb, 0xb9c020bb, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xa1c2b9ec, 0x34038c40, 0xa1c2b9ec, 0xf94f034, 0x9813a416, 0x9813a416, 0x438820a6, 0x438820a6, 0x438820a6, 0xd253a695, 0xd253a695, 0xd253a695, 0xcbe99b45, 0xcbe99b45, 0xcbe99b45, 0x9813a416, 0xf94f034, 0xf94f034, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x339cc65f, 0xe46f6cec, 0x339cc65f, 0x453af3ec, 0x5fcf013d, 0x5fcf013d, 0xad75b235, 0xad75b235, 0xad75b235, 0x7f65aa43, 0x7f65aa43, 0x7f65aa43, 0x691695dc, 0x691695dc, 0x691695dc, 0x5fcf013d, 0x453af3ec, 0x453af3ec, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x1c229a1a, 0x83752c05, 0x1c229a1a, 0x727401d, 0xdd28f52b, 0xdd28f52b, 0x4b4f5d0, 0x4b4f5d0, 0x4b4f5d0, 0x25880c34, 0x25880c34, 0x25880c34, 0x5830c7b8, 0x5830c7b8, 0x5830c7b8, 0xdd28f52b, 0x727401d, 0x727401d, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x4d69e76c, 0x11e8d41f, 0x4d69e76c, 0xb2d6fcec, 0x43d1f34, 0x43d1f34, 0x15b4256, 0x15b4256, 0x15b4256, 0x7e51ebfe, 0x7e51ebfe, 0x7e51ebfe, 0xe700ee78, 0xe700ee78, 0xe700ee78, 0x43d1f34, 0xb2d6fcec, 0xb2d6fcec, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xecc0313, 0x6803ef90, 0xecc0313, 0x59e1bdcd, 0x59c36f00, 0x59c36f00, 0xbaf5c463, 0xbaf5c463, 0xbaf5c463, 0xc475a905, 0xc475a905, 0xc475a905, 0xa683bcd7, 0xa683bcd7, 0xa683bcd7, 0x59c36f00, 0x59e1bdcd, 0x59e1bdcd, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xfb839522, 0x5fa9129a, 0xfb839522, 0x4b244f74, 0xaa4593fe, 0xaa4593fe, 0xf644f45d, 0xf644f45d, 0xf644f45d, 0x50b1f93a, 0x50b1f93a, 0x50b1f93a, 0x7d895242, 0x7d895242, 0x7d895242, 0xaa4593fe, 0x4b244f74, 0x4b244f74, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xf84fee63, 0x42c3b1bb, 0xf84fee63, 0xe86af0cd, 0xc9cbf769, 0xc9cbf769, 0x93e5d13b, 0x93e5d13b, 0x93e5d13b, 0x6d3d10f7, 0x6d3d10f7, 0x6d3d10f7, 0x8477afff, 0x8477afff, 0x8477afff, 0xc9cbf769, 0xe86af0cd, 0xe86af0cd, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xcbed2522, 0x784d2c15, 0xcbed2522, 0xfb9cd90d, 0x9813a416, 0x9813a416, 0x94668b23, 0x94668b23, 0x94668b23, 0x5bd0d10, 0x5bd0d10, 0x5bd0d10, 0x1c0730c0, 0x1c0730c0, 0x1c0730c0, 0x9813a416, 0xfb9cd90d, 0xfb9cd90d, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xc1ca0a91, 0xd13c11f0, 0xc1ca0a91, 0x6fcde564, 0x5fcf013d, 0x5fcf013d, 0xb6cdf7a2, 0xb6cdf7a2, 0xb6cdf7a2, 0x64ddefd4, 0x64ddefd4, 0x64ddefd4, 0x72aed04b, 0x72aed04b, 0x72aed04b, 0x5fcf013d, 0x6fcde564, 0x6fcde564, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xca477228, 0x9e3fd6f6, 0xca477228, 0x4423b9f2, 0xdd28f52b, 0xdd28f52b, 0x1ff53543, 0x1ff53543, 0x1ff53543, 0x3ec9cca7, 0x3ec9cca7, 0x3ec9cca7, 0x4371072b, 0x4371072b, 0x4371072b, 0xdd28f52b, 0x4423b9f2, 0x4423b9f2, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xfe345ca6, 0x55a58b1b, 0xfe345ca6, 0x696cda06, 0x43d1f34, 0x43d1f34, 0x72d541bf, 0x72d541bf, 0x72d541bf, 0xddfe817, 0xddfe817, 0xddfe817, 0x948eed91, 0x948eed91, 0x948eed91, 0x43d1f34, 0x696cda06, 0x696cda06, 0x43d1f34, }, 20 },
|
||||
{ "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x4cfdf9ab, 0x2a321528, 0x4cfdf9ab, 0xf4b75661, 0x59c36f00, 0x59c36f00, 0xd3548a15, 0xd3548a15, 0xd3548a15, 0xadd4e773, 0xadd4e773, 0xadd4e773, 0xcf22f2a1, 0xcf22f2a1, 0xcf22f2a1, 0x59c36f00, 0xf4b75661, 0xf4b75661, 0x59c36f00, }, 20 },
|
||||
{ "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x287ff948, 0x8c557ef0, 0x287ff948, 0xebf931c7, 0xaa4593fe, 0xaa4593fe, 0x7d5e4ea7, 0x7d5e4ea7, 0x7d5e4ea7, 0xdbab43c0, 0xdbab43c0, 0xdbab43c0, 0xf693e8b8, 0xf693e8b8, 0xf693e8b8, 0xaa4593fe, 0xebf931c7, 0xebf931c7, 0xaa4593fe, }, 20 },
|
||||
{ "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x5ecea36b, 0xe442fcb3, 0x5ecea36b, 0x1cab5f56, 0xc9cbf769, 0xc9cbf769, 0x7c3c68c, 0x7c3c68c, 0x7c3c68c, 0xf91b0740, 0xf91b0740, 0xf91b0740, 0x1051b848, 0x1051b848, 0x1051b848, 0xc9cbf769, 0x1cab5f56, 0x1cab5f56, 0xc9cbf769, }, 20 },
|
||||
{ "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xf6c7d73a, 0x4567de0d, 0xf6c7d73a, 0xb8d47573, 0x9813a416, 0x9813a416, 0x60ef8d73, 0x60ef8d73, 0x60ef8d73, 0xf1340b40, 0xf1340b40, 0xf1340b40, 0xe88e3690, 0xe88e3690, 0xe88e3690, 0x9813a416, 0xb8d47573, 0xb8d47573, 0x9813a416, }, 20 },
|
||||
{ "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x56e3bddb, 0x4615a6ba, 0x56e3bddb, 0xc585b2ec, 0x5fcf013d, 0x5fcf013d, 0x6f5971e2, 0x6f5971e2, 0x6f5971e2, 0xbd496994, 0xbd496994, 0xbd496994, 0xab3a560b, 0xab3a560b, 0xab3a560b, 0x5fcf013d, 0xc585b2ec, 0xc585b2ec, 0x5fcf013d, }, 20 },
|
||||
{ "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x5ebfa46, 0x51935e98, 0x5ebfa46, 0xe26d3e18, 0xdd28f52b, 0xdd28f52b, 0xda805056, 0xda805056, 0xda805056, 0xfbbca9b2, 0xfbbca9b2, 0xfbbca9b2, 0x8604623e, 0x8604623e, 0x8604623e, 0xdd28f52b, 0xe26d3e18, 0xe26d3e18, 0xdd28f52b, }, 20 },
|
||||
{ "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x4995beac, 0xe2046911, 0x4995beac, 0x311de003, 0x43d1f34, 0x43d1f34, 0x9a133a7f, 0x9a133a7f, 0x9a133a7f, 0xe51993d7, 0xe51993d7, 0xe51993d7, 0x7c489651, 0x7c489651, 0x7c489651, 0x43d1f34, 0x311de003, 0x311de003, 0x43d1f34, }, 20 },
|
||||
{ "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, }, 5 },
|
||||
{ "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, }, 5 },
|
||||
{ "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, }, 5 },
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2016 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/test.h>
|
||||
#include <grub/dl.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static void
|
||||
strtoull_testcase (const char *input, int base, unsigned long long expected,
|
||||
int num_digits, grub_err_t error)
|
||||
{
|
||||
char *output;
|
||||
unsigned long long value;
|
||||
grub_errno = 0;
|
||||
value = grub_strtoull(input, &output, base);
|
||||
grub_test_assert (grub_errno == error,
|
||||
"unexpected error. Expected %d, got %d. Input \"%s\"",
|
||||
error, grub_errno, input);
|
||||
if (grub_errno)
|
||||
{
|
||||
grub_errno = 0;
|
||||
return;
|
||||
}
|
||||
grub_test_assert (input + num_digits == output,
|
||||
"unexpected number of digits. Expected %d, got %d, input \"%s\"",
|
||||
num_digits, (int) (output - input), input);
|
||||
grub_test_assert (value == expected,
|
||||
"unexpected return value. Expected %llu, got %llu, input \"\%s\"",
|
||||
expected, value, input);
|
||||
}
|
||||
|
||||
static void
|
||||
strtoull_test (void)
|
||||
{
|
||||
strtoull_testcase ("9", 0, 9, 1, GRUB_ERR_NONE);
|
||||
strtoull_testcase ("0xaa", 0, 0xaa, 4, GRUB_ERR_NONE);
|
||||
strtoull_testcase ("0xff", 0, 0xff, 4, GRUB_ERR_NONE);
|
||||
strtoull_testcase ("0", 10, 0, 1, GRUB_ERR_NONE);
|
||||
strtoull_testcase ("8", 8, 0, 0, GRUB_ERR_BAD_NUMBER);
|
||||
strtoull_testcase ("38", 8, 3, 1, GRUB_ERR_NONE);
|
||||
strtoull_testcase ("7", 8, 7, 1, GRUB_ERR_NONE);
|
||||
strtoull_testcase ("1]", 16, 1, 1, GRUB_ERR_NONE);
|
||||
strtoull_testcase ("18446744073709551616", 10, 0, 0, GRUB_ERR_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
|
||||
GRUB_FUNCTIONAL_TEST (strtoull_test, strtoull_test);
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <grub/mm.h>
|
||||
#include <grub/video.h>
|
||||
#include <grub/video_fb.h>
|
||||
#include <grub/machine/lbio.h>
|
||||
#include <grub/coreboot/lbio.h>
|
||||
#include <grub/machine/console.h>
|
||||
|
||||
struct grub_linuxbios_table_framebuffer *grub_video_coreboot_fbtable;
|
||||
29
include/grub/arm/coreboot/console.h
Normal file
29
include/grub/arm/coreboot/console.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2009 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_MACHINE_CONSOLE_HEADER
|
||||
#define GRUB_MACHINE_CONSOLE_HEADER 1
|
||||
|
||||
void grub_video_coreboot_fb_init (void);
|
||||
void grub_video_coreboot_fb_early_init (void);
|
||||
void grub_video_coreboot_fb_late_init (void);
|
||||
void grub_video_coreboot_fb_fini (void);
|
||||
|
||||
extern struct grub_linuxbios_table_framebuffer *grub_video_coreboot_fbtable;
|
||||
|
||||
#endif /* ! GRUB_MACHINE_CONSOLE_HEADER */
|
||||
44
include/grub/arm/coreboot/kernel.h
Normal file
44
include/grub/arm/coreboot/kernel.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 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_KERNEL_MACHINE_HEADER
|
||||
#define GRUB_KERNEL_MACHINE_HEADER 1
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
|
||||
struct grub_fdt_board
|
||||
{
|
||||
const char *vendor, *part;
|
||||
const grub_uint8_t *dtb;
|
||||
grub_size_t dtb_size;
|
||||
};
|
||||
|
||||
extern struct grub_fdt_board grub_fdt_boards[];
|
||||
void grub_machine_timer_init (void);
|
||||
void grub_pl050_init (void);
|
||||
void
|
||||
grub_cros_init (void);
|
||||
extern grub_addr_t EXPORT_VAR (start_of_ram);
|
||||
#endif /* ! ASM_FILE */
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_STACK_SIZE GRUB_KERNEL_ARM_STACK_SIZE
|
||||
|
||||
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
|
||||
0
include/grub/arm/coreboot/memory.h
Normal file
0
include/grub/arm/coreboot/memory.h
Normal file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user