endif\r
\r
KERNEL_SRC = ../../KernelLand/Kernel/\r
+LDACESS_SRC = ../../Usermode/Libraries/ld-acess.so_src/\r
\r
KERNEL_OBJ := logging.o adt.o lib.o debug.o messages.o drvutil_disk.o drvutil_video.o\r
#KERNEL_OBJ += libc.o\r
KERNEL_OBJ += vfs/nodecache.o vfs/mount.o vfs/memfile.o vfs/select.o\r
KERNEL_OBJ += vfs/fs/root.o vfs/fs/devfs.o\r
KERNEL_OBJ += drv/fifo.o drv/proc.o drv/dgram_pipe.o\r
-KERNEL_OBJ += drv/vterm.o drv/vterm_font.o drv/vterm_vt100.o drv/vterm_output.o drv/vterm_input.o drv/vterm_termbuf.o\r
+KERNEL_OBJ += drv/vterm.o drv/vterm_font.o drv/vterm_output.o drv/vterm_input.o drv/vterm_termbuf.o\r
+KERNEL_OBJ += drv/vterm_vt100.o drv/vterm_2d.o\r
+KERNEL_OBJ += drv/pty.o\r
\r
N_OBJ := main.o\r
\r
DEPFILES = $(filter %.o,$(OBJ) $(N_OBJ) $(K_OBJ))\r
DEPFILES := $(DEPFILES:%=%.dep)\r
\r
-KCPPFLAGS = -I include/ -I $(KERNEL_SRC)include/\r
+KCPPFLAGS = -I include/ -I $(KERNEL_SRC)include/ -I$(LDACESS_SRC)include_exp/\r
CFLAGS += -Wall -g -std=gnu99\r
CPPFLAGS += $(shell sdl-config --cflags) -I /usr/include/\r
LDFLAGS += $(shell sdl-config --libs) -g -Wl,--defsym,__buildnum=$(BUILD_NUM)\r
int Mouse_Cleanup(void);
// - "User" side
int Mouse_Root_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]);
-tVFS_Node *Mouse_Root_FindDir(tVFS_Node *Node, const char *Name);
+tVFS_Node *Mouse_Root_FindDir(tVFS_Node *Node, const char *Name, Uint Flags);
int Mouse_Dev_IOCtl(tVFS_Node *Node, int ID, void *Data);
-size_t Mouse_Dev_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Data);
+size_t Mouse_Dev_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Data, Uint Flags);
// - Device Side
void Mouse_HandleEvent(Uint32 ButtonState, int *AxisDeltas, int *AxisValues);
return 0;
}
-tVFS_Node *Mouse_Root_FindDir(tVFS_Node *Node, const char *Name)
+tVFS_Node *Mouse_Root_FindDir(tVFS_Node *Node, const char *Name, Uint Flags)
{
if( strcmp(Name, "system") != 0 ) return NULL;
return &gMouse_Pointer.Node;
/**
* \brief Read from a device
*/
-size_t Mouse_Dev_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Data)
+size_t Mouse_Dev_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Data, Uint Flags)
{
tPointer *ptr = Node->ImplPtr;
int n_buttons = ptr->FileHeader->NButtons;
// === STRUCTURES ===\r
typedef struct\r
{\r
- int InodeHandle;\r
+ void *InodeHandle;\r
int bReadOnly;\r
} tNativeFS;\r
\r
int NativeFS_Install(char **Arguments);\r
tVFS_Node *NativeFS_Mount(const char *Device, const char **Arguments);\r
void NativeFS_Unmount(tVFS_Node *Node);\r
-tVFS_Node *NativeFS_FindDir(tVFS_Node *Node, const char *Name);\r
+tVFS_Node *NativeFS_FindDir(tVFS_Node *Node, const char *Name, Uint Flags);\r
int NativeFS_ReadDir(tVFS_Node *Node, int Position, char Dest[FILENAME_MAX]);\r
-size_t NativeFS_Read(tVFS_Node *Node, _acess_off_t Offset, size_t Length, void *Buffer);\r
-size_t NativeFS_Write(tVFS_Node *Node, _acess_off_t Offset, size_t Length, const void *Buffer);\r
+size_t NativeFS_Read(tVFS_Node *Node, _acess_off_t Offset, size_t Length, void *Buffer, Uint Flags);\r
+size_t NativeFS_Write(tVFS_Node *Node, _acess_off_t Offset, size_t Length, const void *Buffer, Uint Flags);\r
void NativeFS_Close(tVFS_Node *Node);\r
\r
// === GLOBALS ===\r
// Check if directory exists\r
// Parse flags from arguments\r
info = malloc(sizeof(tNativeFS));\r
- info->InodeHandle = Inode_GetHandle();\r
+ info->InodeHandle = Inode_GetHandle(NULL);\r
info->bReadOnly = 0;\r
// Create node\r
ret = malloc(sizeof(tVFS_Node));\r
}\r
}\r
\r
-tVFS_Node *NativeFS_FindDir(tVFS_Node *Node, const char *Name)\r
+tVFS_Node *NativeFS_FindDir(tVFS_Node *Node, const char *Name, Uint Flags)\r
{\r
char *path;\r
tNativeFS *info = Node->ImplPtr;\r
return 0;\r
}\r
\r
-size_t NativeFS_Read(tVFS_Node *Node, _acess_off_t Offset, size_t Length, void *Buffer)\r
+size_t NativeFS_Read(tVFS_Node *Node, _acess_off_t Offset, size_t Length, void *Buffer, Uint Flags)\r
{\r
ENTER("pNode XOffset xLength pBuffer", Node, Offset, Length, Buffer);\r
if( fseek( (FILE *)(tVAddr)Node->Inode, Offset, SEEK_SET ) != 0 )\r
return ret;\r
}\r
\r
-size_t NativeFS_Write(tVFS_Node *Node, _acess_off_t Offset, size_t Length, const void *Buffer)\r
+size_t NativeFS_Write(tVFS_Node *Node, _acess_off_t Offset, size_t Length, const void *Buffer, Uint Flags)\r
{\r
FILE *fp = (FILE *)(tVAddr)Node->Inode;\r
ENTER("pNode XOffset xLength pBuffer", Node, Offset, Length, Buffer);\r
return h;
}
+int VFS_SetHandle(int FD, tVFS_Node *Node, int Mode)
+{
+ tVFS_Handle *h;
+ if(FD < 0) return -1;
+
+ if( FD & VFS_KERNEL_FLAG ) {
+ FD &= (VFS_KERNEL_FLAG -1);
+ if( FD >= MAX_KERNEL_FILES ) return -1;
+ h = &gaKernelHandles[FD];
+ }
+ else {
+ tUserHandles *ent;
+ int pid = Threads_GetPID();
+ int maxhandles = *Threads_GetMaxFD();
+
+ ent = VFS_int_GetUserHandles(pid, 0);
+ if(!ent) {
+ Log_Error("VFS", "Client %i does not have a handle list (>)", pid);
+ return NULL;
+ }
+
+ if(FD >= maxhandles) {
+ LOG("FD (%i) > Limit (%i), RETURN NULL", FD, maxhandles);
+ return NULL;
+ }
+ h = &ent->Handles[ FD ];
+ }
+ h->Node = Node;
+ h->Mode = Mode;
+ return FD;
+}
+
+
int VFS_AllocHandle(int bIsUser, tVFS_Node *Node, int Mode)
{
int i;
// === PROTOTYPES ===
int Video_Install(char **Arguments);
-size_t Video_Read(tVFS_Node *Node, Uint64 Offset, size_t Length, void *Buffer);
-size_t Video_Write(tVFS_Node *Node, Uint64 Offset, size_t Length, const void *Buffer);
+size_t Video_Read(tVFS_Node *Node, Uint64 Offset, size_t Length, void *Buffer, Uint Flags);
+size_t Video_Write(tVFS_Node *Node, Uint64 Offset, size_t Length, const void *Buffer, Uint Flags);
int Video_IOCtl(tVFS_Node *Node, int ID, void *Data);
// --- 2D Acceleration Functions --
void Video_2D_Fill(void *Ent, Uint16 X, Uint16 Y, Uint16 W, Uint16 H, Uint32 Colour);
/**
* \brief Read from framebuffer (unimplemented)
*/
-size_t Video_Read(tVFS_Node *Node, Uint64 Offset, size_t Length, void *Buffer)
+size_t Video_Read(tVFS_Node *Node, Uint64 Offset, size_t Length, void *Buffer, Uint Flags)
{
return 0;
}
/**
* \brief Write to the framebuffer
*/
-size_t Video_Write(tVFS_Node *Node, Uint64 Offset, size_t Length, const void *Buffer)
+size_t Video_Write(tVFS_Node *Node, Uint64 Offset, size_t Length, const void *Buffer, Uint Flags)
{
int i;
ENTER("pNode XOffset XLength pBuffer", Node, Offset, Length, Buffer);
--- /dev/null
+#!/bin/sh
+make -C AcessNative/libacess-native.so_src/ && make -C AcessNative/acesskernel_src/ && ARCH=native make all-user
+