From 6d154a74c21df32fcc3b2fbef11039f2487dca75 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 25 Feb 2008 15:44:24 -0800 Subject: gptmbr: save phdr -> bootsect on the stack, saving one byte --- mbr/gptmbr.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mbr/gptmbr.S b/mbr/gptmbr.S index 10dfd45a..4009643f 100644 --- a/mbr/gptmbr.S +++ b/mbr/gptmbr.S @@ -115,6 +115,7 @@ next: xorl %edx,%edx incw %ax movw $phdr, %bx + pushw %bx /* -8(%bp) phdr == bootsect */ call read_sector /* Number of partition sectors */ @@ -189,12 +190,13 @@ found_part: /* * boot: invoke the actual bootstrap. %ds:%si points to the - * partition information in memory. + * partition information in memory. The top word on the stack + * is phdr == 0x7c00 == the address of the boot sector. */ boot: movl (32+16)(%si),%eax movl (36+16)(%si),%edx - movw $bootsec,%bx + popw %bx call read_sector cmpw $0xaa55, -2(%bx) jne missing_os /* Not a valid boot sector */ -- cgit v1.2.1