diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-03-04 22:50:53 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-03-04 22:50:53 -0500 |
commit | 180a959053bd1b955bef8db4dab443f341ee1ce7 (patch) | |
tree | a0f0ed1ac9f46bd2cdef22282b10413583fd858b /src/boot.c | |
parent | 7d0f08a738b3fedbf88e5e31e8682414640a3d57 (diff) | |
download | seabios-hppa-180a959053bd1b955bef8db4dab443f341ee1ce7.zip seabios-hppa-180a959053bd1b955bef8db4dab443f341ee1ce7.tar.gz seabios-hppa-180a959053bd1b955bef8db4dab443f341ee1ce7.tar.bz2 |
Get CDROM emulation working.
Fix bug causing ata_cmd_packet to insl to wrong address.
Add new cdrom_read helper.
Join ata.hdidmap/cdidmap into one array variable.
Rename CONFIG_ELTORITO_BOOT to CONFIG_CDROM_BOOT.
Add cd emulation code.
Diffstat (limited to 'src/boot.c')
-rw-r--r-- | src/boot.c | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -10,6 +10,7 @@ #include "config.h" // CONFIG_* #include "cmos.h" // inb_cmos #include "ata.h" // ata_detect +#include "disk.h" // cdrom_boot // We need a copy of this string, but we are not actually a PnP BIOS, // so make sure it is *not* aligned, so OSes will not see it if they @@ -67,7 +68,7 @@ try_boot(u16 seq_nr) u8 bootdrv = 0; u16 bootdev, bootip; - if (CONFIG_ELTORITO_BOOT) { + if (CONFIG_CDROM_BOOT) { bootdev = inb_cmos(CMOS_BIOS_BOOTFLAG2); bootdev |= ((inb_cmos(CMOS_BIOS_BOOTFLAG1) & 0xf0) << 4); bootdev >>= 4 * seq_nr; @@ -133,10 +134,24 @@ try_boot(u16 seq_nr) bootip = (bootseg & 0x0fff) << 4; bootseg &= 0xf000; break; - case IPL_TYPE_CDROM: /* CD-ROM */ - // XXX - return; + case IPL_TYPE_CDROM: { + /* CD-ROM */ + if (! CONFIG_CDROM_BOOT) + break; + u16 status = cdrom_boot(); + if (status) { + printf("CDROM boot failure code : %04x\n", status); + print_boot_failure(type, 1); + return; + } + + bootdrv = GET_EBDA(cdemu.emulated_drive); + bootseg = GET_EBDA(cdemu.load_segment); + /* Canonicalize bootseg:bootip */ + bootip = (bootseg & 0x0fff) << 4; + bootseg &= 0xf000; break; + } case IPL_TYPE_BEV: { /* Expansion ROM with a Bootstrap Entry Vector (a far * pointer) */ |