Skip to content

Commit

Permalink
hw/x86: add a couple of comments explaining how the kernel image is p…
Browse files Browse the repository at this point in the history
…arsed

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

CC: [email protected]
Signed-off-by: Ani Sinha <[email protected]>
Reviewed-by: Zhao Liu <[email protected]>
Reviewed-by: Michael Tokarev <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
ani-sinha authored and Michael Tokarev committed Aug 23, 2024
1 parent 407f9a4 commit 80e3541
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hw/i386/x86-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/*
Expand Down

0 comments on commit 80e3541

Please sign in to comment.