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.
This commit is contained in:
cinap_lenrek 2017-09-29 21:19:12 +02:00
parent 87274893d8
commit a9b4126468

View file

@ -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;