CoolPotOS/apps/include/syscall.h

47 lines
1.3 KiB
C
Raw Normal View History

2024-08-30 16:12:44 +08:00
#ifndef CRASHPOWEROS_SYSCALL_H
#define CRASHPOWEROS_SYSCALL_H
2024-08-31 12:36:49 +08:00
#define SYSCALL_PUTC 1
2024-08-30 16:12:44 +08:00
#define SYSCALL_PRINT 2
2024-09-01 11:56:39 +08:00
#define SYSCALL_GETCH 3
2024-08-31 12:36:49 +08:00
#define SYSCALL_MALLOC 4
#define SYSCALL_FREE 5
#define SYSCALL_EXIT 6
#define SYSCALL_G_CLEAN 7
2024-09-01 11:56:39 +08:00
#define SYSCALL_GET_CD 8
2024-09-01 14:56:38 +08:00
#define SYSCALL_VFS_FILESIZE 9
#define SYSCALL_VFS_READFILE 10
#define SYSCALL_VFS_WRITEFILE 11
2024-09-01 20:09:41 +08:00
#define SYSCALL_SYSINFO 12
2024-09-06 00:16:50 +08:00
#define SYSCALL_EXEC 13
2024-09-06 23:11:41 +08:00
#define SYSCALL_CHANGE_PATH 14
2024-09-08 22:43:05 +08:00
#define SYSCALL_GET_ARG 15
#define SYSCALL_CLOCK 16
#define SYSCALL_SLEEP 17
#define SYSCALL_VFS_REMOVE_FILE 18
#define SYSCALL_VFS_RENAME 19
2024-08-30 16:12:44 +08:00
2024-09-01 16:43:58 +08:00
#include "ctype.h"
2024-08-30 16:12:44 +08:00
2024-08-31 12:36:49 +08:00
void syscall_print(char* c);
void syscall_putchar(char c);
2024-09-01 11:56:39 +08:00
char syscall_getch();
2024-08-31 12:36:49 +08:00
void* syscall_malloc(size_t size);
void syscall_free(void *ptr);
void syscall_exit(int code);
void syscall_g_clean();
2024-09-01 11:56:39 +08:00
void syscall_get_cd(char *buffer);
2024-09-01 14:56:38 +08:00
int syscall_vfs_filesize(char* filename);
void syscall_vfs_readfile(char* filename,char* buffer);
void syscall_vfs_writefile(char* filename,char* buffer,unsigned int size);
2024-09-01 20:09:41 +08:00
void* syscall_sysinfo();
2024-09-08 22:43:05 +08:00
int syscall_exec(char *filename,char* args,int is_async);
2024-09-06 23:11:41 +08:00
void syscall_vfs_change_path(const char* path);
2024-09-08 22:43:05 +08:00
char* syscall_get_arg();
long syscall_clock();
void syscall_sleep(uint32_t timer);
int syscall_vfs_remove_file(char* filename);
int syscall_vfs_rename(char* filename1,char* filename2);
2024-08-31 01:23:06 +08:00
2024-08-30 16:12:44 +08:00
#endif