From 7514bb8053931759b99f77d3f9ad70446b0625ac Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 12 Jan 2010 21:04:59 +0800 Subject: [PATCH 1/1] Bugfixes, Cleanup and Rewite started on UDI interface - Fixed bug in mm_virt where the kernel (as 0-1MiB) was being marked COW (hence triple faulting) - Cleaned up /Makefile (now only builds kernel and modules with no target) - Started rewriting the UDI system --- Kernel/Makefile | 2 + Kernel/Makefile.BuildNum | 2 +- Kernel/arch/x86/desctab.asm | 1 + Kernel/arch/x86/include/mm_virt.h | 1 + Kernel/arch/x86/mm_virt.c | 23 +- Kernel/arch/x86/proc.c | 9 +- Kernel/arch/x86/start.asm | 3 + Kernel/binary.c | 4 + Kernel/debug.c | 6 +- Kernel/drv/vterm.c | 14 + Kernel/syscalls.c | 7 +- Makefile | 8 +- Makefile.cfg | 4 +- Modules/BochsGA/bochsvbe.c | 1 - Modules/UDI/include/_udi/logging.h | 25 -- Modules/UDI/include/_udi/meta_gio.h | 26 -- Modules/UDI/include/_udi/meta_mgmt.h | 49 ---- Modules/UDI/include/_udi/values.h | 13 - Modules/UDI/include/udi.h | 249 ++++++++--------- Modules/UDI/include/udi_arch.h | 28 -- Modules/UDI/include/udi_init.h | 312 ++++++++++++++++++++++ Modules/UDI/include/udi_meta_mgmt.h | 140 ++++++++++ Modules/UDI/include/udi_physio.h | 26 -- Modules/UDI/logging.c | 2 +- Modules/UDI/main.c | 12 +- Usermode/Applications/ifconfig_src/main.c | 4 +- 26 files changed, 646 insertions(+), 325 deletions(-) delete mode 100644 Modules/UDI/include/_udi/logging.h delete mode 100644 Modules/UDI/include/_udi/meta_gio.h delete mode 100644 Modules/UDI/include/_udi/meta_mgmt.h delete mode 100644 Modules/UDI/include/_udi/values.h delete mode 100644 Modules/UDI/include/udi_arch.h create mode 100644 Modules/UDI/include/udi_init.h create mode 100644 Modules/UDI/include/udi_meta_mgmt.h delete mode 100644 Modules/UDI/include/udi_physio.h diff --git a/Kernel/Makefile b/Kernel/Makefile index 4cf661ad..1d0f363f 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -84,5 +84,7 @@ include/syscalls.h: syscalls.lst Makefile Makefile: ../Makefile.cfg arch/$(ARCHDIR)/Makefile +drv/proc.o.%: Makefile.BuildNum + # Dependency Files -include $(DEPFILES) diff --git a/Kernel/Makefile.BuildNum b/Kernel/Makefile.BuildNum index fc8e6128..662ae943 100644 --- a/Kernel/Makefile.BuildNum +++ b/Kernel/Makefile.BuildNum @@ -1 +1 @@ -BUILD_NUM = 59 +BUILD_NUM = 94 diff --git a/Kernel/arch/x86/desctab.asm b/Kernel/arch/x86/desctab.asm index b5d060dd..737570b0 100644 --- a/Kernel/arch/x86/desctab.asm +++ b/Kernel/arch/x86/desctab.asm @@ -205,6 +205,7 @@ Isr240: ; --------------------- [extern ErrorHandler] ErrorCommon: + ;xchg bx, bx pusha push ds push es diff --git a/Kernel/arch/x86/include/mm_virt.h b/Kernel/arch/x86/include/mm_virt.h index ec6ca828..cc2d5d81 100644 --- a/Kernel/arch/x86/include/mm_virt.h +++ b/Kernel/arch/x86/include/mm_virt.h @@ -6,6 +6,7 @@ #define _MM_VIRT_H // === FUNCTIONS === +extern void MM_FinishVirtualInit(); extern void MM_SetCR3(Uint32 CR3); extern tPAddr MM_Allocate(tVAddr VAddr); extern void MM_Deallocate(tVAddr VAddr); diff --git a/Kernel/arch/x86/mm_virt.c b/Kernel/arch/x86/mm_virt.c index 0ef67710..958b9f15 100644 --- a/Kernel/arch/x86/mm_virt.c +++ b/Kernel/arch/x86/mm_virt.c @@ -10,6 +10,7 @@ * 0xFF - System Calls / Kernel's User Code */ #define DEBUG 1 +#define SANITY 1 #include #include #include @@ -105,10 +106,8 @@ Uint32 gWorkerStacks[(NUM_WORKER_STACKS+31)/32]; void MM_PreinitVirtual() { #if USE_PAE - //gaInitPDPT[ 0 ] = 0; gaInitPageDir[ ((PAGE_TABLE_ADDR >> TAB)-3*512+3)*2 ] = ((tTabEnt)&gaInitPageDir - KERNEL_BASE) | 3; #else - //gaInitPageDir[ 0 ] = 0; // Needed for SMP startup code gaInitPageDir[ PAGE_TABLE_ADDR >> 22 ] = ((tTabEnt)&gaInitPageDir - KERNEL_BASE) | 3; #endif INVLPG( PAGE_TABLE_ADDR ); @@ -156,6 +155,18 @@ void MM_InstallVirtual() #endif } +/** + * \brief Cleans up the SMP required mappings + */ +void MM_FinishVirtualInit() +{ + #if USE_PAE + gaInitPDPT[ 0 ] = 0; + #else + gaInitPageDir[ 0 ] = 0; + #endif +} + /** * \fn void MM_PageFault(tVAddr Addr, Uint ErrorCode, tRegs *Regs) * \brief Called on a page fault @@ -177,6 +188,7 @@ void MM_PageFault(tVAddr Addr, Uint ErrorCode, tRegs *Regs) } else { + //Log("MM_PageFault: COW - MM_DuplicatePage(0x%x)", Addr); paddr = MM_DuplicatePage( Addr ); MM_DerefPhys( gaPageTable[Addr>>12] & ~0xFFF ); gaPageTable[Addr>>12] &= PF_USER; @@ -318,7 +330,7 @@ tPAddr MM_Allocate(tVAddr VAddr) //LOG("paddr = 0x%llx (new table)", paddr); if( paddr == 0 ) { Warning("MM_Allocate - Out of Memory (Called by %p)", __builtin_return_address(0)); - LEAVE('i',0); + //LEAVE('i',0); return 0; } // Map @@ -524,7 +536,7 @@ tPAddr MM_Clone() memsetd( gaTmpDir, 0, 1024 ); // Copy Tables - for(i=0;i<768;i++) + for( i = 0; i < 768; i ++) { // Check if table is allocated if( !(gaPageDir[i] & PF_PRESENT) ) { @@ -802,6 +814,8 @@ tPAddr MM_DuplicatePage(tVAddr VAddr) Uint temp; int wasRO = 0; + //ENTER("xVAddr", VAddr); + // Check if mapped if( !(gaPageDir [VAddr >> 22] & PF_PRESENT) ) return 0; if( !(gaPageTable[VAddr >> 12] & PF_PRESENT) ) return 0; @@ -826,6 +840,7 @@ tPAddr MM_DuplicatePage(tVAddr VAddr) if(!wasRO) gaPageTable[VAddr >> 12] |= PF_WRITE; INVLPG(VAddr); + //LEAVE('X', ret); return ret; } diff --git a/Kernel/arch/x86/proc.c b/Kernel/arch/x86/proc.c index 9ad06a53..a66a540c 100644 --- a/Kernel/arch/x86/proc.c +++ b/Kernel/arch/x86/proc.c @@ -52,6 +52,7 @@ void Proc_Scheduler(); // === GLOBALS === // --- Multiprocessing --- #if USE_MP +volatile int giNumInitingCPUs = 0; tMPInfo *gMPFloatPtr = NULL; tAPIC *gpMP_LocalAPIC = NULL; Uint8 gaAPIC_to_CPU[256] = {0}; @@ -244,7 +245,11 @@ void ArchThreads_Init() if( giNumCPUs > MAX_CPUS ) { Warning("Too many CPUs detected (%i), only using %i of them", giNumCPUs, MAX_CPUS); + giNumCPUs = MAX_CPUS; } + + while( giNumInitingCPUs ) + MM_FinishVirtualInit(); Panic("Uh oh... MP Table Parsing is unimplemented\n"); } @@ -256,6 +261,7 @@ void ArchThreads_Init() #else giNumCPUs = 1; gTSSs = &gTSS0; + MM_FinishVirtualInit(); #endif // Initialise Double Fault TSS @@ -325,6 +331,7 @@ void MP_StartAP(int CPU) *(Uint16*)(KERNEL_BASE|0x469) = 0xFFFF; outb(0x70, 0x0F); outb(0x71, 0x0A); // Warm Reset MP_SendIPI(gaCPUs[CPU].APICID, 0, 5); + giNumInitingCPUs ++; } void MP_SendIPI(Uint8 APICID, int Vector, int DeliveryMode) @@ -739,7 +746,7 @@ void Proc_Scheduler(int CPU) #endif // Update Kernel Stack pointer - gTSSs[CPU].ESP0 = thread->KernelStack; + gTSSs[CPU].ESP0 = thread->KernelStack-4; // Set address space #if USE_PAE diff --git a/Kernel/arch/x86/start.asm b/Kernel/arch/x86/start.asm index ebf69f42..f1d1ea74 100644 --- a/Kernel/arch/x86/start.asm +++ b/Kernel/arch/x86/start.asm @@ -60,6 +60,7 @@ start: [extern gpMP_LocalAPIC] [extern gaAPIC_to_CPU] [extern gaCPUs] +[extern giNumInitingCPUs] lGDTPtr: ; Local GDT Pointer dw 2*8-1 dd gGDT-KERNEL_BASE @@ -99,6 +100,8 @@ APStartup: mov cl, BYTE [gaAPIC_to_CPU+ecx] ; CL is now the CPU ID mov BYTE [gaCPUs+ecx*8+1], 1 + ; Decrement the remaining CPU count + dec DWORD [giNumInitingCPUs] ; CPU is now marked as initialised sti .hlt: diff --git a/Kernel/binary.c b/Kernel/binary.c index fc58bf47..e3698da8 100644 --- a/Kernel/binary.c +++ b/Kernel/binary.c @@ -804,3 +804,7 @@ Uint Binary_FindSymbol(void *Base, char *Name, Uint *val) Base, ident&0xFF, ident>>8, ident>>16, ident>>24); return 0; } + +// === EXPORTS === +EXPORT(Binary_FindSymbol); +EXPORT(Binary_Unload); diff --git a/Kernel/debug.c b/Kernel/debug.c index d9016419..ea303790 100644 --- a/Kernel/debug.c +++ b/Kernel/debug.c @@ -56,7 +56,7 @@ void E9_Fmt(const char *format, va_list *args) char *p = NULL; int isLongLong = 0; Uint64 arg; - + while((c = *format++) != 0) { // Non control character @@ -305,6 +305,10 @@ void Debug_Leave(char *FuncName, char RetType, ...) va_start(args, RetType); + if( i == -1 ) { + gDebug_Level = 0; + i = 0; + } // Indenting while(i--) E9(' '); diff --git a/Kernel/drv/vterm.c b/Kernel/drv/vterm.c index 8496b9e0..0e66601a 100644 --- a/Kernel/drv/vterm.c +++ b/Kernel/drv/vterm.c @@ -10,6 +10,8 @@ #include #include +#define USE_CTRL_ALT 0 + // === CONSTANTS === #define VERSION ((0<<8)|(50)) @@ -465,6 +467,10 @@ void VT_KBCallBack(Uint32 Codepoint) Codepoint &= 0x7FFFFFFF; switch(Codepoint) { + #if !USE_CTRL_ALT + case KEY_RSHIFT: gbVT_CtrlDown = 0; break; + case KEY_LSHIFT: gbVT_AltDown = 0; break; + #else case KEY_LALT: case KEY_RALT: gbVT_AltDown = 0; @@ -473,12 +479,17 @@ void VT_KBCallBack(Uint32 Codepoint) case KEY_RCTRL: gbVT_CtrlDown = 0; break; + #endif } return; } switch(Codepoint) { + #if !USE_CTRL_ALT + case KEY_RSHIFT: gbVT_CtrlDown = 1; break; + case KEY_LSHIFT: gbVT_AltDown = 1; break; + #else case KEY_LALT: case KEY_RALT: gbVT_AltDown = 1; @@ -487,10 +498,13 @@ void VT_KBCallBack(Uint32 Codepoint) case KEY_RCTRL: gbVT_CtrlDown = 1; break; + #endif default: + #if USE_CTRL_ALT if(!gbVT_AltDown || !gbVT_CtrlDown) break; + #endif switch(Codepoint) { case KEY_F1: VT_SetTerminal(0); return; diff --git a/Kernel/syscalls.c b/Kernel/syscalls.c index 2570f8cc..ba9051a9 100644 --- a/Kernel/syscalls.c +++ b/Kernel/syscalls.c @@ -46,7 +46,6 @@ void SyscallHandler(tSyscallRegs *Regs) if(Regs->Num < NUM_SYSCALLS) LOG("Syscall %s", cSYSCALL_NAMES[Regs->Num]); LOG("Arg1: 0x%x, Arg2: 0x%x, Arg3: 0x%x, Arg4: 0x%x", Regs->Arg1, Regs->Arg2, Regs->Arg3, Regs->Arg4); - //#endif switch(Regs->Num) { @@ -158,6 +157,7 @@ void SyscallHandler(tSyscallRegs *Regs) } } } + LEAVE('s', "Assuming 0"); // Path, **Argv, **Envp ret = Proc_Execve((char*)Regs->Arg1, (char**)Regs->Arg2, (char**)Regs->Arg3); break; @@ -304,7 +304,10 @@ void SyscallHandler(tSyscallRegs *Regs) Regs->Error = err; #if DEBUG LOG("err = %i", err); - LEAVE('x', ret); + if(Regs->Num != SYS_EXECVE) + LEAVE('x', ret); + else + LOG("Actual %i", ret); #endif } diff --git a/Makefile b/Makefile index 178ebf79..56878c1f 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,13 @@ # (Oh man! This is hacky, but beautiful at the same time, much like the # rest of Acess) +-include Makefile.cfg + .PHONY: all clean SUBMAKE = $(MAKE) --no-print-directory -MODULES = FS_Ext2 FDD BochsGA IPStack NE2000 USB +MODULES += $(DYNMODS) USRLIBS = ld-acess.so libacess.so libgcc.so libc.so USRAPPS = init login CLIShell cat ls mount ifconfig @@ -31,8 +33,10 @@ ALLINSTALL_USRAPPS = $(addprefix allinstall-,$(USRAPPS)) $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS) \ $(INSTALL_MODULES) install-Kernel $(INSTALL_USRLIBS) $(INSTALL_USRAPPS) +kmode: $(ALLINSTALL_MODULES) allinstall-Kernel + all: $(ALL_MODULES) all-Kernel $(ALL_USRLIBS) $(ALL_USRAPPS) -all-install: $(ALLINSTALL_MODULES) all-Kernel $(ALLINSTALL_USRLIBS) $(ALLINSTALL_USRAPPS) +all-install: $(ALLINSTALL_MODULES) allinstall-Kernel $(ALLINSTALL_USRLIBS) $(ALLINSTALL_USRAPPS) clean: $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS) install: $(INSTALL_MODULES) install-Kernel $(INSTALL_USRLIBS) $(INSTALL_USRAPPS) diff --git a/Makefile.cfg b/Makefile.cfg index 604f8614..da612a94 100644 --- a/Makefile.cfg +++ b/Makefile.cfg @@ -25,7 +25,9 @@ endif FILESYSTEMS = fat DRIVERS = ata_x86 -MODULES = FS_Ext2 FDD NE2000 BochsGA +MODULES = FS_Ext2 FDD NE2000 BochsGA IPStack +DYNMODS = USB +# UDI #DISTROOT = /mnt/AcessHDD/Acess2 #DISTROOT = ~/Projects/Acess2/Filesystem diff --git a/Modules/BochsGA/bochsvbe.c b/Modules/BochsGA/bochsvbe.c index 3d19585e..5fe82f5b 100644 --- a/Modules/BochsGA/bochsvbe.c +++ b/Modules/BochsGA/bochsvbe.c @@ -13,7 +13,6 @@ #include #include -//#define INT static #define INT // === TYPEDEFS === diff --git a/Modules/UDI/include/_udi/logging.h b/Modules/UDI/include/_udi/logging.h deleted file mode 100644 index 37d3c3c4..00000000 --- a/Modules/UDI/include/_udi/logging.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - */ -#ifndef _UDI_LOGGING_H -#define _UDI_LOGGING_H - -typedef void udi_log_write_call_t( udi_cb_t *gcb, udi_status_t correlated_status ); - -extern void udi_log_write( - udi_log_write_call_t *callback, - udi_cb_t *gcb, - udi_trevent_t trace_event, - udi_ubit8_t severity, - udi_index_t meta_idx, - udi_status_t original_status, - udi_ubit32_t msgnum, - ... - ); - -/* Values for severity */ -#define UDI_LOG_DISASTER 1 -#define UDI_LOG_ERROR 2 -#define UDI_LOG_WARNING 3 -#define UDI_LOG_INFORMATION 4 - -#endif diff --git a/Modules/UDI/include/_udi/meta_gio.h b/Modules/UDI/include/_udi/meta_gio.h deleted file mode 100644 index 57d92352..00000000 --- a/Modules/UDI/include/_udi/meta_gio.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Acess2 UDI Support - * _udi/meta_gio.h - * - General IO Metalanguage - */ -#ifndef _UDI_META_GIO_H_ -#define _UDI_META_GIO_H_ - -typedef struct { - udi_channel_event_ind_op_t *channel_event_ind_op ; - udi_gio_bind_ack_op_t *gio_bind_ack_op ; - udi_gio_unbind_ack_op_t *gio_unbind_ack_op ; - udi_gio_xfer_ack_op_t *gio_xfer_ack_op ; - udi_gio_xfer_nak_op_t *gio_xfer_nak_op ; - udi_gio_event_ind_op_t *gio_event_ind_op ; -} udi_gio_client_ops_t; - -typedef struct { - udi_channel_event_ind_op_t *channel_event_ind_op ; - udi_gio_bind_req_op_t *gio_bind_req_op ; - udi_gio_unbind_req_op_t *gio_unbind_req_op ; - udi_gio_xfer_req_op_t *gio_xfer_req_op ; - udi_gio_event_res_op_t *gio_event_res_op ; -} udi_gio_provider_ops_t ; - -#endif diff --git a/Modules/UDI/include/_udi/meta_mgmt.h b/Modules/UDI/include/_udi/meta_mgmt.h deleted file mode 100644 index 354278e4..00000000 --- a/Modules/UDI/include/_udi/meta_mgmt.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Acess2 UDI Support - * _udi/meta_mgmt.h - * - Mangement Metalanguage - */ -#ifndef _UDI_META_MGMT_H_ -#define _UDI_META_MGMT_H_ - -typedef struct { - udi_cb_t gcb; -} udi_mgmt_cb_t; - -typedef struct { - udi_cb_t gcb; - udi_trevent_t trace_mask; - udi_index_t meta_idx; -} udi_usage_cb_t; - -typedef struct { - udi_cb_t gcb; - udi_ubit32_t child_ID; - void *child_data; - udi_instance_attr_list_t *attr_list; - udi_ubit8_t attr_valid_length; - const udi_filter_element_t *filter_list; - udi_ubit8_t filter_list_length; - udi_ubit8_t parent_ID; -} udi_enumerate_cb_t; - - -typedef void udi_usage_ind_op_t(udi_usage_cb_t *, udi_ubit8_t); -typedef void udi_enumerate_req_op_t(udi_enumerate_cb_t *, udi_ubit8_t); -typedef void udi_devmgmt_req_op_t(udi_mgmt_cb_t *, udi_ubit8_t); -typedef void udi_final_cleanup_req_op_t(udi_mgmt_cb_t *); - -typedef const struct { - udi_usage_ind_op_t *usage_ind_op; - udi_enumerate_req_op_t *enumerate_req_op; - udi_devmgmt_req_op_t *devmgmt_req_op; - udi_final_cleanup_req_op_t *final_cleanup_req_op; -} udi_mgmt_ops_t; - -extern void udi_devmgmt_ack(udi_mgmt_cb_t *cb, udi_ubit8_t flags, udi_status_t status) -/* Values for flags */ -#define UDI_DMGMT_NONTRANSPARENT (1U<<0) -/* Meta-Specific Status Codes */ -#define UDI_DMGMT_STAT_ROUTING_CHANGE (UDI_STAT_META_SPECIFIC|1) - -#endif diff --git a/Modules/UDI/include/_udi/values.h b/Modules/UDI/include/_udi/values.h deleted file mode 100644 index 6c17d48e..00000000 --- a/Modules/UDI/include/_udi/values.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _UDI_VALUES_H_ -#define _UDI_VALUES_H_ - -typedef udi_ubit8_t udi_instance_attr_type_t; -/* Instance Attribute Types */ -#define UDI_ATTR_NONE 0 -#define UDI_ATTR_STRING 1 -#define UDI_ATTR_ARRAY8 2 -#define UDI_ATTR_UBIT32 3 -#define UDI_ATTR_BOOLEAN 4 -#define UDI_ATTR_FILE 5 - -#endif diff --git a/Modules/UDI/include/udi.h b/Modules/UDI/include/udi.h index 02fe0126..acfdebb8 100644 --- a/Modules/UDI/include/udi.h +++ b/Modules/UDI/include/udi.h @@ -1,173 +1,142 @@ -/* - * Acess2 UDI Support - * udi.h +/** + * \file udi.h */ -#ifndef _UDI_H_ -#define _UDI_H_ - -#include +#ifndef _UDI_ARCH_H_ +#define _UDI_ARCH_H_ -typedef void udi_op_t(void); +// Use the core acess file to use the specific size types (plus va_arg) +#include -typedef udi_op_t const *udi_ops_vector_t; +typedef Sint8 udi_sbit8_t; /* signed 8-bit: -2^7..2^7-1 */ +typedef Sint16 udi_sbit16_t; /* signed 16-bit: -2^15..2^15-1 */ +typedef Sint32 udi_sbit32_t; /* signed 32-bit: -2^31..2^31-1 */ +typedef Uint8 udi_ubit8_t; /* unsigned 8-bit: 0..28-1 */ +typedef Uint16 udi_ubit16_t; /* unsigned 16-bit: 0..216-1 */ +typedef Uint32 udi_ubit32_t; /* unsigned 32-bit: 0..232-1 */ -typedef const udi_ubit8_t udi_layout_t; +typedef udi_ubit8_t udi_boolean_t; /* 0=False; 1..28-1=True */ +#define FALSE 0 +#define TRUE 1 -typedef udi_ubit32_t udi_trevent_t; +typedef size_t udi_size_t; /* buffer size */ +typedef size_t udi_index_t; /* zero-based index type */ -#include <_udi/values.h> - -typedef struct { - udi_channel_t channel; - void *context; - void *scratch; - void *initiator_context; - udi_origin_t origin; -} udi_cb_t; +/* Channel Handle */ +typedef void *udi_channel_t; +#define UDI_NULL_CHANNEL NULL /** - * \name Attributes - * \{ - */ -#define UDI_MAX_ATTR_NAMELEN 32 -#define UDI_MAX_ATTR_SIZE 64 -typedef struct { - char attr_name[UDI_MAX_ATTR_NAMELEN]; - udi_ubit8_t attr_value[UDI_MAX_ATTR_SIZE]; - udi_ubit8_t attr_length; - udi_instance_attr_type_t attr_type; -} udi_instance_attr_list_t; - -typedef struct { - char attr_name[UDI_MAX_ATTR_NAMELEN]; - udi_ubit8_t attr_min[UDI_MAX_ATTR_SIZE]; - udi_ubit8_t attr_min_len; - udi_ubit8_t attr_max[UDI_MAX_ATTR_SIZE]; - udi_ubit8_t attr_max_len; - udi_instance_attr_type_t attr_type; - udi_ubit32_t attr_stride; -} udi_filter_element_t; -/** - * \} + * \brief Buffer Path */ +typedef void *udi_buf_path_t; +#define UDI_NULL_BUF_PATH NULL +typedef void *udi_origin_t; +#define UDI_NULL_ORIGIN NULL +typedef Sint64 udi_timestamp_t; -#include <_udi/meta_mgmt.h> - -/** - */ -typedef const struct { - udi_index_t cb_idx; - udi_size_t scratch_requirement; -} udi_gcb_init_t; - -/** - */ -typedef const struct { - udi_index_t ops_idx; - udi_index_t cb_idx; -} udi_cb_select_t; +#define UDI_HANDLE_IS_NULL(handle, handle_type) (handle == NULL) +#define UDI_HANDLE_ID(handle, handle_type) ((Uint32)handle) /** + * \name va_arg wrapper + * \{ */ -typedef const struct { - udi_index_t cb_idx; - udi_index_t meta_idx; - udi_index_t meta_cb_num; - udi_size_t scratch_requirement; - udi_size_t inline_size; - udi_layout_t *inline_layout; -} udi_cb_init_t; - +#define UDI_VA_ARG(pvar, type, va_code) va_arg(pvar,type) +#define UDI_VA_UBIT8_T +#define UDI_VA_SBIT8_T +#define UDI_VA_UBIT16_T +#define UDI_VA_SBIT16_T +#define UDI_VA_UBIT32_T +#define UDI_VA_SBIT32_T +#define UDI_VA_BOOLEAN_T +#define UDI_VA_INDEX_T +#define UDI_VA_SIZE_T +#define UDI_VA_STATUS_T +#define UDI_VA_CHANNEL_T +#define UDI_VA_ORIGIN_T +#define UDI_VA_POINTER /** - * The \a udi_ops_init_t structure contains information the environment - * needs to subsequently create channel endpoints for a particular type of ops - * vector and control block usage. This structure is part of \a udi_init_info. + * \} */ -typedef const struct { - udi_index_t ops_idx; //!< Non Zero driver assigned number - udi_index_t meta_idx; //!< Metalanguage Selector - udi_index_t meta_ops_num; //!< Metalanguage Operation - udi_size_t chan_context_size; - udi_ops_vector_t *ops_vector; //!< Array of function pointers - const udi_ubit8_t *op_flags; -} udi_ops_init_t; /** + * \brief Status Type */ -typedef const struct { - udi_index_t region_idx; - udi_size_t rdata_size; -} udi_secondary_init_t; - +typedef udi_ubit32_t udi_status_t; /** + * \name Values and Flags for udi_status_t + * \{ */ -typedef const struct { - udi_mgmt_ops_t *mgmt_ops; - const udi_ubit8_t *mgmt_op_flags; - udi_size_t mgmt_scratch_requirement; - udi_ubit8_t enumeration_attr_list_length; - udi_size_t rdata_size; - udi_size_t child_data_size; - udi_ubit8_t per_parent_paths; -} udi_primary_init_t; - +#define UDI_STATUS_CODE_MASK 0x0000FFFF +#define UDI_STAT_META_SPECIFIC 0x00008000 +#define UDI_SPECIFIC_STATUS_MASK 0x00007FFF +#define UDI_CORRELATE_OFFSET 16 +#define UDI_CORRELATE_MASK 0xFFFF0000 +/* Common Status Values */ +#define UDI_OK 0 +#define UDI_STAT_NOT_SUPPORTED 1 +#define UDI_STAT_NOT_UNDERSTOOD 2 +#define UDI_STAT_INVALID_STATE 3 +#define UDI_STAT_MISTAKEN_IDENTITY 4 +#define UDI_STAT_ABORTED 5 +#define UDI_STAT_TIMEOUT 6 +#define UDI_STAT_BUSY 7 +#define UDI_STAT_RESOURCE_UNAVAIL 8 +#define UDI_STAT_HW_PROBLEM 9 +#define UDI_STAT_NOT_RESPONDING 10 +#define UDI_STAT_DATA_UNDERRUN 11 +#define UDI_STAT_DATA_OVERRUN 12 +#define UDI_STAT_DATA_ERROR 13 +#define UDI_STAT_PARENT_DRV_ERROR 14 +#define UDI_STAT_CANNOT_BIND 15 +#define UDI_STAT_CANNOT_BIND_EXCL 16 +#define UDI_STAT_TOO_MANY_PARENTS 17 +#define UDI_STAT_BAD_PARENT_TYPE 18 +#define UDI_STAT_TERMINATED 19 +#define UDI_STAT_ATTR_MISMATCH 20 /** + * \} */ -typedef const struct { - udi_primary_init_t *primary_init_info; - udi_secondary_init_t *secondary_init_list; //!< Array - udi_ops_init_t *ops_init_list; - udi_cb_init_t *cb_init_list; - udi_gcb_init_t *gcb_init_list; - udi_cb_select_t *cb_select_list; -} udi_init_t; - - -// -// == Regions == -// /** - * udi_limits_t reflects implementation-dependent system limits, such as - * memory allocation and timer resolution limits, for a particular region. These - * limits may vary from region to region, but will remain constant for the life of - * a region. + * \name Data Layout Specifiers + * \{ */ -typedef struct { - udi_size_t max_legal_alloc; - udi_size_t max_safe_alloc; - udi_size_t max_trace_log_formatted_len; - udi_size_t max_instance_attr_len; - udi_ubit32_t min_curtime_res; - udi_ubit32_t min_timer_res; -} udi_limits_t; - +typedef const udi_ubit8_t udi_layout_t; +/* Specific-Length Layout Type Codes */ +#define UDI_DL_UBIT8_T 1 +#define UDI_DL_SBIT8_T 2 +#define UDI_DL_UBIT16_T 3 +#define UDI_DL_SBIT16_T 4 +#define UDI_DL_UBIT32_T 5 +#define UDI_DL_SBIT32_T 6 +#define UDI_DL_BOOLEAN_T 7 +#define UDI_DL_STATUS_T 8 +/* Abstract Element Layout Type Codes */ +#define UDI_DL_INDEX_T 20 +/* Opaque Handle Element Layout Type Codes */ +#define UDI_DL_CHANNEL_T 30 +#define UDI_DL_ORIGIN_T 32 +/* Indirect Element Layout Type Codes */ +#define UDI_DL_BUF 40 +#define UDI_DL_CB 41 +#define UDI_DL_INLINE_UNTYPED 42 +#define UDI_DL_INLINE_DRIVER_TYPED 43 +#define UDI_DL_MOVABLE_UNTYPED 44 +/* Nested Element Layout Type Codes */ +#define UDI_DL_INLINE_TYPED 50 +#define UDI_DL_MOVABLE_TYPED 51 +#define UDI_DL_ARRAY 52 +#define UDI_DL_END 0 /** -The \a udi_init_context_t structure is stored at the front of the region -data area of each newly created region, providing initial data that a driver will -need to begin executing in the region. A pointer to this structure (and therefore -the region data area as a whole) is made available to the driver as the initial -channel context for its first channel. + * \} */ -typedef struct { - udi_index_t region_idx; - udi_limits_t limits; -} udi_init_context_t; - -typedef struct { - void *rdata; -} udi_chan_context_t; - -// === FUNCTIONS === -extern void udi_final_cleanup_ack(udi_mgmt_cb_t *cb); - -// --- Channel Events --- -extern void udi_channel_event_complete(udi_channel_event_cb_t *cb, udi_status_t status); - - +// === INCLUDE SUB-SECTIONS === +#include "udi_meta_mgmt.h" // Management Metalanguage +#include "udi_init.h" // Init #endif diff --git a/Modules/UDI/include/udi_arch.h b/Modules/UDI/include/udi_arch.h deleted file mode 100644 index 0d8ac6a5..00000000 --- a/Modules/UDI/include/udi_arch.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Acess2 UDI Support - * - Architecture Dependent Definitions - */ -#ifndef _UDI_ARCH_H_ -#define _UDI_ARCH_H_ - -//#if ARCH == x86 -typedef char udi_sbit8_t; /* signed 8-bit: -2^7..2^7-1 */ -typedef short udi_sbit16_t; /* signed 16-bit: -2^15..2^15-1 */ -typedef long udi_sbit32_t; /* signed 32-bit: -2^31..2^31-1 */ -typedef unsigned char udi_ubit8_t; /* unsigned 8-bit: 0..2^8-1 */ -typedef unsigned short udi_ubit16_t; /* unsigned 16-bit: 0..2^16-1 */ -typedef unsigned long udi_ubit32_t; /* unsigned 32-bit: 0..2^32-1 */ -typedef udi_ubit8_t udi_boolean_t; /* 0=False; 1..255=True */ - - -typedef unsigned int udi_size_t; /* buffer size (equiv to size_t) */ -typedef unsigned int udi_index_t; /* zero-based index type */ - -typedef void* udi_channel_t; /* UDI_NULL_CHANNEL */ -typedef void* udi_buf_path_t; /* UDI_NULL_BUF_PATH */ -typedef void* udi_origin_t; /* UDI_NULL_ORIGIN */ - -typedef void* udi_timestamp_t; -//#endif - -#endif diff --git a/Modules/UDI/include/udi_init.h b/Modules/UDI/include/udi_init.h new file mode 100644 index 00000000..cfc9e3ff --- /dev/null +++ b/Modules/UDI/include/udi_init.h @@ -0,0 +1,312 @@ +/** + * \file udi_init.h + */ +#ifndef _UDI_INIT_H_ +#define _UDI_INIT_H_ + +typedef struct udi_init_s udi_init_t; +typedef struct udi_primary_init_s udi_primary_init_t; +typedef struct udi_secondary_init_s udi_secondary_init_t; +typedef struct udi_ops_init_s udi_ops_init_t; +typedef struct udi_cb_init_s udi_cb_init_t; +typedef struct udi_cb_select_s udi_cb_select_t; +typedef struct udi_gcb_init_s udi_gcb_init_t; + +typedef struct udi_init_context_s udi_init_context_t; +typedef struct udi_limits_s udi_limits_t; +typedef struct udi_chan_context_s udi_chan_context_t; +typedef struct udi_child_chan_context_s udi_child_chan_context_t; + +/** + * \brief UDI Initialisation Structure + * + * Defines how to initialise and use a UDI driver + */ +struct udi_init_s +{ + /** + * \brief Defines the primary region + * \note For secondary modules this must be NULL + */ + udi_primary_init_t *primary_init_info; + + /** + * \brief Defines all secondary regions + * Pointer to a list (so, essentially an array) of ::udi_secondary_init_t + * It is terminated by an entry with ::udi_secondary_init_t.region_idx + * set to zero. + * \note If NULL, it is to be treated as an empty list + */ + udi_secondary_init_t *secondary_init_list; + + /** + * \brief Channel operations + * Pointer to a ::udi_ops_init_t.ops_idx == 0 terminated list that + * defines the channel opterations usage for each ops vector implemented + * in this module. + * \note Must contain at least one entry for each metalanguage used + */ + udi_ops_init_t *ops_init_list; + + /** + * \brief Control Blocks + */ + udi_cb_init_t *cb_init_list; + + /** + * \brief Generic Control Blocks + */ + udi_gcb_init_t *gcb_init_list; + + /** + * \brief Overrides for control blocks + * Allows a control block to override the ammount of scratch space it + * gets for a specific ops vector. + */ + udi_cb_select_t *cb_select_list; +}; + + +/** + * \name Flags for ::udi_primary_init_t.mgmt_op_flags + * \{ + */ + +/** + * \brief Tells the environment that this operation may take some time + * Used as a hint in scheduling tasks + */ +#define UDI_OP_LONG_EXEC 0x01 + +/** + * \} + */ + +/** + * \brief Describes the Primary Region + * Tells the environment how to set up the driver's primary region. + */ +struct udi_primary_init_s +{ + /** + * \brief Management Ops Vector + * Pointer to a list of functions for the Management Metalanguage + */ + udi_mgmt_ops_t *mgmt_ops; + + /** + * \brief Flags for \a mgmt_ops + * Each entry in \a mgmt_ops is acommanied by an entry in this array. + * Each entry contains the flags that apply to the specified ops vector. + * \see UDI_OP_LONG_EXEC + */ + const udi_ubit8_t *mgmt_op_flags; + + /** + * \brief Scratch space size + * Specifies the number of bytes to allocate for each control block + * passed by the environment. + * \note must not exceed ::UDI_MAX_SCRATCH + */ + udi_size_t mgmt_scratch_requirement; + + /** + * \todo What is this? + */ + udi_ubit8_t enumeration_attr_list_length; + + /** + * \brief Size in bytes to allocate to each instance of the primary + * region + * Essentially the size of the driver's instance state + * \note Must be at least sizeof(udi_init_context_t) and not more + * than UDI_MIN_ALLOC_LIMIT + */ + udi_size_t rdata_size; + + /** + * \brief Size in bytes to allocate for each call to ::udi_enumerate_req + * \note Must not exceed UDI_MIN_ALLOC_LIMIT + */ + udi_size_t child_data_size; + + /** + * \brief Number of path handles for each parent bound to this driver + * \todo What the hell are path handles? + */ + udi_ubit8_t per_parent_paths; +}; + +/** + * \brief Tells the environment how to create a secondary region + */ +struct udi_secondary_init_s +{ + /** + * \brief Region Index + * Non-zero driver-dependent index value that identifies the region + * \note This corresponds to a "region" declaration in the udiprops.txt + * file. + */ + udi_index_t region_idx; + /** + * \brief Number of bytes to allocate + * + * \note Again, must be between sizeof(udi_init_context_t) and + * UDI_MIN_ALLOC_LIMIT + */ + udi_size_t rdata_size; +}; + +/** + * \brief Defines channel endpoints (ways of communicating with the driver) + * + */ +struct udi_ops_init_s +{ + /** + * \brief ops index number + * Used to uniquely this entry + * \note If this is zero, it marks the end of the list + */ + udi_index_t ops_idx; + /** + * \brief Metalanguage Index + * Defines what metalanguage is used + */ + udi_index_t meta_idx; + /** + * \brief Metalanguage Operation + * Defines what metalanguage operation is used + */ + udi_index_t meta_ops_num; + /** + * \brief Size of the context area + * \note If non-zero, must be at least + */ + udi_size_t chan_context_size; + /** + * \brief Pointer to the operations + * Pointer to a <>_<>_ops_t structure + */ + udi_ops_vector_t *ops_vector; + /** + * \brief Flags for each entry in \a ops_vector + */ + const udi_ubit8_t *op_flags; +}; + +/** + * \brief Defines control blocks + * Much the same as ::udi_ops_init_t + */ +struct udi_cb_init_s +{ + udi_index_t cb_idx; + udi_index_t meta_idx; + udi_index_t meta_cb_num; + udi_size_t scratch_requirement; + /** + * \brief Size of inline memory + */ + udi_size_t inline_size; + /** + * \brief Layout of inline memory + */ + udi_layout_t *inline_layout; +}; + +/** + * \brief Overrides the scratch size for an operation + */ +struct udi_cb_select_s +{ + udi_index_t ops_idx; + udi_index_t cb_idx; +}; + +/** + * \brief General Control Blocks + * These control blocks can only be used as general data storage, not + * for any channel operations. + */ +struct udi_gcb_init_s +{ + udi_index_t cb_idx; + udi_size_t scratch_requirement; +}; + + +// === +// === +/** + * \brief + */ +struct udi_init_context_s +{ + udi_index_t region_idx; + udi_limits_t limits; +}; + +/** + * \brief Environement Imposed Limits + */ +struct udi_limits_s +{ + /** + * \brief Maximum legal ammount of memory that can be allocated + */ + udi_size_t max_legal_alloc; + + /** + * \brief Maximum ammount of guaranteed memory + */ + udi_size_t max_safe_alloc; + /** + * \brief Maximum size of the final string from ::udi_trace_write + * or ::udi_log_write + */ + udi_size_t max_trace_log_formatted_len; + /** + * \brief Maximum legal size of an instanct attribute value + */ + udi_size_t max_instance_attr_len; + /** + * \brief Minumum time difference (in nanoseconds between unique values + * returned by ::udi_time_current + */ + udi_ubit32_t min_curtime_res; + /** + * \brief Minimum resolution of timers + * \see ::udi_timer_start_repeating, ::udi_timer_start + */ + udi_ubit32_t min_timer_res; +}; + +/** + * \brief Channel context data + */ +struct udi_chan_context_s +{ + /** + * \brief Pointer to the driver instance's initial region data + */ + void *rdata; +}; + +/** + * \brief Child Channel context + */ +struct udi_child_chan_context_s +{ + /** + * \brief Pointer to the driver instance's initial region data + */ + void *rdata; + /** + * \brief Some sort of unique ID number + */ + udi_ubit32_t child_ID; +}; + +#endif diff --git a/Modules/UDI/include/udi_meta_mgmt.h b/Modules/UDI/include/udi_meta_mgmt.h new file mode 100644 index 00000000..320f0eb1 --- /dev/null +++ b/Modules/UDI/include/udi_meta_mgmt.h @@ -0,0 +1,140 @@ +/** + * \file udi_meta_mgmt.h + */ +#ifndef _UDI_META_MGMT_H_ +#define _UDI_META_MGMT_H_ + +typedef struct udi_mgmt_ops_s udi_mgmt_ops_t; +typedef struct udi_mgmt_cb_s udi_mgmt_cb_t; +typedef struct udi_usage_cb_s udi_usage_cb_t; +typedef struct udi_filter_element_s udi_filter_element_t; +typedef struct udi_enumerate_cb_s udi_enumerate_cb_t; + +/** + * \name Specify Usage + * \{ + */ +typedef void udi_usage_ind_op_t(udi_usage_cb_t *cb, udi_ubit8_t resource_level); +/* Values for resource_level */ +#define UDI_RESOURCES_CRITICAL 1 +#define UDI_RESOURCES_LOW 2 +#define UDI_RESOURCES_NORMAL 3 +#define UDI_RESOURCES_PLENTIFUL 4 +/* Proxy */ +extern udi_usage_ind_op_t udi_static_usage; +/** + * \} + */ + +typedef void udi_usage_res_op_t(udi_usage_cb_t *cb); + +/** + * \name Enumerate this driver + * \{ + */ +typedef void udi_enumerate_req_op_t(udi_enumerate_cb_t *cb, udi_ubit8_t enumeration_level); +/* Values for enumeration_level */ +#define UDI_ENUMERATE_START 1 +#define UDI_ENUMERATE_START_RESCAN 2 +#define UDI_ENUMERATE_NEXT 3 +#define UDI_ENUMERATE_NEW 4 +#define UDI_ENUMERATE_DIRECTED 5 +#define UDI_ENUMERATE_RELEASE 6 +/* Proxy */ +extern udi_enumerate_req_op_t udi_enumerate_no_children; +/** + * \} + */ + +/** + * \name Enumeration Acknowlagement + * \{ + */ +typedef void udi_enumerate_ack_op_t(udi_enumerate_cb_t *cb, udi_ubit8_t enumeration_result, udi_index_t ops_idx); +/* Values for enumeration_result */ +#define UDI_ENUMERATE_OK 0 +#define UDI_ENUMERATE_LEAF 1 +#define UDI_ENUMERATE_DONE 2 +#define UDI_ENUMERATE_RESCAN 3 +#define UDI_ENUMERATE_REMOVED 4 +#define UDI_ENUMERATE_REMOVED_SELF 5 +#define UDI_ENUMERATE_RELEASED 6 +#define UDI_ENUMERATE_FAILED 255 +/** + * \} + */ + +/** + * \name + * \{ + */ +typedef void udi_devmgmt_req_op_t(udi_mgmt_cb_t *cb, udi_ubit8_t mgmt_op, udi_ubit8_t parent_ID); +/* Values for mgmt_op */ +#define UDI_DMGMT_PREPARE_TO_SUSPEND 1 +#define UDI_DMGMT_SUSPEND 2 +#define UDI_DMGMT_SHUTDOWN 3 +#define UDI_DMGMT_PARENT_SUSPENDED 4 +#define UDI_DMGMT_RESUME 5 +#define UDI_DMGMT_UNBIND 6 + +typedef void udi_devmgmt_ack_op_t(udi_mgmt_cb_t *cb, udi_ubit8_t flags, udi_status_t status); +/* Values for flags */ +#define UDI_DMGMT_NONTRANSPARENT (1U<<0) +/* Meta-Specific Status Codes */ +#define UDI_DMGMT_STAT_ROUTING_CHANGE (UDI_STAT_META_SPECIFIC|1) +/** + * \} + */ +typedef void udi_final_cleanup_req_op_t(udi_mgmt_cb_t *cb); +typedef void udi_final_cleanup_ack_op_t(udi_mgmt_cb_t *cb); + + + + + +struct udi_mgmt_ops_s +{ + udi_usage_ind_op_t *usage_ind_op; + udi_enumerate_req_op_t *enumerate_req_op; + udi_devmgmt_req_op_t *devmgmt_req_op; + udi_final_cleanup_req_op_t *final_cleanup_req_op; +}; + +struct udi_mgmt_cb_s +{ + udi_cb_t gcb; +}; + +struct udi_usage_cb_s +{ + udi_cb_t gcb; + udi_trevent_t trace_mask; + udi_index_t meta_idx; +}; + + +struct udi_filter_element_s +{ + char attr_name[UDI_MAX_ATTR_NAMELEN]; + udi_ubit8_t attr_min[UDI_MAX_ATTR_SIZE]; + udi_ubit8_t attr_min_len; + udi_ubit8_t attr_max[UDI_MAX_ATTR_SIZE]; + udi_ubit8_t attr_max_len; + udi_instance_attr_type_t attr_type; + udi_ubit32_t attr_stride; +}; +struct udi_enumerate_cb_s +{ + udi_cb_t gcb; + udi_ubit32_t child_ID; + void *child_data; + udi_instance_attr_list_t *attr_list; + udi_ubit8_t attr_valid_length; + const udi_filter_element_t *filter_list; + udi_ubit8_t filter_list_length; + udi_ubit8_t parent_ID; +}; +/* Special parent_ID filter values */ +#define UDI_ANY_PARENT_ID 0 + +#endif diff --git a/Modules/UDI/include/udi_physio.h b/Modules/UDI/include/udi_physio.h deleted file mode 100644 index 08b380ed..00000000 --- a/Modules/UDI/include/udi_physio.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - */ -#ifndef _UDI_PHYSIO_H_ -#include - -/** - * \name Bus Operations - * \{ - */ -typedef struct { - udi_cb_t gcb; -} udi_bus_bind_cb_t; - -/** - * \brief Bus Bind Control Block Group Number - */ -#define UDI_BUS_BIND_CB_NUM 1 - -extern void udi_bus_bind_req(udi_bus_bind_cb_t *cb); - -extern void udi_bus_unbind_req(udi_bus_bind_cb_t *cb); -/** - * \} - */ - -#endif diff --git a/Modules/UDI/logging.c b/Modules/UDI/logging.c index 10a109ab..a083413e 100644 --- a/Modules/UDI/logging.c +++ b/Modules/UDI/logging.c @@ -2,7 +2,7 @@ * \file logging.c * \author John Hodge (thePowersGang) */ -#include +#include #include // === PROTOTYPES === diff --git a/Modules/UDI/main.c b/Modules/UDI/main.c index 03a1650e..a7aab401 100644 --- a/Modules/UDI/main.c +++ b/Modules/UDI/main.c @@ -3,7 +3,7 @@ */ #define DEBUG 0 #define VERSION ((0<<8)|1) -#include +#include #include #include @@ -30,7 +30,8 @@ int UDI_Install(char **Arguments) int UDI_LoadDriver(void *Base) { udi_init_t *info; - char *udiprops; + char *udiprops = NULL; + int udiprops_size; int i, j; if( Binary_FindSymbol(Base, "udi_init_info", (Uint*)&info) == 0) { @@ -38,6 +39,13 @@ int UDI_LoadDriver(void *Base) return 0; } + if( Binary_FindSymbol(Base, "_udiprops", (Uint*)&udiprops) == 0 ) { + Warning("[UDI ] _udiprops is not defined, this is usually bad"); + } + else { + Binary_FindSymbol(Base, "_udiprops_size", (Uint*)&udiprops_size); + } + Log("primary_init_info = %p", info->primary_init_info); Log("secondary_init_list = %p", info->secondary_init_list); Log("ops_init_list = %p", info->ops_init_list); diff --git a/Usermode/Applications/ifconfig_src/main.c b/Usermode/Applications/ifconfig_src/main.c index ea8dcb8e..7f8746b3 100644 --- a/Usermode/Applications/ifconfig_src/main.c +++ b/Usermode/Applications/ifconfig_src/main.c @@ -135,8 +135,8 @@ int DoAutoConfig( char *Device ) { int tmp, fd; char path[sizeof(IPSTACK_ROOT)+5+1]; // ip000 - uint8_t addr[4] = {10,0,0,55}; - uint8_t gw[4] = {10,0,0,1}; + uint8_t addr[4] = {10,0,2,55}; + uint8_t gw[4] = {10,0,2,1}; int subnet = 8; tmp = AddInterface(Device); -- 2.20.1