return v;
}
+/*
+ * Specify max RAM by reservation
+ * Adds a reservation to data in INT15h to prevent access to the top of RAM
+ * if there's any above the point specified.
+ */
+void int15maxres(uint32_t restop)
+{
+ uint32_t ramtop;
+
+ if (high_mem) {
+ ramtop = high_mem + (1<<24);
+ } else if (low_mem) {
+ ramtop = low_mem + (1<<20);
+ } else {
+ ramtop = 0;
+ }
+
+ /* printf(" TOP RAM-%08x RES-%08x", ramtop, restop); */
+ if (restop < ramtop) {
+ /* printf(" (A)"); */
+ insertrange(restop, (ramtop - restop), 3);
+ parse_mem();
+ }
+ if (high_mem) {
+ ramtop = high_mem + (1<<24);
+ } else if (low_mem) {
+ ramtop = low_mem + (1<<20);
+ } else {
+ ramtop = 0;
+ }
+ /* printf(" NOW RAM-%08x\n", ramtop); */
+}
+
struct real_mode_args rm_args;
/*
int no_bpt; /* No valid BPT presented */
uint32_t boot_seg = 0; /* Meaning 0000:7C00 */
uint32_t boot_len = 512; /* One sector */
+ const char *p;
/* We need to copy the rm_args into their proper place */
memcpy(&rm_args, rm_args_ptr, sizeof rm_args);
pptr->cd_pkt.geom3 = (uint8_t)(pptr->heads);
}
+ if ((p = getcmditem("int15maxres")) != CMD_NOTFOUND) {
+ int15maxres(atou(p));
+ }
+
/* The size is given by hptr->total_size plus the size of the E820
map -- 12 bytes per range; we may need as many as 2 additional
ranges (each insertrange() can worst-case turn 1 area into 3)