PDB (Palm OS)

Last updated

PDB is a container format for record databases in Palm OS, Garnet OS and Access Linux Platform. Its structure is similar to PRC resource databases. [1] The PalmDOC eBook format is a special version of the PDB format. [2]

Contents

Structure of PDB file

A PDB file contains a PDB header, PDB record headers and records. [3] [4]

PDB Header
PDB Record Header
PDB Records

PDB Header

The PDB header is located at the beginning of the file and contains meta-information on the file: [3]

OffsetNameTypeSize
0x00namechar (Modified ISO-8859-1)32 Bytes
0x20file attributesinteger2 Bytes
0x22versioninteger2 Bytes
0x24creation time 32bit integer - PDB Datetime 4 Bytes
0x28modification time 32bit integer - PDB Datetime 4 Bytes
0x2cbackup time 32bit integer - PDB Datetime 4 Bytes
0x30modification numberinteger4 Bytes
0x34app_infointeger4 Bytes
0x38sort_infointeger4 Bytes
0x3ctypeinteger4 Bytes
0x40creatorinteger4 Bytes
0x44unique_id_seedinteger4 Bytes
0x48next_record_listinteger4 Bytes
0x4cnum_recordsinteger2 Bytes

PDB Record Header

For every record, there is an eight byte record header, containing: [3]

nametypesizenotes
offsetinteger4 bytesByte number in the PDB file (counting from zero), where the record is located
attributesbyte1 byteAttributes of the record (delete/dirty/busy/secret/category)
UniqueIDinteger3 bytesAlways 0

PDB Records

Now the records themselves follow. The usual order is AppInfoArea, SortInfoArea and records, sequentially. [4]

PDB Datetimes

Many PDB format files used times counting in seconds from 1904-01-01T00:00:00. This is the base time used by the original Macintosh (up to Mac OS 9). It may be noted that there were close links between Palm OS and Mac OS during early development. Using an unsigned 32-bit integer and the 1904 epoch, integer overflow will overflow will occur sometime in 2040.

Others may be observed to be counting from 1970-01-01T00:00:00 (the Unix epoch base time), and uses a signed 32-bit integer which will overflow sometime in 2038.

Palm OS Protein C/C++ Compiler Language & Library Reference, Copyright 2004 Palm Source calls the dates calculated from 1904 "old Palm epoch", and the dates calculated from 1970 "UNIX epoch". Protein C also provides functions (palm_seconds_to_time_t(), and time_t_to_palm_seconds() ) for converting between the two.

Some sources even suggest some very old files may use times counting from 1900 (which would be consistent with the Excel epoch).

This conflict between old Palm (Mac OS 9) epoch and UNIX epoch is unfortunate, the following heuristic may be useful when examining a file copied from a Palm OS device:

This is based on the idea that, otherwise the time would be before 1972 or before 1970 (depending on the interpretation) and the PDB format wasn't around then.

The palmdump utility and other software uses this rule-of-thumb when reading files.

See also

Related Research Articles

The Au file format is a simple audio file format introduced by Sun Microsystems. The format was common on NeXT systems and on early Web pages. Originally it was headerless, being simply 8-bit μ-law-encoded data at an 8000 Hz sample rate. Hardware from other vendors often used sample rates as high as 8192 Hz, often integer multiples of video clock signal frequencies. Newer files have a header that consists of six unsigned 32-bit words, an optional information chunk which is always of non-zero size, and then the data.

<span class="mw-page-title-main">Executable and Linkable Format</span> Standard file format for executables, object code, shared libraries, and core dumps.

In computing, the Executable and Linkable Format, is a common standard file format for executable files, object code, shared libraries, and core dumps. First published in the specification for the application binary interface (ABI) of the Unix operating system version named System V Release 4 (SVR4), and later in the Tool Interface Standard, it was quickly accepted among different vendors of Unix systems. In 1999, it was chosen as the standard binary file format for Unix and Unix-like systems on x86 processors by the 86open project.

Hierarchical File System (HFS) is a proprietary file system developed by Apple Inc. for use in computer systems running Mac OS. Originally designed for use on floppy and hard disks, it can also be found on read-only media such as CD-ROMs. HFS is also referred to as Mac OS Standard, while its successor, HFS Plus, is also called Mac OS Extended.

Resource Interchange File Format (RIFF) is a generic file container format for storing data in tagged chunks. It is primarily used for audio and video, though it can be used for arbitrary data.

<span class="mw-page-title-main">Year 2038 problem</span> Computer software bug occurring in 2038

The year 2038 problem is a time formatting bug in computer systems with representing times after 03:14:07 UTC on 19 January 2038.

The Common Object File Format (COFF) is a format for executable, object code, and shared library computer files used on Unix systems. It was introduced in Unix System V, replaced the previously used a.out format, and formed the basis for extended specifications such as XCOFF and ECOFF, before being largely replaced by ELF, introduced with SVR4. COFF and its variants continue to be used on some Unix-like systems, on Microsoft Windows, in UEFI environments and in some embedded development systems.

In computer programming, a magic number is any of the following:

uuencoding is a form of binary-to-text encoding that originated in the Unix programs uuencode and uudecode written by Mary Ann Horton at the University of California, Berkeley in 1980, for encoding binary data for transmission in email systems.

In classic Mac OS System 7 and later, and in macOS, an alias is a small file that represents another object in a local, remote, or removable file system and provides a dynamic link to it; the target object may be moved or renamed, and the alias will still link to it. In Windows, a "shortcut", a file with a .lnk extension, performs a similar function.

<span class="mw-page-title-main">2,147,483,647</span> Natural number

The number 2,147,483,647 is the eighth Mersenne prime, equal to 231 − 1. It is one of only four known double Mersenne primes.

HFS Plus or HFS+ is a journaling file system developed by Apple Inc. It replaced the Hierarchical File System (HFS) as the primary file system of Apple computers with the 1998 release of Mac OS 8.1. HFS+ continued as the primary Mac OS X file system until it was itself replaced with the Apple File System (APFS), released with macOS High Sierra in 2017. HFS+ is also one of the formats supported by the iPod digital music player.

<span class="mw-page-title-main">Unix time</span> Date and time representation system widely used in computing

Unix time is a date and time representation widely used in computing. It measures time by the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970, the Unix epoch, without adjustments made because of leap seconds. In modern computing, values are sometimes stored with higher granularity, such as microseconds or nanoseconds.

The Time Protocol is a network protocol in the Internet Protocol Suite defined in 1983 in RFC 868 by Jon Postel and K. Harrenstein. Its purpose is to provide a site-independent, machine readable date and time.

<span class="mw-page-title-main">C data types</span> Data types supported by the C programming language

In the C programming language, data types constitute the semantics and characteristics of storage of data elements. They are expressed in the language syntax in form of declarations for memory locations or variables. Data types also determine the types of operations or methods of processing of data elements.

The Apple Icon Image format is an icon format used in Apple Inc.'s macOS. It supports icons of 16 × 16, 32 × 32, 48 × 48, 128 × 128, 256 × 256, 512 × 512 points at 1x and 2x scale, with both 1- and 8-bit alpha channels and multiple image states. The fixed-size icons can be scaled by the operating system and displayed at any intermediate size.

In computer science and computer programming, system time represents a computer system's notion of the passage of time. In this sense, time also includes the passing of days on the calendar.

cdb, short for "constant database", refers to both a library and data format created by Daniel J. Bernstein. cdb acts as an on-disk associative array, mapping keys to values, and allows multiple values to be stored for a single key. A constant database allows only two operations: creation and reading. Both operations are designed to be very fast and highly reliable. Since the database does not change while it is in use, multiple processes can access a single database without locking. Additionally, since all modifications create a replacement database, it can take advantage of UNIX filesystem semantics to provide a guarantee of reliability.

In computer science, time formatting and storage bugs are a class of software bugs that cause errors in time and date calculation or display. These are most commonly manifestations of arithmetic overflow, but can also be the result of other issues. The most well-known consequence of bugs of this type is the Y2K problem, but many other milestone dates or times exist that have caused or will cause problems depending on various programming deficiencies.

PRC is a container format for code databases in Palm OS, Garnet OS and Access Linux Platform. Its structure is similar to PDB databases. Usually, a PRC file is a flat representation of a Palm OS application that is stored as forked database on the PDA.

In computing, an epoch is a fixed date and time used as a reference from which a computer measures system time. Most computer systems determine time as a number representing the seconds removed from a particular arbitrary date and time. For instance, Unix and POSIX measure time as the number of seconds that have passed since Thursday 1 January 1970 00:00:00 UT, a point in time known as the Unix epoch. Windows NT systems, up to and including Windows 11 and Windows Server 2022, measure time as the number of 100-nanosecond intervals that have passed since 1 January 1601 00:00:00 UTC, making that point in time the epoch for those systems. Computing epochs are nearly always specified as midnight Universal Time on some particular date.

References

  1. N. Rhodes, J. McKeehan. Palm OS Programming, Second Edition, O'Reilly, 2001, ISBN   1-56592-856-3
  2. MobileRead Wiki: Specification of the PalmDOC format
  3. 1 2 3 Paul J. Lucas (1998) PDB (Pilot Database) file format. Archived 2022-02-23 at the Wayback Machine Accessed on 20090308
  4. 1 2 Microfirst Software. The Pilot Record Database Format Archived 2009-03-15 at the Wayback Machine Accessed on 20090308