Also there's macros in Linux that return/test for errors via setting pointers to values < 4096. Because "these addresses are NEVER valid". ;) Not sure how uCLinux deals with this, other than people avoiding putting valid memory address near 0.
Just another challenge with micros. On Thu, Feb 13, 2014 at 12:37 AM, Angelo Dureghello <angel...@gmail.com> wrote: > That was exactly my case, a null pointer, and ram starts from 0x0 in the map > :). > I will keep in mind this thing for the future. > > Still thanks. > > Regards > Angelo > > > On 13/02/2014 03:29, Gavin Lambert wrote: >> >> Quoth Larry Baker: >>> >>> Yes, this is indeed what can happen on a system like uClinux that does >>> not have an MMU (memory management unit). The tiny controller chips >>> that uClinux targets do not protect any part of the memory from being >>> accidentally corrupted. As long as the memory being accessed exists, >>> there is no hardware fence between a user program and the rest of memory. >> >> It's especially fun when address 0 is valid memory (which is not >> uncommon). >> Then you don't get crashes from null pointer accesses, which most >> developers >> expect (and some can be lazy about protecting against, thinking that >> they'll >> find it during debugging). >> >> I always try to configure the target device's memory map such that >> addresses >> near 0 remain invalid, whenever possible -- but some targets don't support >> that. >> >> > > _______________________________________________ > uClinux-dev mailing list > uClinux-dev@uclinux.org > http://mailman.uclinux.org/mailman/listinfo/uclinux-dev > This message was resent by uclinux-dev@uclinux.org > To unsubscribe see: > http://mailman.uclinux.org/mailman/options/uclinux-dev _______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev