Add ANSI escape sequences library to ulib

This commit is contained in:
2025-09-06 14:55:09 +02:00
parent 97bfa178d1
commit b04ebd9c71
9 changed files with 842 additions and 3 deletions

View File

@ -4,19 +4,21 @@
#include <sysdefs/ioctl.h>
#include <system/ioctl.h>
#include <uprintf.h>
#include <ansiq/all.h>
void main(void) {
debugprint("Hello world from userspace in C");
debugprint(ANSIQ_SCR_CLR_ALL);
debugprint(ANSIQ_CUR_SET(0, 0));
int32_t ioh = ioctl_openfile("base:/hello.txt", IOCTL_F_WRITE | IOCTL_F_READ | IOCTL_F_MAKE);
char *text = "Hello from the filesystem";
ioctl_writefile(ioh, (const uint8_t *const)text, string_len(text), 0);
char buf[0x100];
char buf[0x100] = {0};
ioctl_readfile(ioh, (uint8_t *const)buf, string_len(text), 0);
debugprint(buf);
uprintf("FILE: %s\n", buf);
ioctl_closefile(ioh);