完善设备驱动模型,基于kset、kobj来维护对象之间的关系 (#401)

* 使用kobj和kset管理/sys文件夹下的对象

* 修改notifier,把action从u64换为泛型。

* 完善设备驱动模型,基于kset、kobj来维护对象之间的关系
This commit is contained in:
LoGin
2023-10-11 00:53:15 +08:00
committed by GitHub
parent 6abb8bd7c0
commit 06d5e24726
46 changed files with 3492 additions and 1530 deletions

View File

@ -339,9 +339,11 @@ int shell_cmd_cat(int argc, char **argv)
int l = read(fd, buf, 511);
if (l < 0)
{
printf("ERROR: Cannot read file: %s\n", file_path);
printf("ERROR: Cannot read file: %s, errno = %d\n", file_path, errno);
return -1;
}
if (l == 0)
break;
buf[l] = '\0';
file_size -= l;