Write an OS for PocketPc

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.
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Write an OS for PocketPc

Post by Karlosoft »

It's a few of time that i've a question.
Is possible, write an OS for pocketpc?
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

Yes, but it depends what processor it uses, as to how you go about it.
If its a ARM, let me know as i have done some ARM programming.
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Post by Karlosoft »

Yes it's a ARM, i think. On the screen is written that it's a Intel PXA255...
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

Right you need to get a suitable bootload eg: ArmBoot
http://armboot.sourceforge.net/

Also find linux example and google for info, if you get stuck just ask
Download & links
http://hw-server.com/hw_products/sld_hws.html

Intel PXA255 DIMM PC board - a detailed datasheet
http://hw-server.com/files/priloha/dimm_pc.pdf

Primary source about ARM architekture: www.arm.com.
Arm Reference Manual: www.arm.com/ARM.

Sources and manuals for gcc, gdb, glib+ and binary utilities : www.gnu.org.
Kernel souces and patches are on the page: www.arm.linux.org.uk.
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Post by Karlosoft »

thank you very much :)
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

Karlosoft wrote:thank you very much :)
Your welcome, for my ARM Dev work, i use FasmArm http://arm.flatassembler.net/
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 »

You can also compile a GCC toolchain that targets ARM (arm-elf, for instance), but that doesn't replace knowing the assembly ;).

It's always nice to be able to code in C instead of assembly though.
molux
Posts: 15
Joined: Fri May 16, 2008 8:36 am

Post by molux »

Hello,

Do you have an idée to emulate a minimliste PocketPC plateform ?
Does i simply have to find an ARM emulator ?
Is there a complicated boot procedure ? (differt thant conventional ARM emulator ?)

An more important, How about the bios ?
(Or where to find documentation for an ipaq for exemple)

Thanks a lot for your response
(Thousand excuses for my bad english)

Molux
tsp
Posts: 14
Joined: Tue Apr 24, 2007 5:35 am

Post by tsp »

pcmattman wrote:You can also compile a GCC toolchain that targets ARM (arm-elf, for instance)
Yes, WinARM is the one I'm using although there are other options also.
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Post by Karlosoft »

What are the "elf executable at 0"???
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Karlosoft wrote:What are the "elf executable at 0"???
Can you give us some context?
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Post by Karlosoft »

yes a moment...

here you are...

Code: Select all

	format ELF dwarf executable at 0
	entry start
	section 'one' executable readable writeable align 020h

start:	mov	r1,string_hello
	mov	r0,4		;SYS_WRITE0
	swi	0x123456	;Multi-ICE DCC semihosting
	mov	r0,18h		;angel_SWIreason_ReportException
	mov	r1,20000h	;Software reason code
	orr	r1,r1,26h	;ADP_Stopped_ApplicationExit
	swi	0x123456	;Multi-ICE DCC semihosting

string_hello	db	'Hello ARM semi-hosting world',13,10,0

and thann

Code: Select all

	format ELF executable
	entry start

	segment readable executable

start:	mov	r0,0
	add	r1,pc,hello-$-8
	mov	r2,hello_len
	swi	0x900004
	mov	r0,6
	swi	0x900001

hello:	db	'Hello world',10
hello_len=$-hello

	;dummy section for bss, see http://board.flatassembler.net/topic.php?t=3689
	segment writeable
molux
Posts: 15
Joined: Fri May 16, 2008 8:36 am

Post by molux »

Hello,

And what about Pocket PC emulation and Pocket PC bios ?
(Does the ARM bios are "standardized" or there is a spécial bios on Pocket pc ?)

thanks in advance

Molux
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Post by Karlosoft »

http://sourceforge.net/project/download ... z&26436493
I've found this link. i don't know how is it...
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

The posted programs seem to be examples for running on a OS, maybe linux on the ARM .
To write a OS for a ARM is a lot simpler than the x86, but you need to do most of the work your self, eg: No BIOS to set things up for you.
And most things that need setting up are differant on the differant ARM chips.

But this is a helloworld! bootloader that would work on all ARM chips

Code: Select all

:****************************************;
; ARM BootLoader.                        ;
;----------------------------------------;
; Prog by Dex.                           ;
; Coded with FasmARM.                    ;
; Part of the the x86 to ARM DexOS port. ;
; C:\fasmarm ArmBoot.asm ArmBoot.bin     ;
;                                        ;
;  C Bamford.2006(c)                     ;
;****************************************;
format binary
org	0			      ; code starts at offset 0.
use32				      ; use 32-bit code.

        b     reset                   ; b lable (is the same as jmp lable in x86 asm )
        b     undefined_instruction
        b     software_interrupt
        b     prefetch_abort
        b     data_abort
        b     not_used
        b     irq
        b     fiq

align 4

;********************************;
; boot start.                    ;
;********************************;
reset:
; here is where your start up code would go.
LetsLoop:
	b LetsLoop

;********************************;
; just Loop For Now ;)           ;
;********************************;
undefined_instruction:
software_interrupt:
prefetch_abort:
data_abort:
not_used:
irq:
fiq:
LetsLoopForNow:
	b     LetsLoopForNow
So for example the software int code would be placed under the lable
"software_interrupt" and so on, all that happans when you turn the device on is 4k of code is load from rom to ram starting at 0 and than it jumps to the 0 address.

I may write a tut if i get time.
Post Reply