在LINUX上,要把Systemback产生的sblive转换为iso,需要使用这个。下载后:
sudo make
sudo make install
/opt/schily/bin/mkisofs -iso-level 3 -r -V sblive -cache-inodes -J -l -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -c isolinux/boot.cat -o sblive.iso sblive
代码片段和文件信息
/* @(#)btcflash.c 1.18 17/07/15 2004-2017 J. Schilling */
#ifndef lint
static const char _sccsid[] =
“@(#)btcflash.c 1.18 17/07/15 2004-2017 J. Schilling“;
#endif
/*--------------------------------------------------------------------------*/
/*
* Firmware flash utility for BTC DRW1008 DVD+/-RW recorder
* Version 2004/04/29
* By David Huang
* This work is dedicated to the public domain
*
* This utility may also work with other BTC DVD recorders such as
* the DRW1004 and DRW1108 but they have not been tested.
*
* USE AT YOUR OWN RISK!
* btcflash is provided AS IS with NO WARRANTY either expressed or implied.
*
* Firmware files may be obtained by running BTC‘s Windows flash
* utility then searching in the WINDOWSTEMP or WINNTTEMP directory
* for a *.HEX file. It will probably be in a subdirectory named
* PAC*.tmp.DIR and the HEX file will be named Vnnnn.HEX where nnnn
* is the firmware version number. You‘ll also find IDEFLASH.EXE or
* BTCFLASH.EXE in the same directory.
*
* This utility will also accept firmware files in “.BIN“ format.
*/
#ifdef DO_INCLUDE
#include
#include
#include
#include
#endif
#define FLASHSIZE 0x100000 /* BTC flash is 1MB */
EXPORT unsigned char *loadfirmware __PR((const char *));
LOCAL int getbyte __PR((char **));
LOCAL unsigned short calcsum __PR((unsigned char *));
LOCAL int btcmain __PR((SCSI *scgp const char *fwfile));
EXPORT unsigned char *
loadfirmware(firmware)
const char * firmware;
{
FILE *f;
char line[80];
char *p;
unsigned char *fwbuf;
int bank;
int length;
int offset;
int type;
int hexsum;
int i;
int b;
fwbuf = malloc(FLASHSIZE);
if (!fwbuf) {
fprintf(stderr _(“Could not allocate memory for firmware
“));
return (NULL);
}
f = fopen(firmware “r“);
if (!f) {
fprintf(stderr _(“%s: Unable to open: “) firmware);
perror(NULL);
free(fwbuf);
return (NULL);
}
/*
* Get length of file. If it‘s exactly FLASHSIZE assume it‘s a
* .bin file. Otherwise try to read it as a .hex file.
*/
fseek(f 0 SEEK_END);
if (ftell(f) == FLASHSIZE) {
rewind(f);
if (fread(fwbuf 1 FLASHSIZE f) != FLASHSIZE) {
fprintf(stderr _(“%s: Short read
“) firmware);
fclose(f);
free(fwbuf);
return (NULL);
}
fclose(f);
return (fwbuf);
}
rewind(f);
memset(fwbuf 0xff FLASHSIZE);
bank = 0;
while (fgets(line sizeof (line) f)) {
if (line[0] != ‘:‘)
continue;
p = line + 1;
length = getbyte(&p);
offset = getbyte(&p) << 8 | getbyte(&p);
type = getbyte(&p);
if (length < 0 || offset < 0 || type < 0 ||
(type != 0 && length != 0)) {
errmsgno(EX_BAD _(“Malformed line: %.79s
“) line);
fclose(f);
free(fwbuf);
return (NULL);
} else if (length == 0) {
if (strncmp(line “:00000155AA“ 11) == 0) {
if (++bank >= 16) {
errmsgno(EX_BAD
_(“Firmware file larger than 1MB
“));
fclose(f);
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)