Use lowercase keys for devices
This commit is contained in:
@@ -27,7 +27,7 @@ void receiver (void* arg) {
|
|||||||
void app_main (void) {
|
void app_main (void) {
|
||||||
debug_printf ("Init process is running. Starting user shell...\n");
|
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);
|
ce_pgid = get_procgroup (ce_pid);
|
||||||
|
|
||||||
process_spawn (&receiver, NULL);
|
process_spawn (&receiver, NULL);
|
||||||
|
|||||||
@@ -72,11 +72,11 @@ void bootmain (void) {
|
|||||||
struct reschedule_ctx rctx;
|
struct reschedule_ctx rctx;
|
||||||
memset (&rctx, 0, sizeof (rctx));
|
memset (&rctx, 0, sizeof (rctx));
|
||||||
|
|
||||||
struct device* sys0 = device_find ("SYS0");
|
struct device* sys0 = device_find ("sys0");
|
||||||
vfs_create_volume (thiscpu->kproc, &rctx, "SYS", FS_TARFS, sys0, false);
|
vfs_create_volume (thiscpu->kproc, &rctx, "sys", FS_TARFS, sys0, false);
|
||||||
|
|
||||||
struct device* temp0 = device_find ("TEMP0");
|
struct device* temp0 = device_find ("temp0");
|
||||||
vfs_create_volume (thiscpu->kproc, &rctx, "TEMP", FS_FAT16, temp0, true);
|
vfs_create_volume (thiscpu->kproc, &rctx, "temp", FS_FAT16, temp0, true);
|
||||||
|
|
||||||
smp_init ();
|
smp_init ();
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ static void smp_bootstrap (struct limine_mp_info* mp_info) {
|
|||||||
struct reschedule_ctx rctx;
|
struct reschedule_ctx rctx;
|
||||||
memset (&rctx, 0, sizeof (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);
|
proc_register (spin_proc, thiscpu, &rctx);
|
||||||
|
|
||||||
spin_lock (&spin_proc->cpu->lock, &fc);
|
spin_lock (&spin_proc->cpu->lock, &fc);
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ static void debugconsole_device_init (void) {
|
|||||||
device_op_func_t ops[] = {
|
device_op_func_t ops[] = {
|
||||||
[DEBUGCONSOLE_PUTSTR] = &debugconsole_putstr,
|
[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);
|
thiscpu->kproc, &rctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ static void terminal_device_init (void) {
|
|||||||
[TERMINAL_PUTSTR] = &terminal_putstr,
|
[TERMINAL_PUTSTR] = &terminal_putstr,
|
||||||
[TERMINAL_DIMENSIONS] = &terminal_dimensions,
|
[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);
|
thiscpu->kproc, &rctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ static void sys_device_init (void) {
|
|||||||
.sector_size = 512,
|
.sector_size = 512,
|
||||||
.buffer = unpack_buffer,
|
.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);
|
&rctx);
|
||||||
|
|
||||||
LZ4F_freeDecompressionContext (dctx);
|
LZ4F_freeDecompressionContext (dctx);
|
||||||
@@ -177,7 +177,7 @@ static void temp_device_init (void) {
|
|||||||
.total_size = 1024 * 1024 * 20,
|
.total_size = 1024 * 1024 * 20,
|
||||||
.sector_size = 512,
|
.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);
|
&rctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ static void ps2kb_device_init (void) {
|
|||||||
device_op_func_t ops[] = {
|
device_op_func_t ops[] = {
|
||||||
[KB_READ_KEY] = &ps2kb_read_key,
|
[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
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ static void ide_make_device (struct proc* proc, struct reschedule_ctx* rctx,
|
|||||||
probe.devno, probe.sector_size, probe.sector_count);
|
probe.devno, probe.sector_size, probe.sector_count);
|
||||||
|
|
||||||
char device_key[fieldsizeof (struct device, key)];
|
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[] = {
|
device_op_func_t ops[] = {
|
||||||
[XDRV_GET_SIZE] = &idedrv_get_size,
|
[XDRV_GET_SIZE] = &idedrv_get_size,
|
||||||
|
|||||||
@@ -339,10 +339,10 @@ void proc_init (void) {
|
|||||||
struct reschedule_ctx rctx;
|
struct reschedule_ctx rctx;
|
||||||
memset (&rctx, 0, sizeof (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);
|
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);
|
proc_register (init, thiscpu, &rctx);
|
||||||
|
|
||||||
spin_lock (&spin_proc->cpu->lock, &fc);
|
spin_lock (&spin_proc->cpu->lock, &fc);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <system.h>
|
#include <system.h>
|
||||||
|
|
||||||
int debugconsole_print (const char* string, size_t len) {
|
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, ...) {
|
void debug_printf (const char* fmt, ...) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
int kb_read_key (void) {
|
int kb_read_key (void) {
|
||||||
char ch = 0;
|
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)
|
if (r == ST_OK)
|
||||||
return (int)ch;
|
return (int)ch;
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
#include <terminal.h>
|
#include <terminal.h>
|
||||||
|
|
||||||
void terminal_print (const char* string, size_t len) {
|
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) {
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user