need a starting point for ARM

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
hanumant
Posts: 21
Joined: Mon Jul 23, 2007 10:16 pm

need a starting point for ARM

Post by hanumant »

Hi

i wanted to try writing a small OS for ARM . how do i go about it?
User avatar
os.hacker64
Member
Member
Posts: 149
Joined: Mon Feb 11, 2008 4:43 pm
Location: Limbo City,Afterlife

Post by os.hacker64 »

I IZ NOOB PLEZE WRITE MY OS FOR ME PLEZ.

Anyway, the point is that your post was a little vague. Lots of things use the ARM, How do I go about it? doesn't cut it. :D
hanumant
Posts: 21
Joined: Mon Jul 23, 2007 10:16 pm

Post by hanumant »

where do i get the info about ARM. If as you say it gets used in a lot of places, can you suggest something that i can try ?
User avatar
os.hacker64
Member
Member
Posts: 149
Joined: Mon Feb 11, 2008 4:43 pm
Location: Limbo City,Afterlife

Post by os.hacker64 »

You, could try the GBA. I think there is something called GBADEV.ORG. I don't have time to search right now, I'm sure there's something if you google it.
pcmattman
Member
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:

Post by pcmattman »

qemu-system-arm is a good way of writing a basic OS for an Integrator CP board (it emulates two versions) - although if you ever want to run your OS on real hardware the boards cost > $500 :(.

Qemu will emulate a PL011 for you as well, with modifications to its implementation to allow you to avoid messy init code.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

First i would start, as suggested above with the GBA, as even if you do not have one theres many emulator out there.
Also i would get FasmArm, see here:
http://board.flatassembler.net/topic.php?t=4191&start=0
Then i would read this
http://www.arm.com/miscPDFs/9658.pdf

Heres a hello world demo i code to get you started:

Code: Select all

; GBA Header and test prog by Dex,Coded with FasmARM.
; c:\fasmarm test.asm test.gba
format binary
org	0			; code starts at offset 0.
use32				; use 32-bit code.

    b    rom_start
NintendoLogo:
    db    0,0,0,0,0,0,0,0,0,0   ; Nintendo Logo space(156 bytes).
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0,0,0,0,0
    db    0,0,0,0,0,0
GameTitle:
    db    "TEAM DEX4U  "        ; Game Title (12 bytes).
GameCode:
    db    "1234"                ; Game Code (4 bytes).
MakerCode:
    db    "_$"                  ; Maker Code (2 bytes).
FixedValue:
    db    0x96                  ; Fixed value (1 byte).
MainUnit:
    db    0                     ; Main unit code (1 byte).
DeviceType:
    db    0                     ; Device Type (1 byte).
ReservedBytes: 
    db    0,0,0,0,0,0,0         ; Reserved (7 bytes)
SoftwareVersion:  
    db    0                     ; Software version (1 byte).
ComplementCheck:
    db    0                     ; Complement check (1 byte).
Reserved2:
    db    0,0                   ; Reserved (2 bytes).

align 4

;********************************;
; Rom start.                     ;
;********************************;
rom_start:  
	mov r0, 0x4000000
	mov r1, 0x400
	add r1, r1, 3
	str r1, [r0]

	mov r0, 0x6000000
	mov r1, 0xff
	mov r2, 0x9600
loop1:
	strh r1, [r0], 2
	subs r2, r2, 1
	bne loop1

LetsLoop:
	b LetsLoop

times 20000- ($-0)  db 0
My OS running on a GBA and DS
http://www.dex4u.com/images/gbademo.jpg

But you first need to learn ARM asm.
pcmattman
Member
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:

Post by pcmattman »

Also, if you do use qemu for your emulating, you can easily build an arm-elf cross-compiler (with GCC/binutils) and use that to write your OS.
Post Reply