Modules/UDI - Working on UDI support
authorJohn Hodge <[email protected]>
Sat, 14 Sep 2013 03:49:11 +0000 (11:49 +0800)
committerJohn Hodge <[email protected]>
Sat, 14 Sep 2013 03:49:11 +0000 (11:49 +0800)
KernelLand/Modules/Interfaces/UDI/main.c
Tools/udisetup/udisetup [new file with mode: 0755]
Tools/udisetup/udisetup-ia32.ld [new file with mode: 0644]

index aa0ad5e..05aa566 100644 (file)
@@ -48,7 +48,7 @@ int UDI_LoadDriver(void *Base)
 {
        udi_init_t      *info;
        char    *udiprops = NULL;
-        int    udiprops_size = 0;
+       Uint    udiprops_size = 0;
         int    i;
        // int  j;
        
@@ -63,15 +63,13 @@ int UDI_LoadDriver(void *Base)
        if( Binary_FindSymbol(Base, "_udiprops", (Uint*)&udiprops) == 0 ) {
                Log_Warning("UDI", "_udiprops is not defined, this is usually bad");
        }
+       else if( Binary_FindSymbol(Base, "_udiprops_size", &udiprops_size) == 0) {
+               Log_Warning("UDI", "_udiprops_size is not defined");
+       }
        else {
-               Uint    udiprops_end = 0;
                 int    i, j, nLines;
                char    **udipropsptrs;
                
-               if( Binary_FindSymbol(Base, "_udiprops_end", (Uint*)&udiprops_end) == 0)
-                       Log_Warning("UDI", "_udiprops_end is not defined");
-               Log_Debug("UDI", "udiprops_end = %p", udiprops_end);
-               udiprops_size = udiprops_end - (Uint)udiprops;
                Log_Debug("UDI", "udiprops = %p, udiprops_size = 0x%x", udiprops, udiprops_size);
                
                Debug_HexDump("UDI_LoadDriver", udiprops, udiprops_size);
diff --git a/Tools/udisetup/udisetup b/Tools/udisetup/udisetup
new file mode 100755 (executable)
index 0000000..b911aac
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+TMPFILE=/tmp/acess_udisetup.tmp
+
+if echo $0 | grep '/' >/dev/null; then
+ THISFILE=$(which $0)
+ THISDIR=$(dirname ${THISFILE})/
+else
+ _=$PWD; cd $(dirname $0); THISDIR=$PWD/; cd $_
+fi
+ACESSDIR=${THISDIR}../../
+
+ARCH=ia32
+PREFIX=i586-elf
+
+UDI_INSTALL_DIR=${ACESSDIR}UDI/${ARCH}/
+
+mkdir -p ${UDI_INSTALL_DIR}
+for file in $(tar -tf $1 --wildcards */bin/${ARCH}/*); do      
+       tar -xf $1 $file -O > $TMPFILE
+       ${PREFIX}-ld -T ${THISDIR}udisetup-${ARCH}.ld $TMPFILE -shared -o ${UDI_INSTALL_DIR}$(basename $file)
+done
diff --git a/Tools/udisetup/udisetup-ia32.ld b/Tools/udisetup/udisetup-ia32.ld
new file mode 100644 (file)
index 0000000..58dfcc6
--- /dev/null
@@ -0,0 +1,31 @@
+OUTPUT_FORMAT(elf32-i386)
+
+SECTIONS 
+{
+       . = 0 + SIZEOF_HEADERS;
+       
+       .text : AT(ADDR(.text)) {
+               textzero = .;
+               *(.text)
+       }
+       
+       .rodata ALIGN(0x1000): AT(ADDR(.rodata)) {
+               *(.rodata)
+               *(.rdata)
+       }
+       
+       .data ALIGN (0x1000) : AT(ADDR(.data)) {
+               *(.data)
+               _udiprops = .;
+               *(.udiprops)
+               _udiprops_size = . - _udiprops;
+       }
+
+       .bss : AT(ADDR(.bss)) {
+               _sbss = .;
+               *(COMMON)
+               *(.bss)
+               _ebss = .;
+       }
+}
+

UCC git Repository :: git.ucc.asn.au