[uClinux-dev] SIGSEGV: What to do now?

Hans Wilmers hans at wilmers.no
Wed Aug 3 17:43:17 EDT 2005


Try setting CONFIG_DIRECT_IO_ACCESS ("Allow user to access IO directly") in 
the kernel settings. The flag is not highlighted in the configuration for 
68EZ328, but it apparently _is_ used in the kernel for this processor.
Regards,
Hans

On Monday 20 June 2005 20:46, Imran Shabbir wrote:
> Hello,
>
>  I am having trouble accessing internal address space on my ucsimm box,
>  simply but I cannot access any of the port D registers without getting an
>  immediate SIGSEGV
>
>  I am using the latest source (uClinux-dist-20041215.tar) and
> toolchain (m68k-elf-tools-20030314.sh) off of uclinux.org, uclinux
> running
>  on a uCsimm/uCgardner kit.
>
>  for the simple test program
>  test.c
>
>  #include <asm/MC68EZ328.h>
>  #include <stdio.h>
>  #include <unistd.h>
>
>  void Init_PortD(void)
>  {
> 	PDSEL = 0xFF;
> 	PDDIR = 0xFF;
> 	PDDATA = 0xFF;
>  }
>
>  void LED_On(unsigned int bit)
>  {
> 	unsigned char tmp;
> 	tmp= 0x01 << bit;
> 	PDDATA =PDDATA & ~tmp;
>  }
>
>  void LED_Off(void)
>  {
> 	sleep(3);
> 	PDDATA = 0xFF;
>  }
>
>  int main(int argc, char*argv[])
>  {
>
> 	printf("\n\t\tWelcome To LED Program.\n");
> 	Init_PortD();
> 	printf("\nPort D has been Initialized.\n");
> 	LED_On(3);
> 	printf("\nLED has been switched on.\n");
> 	LED_Off();
> 	printf("\nLED has been switched off after three seconds.\n");
>
>
>  }
>
>  I compile:
>
>  $ m68k-elf-gcc -m68000 -D__ELF__ -D__linux__ -Wl,-elf2flt -o test test.c
> -lc
>
>  I run:
>
>  # ./test
> 		Welcome To LED Program.
>  SIGSEGV
>  #
>
>
>
>  I have Tested:
>
>  1.  #include <include/asm-m68knommu/MC68EZ328.h> instead of mentioned
> above
>
>  2.  /opt/uClinux-dist/linux-2.3.x/arch/m68knommu/platform/68EZ328/ucsimm
>      on this path check out following code:
>      #ifdef CONFIG_DIRECT_IO_ACCESS
> 		moveb	#0x0,	0xFFFFF000
>      #endif
>
>  3.  Replace test program:
>
> 	int main(int argc, char*argv[])
>         {
>
> 	printf("\n\t\tWelcome To LED Blinking Program.\n");
>
> 	PDSEL |=0x01;
> 	PDDIR |=0x01;
>
> 		while(1)
> 		{
> 			PDDATA ^= 0x01;
> 			sleep(1);
> 		}
>
>
>         }
>
>
>  But there is still SIGSEGV error occur. What 'll be the reason behind
> it suggest me as
>  soon as possible.
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org

-- 
Wilmers Instruments
Hans Wilmers
Øvre Frydendal 130
N-1384 Asker
Tel: +47 66989466
Mobile: +47 92459361
http://www.wilmers.no



More information about the uClinux-dev mailing list