diff --git a/bootloader/elf.S b/bootloader/elf.S index 14d9ea4c92..d4a9b8df49 100644 --- a/bootloader/elf.S +++ b/bootloader/elf.S @@ -156,13 +156,14 @@ elf_read_kernel_to_memory: movl (elf_program_header + p_memsz), %ecx subl %ebx, %ecx - jz .elf_read_kernel_to_memory_no_memset + jz .elf_read_kernel_to_memory_memset_done .elf_read_kernel_to_memory_memset: movb $0, (%edi) + incl %edi decl %ecx jnz .elf_read_kernel_to_memory_memset - .elf_read_kernel_to_memory_no_memset: + .elf_read_kernel_to_memory_memset_done: # read file specified in program header to memory movl (elf_program_header + p_offset), %eax