ARM Integrator-CP Bare Bones
ARM Integrator-CP Bare Bones
Hi everybody, for all those interested I've put together a working ARM Bare Bones tutorial for the wiki. Here it is.
All it does currently is boot and display "hello, world" via the serial port, I'm planning on updating it soon to use the LCD screen and possibly the PIC, Mouse, Keyboard and Interrupts.
Please note that it is still a work in progress.
All it does currently is boot and display "hello, world" via the serial port, I'm planning on updating it soon to use the LCD screen and possibly the PIC, Mouse, Keyboard and Interrupts.
Please note that it is still a work in progress.
Last edited by tharkun on Sun May 16, 2010 5:28 am, edited 1 time in total.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: ARM Bare Bones
Well, right now it looks like a working hack, but that doesn't mean it can't be fixed:
- you use qemu's -kernel option. That means qemu does the ELF loading for you and puts the various parts of the binary in the locations they belong. However, on a real ARM execution doesn't automagically begin at _start, but at some fixed address. What/how's the task of the bios performed on real hardware? How do you run your kernel on a real integrator board?
- You fix the stack at 64k growing downward. Please comment on that as it will probably end up in your data section once the kernel grows to some size.
Keep up the good work!
- you use qemu's -kernel option. That means qemu does the ELF loading for you and puts the various parts of the binary in the locations they belong. However, on a real ARM execution doesn't automagically begin at _start, but at some fixed address. What/how's the task of the bios performed on real hardware? How do you run your kernel on a real integrator board?
- You fix the stack at 64k growing downward. Please comment on that as it will probably end up in your data section once the kernel grows to some size.
Keep up the good work!
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: ARM Bare Bones
You may also want to clarify that the tutorial is for the Integrator/CP boards that QEMU emulates, rather than promoting it as a complete generic ARM barebones.
Re: ARM Integrator-CP Bare Bones
I'm currently working on that, I'm reading through the Integrator-CP docs as write this. AFAICT the top 256KiB of the flash memory is reserved for system boot code. This boot code is mapped to address 0x20000000, and the rest of the flash memory is mapped to 0x24000000.Combuster wrote: - you use qemu's -kernel option. That means qemu does the ELF loading for you and puts the various parts of the binary in the locations they belong. However, on a real ARM execution doesn't automagically begin at _start, but at some fixed address. What/how's the task of the bios performed on real hardware? How do you run your kernel on a real integrator board?
EDIT: The boot code actually starts at an address depending on the size of the flash memory, e.g if your flash memory is 16MiB, then your boot code will start at 0x24FC0000. (0x24000000 + (16MiB - 256KiB))
Fixed, I've changed the kernel starting address to 0x10000, just above the stack, which has been change to start at 0xFFFC, growing downward. This is subject to further change, as I'm planning on writing the boot code and moving the kernel to 0x24000000.Combuster wrote: - You fix the stack at 64k growing downward. Please comment on that as it will probably end up in your data section once the kernel grows to some size.
The title of the thread and article have been, changed to ARM Integrator-CP Bare Bones.pcmattman wrote:You may also want to clarify that the tutorial is for the Integrator/CP boards that QEMU emulates, rather than promoting it as a complete generic ARM barebones.
Re: ARM Integrator-CP Bare Bones
I will love to see it, because I'm very interested on OS development for mobile platforms, as ARM and MIPS.pinged wrote:Hi everybody, for all those interested I've put together a working ARM Bare Bones tutorial for the wiki. Here it is.
All it does currently is boot and display "hello, world" via the serial port, I'm planning on updating it soon to use the LCD screen and possibly the PIC, Mouse, Keyboard and Interrupts.
Please note that it is still a work in progress.
Congratulations for the beginning!
Re: ARM Integrator-CP Bare Bones
The bare bones, in it's current state, won't work on real hardware. It's to do with the way QEMU loads the kernel - there's no way to emulate the way real hardware loads it using QEMU (I'm working on this, but AFAICT patching QEMU is the only option)Nathan wrote: I will love to see it, because I'm very interested on OS development for mobile platforms, as ARM and MIPS.
This however shouldn't be much of a problem as not many people have Integrator/CP boards, as they happen to cost $9500+, the reason I'm writing a tutorial for them is because the documentation for them was fairly easy to find. I originally intended to write a tutorial for the Versatile/PB board that QEMU also emulates, but the I was unable to find any documentation. (Though I would appreciate it if somebody who knows where to find documentation, would tell me )
I'm planning on turning the current bare bones, into more of a step by step tutorial, as this might make it easier to follow - and in my opinion easier to write
Thanks.Nathan wrote:Congratulations for the beginning!
Re: ARM Integrator-CP Bare Bones
You're Welcome!
Also, I love this, because in the internet I can't find ANY site that had the documentation to help me on this, also I already know about the Qemu problem, because I've already developed some programs for MIPSLinux, then I was using Qemu to emulate, and people said that the Linux won't work on the real hardware. But remember that even if it won't work on the real one, just do it to work on a emulator already help the people too much to get the base needed to continue.
As I'm just beginning, I will love if you put some references on the wiki, where we can get reference to continue developing for this awesome micro-controler!
When I've talked about the references, I was talking about things as how did you know that 0x16000000 was the base for output, and why it should be added to 0x18 to know that the buffer is empty. Things like this that make my head explode on questions that I can't solve by myself.
Also, I love this, because in the internet I can't find ANY site that had the documentation to help me on this, also I already know about the Qemu problem, because I've already developed some programs for MIPSLinux, then I was using Qemu to emulate, and people said that the Linux won't work on the real hardware. But remember that even if it won't work on the real one, just do it to work on a emulator already help the people too much to get the base needed to continue.
As I'm just beginning, I will love if you put some references on the wiki, where we can get reference to continue developing for this awesome micro-controler!
When I've talked about the references, I was talking about things as how did you know that 0x16000000 was the base for output, and why it should be added to 0x18 to know that the buffer is empty. Things like this that make my head explode on questions that I can't solve by myself.
Re: ARM Integrator-CP Bare Bones
I'll add some links and references later, when I get some time. Thanks for the feedback.Nathan wrote: When I've talked about the references, I was talking about things as how did you know that 0x16000000 was the base for output, and why it should be added to 0x18 to know that the buffer is empty. Things like this that make my head explode on questions that I can't solve by myself.
Re: ARM Integrator-CP Bare Bones
I've updated it with a 'links' section at bottom of the page. I'll try tomorrow to add a section on interrupt handling (syscalls mainly - I'm still working on the IRQs)
Re: ARM Integrator-CP Bare Bones
Thanks very much mate, you're doing a very wonderful and helpful work!
Re: ARM Integrator-CP Bare Bones
Also, I'm having some problems to understand both codes, then could you please do a better explanation of the codes?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: ARM Integrator-CP Bare Bones
Unfortunately for you, no explanation is good enough to actually make you understand. Did you notice the references to the required knowledge?Nathan wrote:Also, I'm having some problems to understand both codes, then could you please do a better explanation of the codes?
Re: ARM Integrator-CP Bare Bones
As hard a wording as you could expect from Combuster, but he's right.
I've never, ever seen ARM assembler before, but I could make perfect sense out of what I saw on first reading.
I've never, ever seen ARM assembler before, but I could make perfect sense out of what I saw on first reading.
Every good solution is obvious once you've found it.
Re: ARM Integrator-CP Bare Bones
Cool, I like that you made it a complete tutorial. If I ever get into this kind of thing, I know where to look. Thanks.
http://www.designarm.com/quickstart-gui ... arted.html -- Looks useful too.
http://www.designarm.com/quickstart-gui ... arted.html -- Looks useful too.
Visit the Montrom user page for more info.