[SLOF] [PATCH] dev-null: The "read" function has to return 0 if nothing has been read

Laurent Vivier lvivier at redhat.com
Wed Feb 24 01:54:48 AEDT 2016



On 23/02/2016 15:40, Thomas Huth wrote:
> The "read" function of the dev-null device currently claims that
> the same amount of bytes has been read as input bytes have been
> requested. This causes grub to hang forever at the boot selection
> menu, since grub then thinks that there's a continuous stream of input
> data. If nothing has been read (which is always the case for the
> dev-null device), the "read" function should simply return 0 instead.
> Then grub also boots properly again after the typical short timeout.
> 
> Reported-by: Laurent Vivier <lvivier at redhat.com>
> Signed-off-by: Thomas Huth <thuth at redhat.com>

Tested-by: Laurent Vivier <lvivier at redhat.com>

> ---
>  board-qemu/slof/dev-null.fs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/board-qemu/slof/dev-null.fs b/board-qemu/slof/dev-null.fs
> index d0ffad6..9ac5169 100644
> --- a/board-qemu/slof/dev-null.fs
> +++ b/board-qemu/slof/dev-null.fs
> @@ -12,7 +12,7 @@ new-device
>  ;
>  
>  : read  ( adr len -- actual )
> -  nip
> +    2drop 0
>  ;
>  
>  : setup-alias
> 


More information about the SLOF mailing list