summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-06-27 12:02:48 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-06-27 12:02:48 -0700
commitb775b0040fe57ef71ec9cd98f9c124a3d116269b (patch)
treeec85cf4b93d4d6ad4e5aa0eeeff0c8db14149a6c
parent7ccf85b2a873bba3f363ad2df05457dd160c3f6d (diff)
downloadsyslinux-b775b0040fe57ef71ec9cd98f9c124a3d116269b.tar.gz
Export the 64-bit partition offset and use it in chain.c
When used with the "fs" option to chain.c32, we need to know our own filesystem offset. That means knowing if we used the MBR vs GPT partition information, as well as if we ended up using the passed-in information or not. Resolve this by providing an explicit pointer to the current partition offset. Eventually this should be replaced by some kind of statfs() call. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--com32/include/syslinux/config.h2
-rw-r--r--com32/modules/chain.c5
-rw-r--r--core/comboot.inc2
-rw-r--r--core/isolinux.asm16
-rw-r--r--doc/comboot.txt9
5 files changed, 20 insertions, 14 deletions
diff --git a/com32/include/syslinux/config.h b/com32/include/syslinux/config.h
index f315f44c..79a4750e 100644
--- a/com32/include/syslinux/config.h
+++ b/com32/include/syslinux/config.h
@@ -112,6 +112,7 @@ union syslinux_derivative_info {
uint32_t _eflags;
const void *ptab_ptr;
const uint32_t *esdi_ptr;
+ const uint64_t *partoffset;
} disk; /* syslinux/extlinux */
struct {
uint16_t _gs, _fs, _es, _ds;
@@ -138,6 +139,7 @@ union syslinux_derivative_info {
uint32_t _eflags;
const void *spec_packet;
const uint32_t *esdi_ptr;
+ const uint64_t *partoffset;
} iso; /* isolinux */
};
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index 555cff1d..b53054e8 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -1425,9 +1425,10 @@ int main(int argc, char *argv[])
drive = sdi->disk.drive_number;
if (!strcmp(drivename, "fs")
&& (sdi->c.filesystem == SYSLINUX_FS_SYSLINUX
- || sdi->c.filesystem == SYSLINUX_FS_EXTLINUX))
+ || sdi->c.filesystem == SYSLINUX_FS_EXTLINUX
+ || sdi->c.filesystem == SYSLINUX_FS_ISOLINUX))
/* We should lookup the Syslinux partition number and use it */
- fs_lba = ((struct part_entry *)sdi->disk.ptab_ptr)->start_lba;
+ fs_lba = *sdi->disk.partoffset;
} else {
error("Unparsable drive specification\n");
goto bail;
diff --git a/core/comboot.inc b/core/comboot.inc
index 91cc15ae..65b20be8 100644
--- a/core/comboot.inc
+++ b/core/comboot.inc
@@ -593,6 +593,8 @@ comapi_derinfo:
mov P_DL,al
mov P_FS,cs
mov P_SI,OrigESDI
+ mov P_GS,cs
+ mov P_DI,Hidden
%if IS_SYSLINUX || IS_EXTLINUX
mov P_ES,cs
mov P_BX,PartInfo
diff --git a/core/isolinux.asm b/core/isolinux.asm
index 80607679..d9d630ee 100644
--- a/core/isolinux.asm
+++ b/core/isolinux.asm
@@ -101,7 +101,7 @@ ISOFlags resb 1 ; Flags for ISO directory search
RetryCount resb 1 ; Used for disk access retries
alignb 8
-bsHidden resq 1 ; Used in hybrid mode
+Hidden resq 1 ; Used in hybrid mode
bsSecPerTrack resw 1 ; Used in hybrid mode
bsHeads resw 1 ; Used in hybrid mode
@@ -242,8 +242,8 @@ _start_hybrid:
pop eax
pop ebx
.nooffset:
- mov [cs:bsHidden],eax
- mov [cs:bsHidden+4],ebx
+ mov [cs:Hidden],eax
+ mov [cs:Hidden+4],ebx
mov si,bios_cbios
jcxz _start_common
@@ -779,8 +779,8 @@ getlinsec_ebios:
xor edx,edx
shld edx,eax,2
shl eax,2 ; Convert to HDD sectors
- add eax,[bsHidden]
- adc edx,[bsHidden+4]
+ add eax,[Hidden]
+ adc edx,[Hidden+4]
shl bp,2
.loop:
@@ -852,7 +852,7 @@ getlinsec_ebios:
getlinsec_cbios:
xor edx,edx
shl eax,2 ; Convert to HDD sectors
- add eax,[bsHidden]
+ add eax,[Hidden]
shl bp,2
.loop:
@@ -1165,8 +1165,8 @@ init_fs:
.hybrid:
movzx ebp,word [MaxTransfer]
.common:
- mov ecx,[bsHidden]
- mov ebx,[bsHidden+4]
+ mov ecx,[Hidden]
+ mov ebx,[Hidden+4]
mov si,[bsHeads]
mov di,[bsSecPerTrack]
pm_call fs_init
diff --git a/doc/comboot.txt b/doc/comboot.txt
index 9e9f99a0..4b4b8803 100644
--- a/doc/comboot.txt
+++ b/doc/comboot.txt
@@ -426,8 +426,12 @@ AX=000Ah [2.00] Get Derivative-Specific Information
Output: AL 31h (SYSLINUX), 34h (EXTLINUX)
DL drive number
CL sector size as a power of 2 (9 = 512 bytes) [3.35]
+ CH mode [3.73]
+ 1 = CBIOS mode
+ 2 = EBIOS mode
ES:BX pointer to partition table entry (if DL >= 80h)
FS:SI pointer to initial ES:DI value [3.53]
+ GS:DI pointer to partition offset (QWORD) [4.00]
Note: This function was broken in EXTLINUX 3.00-3.02.
@@ -501,6 +505,7 @@ AX=000Ah [2.00] Get Derivative-Specific Information
2 = Hybrid (hard disk), EBIOS mode
ES:BX pointer to El Torito spec packet
FS:SI pointer to initial ES:DI value [3.53]
+ GS:DI pointer to partition offset (QWORD) [4.00]
Note: Some very broken El Torito implementations do
not provide the spec packet information. If so, ES:BX
@@ -508,10 +513,6 @@ AX=000Ah [2.00] Get Derivative-Specific Information
AX=4B01h to obtain the spec packet directly from the
BIOS if necessary.
- This call gives information specific to a particular Syslinux
- derivative. The value returned in AL is the same as is
- returned in DL by INT 22h AX=0001h.
-
AX=000Bh [2.00] Get Serial Console Configuration