create iso images with a non floppy emulation bootblock. all this patch does is to add the -B option, wich is like -b but sets the type of the bootblock to non emulation so that bootblock has full lba access to the iso filesystem. Reference: /n/sources/patch/applied/dump9660-noemu-bootblock Date: Sun Mar 28 23:30:54 CES 2010 Signed-off-by: cinap_lenrek@gmx.de --- /sys/src/cmd/disk/9660/boot.c Sun Mar 28 23:27:37 2010 +++ /sys/src/cmd/disk/9660/boot.c Sun Mar 28 23:27:34 2010 @@ -149,6 +149,7 @@ Cupdatebootcat(Cdimg *cd) { uvlong o; + int n; if(cd->bootdirec == nil) return; @@ -156,20 +157,33 @@ o = Cwoffset(cd); Cwseek(cd, cd->bootimageptr); Cputc(cd, 0x88); - switch(cd->bootdirec->length){ - default: - fprint(2, "warning: boot image is not 1.44MB or 2.88MB; pretending 1.44MB\n"); - case 1440*1024: - Cputc(cd, 0x02); /* 1.44MB disk */ - break; - case 2880*1024: - Cputc(cd, 0x03); /* 2.88MB disk */ - break; + + if(cd->flags & CDbootnoemu){ + Cputc(cd, 0x00); /* no disk emulation */ + } else { + switch(cd->bootdirec->length){ + default: + fprint(2, "warning: boot image is not 1.44MB or 2.88MB; pretending 1.44MB\n"); + case 1440*1024: + Cputc(cd, 0x02); /* 1.44MB disk */ + break; + case 2880*1024: + Cputc(cd, 0x03); /* 2.88MB disk */ + break; + } } Cputnl(cd, 0, 2); /* load segment */ Cputc(cd, 0); /* system type */ Cputc(cd, 0); /* unused */ - Cputnl(cd, 1, 2); /* 512-byte sector count for load */ + n = 1; + if(cd->flags & CDbootnoemu){ + n = (cd->bootdirec->length+511)/512; + if(n > 4){ + fprint(2, "warning: boot image too big; will only load the first 2K\n"); + n = 4; + } + } + Cputnl(cd, n, 2); /* 512-byte sector count for load */ Cputnl(cd, cd->bootdirec->block, 4); /* ptr to disk image */ Cwseek(cd, o); } --- /sys/src/cmd/disk/9660/cdrdwr.c Sun Mar 28 23:27:42 2010 +++ /sys/src/cmd/disk/9660/cdrdwr.c Thu Jul 15 00:44:22 2010 @@ -44,7 +44,7 @@ Cputisopvd(cd, info); if(info.flags & CDbootable){ cd->bootimage = info.bootimage; - cd->flags |= CDbootable; + cd->flags |= info.flags & (CDbootable|CDbootnoemu); Cputbootvol(cd); } --- /sys/src/cmd/disk/9660/dump9660.c Sun Mar 28 23:27:47 2010 +++ /sys/src/cmd/disk/9660/dump9660.c Sun Mar 28 23:27:44 2010 @@ -77,6 +77,9 @@ case 'a': doabort = 1; break; + case 'B': + info.flags |= CDbootnoemu; + /* no break */ case 'b': if(!mk9660) usage(); --- /sys/src/cmd/disk/9660/iso9660.h Sun Mar 28 23:27:53 2010 +++ /sys/src/cmd/disk/9660/iso9660.h Sun Mar 28 23:27:50 2010 @@ -133,6 +133,7 @@ CDnew = 1<<4, CDdump = 1<<5, CDbootable = 1<<6, + CDbootnoemu = 1<<7, }; typedef struct Tx Tx;