System Design
The checkpoint image format
The checkpoint-ed process is stored as a binary image file with a specific structure. To ensure data integrity, a header containing metadata is written at the beginning of the file, followed by the raw memory dump. The structure of the file is visualized in Figure 1. The header acts as a metadata container, ensuring that the restoration process has all context required (PID, memory size, and CPU registers) before it begins loading the raw memory data.

The corresponding C structure definition used in the kernel is shown below:
# define CHECKPOINT_HEADER_ID 0 xDEADBEEF
struct check_point_header {
uint id ; // Magic number (0 xDEADBEEF )
int pid ; // Original Process ID
uint sz ; // Size of process memory in bytes
char name [16]; // Process name
struct trapframe tf ; // Saved CPU registers
};
System Calls
Two new system calls were introduced:
- int checkpoint(int pid, char *filename): Locates the target process, freezes its state, and streams its memory to disk.
- int restart(char *filename): Replaces the calling process’s memory and context with the data found in the image file.