]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
hw/x86: add a couple of comments explaining how the kernel image is parsed
authorAni Sinha <anisinha@redhat.com>
Fri, 19 Jul 2024 13:49:37 +0000 (19:19 +0530)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 23 Aug 2024 09:07:23 +0000 (12:07 +0300)
Cosmetic: add comments in x86_load_linux() pointing to the kernel documentation
so that users can better understand the code.

CC: qemu-trivial@nongnu.org
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/i386/x86-common.c

index c0c66a0eb52bf4f873b751707351eb1c7755fe69..992ea1f25e941c5f1b2568b1f7b99cf0f2006049 100644 (file)
@@ -665,8 +665,11 @@ void x86_load_linux(X86MachineState *x86ms,
         exit(1);
     }
 
-    /* kernel protocol version */
-    if (ldl_p(header + 0x202) == 0x53726448) {
+    /*
+     * kernel protocol version.
+     * Please see https://www.kernel.org/doc/Documentation/x86/boot.txt
+     */
+    if (ldl_p(header + 0x202) == 0x53726448) /* Magic signature "HdrS" */ {
         protocol = lduw_p(header + 0x206);
     } else {
         /*