[syslinux:dynamic-sector] core: Move sector 1 to address 0x8000 so it is aligned
syslinux-bot for H. Peter Anvin
hpa at linux.intel.com
Tue Apr 5 14:27:30 PDT 2011
Commit-ID: b5f98decd092f6358043ff57e18383268b12c1f9
Gitweb: http://syslinux.zytor.com/commit/b5f98decd092f6358043ff57e18383268b12c1f9
Author: H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Tue, 5 Apr 2011 14:07:32 -0700
Committer: H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Tue, 5 Apr 2011 14:07:32 -0700
core: Move sector 1 to address 0x8000 so it is aligned
Move sector 1 to 0x8000, so that it will be sector-aligned no matter
what the sector size is (well, as long as it is <= 32K). This avoids
potential conflicts between the 64K "seams" and the sector size.
Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
---
core/Makefile | 2 +-
core/diskboot.inc | 2 +-
core/diskstart.inc | 14 +++++++++++---
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/core/Makefile b/core/Makefile
index 33ad7e9..e89c419 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -109,7 +109,7 @@ ldlinux.bss: ldlinux.bin
dd if=$< of=$@ bs=512 count=1
ldlinux.sys: ldlinux.bin
- dd if=$< of=$@ bs=512 skip=1
+ dd if=$< of=$@ bs=512 skip=2
codepage.cp: ../codepage/$(CODEPAGE).cp
cp -f $< $@
diff --git a/core/diskboot.inc b/core/diskboot.inc
index 68672e4..141986e 100644
--- a/core/diskboot.inc
+++ b/core/diskboot.inc
@@ -278,7 +278,7 @@ Sect1Ptr1 equ $-4
cmp dword [ldlinux_magic+4],LDLINUX_MAGIC^HEXDATE
jne kaboom
- ; Go for it! This also normalizes CS:IP.
+ ; Go for it!
jmp ldlinux_ent
;
diff --git a/core/diskstart.inc b/core/diskstart.inc
index 71cdaee..0124853 100644
--- a/core/diskstart.inc
+++ b/core/diskstart.inc
@@ -23,6 +23,14 @@ Sect1Ptr1_VAL equ 0xfeedface
%include "diskboot.inc"
; ===========================================================================
+; Padding after the (minimum) 512-byte boot sector so that the rest of
+; the file has aligned sectors, even if they are larger than 512 bytes.
+; ===========================================================================
+
+ section .init
+align_pad zb 512
+
+; ===========================================================================
; Start of LDLINUX.SYS
; ===========================================================================
@@ -424,10 +432,10 @@ safedumpregs:
rl_checkpt equ $ ; Must be <= 8000h
-rl_checkpt_off equ ($-$$)
+rl_checkpt_off equ $-ldlinux_sys
%ifndef DEPEND
- %if rl_checkpt_off > 3F6h ; Need one extent
- %assign rl_checkpt_overflow rl_checkpt_off - 3F6h
+ %if rl_checkpt_off > 512-10 ; Need minimum one extent
+ %assign rl_checkpt_overflow rl_checkpt_off - (512-10)
%error Sector 1 overflow by rl_checkpt_overflow bytes
%endif
%endif
More information about the Syslinux-commits
mailing list