Skip to contentSkip to conversation

hw/x86: add a couple of comments explaining how the kernel image is parsed

PATCH In review Ani Sinha 2 participants 2 messages Jul 19, 2024 – Jul 21, 2024

lore
Share & tools
lore

Ani Sinha

author
#0 lore raw

PATCH 1/1 hw/x86: add a couple of comments explaining how the kernel image is parsed

Cosmetic: add comments in x86_load_linux() pointing to the kernel documentation so that users can better understand the code.

---
 hw/i386/x86-common.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
hw/i386/x86-common.c +5 -2
index c0c66a0eb5..992ea1f25e 100644
@@ -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 {
         /*
Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Ani Sinha

Date: Fri, 19 Jul 2024 19:19:37 +0530
From: Ani Sinha <[email protected]>
Subject: [PATCH] hw/x86: add a couple of comments explaining how the kernel
image is parsed
X-Mailer: git-send-email 2.42.0

Quoted 9 lines

Cosmetic: add comments in x86_load_linux() pointing to the kernel documentation so that users can better understand the code.

---
 hw/i386/x86-common.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)