200 likes | 225 Views
An Overview of Palm OS. Designed for special hardware small screen ( 160 x 160 ) less processing power than desktop PCs quick turnaround expected limited memory ( 512k ~ 8MB ) no disk drive or PCMCIA disk. The Appearance of a PalmPilot. System Architecture. Memory Orgnization.
E N D
An Overview of Palm OS • Designed for special hardware • small screen ( 160 x 160 ) • less processing power than desktop PCs • quick turnaround expected • limited memory ( 512k ~ 8MB ) • no disk drive or PCMCIA disk
Memory Orgnization • Motorola 68328 uses 32-bit addresses • External data bus is only 16 bits wide • ROM - stores the main suite of applications ( the OS itself) • RAM - stores additional and replacement applications & system extensions • RAM - dynamic RAM & storage RAM
Dynamic RAM • Served as temporary space for allocation • Analogous to the RAM installed in a typical desktop system • Is cleaned after reboot • Implement a single heap that provides memory for dynamic allocations( TCP/IP, IrDA, …)
Storage RAM • Holds nonvolatile user data ( appointments, to do lists, memos, address lists, … ) • Is accessed via calling the database manager or the resource manager • Analogous to the disk drive of a typical desktop system
Memory Chunks and Heaps • A chunk - contiguous memory between 1byte ~ 64 KB that has been allocated by the Palm OS memory manager • Each chunk resides in a heap • Memory manager allocates memory in the dynamic heap • Data manager allocates memory in the storage heap
Memory Heaps • Each heap has a unique heap ID • The heap with heap ID 0 is the dynamic heap • Only the dynamic heap is reinitialized through soft reset cycles
Movable / Nonmovable Chunks • Each chunk is referenced by a local ID • The local ID of a nonmovable chunk : the offset of the chunk from the base address of the card • The local ID of a movable chunk : the offset of the master pointer to the chunk from the base address of the card
The Memory Manager • The functions of the memory manager: • allocating new chunks • disposing of chunks • resizing of chunks • locking and unlocking chunks • compacting heaps when they become fragmented
Heap Structure Heap • Master pointer table stores 32-bit pointer to movable chunks • Movable chunks are allocated at the beginning Heap Header Master pointer table Movable chunks Non-movable chunks
Chunk Structure • Each chunk begins with an 8-byte header followed by that chunk’s data • Flags:sizeAdj flag: • high nibble : set for free chunk • low nibble : reqSize = size - 8 - [this value] • size field( 3 bytes) • the size of the chunk, which is larger than the size requested by the application , including the chunk header itself
Chunk Structure(cont.) • Lock:owner byte • high nibble : the lock count, which is incremented when being locked • low nibble : the owner ID of the memory chunk • hOffset field( 3 bytes) • the distance from the master pointer to the chunk header, divided by two
The Data Manager • The database is analogous to disk • A database is a collection of records • A record is mapped to a memory chunk • A database accesses its records by storing their local ID’s • An application requests a particular record in a database by index
The Resource Manager • Resources : store the UI elements of an application, such as images, fonts, dialog layouts, … • Resource manager : Data manager with the additional ability of tagging each chunk of data with a unique resource type and resource ID
Application Structure • Single threaded • Event-driven • PilotMain() corresponds to main() in C • PilotMain -- Response to launch codes • An event loop in response of a normal launch
Developing Apps on Palm • Various development tools: • Code Warrior for Palm OS • Palm SDK (header files, documents, examples) • GCC • POSE - An open source Palm emulator runs on Windows, Mac and UNIX
Conclusion • The Palm OS provides a good platform for developing Palm apps • The Palm OS provides various libraries for communicating with PC’s • A good OS design is not necessarily having the most advanced feature, but having the best integration of the hardware
The End B86506053 龔律全 B86506025 卓聖堯