[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] writing into main memory (in uClinux)



If you're only trying to write a byte, then you need:

char *ptr = (char *)0xffe00000;
*ptr=0x01;

AFAIK, an int is 16 bit on Microblaze...

In uClinux you should have no problems writing to addresses directly
from user-space.  Of course, with an MMU this wouldn't be possible.

Once you get that working it should be a matter of just modifying the
linux framebuffer driver (fbmem)
(http://sourceforge.net/projects/linux-fbdev/) with the correct
definitions for your framebuffer device, and setting up the correct
parameters to get the console to appear on /dev/fb0 or /dev/fbmem rather
than /dev/ttyS0.

On 13 Sep 2004 07:26:23 -0000, "anand_12" <anand_12@tenet.res.in> said:
> 
> Hi all
> 
>  I am running uClinux on a memec spartan 2 E microblaze board..we have
>  memory mapped a framebuffer device..
> and using the vga monitor to observe the display for any bytes written
> into that memory region...
> 
> i wrote this code to write a byte into a particular memory location :
> 
> ----------------start----------------------------------
> 
>  int *ptr;
>  ptr=(int *)0xffe00000;
>  *ptr=0x01;
> 
> ---------------end--------------------------------------
> 
> i integrated this with my uClinux dist using the "Adding user app HOWTO"
> instructions..it compiles well and when i download and execute the image
> on board...the display on the vga monitor seems to suggest that multiple
> bytes have been written all over the frame buffer memory map(the screen
> displays random patterns all over)..
> 
> regarding this i have a few doubts :
> 
> 1. is the above piece of code correct to write to a particular location
> in memory?
> 
> 2. can user apps directly write to absolute addresses in main memory
> (with uClinux)?
> 
> 3. if yes,then why is it that multiple pixels are getting 
> enabled when infact i am writing only a byte using a resolution of
> 320x240(1 bit per pixel)?
> 
>  thanks for any help in this regard
> 
> if it helps,when the same code is executed directly on hardware without
> uClinux,it works perfectly fine..i mean only that particular pixel is
> enabled...so what i essentially see a dot on the top left corner of the
> vga monitor...i guess my understanding of how uclinux handles memory is
> still unclear...any pointers are most welcome!!.
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/