Page 1 of 1

need a starting point for ARM

Posted: Wed Feb 20, 2008 9:26 pm
by hanumant
Hi

i wanted to try writing a small OS for ARM . how do i go about it?

Posted: Wed Feb 20, 2008 9:36 pm
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

Posted: Wed Feb 20, 2008 9:39 pm
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 ?

Posted: Wed Feb 20, 2008 9:44 pm
by exkor

Posted: Wed Feb 20, 2008 9:45 pm
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.

Posted: Thu Feb 21, 2008 1:32 am
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.

Posted: Thu Feb 21, 2008 10:27 am
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.

Posted: Thu Feb 21, 2008 2:32 pm
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.