#!/bin/sh
trap '' 2
-$1 ./AcessKernel --rootapp /Acess/SBin/login
-#$1 ./AcessKernel --rootapp /Acess/Apps/AxWin/3.0/AxWinWM
+#$1 ./AcessKernel --rootapp /Acess/SBin/login
+$1 ./AcessKernel --rootapp /Acess/Apps/AxWin/3.0/AxWinWM
trap 2
killall ld-acess
#include <unistd.h>
#include <string.h>
+#define VALGRIND_CLIENT 0
+
// === IMPORTS ===
extern int UI_Initialise(int Width, int Height);
extern void UI_MainLoop(void);
if( rootapp )
{
int pid;
- char *args[7+rootapp_argc+1];
-
- args[0] = "ld-acess";
- args[1] = "--open"; args[2] = "/Devices/VTerm/0";
- args[3] = "--open"; args[4] = "/Devices/VTerm/0";
- args[5] = "--open"; args[6] = "/Devices/VTerm/0";
+ int argcount = 0;
+ char *args[7+rootapp_argc+1+1];
+
+ #if VALGRIND_CLIENT
+ args[argcount++] = "valgrind";
+ #endif
+ args[argcount++] = "./ld-acess";
+ args[argcount++] = "--open"; args[argcount++] = "/Devices/VTerm/0";
+ args[argcount++] = "--open"; args[argcount++] = "/Devices/VTerm/0";
+ args[argcount++] = "--open"; args[argcount++] = "/Devices/VTerm/0";
for( i = 0; i < rootapp_argc; i ++ )
- args[7+i] = rootapp[i];
- args[7+rootapp_argc] = NULL;
+ args[argcount+i] = rootapp[i];
+ args[argcount+rootapp_argc] = NULL;
pid = fork();
if(pid < 0) {
#ifdef __LINUX__
prctl(PR_SET_PDEATHSIG, SIGHUP); // LINUX ONLY!
#endif
+ #if VALGRIND_CLIENT
+ execv("valgrind", args);
+ #else
execv("./ld-acess", args);
+ #endif
}
printf("Root application running as PID %i\n", pid);
}
#endif
#include "../syscalls.h"
//#include <debug.h>
+#include <errno.h>
#define USE_TCP 1
#define MAX_CLIENTS 16
size_t len = recv(Client->Socket, hdr, sizeof(*hdr), 0);
Log_Debug("Server", "%i bytes of header", len);
if( len == 0 ) break;
+ if( len == -1 ) {
+ perror("recv header");
+// Log_Warning("Server", "recv() error - %s", strerror(errno));
+ break;
+ }
if( len != sizeof(*hdr) ) {
// Oops?
Log_Warning("Server", "FD%i bad sized (%i != exp %i)",
continue ;
}
- len = recv(Client->Socket, hdr->Params, hdr->NParams*sizeof(tRequestValue), 0);
- Log_Debug("Server", "%i bytes of params", len);
- if( len != hdr->NParams*sizeof(tRequestValue) ) {
- // Oops.
+ if( hdr->NParams > 0 )
+ {
+ len = recv(Client->Socket, hdr->Params, hdr->NParams*sizeof(tRequestValue), 0);
+ Log_Debug("Server", "%i bytes of params", len);
+ if( len != hdr->NParams*sizeof(tRequestValue) ) {
+ // Oops.
+ }
+ }
+ else
+ {
+ Log_Debug("Server", "No params?");
}
// Get buffer size
CFLAGS += -Wall
CFLAGS += -Werror
-CFLAGS += -g
+CFLAGS += -g -O2
CPPFLAGS += -DARCHDIR_is_x86_64=1
LDFLAGS += -g -Wl,-T,obj-$(PLATFORM)/link.ld
$(BIN): obj-$(PLATFORM)/link.ld $(OBJ)
$(CC) $(LDFLAGS) -o $@ $(OBJ)
obj-$(PLATFORM)/%.o: %.c
@mkdir -p $(dir $@)
obj-lin/link.ld:
@mkdir -p $(dir $@)
@echo "Making Linker Script ($@)"
- $(LD) --verbose | awk '{ if( substr($$0,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/\b0x[048][0-9]*\b/$(LINKADDR)/g' | sed 's/CONSTANT (MAXPAGESIZE)/0x1000/g' > $@
+ $(LD) -g --verbose | awk '{ if( substr($$1,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/\b0x[048][0-9]*\b/$(LINKADDR)/g' | sed 's/CONSTANT (MAXPAGESIZE)/0x1000/g' > $@
-include $(DEPFILES)
{
tRequestAuthHdr auth;
auth.pid = giSyscall_ClientID;
+ auth.key = 0;
SendData(&auth, sizeof(auth));
int len = ReadData(&auth, sizeof(auth), 5);
if( len == 0 ) {