浏览代码

emul: add sanity check for blkfs

pull/108/head
Virgil Dupras 4 年前
父节点
当前提交
48f371d380
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      emul/emul.c

+ 7
- 0
emul/emul.c 查看文件

@@ -86,6 +86,13 @@ Machine* emul_init()
fprintf(stderr, "Can't open\n");
return NULL;
}
fseek(blkfp, 0, SEEK_END);
if (ftell(blkfp) < 100 * 1024) {
fclose(blkfp);
fprintf(stderr, "emul/blkfs too small, something's wrong, aborting.\n");
return NULL;
}
fseek(blkfp, 0, SEEK_SET);
// initialize memory
memset(m.mem, 0, 0x10000);
FILE *bfp = fopen(FBIN_PATH, "r");


正在加载...
取消
保存