提交 ed388380 编写于 作者: Z Zihao Yu

Merge branch 'misc' into 'master'

Misc

See merge request projectn/nemu!81
......@@ -35,9 +35,14 @@ void init_disk() {
add_pio_map ("disk", AUDIO_PORT, (void *)disk_base, space_size, disk_io_handler);
add_mmio_map("disk", AUDIO_MMIO, (void *)disk_base, space_size, disk_io_handler);
fp = fopen("/home/yzh/projectn/nanos-lite/build/ramdisk.img", "r");
assert(fp);
fseek(fp, 0, SEEK_END);
disk_base[SIZE] = ftell(fp) / 512 + 1;
fseek(fp, 0, SEEK_SET);
const char *path ="/home/yzh/projectn/nanos-lite/build/ramdisk.img";
fp = fopen(path, "r");
if (fp) {
fseek(fp, 0, SEEK_END);
disk_base[SIZE] = ftell(fp) / 512 + 1;
fseek(fp, 0, SEEK_SET);
} else {
Log("Can not open %s. Disable disk...", path);
disk_base[SIZE] = 0;
}
}
......@@ -26,8 +26,10 @@
#define VGACTL_PORT 0x100 // Note that this is not the standard
#define VGACTL_MMIO 0xa1000100
#ifdef SHOW_SCREEN
static SDL_Renderer *renderer = NULL;
static SDL_Texture *texture = NULL;
#endif
static uint32_t (*vmem) [SCREEN_W] = NULL;
static uint32_t *vgactl_port_base = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册