From a9b4126468e49b662c12d2d35251443a6d7a3192 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 29 Sep 2017 21:19:12 +0200 Subject: 9boot: limit read size to 4K for efi simple file system protocol copying files from the uefi shell works, reading plan9.ini works, loading the kernel by calling Read to read in the DATA section of the kernel *FAILS*. my guess is that uefi filesystem driver or nvme driver tries to allocate a temporary buffer and hasnt got the space. limiting the read size fixes it. --- sys/src/boot/efi/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/src/boot/efi/fs.c b/sys/src/boot/efi/fs.c index c6d2331a8..5a13b3b6a 100644 --- a/sys/src/boot/efi/fs.c +++ b/sys/src/boot/efi/fs.c @@ -71,7 +71,7 @@ fsread(void *f, void *data, int len) { UINTN size; - size = len; + size = len > 4096 ? 4096 : len; if(eficall(((EFI_FILE_PROTOCOL*)f)->Read, f, &size, data)) return 0; return (int)size; -- cgit v1.2.3