Rework the ioctl() syscall, clean up arguments

This commit is contained in:
2025-09-09 18:12:33 +02:00
parent 1029db6342
commit ac195acd2f
6 changed files with 38 additions and 77 deletions

View File

@ -13,17 +13,22 @@ void main(void) {
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);
int32_t ioh = ioctl(IOCTL_NOHANDLE,
IOCTL_OPENF,
(uint64_t)"base:/hello.txt",
IOCTL_F_WRITE | IOCTL_F_READ | IOCTL_F_MAKE,
0
);
char *text = "Hello from FS";
ioctl(ioh, IOCTL_WRITE, (uint64_t)text, string_len(text), 0);
char buf[0x100] = {0};
ioctl_readfile(ioh, (uint8_t *const)buf, string_len(text), 0);
ioctl(ioh, IOCTL_READ, (uint64_t)buf, string_len(text), 0);
uprintf("FILE: %s\n", buf);
uprintf("file contents: %s\n", buf);
ioctl_closefile(ioh);
ioctl(ioh, IOCTL_CLOSEF, 0, 0, 0);
uprintf("Hello world using uprintf\n");