> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 16:34:34 up 7 days,  1:32,  1 user,  load average: 0.78, 0.37, 0.28
This commit is contained in:
tracer-ics2023
2024-09-24 16:34:38 +08:00
committed by zzy
parent cc41ab01b4
commit f0e95a851a
2 changed files with 2 additions and 3 deletions

View File

@ -59,7 +59,7 @@ size_t _fs_read(int fd, void *buf, size_t len) {
}
if (file_table[fd].size < file_table[fd].open_offset + len) {
return -1;
len = file_table[fd].size - file_table[fd].open_offset;
}
size_t ret = ramdisk_read(buf, file_table[fd].disk_offset + file_table[fd].open_offset, len);
file_table[fd].open_offset += ret;
@ -73,7 +73,7 @@ size_t _fs_write(int fd, const void *buf, size_t len) {
}
if (file_table[fd].size < file_table[fd].open_offset + len) {
return -1;
len = file_table[fd].size - file_table[fd].open_offset;
}
size_t ret = ramdisk_write(buf, file_table[fd].disk_offset + file_table[fd].open_offset, len);
file_table[fd].open_offset += ret;

View File

@ -13,7 +13,6 @@ int main() {
int i, n;
for (i = 500; i < 1000; i ++) {
fscanf(fp, "%d", &n);
printf("%d ", n);
assert(n == i + 1);
}