1952 |
/* Set the "force LBA" flag. */ |
/* Set the "force LBA" flag. */ |
1953 |
*((unsigned char *) (stage1_buffer + STAGE1_FORCE_LBA)) = is_force_lba; |
*((unsigned char *) (stage1_buffer + STAGE1_FORCE_LBA)) = is_force_lba; |
1954 |
|
|
1955 |
/* Set the boot drive mask. This is a workaround for buggy BIOSes which |
/* If DEST_DRIVE is a hard disk, enable the workaround, which is |
1956 |
don't pass boot drive correctly. Instead, they pass 0x00 even when |
for buggy BIOSes which don't pass boot drive correctly. Instead, |
1957 |
booted from 0x80. */ |
they pass 0x00 or 0x01 even when booted from 0x80. */ |
1958 |
*((unsigned char *) (stage1_buffer + STAGE1_BOOT_DRIVE_MASK)) |
if (dest_drive & BIOS_FLAG_FIXED_DISK) |
1959 |
= (dest_drive & BIOS_FLAG_FIXED_DISK); |
/* Replace the jmp (2 bytes) with double nop's. */ |
1960 |
|
*((unsigned short *) (stage1_buffer + STAGE1_BOOT_DRIVE_CHECK)) |
1961 |
|
= 0x9090; |
1962 |
|
|
1963 |
/* Read the first sector of Stage 2. */ |
/* Read the first sector of Stage 2. */ |
1964 |
disk_read_hook = disk_read_savesect_func; |
disk_read_hook = disk_read_savesect_func; |