Kernel Only Executes at Certain Physical Address OMAP bb-xm
Posted: Wed Dec 21, 2011 5:33 pm
Heyo,
So I've been writing my own OS on the beagleboard xm as a learning experience and I have a question. So far, I've managed to get my own asm code and I've made the jump into C land successfully.
The next thing I've been trying to do was map out memory so I could start paging. I know that in order to actually enable paging I need to mess around with certain status registers (mcr, msr assembly commands). But in order to actually start handing out memory I need to know what physical addresses I have are valid.
The OMAP is a 32bit processor, so it has 4 gigs of physical addresses but the beagleboard only came with 512 MB of ram. Furthermore, there is no BIOS (as far as I can tell) to tell me how memory is laid out. This means I need to pretty much hard code the memory mapping in my kernel. So I dragged out the OMAP 35x TRM http://www.ti.com/litv/pdf/spruf98u to see how memory is laid out. In section 2.2, there is a table which states that:
Device -- Start -- End
GPMC -- 0x0000 0000 -- 0x3fff ffff (1GB)
On chip memory -- 0x4000 0000 -- 0x47ff fff (Mostly reserved, 128MB)
Reserved, memory mapped IO, etc -- 0x4800 0000 -- 0x6fff ffff (about 639MB)
SDRC -- 0x7000 0000 --0x7fff ffff (256MB)
CS0 SDRAM -- 0x8000 0000 -- 0x9fff ffff (512 MB)
CS1 SDRAM -- 0xA000 0000 -- 0xBfff ffff (512 MB)
I guessed that CS0 encompassed all of my physical memory, So I moved my kernel down to 0x8010 0000, which would theoretically be somewhere in the middle of my beagleboards 512 MB of memory. My kernel fails to load from there, or any other address I tested besides 0x8020 0000. I'm aware that ARM has interrupt tables near the beginning of physical memory, but I'm unaware of anything that would make my kernel fail to load at addresses 0x8010 0000 or 0x8030 0000. My assembly startup code is position independent, my linker script shouldn't be an issue, and I'm telling u-boot exactly where to jump to (loading the binary over a serial connection and using the 'go' command).
TL,DR; why does it seem my kernel can only start at physical address 0x8020 0000
Also, the TRM doesn't seem to mention address 0x8020 0000 specifically, nor did a few Google searches.
So I've been writing my own OS on the beagleboard xm as a learning experience and I have a question. So far, I've managed to get my own asm code and I've made the jump into C land successfully.
The next thing I've been trying to do was map out memory so I could start paging. I know that in order to actually enable paging I need to mess around with certain status registers (mcr, msr assembly commands). But in order to actually start handing out memory I need to know what physical addresses I have are valid.
The OMAP is a 32bit processor, so it has 4 gigs of physical addresses but the beagleboard only came with 512 MB of ram. Furthermore, there is no BIOS (as far as I can tell) to tell me how memory is laid out. This means I need to pretty much hard code the memory mapping in my kernel. So I dragged out the OMAP 35x TRM http://www.ti.com/litv/pdf/spruf98u to see how memory is laid out. In section 2.2, there is a table which states that:
Device -- Start -- End
GPMC -- 0x0000 0000 -- 0x3fff ffff (1GB)
On chip memory -- 0x4000 0000 -- 0x47ff fff (Mostly reserved, 128MB)
Reserved, memory mapped IO, etc -- 0x4800 0000 -- 0x6fff ffff (about 639MB)
SDRC -- 0x7000 0000 --0x7fff ffff (256MB)
CS0 SDRAM -- 0x8000 0000 -- 0x9fff ffff (512 MB)
CS1 SDRAM -- 0xA000 0000 -- 0xBfff ffff (512 MB)
I guessed that CS0 encompassed all of my physical memory, So I moved my kernel down to 0x8010 0000, which would theoretically be somewhere in the middle of my beagleboards 512 MB of memory. My kernel fails to load from there, or any other address I tested besides 0x8020 0000. I'm aware that ARM has interrupt tables near the beginning of physical memory, but I'm unaware of anything that would make my kernel fail to load at addresses 0x8010 0000 or 0x8030 0000. My assembly startup code is position independent, my linker script shouldn't be an issue, and I'm telling u-boot exactly where to jump to (loading the binary over a serial connection and using the 'go' command).
TL,DR; why does it seem my kernel can only start at physical address 0x8020 0000
Also, the TRM doesn't seem to mention address 0x8020 0000 specifically, nor did a few Google searches.