From 5d7ca8daf3c5874d3918b177d33869dbe3afb55a Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 22 Dec 2009 12:10:43 -0800 Subject: [PATCH] pxe: update to match the new fs_init interface fs_init now takes a pointer to an array of filesystems, so provide it as such. Furthermore, fs_init needs to return a nonnegative value to be considered successful. Finally, handle the case of 64-bit partition offsets being passed in to fs_init (in ebx:ecx in the disk-based derivatives.) Signed-off-by: H. Peter Anvin --- core/fs.c | 17 +++++++++++------ core/fs/pxe/pxe.c | 4 +++- core/pxelinux.asm | 12 ++++++++++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/core/fs.c b/core/fs.c index 4c8c153..fc93685 100644 --- a/core/fs.c +++ b/core/fs.c @@ -166,22 +166,27 @@ void close_file(com32sys_t *regs) */ void fs_init(com32sys_t *regs) { + sector_t part_offset = regs->ecx.l | ((sector_t)regs->ebx.l << 32); int blk_shift = -1; + struct device *dev = NULL; /* ops is a ptr list for several fs_ops */ const struct fs_ops **ops = (const struct fs_ops **)regs->eax.l; while ((blk_shift < 0) && *ops) { /* set up the fs stucture */ fs.fs_ops = *ops; - /* this is a total hack... */ - if (fs.fs_ops->fs_flags & FS_NODEV) - fs.fs_dev = NULL; - else { - static struct device *dev; + /* + * This boldly assumes that we don't mix FS_NODEV filesystems + * with FS_DEV filesystems... + */ + if (fs.fs_ops->fs_flags & FS_NODEV) { + fs.fs_dev = NULL; + } else { if (!dev) dev = device_init(regs->edx.b[0], regs->edx.b[1], - regs->ecx.l, regs->esi.w[0], regs->edi.w[0]); + part_offset, + regs->esi.w[0], regs->edi.w[0]); fs.fs_dev = dev; } /* invoke the fs-specific init code */ diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c index 4d08191..0e6e227 100644 --- a/core/fs/pxe/pxe.c +++ b/core/fs/pxe/pxe.c @@ -1293,7 +1293,7 @@ static const struct pxenv_t *memory_scan_for_pxenv_struct(void) * if if the API version is 2.1 or later * */ -static void pxe_init(void) +static int pxe_init(void) { extern void pxe_int1a(void); char plan = 'A'; @@ -1395,6 +1395,8 @@ static void pxe_init(void) data_seg = data_seg + ((data_len + 15) >> 4); real_base_mem = max(code_seg,data_seg) >> 6; /* Convert to kilobytes */ + + return 0; } /* diff --git a/core/pxelinux.asm b/core/pxelinux.asm index e5aed7c..c71b07b 100644 --- a/core/pxelinux.asm +++ b/core/pxelinux.asm @@ -309,10 +309,18 @@ efi_csm_hack_size equ $-efi_csm_hack ; ; do fs initialize ; - extern pxe_fs_ops - mov eax,pxe_fs_ops + mov eax,ROOT_FS_OPS pm_call fs_init + section .data + alignz 4 +ROOT_FS_OPS: + extern pxe_fs_ops + dd pxe_fs_ops + dd 0 + + + section .text16 ; ; Initialize the idle mechanism ; -- 2.7.4