Remove fbdev, add term_getsizes() syscall to get terminal width+height

This commit is contained in:
2025-11-15 00:57:53 +01:00
parent cf4a6b23c7
commit 871c9cf439
8 changed files with 18 additions and 51 deletions

View File

@ -78,4 +78,5 @@ SyscallFn SYSCALL_TABLE[SYSCALLS_MAX] = {
[SYS_IPC_MBUSDTTCH] = &sys_ipc_mbusdttch,
[SYS_TERM_WRITE] = &sys_term_write,
[SYS_TERM_GETSIZES] = &sys_term_getsizes,
};

View File

@ -1,6 +1,7 @@
#include <stdint.h>
#include <stddef.h>
#include "syscall/syscall.h"
#include "bootinfo/bootinfo.h"
#include "kprintf.h"
#include "errors.h"
@ -16,3 +17,17 @@ int32_t SYSCALL2(sys_term_write, buffer1, len1) {
return E_OK;
}
int32_t SYSCALL2(sys_term_getsizes, w1, h1) {
uint16_t *w = (uint16_t *)w1;
uint16_t *h = (uint16_t *)h1;
if (w == NULL || h == NULL) {
return E_INVALIDARGUMENT;
}
*w = (uint16_t)(BOOT_INFO.fb->width / 16);
*h = (uint16_t)(BOOT_INFO.fb->height / 16);
return E_OK;
}

View File

@ -6,5 +6,6 @@
#include "syscall/syscall.h"
int32_t SYSCALL2(sys_term_write, buffer1, len1);
int32_t SYSCALL2(sys_term_getsizes, w1, h1);
#endif // SYSCALL_TERM_H_