13 static size_t lowmem_len
;
15 void *zero_addr
; /* Hack to keep gcc from complaining */
17 void snapshot_lowmem(void)
19 extern void _start(void);
21 lowmem_len
= (size_t)_start
;
22 lowmem
= malloc(lowmem_len
);
24 printf("Snapshotting lowmem... ");
26 memcpy(lowmem
, zero_addr
, lowmem_len
);
32 static void dump_memory_range(struct backend
*be
, const void *where
,
33 const void *addr
, size_t len
)
37 sprintf(filename
, "memory/%08zx", (size_t)addr
);
38 cpio_writefile(be
, filename
, where
, len
);
41 void dump_memory(struct backend
*be
)
43 printf("Dumping memory... ");
45 cpio_mkdir(be
, "memory");
48 dump_memory_range(be
, lowmem
, zero_addr
, lowmem_len
);