--- trunk/src/promemul/pc_bios.c 2007/10/08 16:18:51 14 +++ trunk/src/promemul/pc_bios.c 2007/10/08 16:19:56 24 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005 Anders Gavare. All rights reserved. + * Copyright (C) 2005-2006 Anders Gavare. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: pc_bios.c,v 1.2 2005/09/30 14:17:04 debug Exp $ + * $Id: pc_bios.c,v 1.6 2006/03/30 19:41:51 debug Exp $ * * Generic PC BIOS emulation. * @@ -878,8 +878,8 @@ } debug("[ pc_bios_int13(): %s biosdisk 0x%02x (offset=" - "0x%llx) mem=0x%04x:0x%04x ]\n", ah==2? "read from" - : "write to", dl, (long long)offset, + "0x%"PRIx64") mem=0x%04x:0x%04x ]\n", ah==2? + "read from" : "write to", dl, (uint64_t) offset, cpu->cd.x86.s[X86_S_ES], bx); if (ah == 3) { @@ -897,9 +897,9 @@ if (!res) { err = 4; fatal("[ pc_bios_int13(): FAILED to %s" - " biosdisk 0x%02x (offset=0x%llx)" + " biosdisk 0x%02x (offset=0x%"PRIx64")" " ]\n", ah==2? "read from" : - "write to", dl, (long long)offset); + "write to", dl, (uint64_t) offset); } else if (ah == 2) { cpu->cd.x86.cursegment = X86_S_ES; if (bx + 512*al > 0x10000) { @@ -1330,7 +1330,7 @@ static void pc_bios_int1c(struct cpu *cpu) { unsigned char ticks[4]; - int i; + size_t i; /* Increase word at 0x0040:0x006C */ cpu->memory_rw(cpu, cpu->mem, 0x46C, @@ -1484,6 +1484,7 @@ { char t[81]; int x, y, nboxlines, i, any_disk = 0, disknr, tmp; + int old_cursegment = cpu->cd.x86.cursegment; int boot_id, boot_type, bios_boot_id = 0, nfloppies = 0, nhds = 0; /* Go to real mode: */ @@ -1781,6 +1782,8 @@ cpu->pc = 0x7c00; cpu->machine->md.pc.initialized = 1; + + cpu->cd.x86.cursegment = old_cursegment; }