diff --git a/src/system/boot/loader/main.cpp b/src/system/boot/loader/main.cpp index bb7a063ccc..e6b081e874 100644 --- a/src/system/boot/loader/main.cpp +++ b/src/system/boot/loader/main.cpp @@ -132,15 +132,15 @@ main(stage2_args *args) gKernelArgs.version = CURRENT_KERNEL_ARGS_VERSION; // clone the boot_volume KMessage into kernel accessible memory - // note, that we need to 4 byte align the buffer and thus allocate - // 3 more bytes - void* buffer = kernel_args_malloc(gBootVolume.ContentSize() + 3); + // note, that we need to 8-byte align the buffer and thus allocate + // 7 more bytes + void* buffer = kernel_args_malloc(gBootVolume.ContentSize() + 7); if (!buffer) { panic("Could not allocate memory for the boot volume kernel " "arguments"); } - buffer = (void*)(((addr_t)buffer + 3) & ~(addr_t)0x3); + buffer = (void*)(((addr_t)buffer + 7) & ~(addr_t)0x7); memcpy(buffer, gBootVolume.Buffer(), gBootVolume.ContentSize()); gKernelArgs.boot_volume = buffer; gKernelArgs.boot_volume_size = gBootVolume.ContentSize();