gdb load address and KERNELLOAD
Hi, all:
I am debugging embedded Linux( linux-2.2.13 for MPC8XX) using bdm/wiggler. I do this
on windowsNT with cygwin and insight downloaded from www.ocdemon.com. The question is: how can I download the vmlinux to a different address from KERNELLOAD which is set to 0xc0000000. I want to do this because the SDRAM is mapped to 0x00000000 and the MMU is of course not enabled when I download the kernel image via gdb. any comment on this subject is welcome.
thank you.
W.Y.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 4 lines · Wang Yong
Hi, all:
I am debugging embedded Linux( linux-2.2.13 for MPC8XX) using bdm/wiggler. I do this
on windowsNT with cygwin and insight downloaded from www.ocdemon.com.
Don't waste your time. It will only work for the first few instructions. Once the MMU is enabled, these tools won't work.
The only BDM debugger that works successfully with Linux is the Abatron gdb/BDI2000, hosted on a Linux platform.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 3 lines · In message <[email protected]> Dan Malek wrote:
The only BDM debugger that works successfully with Linux is the Abatron gdb/BDI2000, hosted on a Linux platform.
This is absolutely correct except for the word "only".
The BDM4GDB project at sourceforge (see bdm4gdb.sourceforge.net) provides all necessary information to build a home-made parallel port adapter (schematics, source extension to GDB) which allows to do the same. If you cannot build a simple PCB yourself, we offer BDM4GDB adapters at production cost ($ 50, including a CD-ROM with sources and binary for the modified GDB) as a service to the Linux community.
The main differences between the BDI2000 and BDM4GDB:
* BDI2000 connects to the Ethernet, BDM4GDB needs a parallel port on a PC.
* BDI2000 has support for many CPU types, BDM4GDB restricted to MPC8xx (so far)
* BDI2000 has support for all comon flash types, BDM4GDB needs some more work in that area (but you can adapt it yourself when needed - it's Open Source)
* BDI2000 is much faster for code download / flash programming
* The BDI2000 costs around $ 2,500, BDM4GDB $ 50.
Shameless plug:
I will give a presentation "Debugging of Linux Kernel and Device Drivers Using Low-Cost BDM Interface" featuring the BDM4GDB on May 4 at the 3rd Brunswick Linux Days, see
http://braunschweiger.linuxtage.de/programm/index.html
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] Remember that Beethoven wrote his first symphony in C ...
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 4 lines · Wolfgang Denk
The BDM4GDB project at sourceforge (see bdm4gdb.sourceforge.net) provides all necessary information to build a home-made parallel port adapter (schematics, source extension to GDB) which allows to do the same.
Really? Like it handles all of the memory mapping details, too?
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 7 lines · In message <[email protected]> Dan Malek wrote:
Quoted 5 lines
The BDM4GDB project at sourceforge (see bdm4gdb.sourceforge.net) provides all necessary information to build a home-made parallel port adapter (schematics, source extension to GDB) which allows to do the same.
Really? Like it handles all of the memory mapping details, too?
In fact the BDM4GDB had an implementation of MMU support before the BDI200 had it - credits to Frank Przybylski, who did all (and still does most of) the work.
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] I often quote myself; it adds spice to my conversation. - G. B. Shaw
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
how to get the physival address
Hi All,
I have a silly question but seem I can not figure out the answer myself. I try write a driver, in which I define a array like"
file : dummy.o
unsigned char buffer_array[4096];
....
bdp->cbd_bufaddr = __pa(buffer_array);
my problem is: I try to get the physical address of buffer array, but the _pa did not return correct address.
I try to print out: buffer_array = 0xC4056220
_pa(buffer_array) = 0x4056220
But my RAM only 16M = 0x100000
My question is: how to get the physical address of buffer_array.
Thank for any answer
Jerry
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: how to get the physival address
Quoted 1 line · jerry
I try to print out:
buffer_array=0xC4056220
To get an address like this, you must be loading the driver as a module. There are a variety of opinions about how to do this, like using kmalloc() to dynamically allocate the space after the module is loaded. In the linuxppc_2_5 kernel from FSM Labs are some VM modifications I have started. The virt_to_phys() is appropriate to use on the MPC8xx for this sort of thing, and you can even do consistent_alloc() if you want cache inhibited pages. In older kernels, there are no functions that will provide this for you (well, you can trudge through the page tables, get the PTE and convert it yourself, but that sucks :-).
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: how to get the physival address
Yes, if I use kmalloc is OK, either __pa or virt_to_phys will return the physical address.
But it does not work for defined variable (it was defined in driver so it should be in kernel space, isn't it?). I wonder which memory space, this variable belong to?
Thank in advances
Jerry
- Original Message -----
From: "Dan Malek" <[email protected]>
To: "jerry" <[email protected]>
Cc: <[email protected]>
Sent: Thursday, April 05, 2001 1:58 PM
Subject: Re: how to get the physival address
Quoted 17 lines
Quoted 1 line · jerry
I try to print out:
buffer_array=0xC4056220To get an address like this, you must be loading the driver as a module. There are a variety of opinions about how to do this, like using
kmalloc()to dynamically allocate the space after the module is loaded. In thelinuxppc_2_5kernel from FSM Labs are some VM modifications I have started. Thevirt_to_phys()is appropriate to use on the MPC8xx for this sort of thing, and you can even doconsistent_alloc()if you want cache inhibited pages. In older kernels, there are no functions that will provide this for you (well, you can trudge through the page tables, get the PTE and convert it yourself, but that sucks :-).
Quoted 1 line
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: how to get the physival address
Quoted 2 lines · jerry
But it does not work for defined variable (it was defined in driver so it should be in kernel space, isn't it?).
A loadable driver is dynamically allocated from kernel virtual memory. The dynamic virtual memory does not have the 1:1 mapping property to real memory that virt_to_phys(), __pa() or anything else expects. To me, based upon my past experience, you should be able to get this mapping information for any virtual address, but others want to argue about that point. So, I have "fixed" the PowerPC verions of these functions in the linuxppc_2_5 kernel, but who knows if it will last.......
-- Dan
--
I like MMUs because I don't have a real life.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: how to get the physival address
In reply to Dan MalekQuoted 6 lines · Dan Malek
Quoted 1 line · jerry
I try to print out:
buffer_array=0xC4056220
Quoted 11 lines
To get an address like this, you must be loading the driver as a module. There are a variety of opinions about how to do this, like using
kmalloc()to dynamically allocate the space after the module is loaded. In thelinuxppc_2_5kernel from FSM Labs are some VM modifications I have started. Thevirt_to_phys()is appropriate to use on the MPC8xx for this sort of thing, and you can even doconsistent_alloc()if you want cache inhibited pages. In older kernels, there are no functions that will provide this for you (well, you can trudge through the page tables, get the PTE and convert it yourself, but that sucks :-).
Furthermre there is no guarantee that the memory will be physically contiguous. Unless magically aligned, a 4096 bytes buffer will almost always span 2 pages.
Gabriel.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/