Matt Fleming
2011-Mar-21 09:51 UTC
[syslinux] [elflink] diskstart.inc:420: error: Sector 1 overflow by 5 bytes
Hi Feng, I'm currently hitting the overflow in core/diskstart.inc on the elfink branch where I see you changed the overflow check, commit 2e91ec5f155f04aee878ed70a04fb5b15e40da3b Author: Feng Tang <feng.tang at intel.com> Date: Wed Jul 14 15:55:25 2010 +0800 elflink: a lot of core/fs merge @@ -691,16 +798,22 @@ rl_checkpt equ $ ; Must be <= 8000h rl_checkpt_off equ ($-$$) %ifndef DEPEND -%if rl_checkpt_off > 3FCh ; Need one pointer in here -%error "Sector 1 overflow" -%endif + %if rl_checkpt_off > 3F6h ; Need one extent + %assign rl_checkpt_overflow rl_checkpt_off - 3F6h + %error Sector 1 overflow by rl_checkpt_overflow bytes + %endif %endif -; Sector pointers - alignz 4 +; +; Extent pointers... each extent contains an 8-byte LBA and an 2-byte +; sector count. In most cases, we will only ever need a handful of +; extents, but we have to assume a maximally fragmented system where each +; extent contains only one sector. +; + alignz 2 MaxInitDataSize equ 96 << 10 MaxLMA equ TEXT_START+SECTOR_SIZE+MaxInitDataSize -SectorPtrs times MaxInitDataSize >> SECTOR_SHIFT dd 0 +SectorPtrs zb 10*(MaxInitDataSize >> SECTOR_SHIFT) SectorPtrsEnd equ $ ; ---------------------------------------------------------------------------- As you can see from the subject, I'm overflowing Sector 1 by 5 bytes. Could you explain why you changed 0x3FC to 0x3F6? I admit to not knowing anything about this piece of code and having read the Extent pointers comment above and the commit log, I'm afraid I'm no closer to understanding it. --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
H. Peter Anvin
2011-Mar-31 20:57 UTC
[syslinux] [elflink] diskstart.inc:420: error: Sector 1 overflow by 5 bytes
On 03/21/2011 02:51 AM, Matt Fleming wrote:> Hi Feng, > > I'm currently hitting the overflow in core/diskstart.inc on the elfink > branch where I see you changed the overflow check, > > commit 2e91ec5f155f04aee878ed70a04fb5b15e40da3b > Author: Feng Tang <feng.tang at intel.com> > Date: Wed Jul 14 15:55:25 2010 +0800 > > elflink: a lot of core/fs merge > > > @@ -691,16 +798,22 @@ rl_checkpt equ $ ; Must be <= 8000h > > rl_checkpt_off equ ($-$$) > %ifndef DEPEND > -%if rl_checkpt_off > 3FCh ; Need one pointer in here > -%error "Sector 1 overflow" > -%endif > + %if rl_checkpt_off > 3F6h ; Need one extent > + %assign rl_checkpt_overflow rl_checkpt_off - 3F6h > + %error Sector 1 overflow by rl_checkpt_overflow bytes > + %endif > %endif > > -; Sector pointers > - alignz 4 > +; > +; Extent pointers... each extent contains an 8-byte LBA and an 2-byte > +; sector count. In most cases, we will only ever need a handful of > +; extents, but we have to assume a maximally fragmented system where each > +; extent contains only one sector. > +; > + alignz 2 > MaxInitDataSize equ 96 << 10 > MaxLMA equ TEXT_START+SECTOR_SIZE+MaxInitDataSize > -SectorPtrs times MaxInitDataSize >> SECTOR_SHIFT dd 0 > +SectorPtrs zb 10*(MaxInitDataSize >> SECTOR_SHIFT) > SectorPtrsEnd equ $ >This isn't Feng's change, but mine; the code changed from having a table of (32-bit) entires to a list of extents, which are 64-bit LBAs plus a 16-bit count. This speeds up loading significantly, and supports 64-bit LBAs. You need a minimum of 10 bytes for a single extent. -hpa