Hi
i wanted to try writing a small OS for ARM . how do i go about it?
need a starting point for ARM
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
- os.hacker64
- Member
- Posts: 149
- Joined: Mon Feb 11, 2008 4:43 pm
- Location: Limbo City,Afterlife
-
- 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:
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.
Qemu will emulate a PL011 for you as well, with modifications to its implementation to allow you to avoid messy init code.
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:
My OS running on a GBA and DS
http://www.dex4u.com/images/gbademo.jpg
But you first need to learn ARM asm.
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
http://www.dex4u.com/images/gbademo.jpg
But you first need to learn ARM asm.