OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 11:54 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: ARM Integrator-CP Bare Bones
PostPosted: Sun May 16, 2010 3:41 am 
Offline
Member
Member

Joined: Sat Mar 21, 2009 1:29 pm
Posts: 51
Location: Ireland
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.


Last edited by tharkun on Sun May 16, 2010 5:28 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: ARM Bare Bones
PostPosted: Sun May 16, 2010 3:54 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
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!

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: ARM Bare Bones
PostPosted: Sun May 16, 2010 4:10 am 
Offline
Member
Member

Joined: Sun Jan 14, 2007 9:15 pm
Posts: 2566
Location: Sydney, Australia (I come from a land down under!)
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.

_________________
Pedigree | GitHub | Twitter | LinkedIn


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Sun May 16, 2010 5:36 am 
Offline
Member
Member

Joined: Sat Mar 21, 2009 1:29 pm
Posts: 51
Location: Ireland
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?

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.

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))

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.

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.

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.


The title of the thread and article have been, changed to ARM Integrator-CP Bare Bones.


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Sun May 16, 2010 7:38 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 19, 2009 1:48 pm
Posts: 201
Location: Brazil
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.

I will love to see it, because I'm very interested on OS development for mobile platforms, as ARM and MIPS. :D

Congratulations for the beginning! =D>

_________________
About.Me - Blog


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Mon May 17, 2010 10:43 am 
Offline
Member
Member

Joined: Sat Mar 21, 2009 1:29 pm
Posts: 51
Location: Ireland
Nathan wrote:
I will love to see it, because I'm very interested on OS development for mobile platforms, as ARM and MIPS. :D

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)
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 :mrgreen:
Nathan wrote:
Congratulations for the beginning! =D>

Thanks.


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Mon May 17, 2010 10:59 am 
Offline
Member
Member
User avatar

Joined: Sun Jul 19, 2009 1:48 pm
Posts: 201
Location: Brazil
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! :D

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.

_________________
About.Me - Blog


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Mon May 17, 2010 11:41 am 
Offline
Member
Member

Joined: Sat Mar 21, 2009 1:29 pm
Posts: 51
Location: Ireland
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.

I'll add some links and references later, when I get some time. Thanks for the feedback.


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Mon May 17, 2010 12:10 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 19, 2009 1:48 pm
Posts: 201
Location: Brazil
I'm going to wait anxious for the update! =P~

_________________
About.Me - Blog


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Mon May 17, 2010 12:58 pm 
Offline
Member
Member

Joined: Sat Mar 21, 2009 1:29 pm
Posts: 51
Location: Ireland
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)


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Mon May 17, 2010 2:49 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 19, 2009 1:48 pm
Posts: 201
Location: Brazil
Thanks very much mate, you're doing a very wonderful and helpful work! =D>

_________________
About.Me - Blog


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Tue May 18, 2010 2:21 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 19, 2009 1:48 pm
Posts: 201
Location: Brazil
Also, I'm having some problems to understand both codes, then could you please do a better explanation of the codes? [-o<

_________________
About.Me - Blog


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Tue May 18, 2010 11:02 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
Nathan wrote:
Also, I'm having some problems to understand both codes, then could you please do a better explanation of the codes? [-o<
Unfortunately for you, no explanation is good enough to actually make you understand. Did you notice the references to the required knowledge? :(

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Wed May 19, 2010 1:25 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
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.

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: ARM Integrator-CP Bare Bones
PostPosted: Wed May 19, 2010 2:56 am 
Offline
Member
Member

Joined: Thu May 13, 2010 1:45 pm
Posts: 86
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.

_________________
Visit the Montrom user page for more info.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group