From 78b194840bb929792b4954dc67b0762dbf2ba131 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 13 Dec 2007 13:55:21 -0800 Subject: [PATCH] Snapshot: initialize the default ADV for disk-based derivatives For the disk-based derivatives, handle the default ADV that is part of the image. --- adv.inc | 36 ++++++++++++++++++++++++++---------- extlinux.asm | 9 +++++++-- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/adv.inc b/adv.inc index 42b36b1..b84ae04 100644 --- a/adv.inc +++ b/adv.inc @@ -64,12 +64,25 @@ adv1: ; the intended location of the ADV ; adv_init: - cmp dword [ADVSec0],0 + cmp byte [ADVDrive],-1 jne adv_read - ; Here, poke the proper values of ADVSec0, 1 - ; based on the position of the syslinux file - +%if IS_SYSLINUX || IS_MDSLINUX || IS_EXTLINUX + ; + ; Update pointers to default ADVs... + ; + mov bx,[LDLSectors] + shl bx,2 + mov ecx,[bsHidden] + mov eax,[bx+SectorPtrs-8] + mov edx,[bx+SectorPtrs-4] + add eax,ecx + add edx,ecx + mov [ADVSec0],eax + mov [ADVSec1],edx + mov al,[DriveNumber] + mov [ADVDrive],al +%endif ; ** fall through to adv_verify ** ; @@ -456,9 +469,12 @@ adv_read_write: section .data align 4, db 0 -ADVSec0 dd 1 -ADVSec1 dd 2 -ADVSecPerTrack dw 0 -ADVHeads dw 0 -ADVDrive db 80h -ADVOp db 0 +ADVDrive db -1 ; No ADV defined + + section .bss + alignb 4 +ADVSec0 resd 1 +ADVSec1 resd 1 +ADVSecPerTrack resw 1 +ADVHeads resw 1 +ADVOp resb 1 diff --git a/extlinux.asm b/extlinux.asm index 5e662d9..818d754 100644 --- a/extlinux.asm +++ b/extlinux.asm @@ -591,12 +591,17 @@ ldlinux_magic dd LDLINUX_MAGIC ; LDLINUX_MAGIC, plus 8 bytes. ; patch_area: -LDLDwords dw 0 ; Total dwords starting at ldlinux_sys -LDLSectors dw 0 ; Number of sectors - (bootsec+this sec) +LDLDwords dw 0 ; Total dwords starting at ldlinux_sys, + ; not including ADVs +LDLSectors dw 0 ; Number of sectors, not including + ; bootsec & this sec, but including the two ADVs CheckSum dd 0 ; Checksum starting at ldlinux_sys ; value = LDLINUX_MAGIC - [sum of dwords] CurrentDir dd 2 ; "Current" directory inode number +; Pointer to auxilliary data vector, for the benefit of the installer. +ADVPtr dw adv0 + ; Space for up to 64 sectors, the theoretical maximum SectorPtrs times 64 dd 0 -- 2.7.4