- Moved IPStack to end of module list (ensures network drivers are inited earlier)
- Debugging in IPStack (ARP)
- Fixing little bugs exposed by verbose errors
cmp eax, 0x80000001 ; Compare the A-register with 0x80000001.
mov eax, 0x80000001
cpuid
- jb .not64bitCapable
+ jb .not64bitCapable
test edx, 1<<29
jz .not64bitCapable
MODULES += Filesystems/Ext2
MODULES += Filesystems/FAT
MODULES += Filesystems/NTFS
-MODULES += IPStack
ifeq ($(ARCHDIR),x86)
MODULES += Storage/ATA Storage/FDD
MODULES += x86/ISADMA x86/VGAText
endif
+MODULES += IPStack # So the other modules are loaded before it
DYNMODS := USB/Core
// Wait for a reply
for(;;)
{
- while(lastID == giARP_LastUpdateID && now() < timeout)
+ while(lastID == giARP_LastUpdateID && now() < timeout) {
+// Log_Debug("ARP", "timeout = %lli", timeout);
Threads_Yield();
+ }
if( now() >= timeout ) break; // Timeout
return &gIP_LoopInterface.Node;
}
- #if 0
- i = 0; num = 0;
- while('0' <= Name[i] && Name[i] <= '9')
- {
- num *= 10;
- num += Name[i] - '0';
- i ++;
- }
- if(Name[i] != '\0') {
- LEAVE('n');
- return NULL;
- }
-
- for( iface = gIP_Interfaces; iface; iface = iface->Next )
- {
- if( (int)iface->Node.ImplInt == num )
- {
- LEAVE('p', &iface->Node);
- return &iface->Node;
- }
- }
- #else
for( iface = gIP_Interfaces; iface; iface = iface->Next )
{
if( strcmp(iface->Name, Name) == 0 )
return &iface->Node;
}
}
- #endif
LEAVE('p', NULL);
return NULL;
CFLAGS = -fno-stack-protector $(CPPFLAGS)
LDFLAGS = -T $(OUTPUTDIR)Libs/acess.ld -rpath-link $(OUTPUTDIR)Libs -L $(OUTPUTDIR)Libs -I /Acess/Libs/ld-acess.so -lld-acess -lc
+# Extra-verbose errors!
+#CFLAGS += -Wall -Wextra -Wwrite-strings -Wshadow -Wswitch-default -Wswitch-enum -Wstrict-overflow=5 -Wfloat-equal -Wundef -Wmissing-declarations -Wlogical-op
+# -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wsync-nand -Wunused -Wstrict-overflow=5 -Wfloat-equal -Wundef -Wno-endif-labels -Wshadow -Wunsafe-loop-optimizations -Wbad-function-cast -Wc++-compat -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-declarations -Wnormalized=nfc -Wpacked -Wpadded -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wdisabled-optimization -Woverlength-strings
+
DIR = Bin
extern void _SysDebug(const char *format, ...);
// --- Proc ---
extern void _exit(int status) __attribute__((noreturn));
-extern void sleep();
-extern void yield();
+extern void sleep(void);
+extern void yield(void);
extern int kill(int pid, int sig);
extern void wait(int miliseconds);
extern int waittid(int id, int *status);
extern int clone(int flags, void *stack);
extern int execve(char *path, char **argv, char **envp);
-extern int gettid();
-extern int getpid();
+extern int gettid(void);
+extern int getpid(void);
extern int _SysSetFaultHandler(int (*Handler)(int));
extern void SysSetName(const char *Name);
//extern int SysGetName(const char *Name);
// --- Permissions ---
-extern int getuid();
-extern int getgid();
+extern int getuid(void);
+extern int getgid(void);
extern void setuid(int id);
extern void setgid(int id);
typedef signed long int32_t;
typedef signed long long int64_t;
-#if __LP64__
+#ifdef __LP64__
typedef uint64_t intptr_t;
typedef uint64_t uintptr_t;
#else
typedef struct s_sysACL t_sysACL;
static inline void FD_ZERO(fd_set *fdsetp) {int i=FD_SETSIZE/16;while(i--)fdsetp->flags[i]=0; }
-static inline void FD_CLR(int fd, fd_set *fdsetp) { fdsetp->flags[fd/16]&=~(1<<(fd%16)); }
-static inline void FD_SET(int fd, fd_set *fdsetp) { fdsetp->flags[fd/16]|=1<<(fd%16); }
-static inline int FD_ISSET(int fd, fd_set *fdsetp) { return fdsetp->flags[fd/16]&(1<<(fd%16)); }
+static inline void FD_CLR(int fd, fd_set *fdsetp) {
+ if(fd < 0 || fd > FD_SETSIZE) return;
+ fdsetp->flags[fd/16] &= (uint16_t) ((~1 << (fd%16))) & 0xFFFF;
+}
+static inline void FD_SET(int fd, fd_set *fdsetp) {
+ if(fd < 0 || fd > FD_SETSIZE) return;
+ fdsetp->flags[fd/16] |= (uint16_t) (1 << (fd%16));
+}
+static inline int FD_ISSET(int fd, fd_set *fdsetp) {
+ if(fd < 0 || fd > FD_SETSIZE) return 0;
+ return !!( fdsetp->flags[fd/16] & (1<<(fd%16)) );
+}
typedef uint32_t pid_t;
typedef uint32_t tid_t;