summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-12-13 13:55:21 -0800
committerH. Peter Anvin <hpa@zytor.com>2007-12-13 13:55:54 -0800
commit78b194840bb929792b4954dc67b0762dbf2ba131 (patch)
treec0162175fe87a43dd63203a1aca9694bc39cea6f
parentc06fbea20bbf62d72e2e0e7b4aa46bc0266c2a6b (diff)
downloadsyslinux-78b194840bb929792b4954dc67b0762dbf2ba131.tar.gz
Snapshot: initialize the default ADV for disk-based derivatives
For the disk-based derivatives, handle the default ADV that is part of the image.
-rw-r--r--adv.inc36
-rw-r--r--extlinux.asm9
2 files changed, 33 insertions, 12 deletions
diff --git a/adv.inc b/adv.inc
index 42b36b18..b84ae049 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 5e662d9b..818d7548 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