git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: owloysius - dynamic init function invocator
[lunaix-os.git]
/
lunaix-os
/
kernel
/
fs
/
probe_boot.c
diff --git
a/lunaix-os/kernel/fs/probe_boot.c
b/lunaix-os/kernel/fs/probe_boot.c
index 4f38c6ac90cc2d93c250c7171db3e708de5e8e19..3cb40494b26dd5d1c17a9aed711355d3477e2586 100644
(file)
--- a/
lunaix-os/kernel/fs/probe_boot.c
+++ b/
lunaix-os/kernel/fs/probe_boot.c
@@
-10,24
+10,30
@@
LOG_MODULE("PROBE")
struct device*
probe_boot_medium()
{
struct device*
probe_boot_medium()
{
- struct device* block_cat = device_getbyname(NULL, "block", 5);
+ struct device
_meta
* block_cat = device_getbyname(NULL, "block", 5);
if (!block_cat) {
return NULL;
}
struct iso_vol_primary* volp = valloc(ISO9660_BLKSZ);
if (!block_cat) {
return NULL;
}
struct iso_vol_primary* volp = valloc(ISO9660_BLKSZ);
- struct device *pos, *n;
+ struct device* dev = NULL;
+ struct device_meta *pos, *n;
llist_for_each(pos, n, &block_cat->children, siblings)
{
llist_for_each(pos, n, &block_cat->children, siblings)
{
+ dev = resolve_device(pos);
+ if (!dev) {
+ continue;
+ }
+
int errno =
int errno =
-
pos->ops.read(pos
, (void*)volp, ISO9660_READ_OFF, ISO9660_BLKSZ);
+
dev->ops.read(dev
, (void*)volp, ISO9660_READ_OFF, ISO9660_BLKSZ);
if (errno < 0) {
if (errno < 0) {
- kprintf(K
WARN "can not probe %x:%s (%d)\n
",
-
pos->dev_id
,
-
pos->name.val
ue,
-
errno
);
-
pos
= NULL;
+ kprintf(K
INFO "failed %xh:%xh, /dev/%s
",
+
dev->ident.fn_grp
,
+
dev->ident.uniq
ue,
+
dev->name.value
);
+
dev
= NULL;
goto done;
}
goto done;
}
@@
-36,9
+42,10
@@
probe_boot_medium()
}
if (*(u32_t*)volp->sys_id == LUNAIX_ID) {
}
if (*(u32_t*)volp->sys_id == LUNAIX_ID) {
- kprintf(KINFO "[%x:%s] %s\n",
- pos->dev_id,
- pos->name.value,
+ kprintf(KINFO "%xh:%xh, /dev/%s, %s",
+ dev->ident.fn_grp,
+ dev->ident.unique,
+ dev->name.value,
(char*)volp->vol_id);
break;
}
(char*)volp->vol_id);
break;
}
@@
-46,5
+53,5
@@
probe_boot_medium()
done:
vfree(volp);
done:
vfree(volp);
- return
pos
;
+ return
dev
;
}
\ No newline at end of file
}
\ No newline at end of file