-
Notifications
You must be signed in to change notification settings - Fork 0
/
memory.h
29 lines (23 loc) · 911 Bytes
/
memory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef __MEMORY_DOT_H__
#define __MEMORY_DOT_H__
#include <stdbool.h>
#include "drives.h"
void *allocate_memory(unsigned int size);
void write_persist(unsigned char *target, unsigned int cpm_image_length);
bool init_persist(void);
#define PERSIST_SIGNATURE 0x1653
#define PERSIST_VERSION 0x01
// keep this in sync with cpmbios.s (search for "persist_t" at the end)
typedef struct {
unsigned int signature; // persist_signature (at address 0xFEFE)
unsigned char version; // persist_version
// data from init to residual (not versioned)
drive_map_t *drive_map; // drvmap
unsigned char drive_count; // drvcnt
// data that we persist between sessions (versioned)
unsigned char config_unit; // config_unit
void *ubios_ccp_clone; // ccpadr
void *ubios_sector_buffer; // bufadr
} persist_t;
extern persist_t persist;
#endif