From: John Hodge Date: Sat, 14 Sep 2013 03:49:11 +0000 (+0800) Subject: Modules/UDI - Working on UDI support X-Git-Tag: rel0.15~217 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=d639d074b69c138529adc599c82d9e1f180ed83e;p=tpg%2Facess2.git Modules/UDI - Working on UDI support --- diff --git a/KernelLand/Modules/Interfaces/UDI/main.c b/KernelLand/Modules/Interfaces/UDI/main.c index aa0ad5ec..05aa566b 100644 --- a/KernelLand/Modules/Interfaces/UDI/main.c +++ b/KernelLand/Modules/Interfaces/UDI/main.c @@ -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 index 00000000..b911aacc --- /dev/null +++ b/Tools/udisetup/udisetup @@ -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 index 00000000..58dfcc63 --- /dev/null +++ b/Tools/udisetup/udisetup-ia32.ld @@ -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 = .; + } +} +