Skip to content

Commit d04e777

Browse files
committed
补充块设备对 sysfs 的注册, 修复块设备管理器读写错误实现问题.
重写 nvme 硬盘驱动. 补充 fsync fdatasync 系统调用. 修复 squashfs 的读取偏移未计算导致解压块错误问题.
1 parent bdef66e commit d04e777

File tree

16 files changed

+1826
-1102
lines changed

16 files changed

+1826
-1102
lines changed

module/squashfs/src/data_reader.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ sqfs_s32 sqfs_data_reader_read(
389389
i = data->cached_block_index;
390390
off = data->cached_disk_offset;
391391
file_block_off = data->cached_block_file_offset;
392+
offset -= file_block_off;
392393
} else {
393394
i = 0;
394395
}

src/arch/x86_64/include/nr.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
#define SYSCALL_WAITPID 61
6464
#define SYSCALL_KILL 62
6565
#define SYSCALL_UNAME 63
66+
#define SYSCALL_FSYNC 74
67+
#define SYSCALL_FDATASYNC 75
6668
#define SYSCALL_FCNTL 72
6769
#define SYSCALL_FTRUNCATE 77
6870
#define SYSCALL_GETCWD 79
@@ -128,6 +130,7 @@
128130
#define SYSCALL_FUTEX 202
129131
#define SYSCALL_GETDENTS64 217
130132
#define SYSCALL_SETID_ADDR 218
133+
#define SYSCALL_FADVISE64 221
131134
#define SYSCALL_EXIT_GROUP 231
132135
#define SYSCALL_C_SETTIME 227
133136
#define SYSCALL_C_GETTIME 228

src/arch/x86_64/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ USED _Noreturn void kmain() {
151151
urandom_init();
152152
// usb_init();
153153
ahci_setup();
154-
// nvme_setup();
154+
nvme_setup();
155155
drm_plainfb_init();
156156

157157
cpio_init();

src/arch/x86_64/syscall.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,15 @@ syscall_t syscall_handlers[MAX_SYSCALLS] = {
227227
[SYSCALL_LCHOWN] = (syscall_t)syscall_lchown,
228228
[SYSCALL_FCHOWNAT] = (syscall_t)syscall_fchownat,
229229
[SYSCALL_UMASK] = (syscall_t)syscall_umask,
230+
[SYSCALL_FADVISE64] = (syscall_t)syscall_fadvise64,
230231
[SYSCALL_UTIMENSAT] = (syscall_t)syscall_utimensat,
231232
[SYSCALL_FUTIMESAT] = (syscall_t)syscall_futimensat,
233+
[SYSCALL_FSYNC] = (syscall_t)syscall_fsync,
234+
[SYSCALL_FDATASYNC] = (syscall_t)syscall_fdatasync,
232235
[SYSCALL_SYNC] = (syscall_t)syscall_sync,
233236
[SYSCALL_REBOOT] = (syscall_t)syscall_reboot,
234237
[SYSCALL_GETRANDOM] = (syscall_t)syscall_getrandom,
238+
[SYSCALL_FSOPEN] = (syscall_t)syscall_fsopen,
235239
[324] = (syscall_t)syscall_membarrier,
236240
[SYSCALL_SOCKET] = (syscall_t)syscall_socket,
237241
[SYSCALL_SOCKETPAIR] = (syscall_t)syscall_socketpair,

0 commit comments

Comments
 (0)