aboutsummaryrefslogtreecommitdiffstats
path: root/mbr
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-25 15:44:24 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-25 15:44:24 -0800
commit6d154a74c21df32fcc3b2fbef11039f2487dca75 (patch)
tree8bc05100aa05b18db5a3fcb36b879c7cd8738ef7 /mbr
parenteaaf9a75bb6767b00db51518dffadd714199741d (diff)
downloadlwip-6d154a74c21df32fcc3b2fbef11039f2487dca75.tar.gz
lwip-6d154a74c21df32fcc3b2fbef11039f2487dca75.tar.xz
lwip-6d154a74c21df32fcc3b2fbef11039f2487dca75.zip
gptmbr: save phdr -> bootsect on the stack, saving one byte
Diffstat (limited to 'mbr')
-rw-r--r--mbr/gptmbr.S6
1 files 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 */