summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-06-13 15:55:27 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-06-13 15:55:27 -0700
commit6899a6d1722b0f7b2989b9b38c1be0fa2912cb30 (patch)
tree667aac60acb211ed75b3b789d01e80a8530547b0
parent1ea741be7aad4c77d4fd2a602c3669ac59f1db73 (diff)
parentb23fe2afe076f88f6c0a74efc9688a5770cdb940 (diff)
downloadsyslinux-6899a6d1722b0f7b2989b9b38c1be0fa2912cb30.tar.gz
Merge remote branch 'sherbszt/gfxboot32' into pathbased
-rw-r--r--com32/gfxboot/gfxboot.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index a6c95fe1..dd4d6410 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -182,27 +182,29 @@ void boot_entry(menu_t *menu_ptr, char *arg);
int main(int argc, char **argv)
{
int menu_index;
- enum syslinux_filesystem syslinux_id;
- com32sys_t r;
+ const union syslinux_derivative_info *sdi;
openconsole(&dev_stdcon_r, &dev_stdcon_w);
- syslinux_id = syslinux_version()->filesystem;
-
lowmem_buf = __com32.cs_bounce;
lowmem_buf_size = __com32.cs_bounce_size;
- r.eax.l = 0x0a; // Get Derivative-Specific Information
- r.ecx.l = 9;
- __intcall(0x22, &r, &r);
- gfx_config.sector_shift = (uint8_t) r.ecx.l;
- gfx_config.boot_drive = (uint8_t) r.edx.l;
+ sdi = syslinux_derivative_info();
+
+ gfx_config.sector_shift = sdi->disk.sector_shift;
+ gfx_config.boot_drive = sdi->disk.drive_number;
- if(syslinux_id == SYSLINUX_FS_PXELINUX) {
+ if(sdi->c.filesystem == SYSLINUX_FS_PXELINUX) {
gfx_config.sector_shift = 11;
gfx_config.boot_drive = 0;
}
+ gfx_config.media_type = gfx_config.boot_drive < 0x80 ? 1 : 0;
+
+ if(sdi->c.filesystem == SYSLINUX_FS_ISOLINUX) {
+ gfx_config.media_type = sdi->iso.cd_mode ? 0 : 2;
+ }
+
gfx_config.bootloader = 1;
gfx_config.sysconfig_size = sizeof gfx_config;
gfx_config.bootloader_seg = 0; // apparently not needed