VFS mountpoint backing device system
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m24s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m24s
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <Flanterm/src/flanterm.h>
|
||||
#include <Flanterm/src/flanterm_backends/fb.h>
|
||||
#include <device/device.h>
|
||||
#include <device/terminal.h>
|
||||
#include <libk/std.h>
|
||||
#include <limine/requests.h>
|
||||
@@ -8,7 +9,6 @@
|
||||
#include <proc/capability.h>
|
||||
#include <proc/proc.h>
|
||||
#include <sys/debug.h>
|
||||
#include <sys/smp.h>
|
||||
|
||||
struct flanterm_context* ft_ctx;
|
||||
|
||||
@@ -19,8 +19,8 @@ void ft_free (void* ptr, size_t size) {
|
||||
free (ptr);
|
||||
}
|
||||
|
||||
bool terminal_init (void* arg) {
|
||||
(void)arg;
|
||||
bool terminal_init (struct device* device, void* arg) {
|
||||
(void)arg, (void)device;
|
||||
|
||||
struct limine_framebuffer_response* fb_r = limine_framebuffer_request.response;
|
||||
struct limine_framebuffer* fb = fb_r->framebuffers[0];
|
||||
@@ -33,27 +33,22 @@ bool terminal_init (void* arg) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void terminal_fini (void) {}
|
||||
void terminal_fini (struct device* device) { (void)device; }
|
||||
|
||||
bool terminal_putstr (struct proc* proc, struct cpu** reschedule_cpu, int* ret, void* a1, void* a2,
|
||||
void* a3, void* a4) {
|
||||
(void)reschedule_cpu, (void)a2, (void)a3, (void)a4;
|
||||
int terminal_putstr (struct device* device, struct device_op_ctx* op_ctx, void* a1, void* a2,
|
||||
void* a3, void* a4) {
|
||||
(void)a2, (void)a3, (void)a4, (void)device;
|
||||
|
||||
if (!(proc->procgroup->capabilities & PROC_CAP_TERMINAL)) {
|
||||
*ret = -ST_PERMISSION_ERROR;
|
||||
return PROC_NO_RESCHEDULE;
|
||||
}
|
||||
if ((op_ctx->proc != NULL) && !(op_ctx->proc->procgroup->capabilities & PROC_CAP_TERMINAL))
|
||||
return -ST_PERMISSION_ERROR;
|
||||
|
||||
char* string = (char*)a1;
|
||||
size_t* len = (size_t*)a2;
|
||||
|
||||
if (string == NULL || len == NULL) {
|
||||
*ret = -ST_BAD_ADDRESS_SPACE;
|
||||
return PROC_NO_RESCHEDULE;
|
||||
}
|
||||
if (string == NULL || len == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
|
||||
flanterm_write (ft_ctx, string, *len);
|
||||
|
||||
*ret = ST_OK;
|
||||
return PROC_NO_RESCHEDULE;
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user