devices utility app
All checks were successful
Build ISO image / build-and-deploy (push) Successful in 4m29s
Build documentation / build-and-deploy (push) Successful in 3m51s

This commit is contained in:
2026-04-03 02:33:47 +02:00
parent 9a16029f4e
commit d79556a58f
10 changed files with 87 additions and 1 deletions

View File

@@ -134,6 +134,7 @@ static void debugconsole_device_init (void) {
static device_op_func_t ops[] = {
[DEBUGCONSOLE_PUTSTR] = &debugconsole_putstr,
};
device_create (DEVICE_TYPE_DEBUGCONSOLE, "debugconsole", ops, lengthof (ops), &debugconsole_init,
&debugconsole_fini, NULL, thiscpu->kproc, &rctx);
}
@@ -146,6 +147,7 @@ static void terminal_device_init (void) {
[TERMINAL_PUTSTR] = &terminal_putstr,
[TERMINAL_DIMENSIONS] = &terminal_dimensions,
};
device_create (DEVICE_TYPE_TERMINAL, "terminal", ops, lengthof (ops), &terminal_init,
&terminal_fini, NULL, thiscpu->kproc, &rctx);
}
@@ -191,6 +193,7 @@ static void sys_device_init (void) {
.sector_size = 512,
.buffer = unpack_buffer,
};
device_create (DEVICE_TYPE_DRIVE, "sys0", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init,
thiscpu->kproc, &rctx);
@@ -213,6 +216,7 @@ static void temp_device_init (void) {
.total_size = 1024 * 1024 * 20,
.sector_size = 512,
};
device_create (DEVICE_TYPE_DRIVE, "temp0", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init,
thiscpu->kproc, &rctx);
}
@@ -225,6 +229,7 @@ static void ps2kb_device_init (void) {
device_op_func_t ops[] = {
[KB_READ_KEY] = &ps2kb_read_key,
};
device_create (DEVICE_TYPE_KEYBOARD, "kb", ops, lengthof (ops), &ps2kb_init, &ps2kb_fini, NULL,
thiscpu->kproc, &rctx);
}

View File

@@ -58,6 +58,7 @@ static void ide_make_device (struct proc* proc, struct reschedule_ctx* rctx,
.irq = probe.irq,
.irqs_support = probe.irqs_support,
};
struct device* ide = device_create (DEVICE_TYPE_DRIVE, device_key, ops, lengthof (ops),
&idedrv_init, &idedrv_fini, &init, proc, rctx);
device_probe_partitions (proc, rctx, ide);