Use lowercase keys for devices

This commit is contained in:
2026-03-16 21:25:06 +01:00
parent 65a7511e36
commit 1b1e1e4954
9 changed files with 18 additions and 18 deletions

View File

@@ -27,7 +27,7 @@ void receiver (void* arg) {
void app_main (void) {
debug_printf ("Init process is running. Starting user shell...\n");
int ce_pid = exec ("SYS", "/ce");
int ce_pid = exec ("sys", "/ce");
ce_pgid = get_procgroup (ce_pid);
process_spawn (&receiver, NULL);

View File

@@ -72,11 +72,11 @@ void bootmain (void) {
struct reschedule_ctx rctx;
memset (&rctx, 0, sizeof (rctx));
struct device* sys0 = device_find ("SYS0");
vfs_create_volume (thiscpu->kproc, &rctx, "SYS", FS_TARFS, sys0, false);
struct device* sys0 = device_find ("sys0");
vfs_create_volume (thiscpu->kproc, &rctx, "sys", FS_TARFS, sys0, false);
struct device* temp0 = device_find ("TEMP0");
vfs_create_volume (thiscpu->kproc, &rctx, "TEMP", FS_FAT16, temp0, true);
struct device* temp0 = device_find ("temp0");
vfs_create_volume (thiscpu->kproc, &rctx, "temp", FS_FAT16, temp0, true);
smp_init ();

View File

@@ -111,7 +111,7 @@ static void smp_bootstrap (struct limine_mp_info* mp_info) {
struct reschedule_ctx rctx;
memset (&rctx, 0, sizeof (rctx));
struct proc* spin_proc = proc_from_file (thiscpu->kproc, "SYS", "/spin", &rctx);
struct proc* spin_proc = proc_from_file (thiscpu->kproc, "sys", "/spin", &rctx);
proc_register (spin_proc, thiscpu, &rctx);
spin_lock (&spin_proc->cpu->lock, &fc);

View File

@@ -98,7 +98,7 @@ static void debugconsole_device_init (void) {
device_op_func_t ops[] = {
[DEBUGCONSOLE_PUTSTR] = &debugconsole_putstr,
};
device_create ("DEBUGCONSOLE", ops, lengthof (ops), &debugconsole_init, &debugconsole_fini, NULL,
device_create ("debugconsole", ops, lengthof (ops), &debugconsole_init, &debugconsole_fini, NULL,
thiscpu->kproc, &rctx);
}
@@ -110,7 +110,7 @@ static void terminal_device_init (void) {
[TERMINAL_PUTSTR] = &terminal_putstr,
[TERMINAL_DIMENSIONS] = &terminal_dimensions,
};
device_create ("TERMINAL", ops, lengthof (ops), &terminal_init, &terminal_fini, NULL,
device_create ("terminal", ops, lengthof (ops), &terminal_init, &terminal_fini, NULL,
thiscpu->kproc, &rctx);
}
@@ -155,7 +155,7 @@ static void sys_device_init (void) {
.sector_size = 512,
.buffer = unpack_buffer,
};
device_create ("SYS0", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init, thiscpu->kproc,
device_create ("sys0", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init, thiscpu->kproc,
&rctx);
LZ4F_freeDecompressionContext (dctx);
@@ -177,7 +177,7 @@ static void temp_device_init (void) {
.total_size = 1024 * 1024 * 20,
.sector_size = 512,
};
device_create ("TEMP0", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init, thiscpu->kproc,
device_create ("temp0", ops, lengthof (ops), &ramdrv_init, &ramdrv_fini, &init, thiscpu->kproc,
&rctx);
}
@@ -189,7 +189,7 @@ static void ps2kb_device_init (void) {
device_op_func_t ops[] = {
[KB_READ_KEY] = &ps2kb_read_key,
};
device_create ("KB", ops, lengthof (ops), &ps2kb_init, &ps2kb_fini, NULL, thiscpu->kproc, &rctx);
device_create ("kb", ops, lengthof (ops), &ps2kb_init, &ps2kb_fini, NULL, thiscpu->kproc, &rctx);
}
#endif

View File

@@ -38,7 +38,7 @@ static void ide_make_device (struct proc* proc, struct reschedule_ctx* rctx,
probe.devno, probe.sector_size, probe.sector_count);
char device_key[fieldsizeof (struct device, key)];
snprintf (device_key, sizeof (device_key), "IDE%d", ide_counter++);
snprintf (device_key, sizeof (device_key), "ide%d", ide_counter++);
device_op_func_t ops[] = {
[XDRV_GET_SIZE] = &idedrv_get_size,

View File

@@ -339,10 +339,10 @@ void proc_init (void) {
struct reschedule_ctx rctx;
memset (&rctx, 0, sizeof (rctx));
struct proc* spin_proc = proc_from_file (thiscpu->kproc, "SYS", "/spin", &rctx);
struct proc* spin_proc = proc_from_file (thiscpu->kproc, "sys", "/spin", &rctx);
proc_register (spin_proc, thiscpu, &rctx);
struct proc* init = proc_from_file (thiscpu->kproc, "SYS", "/init", &rctx);
struct proc* init = proc_from_file (thiscpu->kproc, "sys", "/init", &rctx);
proc_register (init, thiscpu, &rctx);
spin_lock (&spin_proc->cpu->lock, &fc);

View File

@@ -6,7 +6,7 @@
#include <system.h>
int debugconsole_print (const char* string, size_t len) {
return device_do ("DEBUGCONSOLE", DEBUGCONSOLE_PUTSTR, (void*)string, (void*)&len, NULL, NULL);
return device_do ("debugconsole", DEBUGCONSOLE_PUTSTR, (void*)string, (void*)&len, NULL, NULL);
}
void debug_printf (const char* fmt, ...) {

View File

@@ -6,7 +6,7 @@
int kb_read_key (void) {
char ch = 0;
int r = device_do ("KB", KB_READ_KEY, &ch, NULL, NULL, NULL);
int r = device_do ("kb", KB_READ_KEY, &ch, NULL, NULL, NULL);
if (r == ST_OK)
return (int)ch;

View File

@@ -3,9 +3,9 @@
#include <terminal.h>
void terminal_print (const char* string, size_t len) {
device_do ("TERMINAL", TERMINAL_PUTSTR, (void*)string, &len, NULL, NULL);
device_do ("terminal", TERMINAL_PUTSTR, (void*)string, &len, NULL, NULL);
}
void terminal_dimensions (size_t* cols, size_t* rows) {
device_do ("TERMINAL", TERMINAL_DIMENSIONS, (void*)cols, (void*)rows, NULL, NULL);
device_do ("terminal", TERMINAL_DIMENSIONS, (void*)cols, (void*)rows, NULL, NULL);
}