/*
- * PROJECT: ReactOS Boot Sector for ISO file system (based on ISOLINUX)
- * LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
- * PROGRAMMERS: H. Peter Anvin
- * Michael K. Ter Louw
- * Eric Kohl
- * Timo Kreuzer <timo.kreuzer@reactos.org>
- * Colin Finck <colin@reactos.org>
- *
- *****************************************************************************
- *
- * isolinux.asm
- *
- * A program to boot Linux kernels off a CD-ROM using the El Torito
- * boot standard in "no emulation" mode, making the entire filesystem
- * available. It is based on the SYSLINUX boot loader for MS-DOS
- * floppies.
- *
- * Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
- * Copyright 2009 Intel Corporation *author: H. Peter Anvin
- *
- * This program is free software *you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
- * Boston MA 02111-1307, USA *either version 2 of the License, or
- * (at your option) any later version *incorporated herein by reference.
- *
- *****************************************************************************/
+ * PROJECT: ReactOS Boot Sector for ISO file system (based on ISOLINUX)
+ * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
+ * PURPOSE: Booting ReactOS off a CD-ROM using the El Torito boot standard in "no emulation mode"
+ * COPYRIGHT: Copyright 1994-2009 H. Peter Anvin
+ * Copyright 2002 Michael K. Ter Louw
+ * Copyright 2002 Eric Kohl
+ * Copyright 2009 Intel Corporation *author: H. Peter Anvin
+ * Copyright 2011 Timo Kreuzer (timo.kreuzer@reactos.org)
+ * Copyright 2017 Colin Finck (colin@reactos.org)
+ */
/* INCLUDES ******************************************************************/
#include <asm.inc>
mov cx, HEX(FFFF)
call getfssec
- // Fetch our stored drive number to DL and set the boot partition to 0 in DH.
- mov dl, byte ptr ds:[DriveNumber]
- mov dh, 0
+ // Pass two parameters to SETUPLDR:
+ // DL = BIOS Drive Number
+ // DH = Boot Partition (0 for HDD booting in hybrid mode, FFh for CD booting)
+ movzx dx, byte ptr ds:[DriveNumber]
+ cmp word ptr ds:[GetlinsecPtr], offset getlinsec_ebios
+ je .jump_to_setupldr
+ mov dh, HEX(FF)
+.jump_to_setupldr:
// Transfer execution to the bootloader.
ljmp16 0, FREELDR_BASE