Compare commits
3 Commits
cba8122b07
...
b1648a146a
| Author | SHA1 | Date | |
|---|---|---|---|
| b1648a146a | |||
| 1b1e1e4954 | |||
| 65a7511e36 |
@@ -8,6 +8,7 @@ $(eval $(call add_lib,libioutil))
|
|||||||
$(eval $(call add_lib,libterminal))
|
$(eval $(call add_lib,libterminal))
|
||||||
$(eval $(call add_lib,libfat))
|
$(eval $(call add_lib,libfat))
|
||||||
$(eval $(call add_lib,libmalloc))
|
$(eval $(call add_lib,libmalloc))
|
||||||
|
$(eval $(call add_lib,libdebugconsole))
|
||||||
$(eval $(call add_include,libkb))
|
$(eval $(call add_include,libkb))
|
||||||
|
|
||||||
cflags += -DPRINTF_INCLUDE_CONFIG_H=1
|
cflags += -DPRINTF_INCLUDE_CONFIG_H=1
|
||||||
|
|||||||
16
ce/interp.c
16
ce/interp.c
@@ -5,6 +5,7 @@
|
|||||||
#include "mprintf.h"
|
#include "mprintf.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "self.h"
|
#include "self.h"
|
||||||
|
#include <debugconsole.h>
|
||||||
#include <desc.h>
|
#include <desc.h>
|
||||||
#include <filereader.h>
|
#include <filereader.h>
|
||||||
#include <filewriter.h>
|
#include <filewriter.h>
|
||||||
@@ -339,15 +340,12 @@ static void help (struct context* context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void cmd_cancel_proc (void* arg) {
|
static void cmd_cancel_proc (void* arg) {
|
||||||
int pid = *(int*)arg;
|
int pid = (int)arg;
|
||||||
|
|
||||||
char ch = 0;
|
char ch = 0;
|
||||||
for (;;) {
|
do {
|
||||||
mail_receive (&ch, 1);
|
mail_receive (&ch, 1);
|
||||||
|
} while (ch != KB_CTRL ('C'));
|
||||||
if (ch == KB_CTRL ('C'))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
kill (pid);
|
kill (pid);
|
||||||
}
|
}
|
||||||
@@ -407,12 +405,12 @@ static void execute_cmd (struct ast_cmd* cmd, struct context* context) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct process_data* cancel_pdata = process_spawn (&cmd_cancel_proc, &pid);
|
struct process_data* cancel_pdata = process_spawn (&cmd_cancel_proc, (void*)pid);
|
||||||
|
|
||||||
wait_for_pid (pid);
|
wait_for_pid (pid);
|
||||||
|
|
||||||
if (kill (cancel_pdata->pid) < 0)
|
kill (cancel_pdata->pid);
|
||||||
free (cancel_pdata);
|
process_data_free (cancel_pdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,5 +30,7 @@
|
|||||||
#define SYS_CREATE_DIR 27
|
#define SYS_CREATE_DIR 27
|
||||||
#define SYS_REMOVE 28
|
#define SYS_REMOVE 28
|
||||||
#define SYS_CREATE_VOLUME 29
|
#define SYS_CREATE_VOLUME 29
|
||||||
|
#define SYS_ENV_SET 30
|
||||||
|
#define SYS_ENV_GET 31
|
||||||
|
|
||||||
#endif // _M_SYSCALL_DEFS_H
|
#endif // _M_SYSCALL_DEFS_H
|
||||||
|
|||||||
@@ -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 ();
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <limine/requests.h>
|
#include <limine/requests.h>
|
||||||
#include <mm/malloc.h>
|
#include <mm/malloc.h>
|
||||||
#include <mm/pmm.h>
|
#include <mm/pmm.h>
|
||||||
|
#include <proc/env.h>
|
||||||
#include <proc/mutex.h>
|
#include <proc/mutex.h>
|
||||||
#include <proc/proc.h>
|
#include <proc/proc.h>
|
||||||
#include <proc/procgroup.h>
|
#include <proc/procgroup.h>
|
||||||
@@ -138,6 +139,8 @@ void proc_cleanup (struct proc* proc, struct reschedule_ctx* rctx) {
|
|||||||
proc_sqs_cleanup (proc);
|
proc_sqs_cleanup (proc);
|
||||||
proc_mutexes_cleanup (proc, rctx);
|
proc_mutexes_cleanup (proc, rctx);
|
||||||
|
|
||||||
|
proc_env_cleanup (proc);
|
||||||
|
|
||||||
pmm_free (proc->pdata.kernel_stack, KSTACK_SIZE / PAGE_SIZE);
|
pmm_free (proc->pdata.kernel_stack, KSTACK_SIZE / PAGE_SIZE);
|
||||||
procgroup_unmap (proc->procgroup, proc->pdata.tls_vaddr, proc->procgroup->tls.tls_tmpl_pages);
|
procgroup_unmap (proc->procgroup, proc->pdata.tls_vaddr, proc->procgroup->tls.tls_tmpl_pages);
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -31,14 +31,20 @@ int id_alloc (struct id_alloc* ida) {
|
|||||||
|
|
||||||
spin_lock (&ida->lock, &fid);
|
spin_lock (&ida->lock, &fid);
|
||||||
|
|
||||||
for (size_t bit = 0; bit < ida->bm.nbits; bit++) {
|
size_t start = ida->next_id;
|
||||||
if (!bm_test (&ida->bm, bit)) {
|
size_t current = start;
|
||||||
bm_set (&ida->bm, bit);
|
do {
|
||||||
|
if (!bm_test (&ida->bm, current)) {
|
||||||
|
bm_set (&ida->bm, current);
|
||||||
|
|
||||||
|
ida->next_id = (current + 1) % ida->bm.nbits;
|
||||||
|
|
||||||
spin_unlock (&ida->lock, fid);
|
spin_unlock (&ida->lock, fid);
|
||||||
return (int)bit;
|
return (int)current;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
current = (current + 1) % ida->bm.nbits;
|
||||||
|
} while (current != start);
|
||||||
|
|
||||||
spin_unlock (&ida->lock, fid);
|
spin_unlock (&ida->lock, fid);
|
||||||
return -ST_OOM_ERROR;
|
return -ST_OOM_ERROR;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
struct id_alloc {
|
struct id_alloc {
|
||||||
struct bm bm;
|
struct bm bm;
|
||||||
spin_lock_t lock;
|
spin_lock_t lock;
|
||||||
|
int next_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
int id_alloc (struct id_alloc* ida);
|
int id_alloc (struct id_alloc* ida);
|
||||||
|
|||||||
83
kernel/proc/env.c
Normal file
83
kernel/proc/env.c
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
#include <libk/fieldlengthof.h>
|
||||||
|
#include <libk/hash.h>
|
||||||
|
#include <libk/lengthof.h>
|
||||||
|
#include <libk/minmax.h>
|
||||||
|
#include <libk/std.h>
|
||||||
|
#include <libk/string.h>
|
||||||
|
#include <mm/malloc.h>
|
||||||
|
#include <proc/env.h>
|
||||||
|
#include <proc/proc.h>
|
||||||
|
#include <status.h>
|
||||||
|
|
||||||
|
void proc_env_cleanup (struct proc* proc) {
|
||||||
|
for (size_t i = 0; i < fieldlengthof (struct proc_env, env_var_buckets); i++) {
|
||||||
|
struct hash_node_link* link = proc->env.env_var_buckets[i];
|
||||||
|
|
||||||
|
if (link == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
struct proc_env_var* var = hash_entry (link, struct proc_env_var, env_link);
|
||||||
|
|
||||||
|
free (var->buffer);
|
||||||
|
free (var);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int proc_env_set (struct proc* proc, const char* key, void* buffer, size_t data_size) {
|
||||||
|
uint64_t fp;
|
||||||
|
|
||||||
|
struct proc_env_var* var = malloc (sizeof (*var));
|
||||||
|
|
||||||
|
if (var == NULL)
|
||||||
|
return -ST_OOM_ERROR;
|
||||||
|
|
||||||
|
memset (var, 0, sizeof (*var));
|
||||||
|
|
||||||
|
var->buffer = malloc (data_size);
|
||||||
|
|
||||||
|
if (var->buffer == NULL) {
|
||||||
|
free (var);
|
||||||
|
return -ST_OOM_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
var->data_size = data_size;
|
||||||
|
memcpy (var->key, key, strlen_null (key));
|
||||||
|
memcpy (var->buffer, buffer, data_size);
|
||||||
|
|
||||||
|
uint32_t env_hash = hash_fnv32 (var->key, strlen_null (var->key));
|
||||||
|
|
||||||
|
spin_lock (&proc->lock, &fp);
|
||||||
|
|
||||||
|
hash_insert (&proc->env, &var->env_link, env_hash, lengthof (proc->env.env_var_buckets),
|
||||||
|
env_var_buckets);
|
||||||
|
|
||||||
|
spin_unlock (&proc->lock, fp);
|
||||||
|
|
||||||
|
return ST_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int proc_env_get (struct proc* proc, const char* key, void* buffer, size_t size) {
|
||||||
|
uint64_t fp;
|
||||||
|
|
||||||
|
struct hash_node_link* found_link = NULL;
|
||||||
|
size_t key_len = strlen_null (key);
|
||||||
|
uint32_t hash = hash_fnv32 (key, key_len);
|
||||||
|
|
||||||
|
spin_lock (&proc->lock, &fp);
|
||||||
|
|
||||||
|
hash_find (&proc->env, key, key_len, hash, lengthof (proc->env.env_var_buckets), env_var_buckets,
|
||||||
|
struct proc_env_var, env_link, key, found_link);
|
||||||
|
|
||||||
|
if (found_link == NULL) {
|
||||||
|
spin_unlock (&proc->lock, fp);
|
||||||
|
return -ST_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct proc_env_var* var = hash_entry (found_link, struct proc_env_var, env_link);
|
||||||
|
|
||||||
|
memcpy (buffer, var->buffer, min (size, var->data_size));
|
||||||
|
|
||||||
|
spin_unlock (&proc->lock, fp);
|
||||||
|
|
||||||
|
return ST_OK;
|
||||||
|
}
|
||||||
28
kernel/proc/env.h
Normal file
28
kernel/proc/env.h
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#ifndef _KERNEL_PROC_ENV_H
|
||||||
|
#define _KERNEL_PROC_ENV_H
|
||||||
|
|
||||||
|
#include <libk/hash.h>
|
||||||
|
#include <libk/std.h>
|
||||||
|
|
||||||
|
#define PROC_ENV_VAR_MAX 128
|
||||||
|
|
||||||
|
struct proc;
|
||||||
|
|
||||||
|
struct proc_env_var {
|
||||||
|
char key[PROC_ENV_VAR_MAX];
|
||||||
|
void* buffer;
|
||||||
|
size_t data_size;
|
||||||
|
struct hash_node_link env_link;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct proc_env {
|
||||||
|
struct hash_node_link* env_var_buckets[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
void proc_env_cleanup (struct proc* proc);
|
||||||
|
|
||||||
|
int proc_env_set (struct proc* proc, const char* key, void* buffer, size_t data_size);
|
||||||
|
|
||||||
|
int proc_env_get (struct proc* proc, const char* key, void* buffer, size_t size);
|
||||||
|
|
||||||
|
#endif // _KERNEL_PROC_ENV_H
|
||||||
@@ -221,7 +221,7 @@ static struct proc* proc_find_sched (struct cpu* cpu) {
|
|||||||
|
|
||||||
struct list_node_link *current, *start;
|
struct list_node_link *current, *start;
|
||||||
|
|
||||||
if (cpu->proc_current)
|
if (cpu->proc_current && cpu->proc_current->cpu_run_q_link.next)
|
||||||
current = cpu->proc_current->cpu_run_q_link.next;
|
current = cpu->proc_current->cpu_run_q_link.next;
|
||||||
else
|
else
|
||||||
current = cpu->proc_run_q;
|
current = cpu->proc_run_q;
|
||||||
@@ -231,31 +231,75 @@ static struct proc* proc_find_sched (struct cpu* cpu) {
|
|||||||
|
|
||||||
start = current;
|
start = current;
|
||||||
|
|
||||||
do {
|
bool wrap = false;
|
||||||
|
|
||||||
|
while (current) {
|
||||||
struct proc* proc = list_entry (current, struct proc, cpu_run_q_link);
|
struct proc* proc = list_entry (current, struct proc, cpu_run_q_link);
|
||||||
|
|
||||||
spin_lock (&proc->lock, &fp);
|
spin_lock (&proc->lock, &fp);
|
||||||
|
|
||||||
int state = proc->state;
|
int state = proc->state;
|
||||||
|
|
||||||
if (state == PROC_READY && !(proc->flags & PROC_KPROC)) {
|
if (!proc->dead && state == PROC_READY && !(proc->flags & PROC_KPROC)) {
|
||||||
spin_unlock (&proc->lock, fp);
|
spin_unlock (&proc->lock, fp);
|
||||||
return proc;
|
return proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock (&proc->lock, fp);
|
spin_unlock (&proc->lock, fp);
|
||||||
|
|
||||||
current = current->next ? current->next : cpu->proc_run_q;
|
current = current->next;
|
||||||
} while (current != start);
|
|
||||||
|
if (!current && !wrap) {
|
||||||
|
current = cpu->proc_run_q;
|
||||||
|
wrap = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wrap && current == start)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void proc_reaper (struct reschedule_ctx* rctx) {
|
||||||
|
uint64_t fpt, fp, fc;
|
||||||
|
|
||||||
|
struct list_node_link* reaper_list = NULL;
|
||||||
|
|
||||||
|
spin_lock (&proc_tree_lock, &fpt);
|
||||||
|
spin_lock (&thiscpu->lock, &fc);
|
||||||
|
|
||||||
|
struct list_node_link *run_link, *tmp_run_link;
|
||||||
|
list_foreach (thiscpu->proc_run_q, run_link, tmp_run_link) {
|
||||||
|
struct proc* proc = list_entry (run_link, struct proc, cpu_run_q_link);
|
||||||
|
|
||||||
|
if (!proc->dead)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
spin_lock (&proc->lock, &fp);
|
||||||
|
list_remove (thiscpu->proc_run_q, &proc->cpu_run_q_link);
|
||||||
|
rbtree_delete (&proc_tree, &proc->proc_tree_link);
|
||||||
|
list_append (reaper_list, &proc->reaper_list_link);
|
||||||
|
spin_unlock (&proc->lock, fp);
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_unlock (&thiscpu->lock, fc);
|
||||||
|
spin_unlock (&proc_tree_lock, fpt);
|
||||||
|
|
||||||
|
struct list_node_link *rlink, *tmp_rlink;
|
||||||
|
list_foreach (reaper_list, rlink, tmp_rlink) {
|
||||||
|
struct proc* proc = list_entry (rlink, struct proc, reaper_list_link);
|
||||||
|
list_remove (reaper_list, &proc->reaper_list_link);
|
||||||
|
proc_cleanup (proc, rctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void proc_sched (void) {
|
void proc_sched (void) {
|
||||||
struct proc* next = NULL;
|
struct proc* next = NULL;
|
||||||
struct cpu* cpu = thiscpu;
|
struct cpu* cpu = thiscpu;
|
||||||
uint64_t fc;
|
uint64_t fc;
|
||||||
|
|
||||||
|
retry:
|
||||||
spin_lock (&cpu->lock, &fc);
|
spin_lock (&cpu->lock, &fc);
|
||||||
|
|
||||||
next = proc_find_sched (cpu);
|
next = proc_find_sched (cpu);
|
||||||
@@ -268,7 +312,9 @@ void proc_sched (void) {
|
|||||||
cpu->proc_current = NULL;
|
cpu->proc_current = NULL;
|
||||||
spin_unlock (&cpu->lock, fc);
|
spin_unlock (&cpu->lock, fc);
|
||||||
|
|
||||||
spin ();
|
spin_lock_relax ();
|
||||||
|
|
||||||
|
goto retry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,10 +334,9 @@ void proc_kill (struct proc* proc, struct reschedule_ctx* rctx) {
|
|||||||
spin_lock (&cpu->lock, &fc);
|
spin_lock (&cpu->lock, &fc);
|
||||||
spin_lock (&proc->lock, &fp);
|
spin_lock (&proc->lock, &fp);
|
||||||
|
|
||||||
proc->state = PROC_DEAD;
|
|
||||||
proc->cpu = NULL;
|
proc->cpu = NULL;
|
||||||
|
proc->dead = true;
|
||||||
|
|
||||||
list_remove (cpu->proc_run_q, &proc->cpu_run_q_link);
|
|
||||||
cpu->proc_run_q_count--;
|
cpu->proc_run_q_count--;
|
||||||
if (cpu->proc_current == proc)
|
if (cpu->proc_current == proc)
|
||||||
cpu->proc_current = NULL;
|
cpu->proc_current = NULL;
|
||||||
@@ -299,16 +344,6 @@ void proc_kill (struct proc* proc, struct reschedule_ctx* rctx) {
|
|||||||
spin_unlock (&proc->lock, fp);
|
spin_unlock (&proc->lock, fp);
|
||||||
spin_unlock (&cpu->lock, fc);
|
spin_unlock (&cpu->lock, fc);
|
||||||
|
|
||||||
spin_lock (&proc_tree_lock, &fpt);
|
|
||||||
spin_lock (&proc->lock, &fp);
|
|
||||||
|
|
||||||
rbtree_delete (&proc_tree, &proc->proc_tree_link);
|
|
||||||
|
|
||||||
spin_unlock (&proc->lock, fp);
|
|
||||||
spin_unlock (&proc_tree_lock, fpt);
|
|
||||||
|
|
||||||
proc_cleanup (proc, rctx);
|
|
||||||
|
|
||||||
rctx_insert_cpu (rctx, cpu);
|
rctx_insert_cpu (rctx, cpu);
|
||||||
|
|
||||||
DEBUG ("killed PID %d\n", proc->pid);
|
DEBUG ("killed PID %d\n", proc->pid);
|
||||||
@@ -321,11 +356,13 @@ void proc_wait_for (struct proc* proc, struct reschedule_ctx* rctx, struct proc*
|
|||||||
static void proc_irq_sched (void* arg, void* regs, bool user, struct reschedule_ctx* rctx) {
|
static void proc_irq_sched (void* arg, void* regs, bool user, struct reschedule_ctx* rctx) {
|
||||||
(void)arg, (void)regs, (void)rctx;
|
(void)arg, (void)regs, (void)rctx;
|
||||||
|
|
||||||
|
proc_reaper (rctx);
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
proc_sched ();
|
rctx_insert_cpu (rctx, thiscpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void proc_init (void) {
|
void proc_init (void) {
|
||||||
@@ -339,10 +376,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);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <libk/rbtree.h>
|
#include <libk/rbtree.h>
|
||||||
#include <libk/std.h>
|
#include <libk/std.h>
|
||||||
#include <path_defs.h>
|
#include <path_defs.h>
|
||||||
|
#include <proc/env.h>
|
||||||
#include <proc/procgroup.h>
|
#include <proc/procgroup.h>
|
||||||
#include <proc/resource.h>
|
#include <proc/resource.h>
|
||||||
#include <proc/suspension_q.h>
|
#include <proc/suspension_q.h>
|
||||||
@@ -20,8 +21,7 @@
|
|||||||
|
|
||||||
/* process states */
|
/* process states */
|
||||||
#define PROC_READY 0
|
#define PROC_READY 0
|
||||||
#define PROC_DEAD 1
|
#define PROC_SUSPENDED 1
|
||||||
#define PROC_SUSPENDED 2
|
|
||||||
|
|
||||||
/* process flags */
|
/* process flags */
|
||||||
#define PROC_USTK_PREALLOC (1 << 0)
|
#define PROC_USTK_PREALLOC (1 << 0)
|
||||||
@@ -33,6 +33,7 @@ struct reschedule_ctx;
|
|||||||
struct proc {
|
struct proc {
|
||||||
int pid;
|
int pid;
|
||||||
int exec_pid;
|
int exec_pid;
|
||||||
|
struct list_node_link reaper_list_link;
|
||||||
struct rb_node_link proc_tree_link;
|
struct rb_node_link proc_tree_link;
|
||||||
struct rb_node_link procgroup_memb_tree_link;
|
struct rb_node_link procgroup_memb_tree_link;
|
||||||
struct list_node_link cpu_run_q_link;
|
struct list_node_link cpu_run_q_link;
|
||||||
@@ -43,11 +44,13 @@ struct proc {
|
|||||||
spin_lock_t lock;
|
spin_lock_t lock;
|
||||||
struct cpu* cpu;
|
struct cpu* cpu;
|
||||||
int state;
|
int state;
|
||||||
|
bool dead;
|
||||||
uintptr_t uvaddr_argument;
|
uintptr_t uvaddr_argument;
|
||||||
void* mail_recv_buffer;
|
void* mail_recv_buffer;
|
||||||
size_t mail_recv_size;
|
size_t mail_recv_size;
|
||||||
char cwv[VOLUME_MAX];
|
char cwv[VOLUME_MAX];
|
||||||
struct proc_suspension_q done_sq;
|
struct proc_suspension_q done_sq;
|
||||||
|
struct proc_env env;
|
||||||
};
|
};
|
||||||
|
|
||||||
void proc_sched (void);
|
void proc_sched (void);
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ c += proc/proc.c \
|
|||||||
proc/mutex.c \
|
proc/mutex.c \
|
||||||
proc/procgroup.c \
|
proc/procgroup.c \
|
||||||
proc/suspension_q.c \
|
proc/suspension_q.c \
|
||||||
proc/mail.c
|
proc/mail.c \
|
||||||
|
proc/env.c
|
||||||
|
|
||||||
o += proc/proc.o \
|
o += proc/proc.o \
|
||||||
proc/resource.o \
|
proc/resource.o \
|
||||||
proc/mutex.o \
|
proc/mutex.o \
|
||||||
proc/procgroup.o \
|
proc/procgroup.o \
|
||||||
proc/suspension_q.o \
|
proc/suspension_q.o \
|
||||||
proc/mail.o
|
proc/mail.o \
|
||||||
|
proc/env.o
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ int proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock_
|
|||||||
if (cpu->proc_current == proc)
|
if (cpu->proc_current == proc)
|
||||||
cpu->proc_current = NULL;
|
cpu->proc_current = NULL;
|
||||||
|
|
||||||
proc->cpu = NULL;
|
|
||||||
int state = proc->state;
|
int state = proc->state;
|
||||||
|
|
||||||
spin_unlock (&sq->lock, fsq);
|
spin_unlock (&sq->lock, fsq);
|
||||||
|
|||||||
@@ -537,14 +537,7 @@ DEFINE_SYSCALL (sys_get_procgroup) {
|
|||||||
return SYSRESULT (-ST_NOT_FOUND);
|
return SYSRESULT (-ST_NOT_FOUND);
|
||||||
|
|
||||||
spin_lock (&target_proc->lock, &fp);
|
spin_lock (&target_proc->lock, &fp);
|
||||||
|
|
||||||
if (target_proc->state == PROC_DEAD) {
|
|
||||||
spin_unlock (&target_proc->lock, fp);
|
|
||||||
return SYSRESULT (-ST_NOT_FOUND);
|
|
||||||
}
|
|
||||||
|
|
||||||
int pgid = target_proc->procgroup->pgid;
|
int pgid = target_proc->procgroup->pgid;
|
||||||
|
|
||||||
spin_unlock (&target_proc->lock, fp);
|
spin_unlock (&target_proc->lock, fp);
|
||||||
|
|
||||||
return SYSRESULT (pgid);
|
return SYSRESULT (pgid);
|
||||||
@@ -681,7 +674,7 @@ DEFINE_SYSCALL (sys_wait_for_pid) {
|
|||||||
|
|
||||||
spin_lock (&wait_proc->lock, &fp);
|
spin_lock (&wait_proc->lock, &fp);
|
||||||
|
|
||||||
if (wait_proc->state == PROC_DEAD) {
|
if (wait_proc->dead) {
|
||||||
spin_unlock (&wait_proc->lock, fp);
|
spin_unlock (&wait_proc->lock, fp);
|
||||||
return SYSRESULT (-ST_NOT_FOUND);
|
return SYSRESULT (-ST_NOT_FOUND);
|
||||||
}
|
}
|
||||||
@@ -694,7 +687,6 @@ DEFINE_SYSCALL (sys_wait_for_pid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* int kill (int pid) */
|
/* int kill (int pid) */
|
||||||
|
|
||||||
DEFINE_SYSCALL (sys_kill) {
|
DEFINE_SYSCALL (sys_kill) {
|
||||||
uint64_t fp;
|
uint64_t fp;
|
||||||
|
|
||||||
@@ -705,15 +697,6 @@ DEFINE_SYSCALL (sys_kill) {
|
|||||||
if (target_proc == NULL)
|
if (target_proc == NULL)
|
||||||
return SYSRESULT (-ST_NOT_FOUND);
|
return SYSRESULT (-ST_NOT_FOUND);
|
||||||
|
|
||||||
spin_lock (&target_proc->lock, &fp);
|
|
||||||
|
|
||||||
if (target_proc->state == PROC_DEAD) {
|
|
||||||
spin_unlock (&target_proc->lock, fp);
|
|
||||||
return SYSRESULT (-ST_NOT_FOUND);
|
|
||||||
}
|
|
||||||
|
|
||||||
spin_unlock (&target_proc->lock, fp);
|
|
||||||
|
|
||||||
proc_kill (target_proc, rctx);
|
proc_kill (target_proc, rctx);
|
||||||
|
|
||||||
return ST_OK;
|
return ST_OK;
|
||||||
@@ -827,6 +810,80 @@ DEFINE_SYSCALL (sys_create_volume) {
|
|||||||
return SYSRESULT (vfs_create_volume (proc, rctx, key, type, device, false));
|
return SYSRESULT (vfs_create_volume (proc, rctx, key, type, device, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* int env_set (char* key, void* buffer, size_t size) */
|
||||||
|
DEFINE_SYSCALL (sys_env_set) {
|
||||||
|
uint64_t fp, fpg;
|
||||||
|
|
||||||
|
uintptr_t uvaddr_key = a1;
|
||||||
|
uintptr_t uvaddr_buffer = a2;
|
||||||
|
size_t size = (size_t)a3;
|
||||||
|
|
||||||
|
struct limine_hhdm_response* hhdm = limine_hhdm_request.response;
|
||||||
|
|
||||||
|
uintptr_t out_paddr;
|
||||||
|
|
||||||
|
spin_lock (&proc->lock, &fp);
|
||||||
|
struct procgroup* procgroup = proc->procgroup;
|
||||||
|
spin_unlock (&proc->lock, fp);
|
||||||
|
|
||||||
|
spin_lock (&procgroup->lock, &fpg);
|
||||||
|
|
||||||
|
out_paddr = mm_v2p (&procgroup->pd, uvaddr_key);
|
||||||
|
|
||||||
|
if (out_paddr == 0) {
|
||||||
|
spin_unlock (&procgroup->lock, fpg);
|
||||||
|
return SYSRESULT (-ST_BAD_ADDRESS_SPACE);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* key = (const char*)((uintptr_t)hhdm->offset + out_paddr);
|
||||||
|
|
||||||
|
spin_unlock (&procgroup->lock, fpg);
|
||||||
|
|
||||||
|
void* buffer = sys_get_user_buffer (procgroup, uvaddr_buffer, size);
|
||||||
|
|
||||||
|
if (buffer == NULL)
|
||||||
|
return SYSRESULT (-ST_BAD_ADDRESS_SPACE);
|
||||||
|
|
||||||
|
return SYSRESULT (proc_env_set (proc, key, buffer, size));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* int env_get (char* key, void* buffer, size_t size) */
|
||||||
|
DEFINE_SYSCALL (sys_env_get) {
|
||||||
|
uint64_t fp, fpg;
|
||||||
|
|
||||||
|
uintptr_t uvaddr_key = a1;
|
||||||
|
uintptr_t uvaddr_buffer = a2;
|
||||||
|
size_t size = (size_t)a3;
|
||||||
|
|
||||||
|
struct limine_hhdm_response* hhdm = limine_hhdm_request.response;
|
||||||
|
|
||||||
|
uintptr_t out_paddr;
|
||||||
|
|
||||||
|
spin_lock (&proc->lock, &fp);
|
||||||
|
struct procgroup* procgroup = proc->procgroup;
|
||||||
|
spin_unlock (&proc->lock, fp);
|
||||||
|
|
||||||
|
spin_lock (&procgroup->lock, &fpg);
|
||||||
|
|
||||||
|
out_paddr = mm_v2p (&procgroup->pd, uvaddr_key);
|
||||||
|
|
||||||
|
if (out_paddr == 0) {
|
||||||
|
spin_unlock (&procgroup->lock, fpg);
|
||||||
|
return SYSRESULT (-ST_BAD_ADDRESS_SPACE);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* key = (const char*)((uintptr_t)hhdm->offset + out_paddr);
|
||||||
|
|
||||||
|
spin_unlock (&procgroup->lock, fpg);
|
||||||
|
|
||||||
|
void* buffer = sys_get_user_buffer (procgroup, uvaddr_buffer, size);
|
||||||
|
|
||||||
|
if (buffer == NULL)
|
||||||
|
return SYSRESULT (-ST_BAD_ADDRESS_SPACE);
|
||||||
|
|
||||||
|
return SYSRESULT (proc_env_set (proc, key, buffer, size));
|
||||||
|
}
|
||||||
|
|
||||||
static syscall_handler_func_t handler_table[] = {
|
static syscall_handler_func_t handler_table[] = {
|
||||||
[SYS_QUIT] = &sys_quit,
|
[SYS_QUIT] = &sys_quit,
|
||||||
[SYS_TEST] = &sys_test,
|
[SYS_TEST] = &sys_test,
|
||||||
@@ -857,6 +914,8 @@ static syscall_handler_func_t handler_table[] = {
|
|||||||
[SYS_CREATE_DIR] = &sys_create_dir,
|
[SYS_CREATE_DIR] = &sys_create_dir,
|
||||||
[SYS_REMOVE] = &sys_remove,
|
[SYS_REMOVE] = &sys_remove,
|
||||||
[SYS_CREATE_VOLUME] = &sys_create_volume,
|
[SYS_CREATE_VOLUME] = &sys_create_volume,
|
||||||
|
[SYS_ENV_SET] = &sys_env_set,
|
||||||
|
[SYS_ENV_GET] = &sys_env_get,
|
||||||
};
|
};
|
||||||
|
|
||||||
syscall_handler_func_t syscall_find_handler (int syscall_num) {
|
syscall_handler_func_t syscall_find_handler (int syscall_num) {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ include ../make/ufuncs.mk
|
|||||||
|
|
||||||
$(eval $(call add_include,libsystem))
|
$(eval $(call add_include,libsystem))
|
||||||
$(eval $(call add_include,libmalloc))
|
$(eval $(call add_include,libmalloc))
|
||||||
|
$(eval $(call add_include,libdebugconsole))
|
||||||
|
|
||||||
libname := libprocess
|
libname := libprocess
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include <debugconsole.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <map.h>
|
#include <map.h>
|
||||||
#include <page_size.h>
|
#include <page_size.h>
|
||||||
@@ -21,6 +22,7 @@ struct process_data* process_spawn (process_func_t func, void* argument_ptr) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pdata->stack = stack;
|
||||||
pdata->arg_ptr = argument_ptr;
|
pdata->arg_ptr = argument_ptr;
|
||||||
pdata->fn = func;
|
pdata->fn = func;
|
||||||
|
|
||||||
@@ -36,3 +38,8 @@ struct process_data* process_spawn (process_func_t func, void* argument_ptr) {
|
|||||||
pdata->pid = pid;
|
pdata->pid = pid;
|
||||||
return pdata;
|
return pdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void process_data_free (struct process_data* pdata) {
|
||||||
|
free (pdata->stack);
|
||||||
|
free (pdata);
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,9 +14,12 @@ struct process_data {
|
|||||||
void* arg_ptr;
|
void* arg_ptr;
|
||||||
process_func_t fn;
|
process_func_t fn;
|
||||||
int pid;
|
int pid;
|
||||||
|
void* stack;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Spawn a new process within the same procgroup with argument */
|
/* Spawn a new process within the same procgroup with argument */
|
||||||
struct process_data* process_spawn (process_func_t func, void* argument_ptr);
|
struct process_data* process_spawn (process_func_t func, void* argument_ptr);
|
||||||
|
|
||||||
|
void process_data_free (struct process_data* pdata);
|
||||||
|
|
||||||
#endif // _LIBPROCESS_PROCESS_PROCESS_H
|
#endif // _LIBPROCESS_PROCESS_PROCESS_H
|
||||||
|
|||||||
@@ -86,3 +86,11 @@ int remove (const char* path) { return (int)do_syscall (SYS_REMOVE, path); }
|
|||||||
int create_volume (const char* key, int fs_type, const char* device_key) {
|
int create_volume (const char* key, int fs_type, const char* device_key) {
|
||||||
return (int)do_syscall (SYS_CREATE_VOLUME, key, fs_type, device_key);
|
return (int)do_syscall (SYS_CREATE_VOLUME, key, fs_type, device_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int env_set (const char* key, void* buffer, size_t len) {
|
||||||
|
return (int)do_syscall (SYS_ENV_SET, key, buffer, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
int env_get (const char* key, void* buffer, size_t len) {
|
||||||
|
return (int)do_syscall (SYS_ENV_GET, key, buffer, len);
|
||||||
|
}
|
||||||
|
|||||||
@@ -93,4 +93,10 @@ int remove (const char* path);
|
|||||||
/* mount a volume */
|
/* mount a volume */
|
||||||
int create_volume (const char* key, int fs_type, const char* device_key);
|
int create_volume (const char* key, int fs_type, const char* device_key);
|
||||||
|
|
||||||
|
/* Set environment variable */
|
||||||
|
int env_set (const char* key, void* buffer, size_t len);
|
||||||
|
|
||||||
|
/* Get environment variable */
|
||||||
|
int env_get (const char* key, void* buffer, size_t len);
|
||||||
|
|
||||||
#endif // _LIBMSL_M_SYSTEM_H
|
#endif // _LIBMSL_M_SYSTEM_H
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ apps := \
|
|||||||
init \
|
init \
|
||||||
spin \
|
spin \
|
||||||
ce \
|
ce \
|
||||||
|
sdutil
|
||||||
|
|
||||||
all_apps:
|
all_apps:
|
||||||
@for d in $(apps); do make -C $$d platform=$(platform) all; done
|
@for d in $(apps); do make -C $$d platform=$(platform) all; done
|
||||||
|
|||||||
5
sdutil/.gitignore
vendored
Normal file
5
sdutil/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
*.o
|
||||||
|
*.json
|
||||||
|
docs/
|
||||||
|
.cache/
|
||||||
|
sdutil
|
||||||
3
sdutil/Makefile
Normal file
3
sdutil/Makefile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
include ../make/ufuncs.mk
|
||||||
|
|
||||||
|
include ../make/user.mk
|
||||||
1
sdutil/app.mk
Normal file
1
sdutil/app.mk
Normal file
@@ -0,0 +1 @@
|
|||||||
|
app := sdutil
|
||||||
3
sdutil/sdutil.c
Normal file
3
sdutil/sdutil.c
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include <system.h>
|
||||||
|
|
||||||
|
void app_main (void) {}
|
||||||
3
sdutil/src.mk
Normal file
3
sdutil/src.mk
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
c += sdutil.c
|
||||||
|
|
||||||
|
o += sdutil.o
|
||||||
Reference in New Issue
Block a user