aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAni Sinha <anisinha@redhat.com>2024-07-19 19:19:37 +0530
committerMichael Tokarev <mjt@tls.msk.ru>2024-08-23 12:07:23 +0300
commit80e3541282af347538a37ee0673bcc04c622ad1c (patch)
treedca6b93ef39fa9124f30b76bd0fc4a55ce45d7c7
parent407f9a4b121eb65166375c410e14d7b704bc1106 (diff)
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. 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>
-rw-r--r--hw/i386/x86-common.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
index c0c66a0eb5..992ea1f25e 100644
--- a/hw/i386/x86-common.c
+++ b/hw/i386/x86-common.c
@@ -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 {
/*