diff --git a/bios/vxtx.asm b/bios/vxtx.asm index 0324905b..5577e3d0 100644 --- a/bios/vxtx.asm +++ b/bios/vxtx.asm @@ -54,6 +54,17 @@ int_13_handler: pop ax iret + +int_15_handler: + cmp ah, 0x88 + jne .error + mov ax, 64 ; Extended memory in KB. + clc + iret +.error: + mov ah, 0x86 + stc + iret int_19_handler: push bp @@ -77,6 +88,9 @@ install_handlers: mov word [INT_13_OFFSET], int_13_handler mov [INT_13_OFFSET+2], cs + mov word [INT_15_OFFSET], int_15_handler + mov [INT_15_OFFSET+2], cs + mov word [INT_19_OFFSET], int_19_handler mov [INT_19_OFFSET+2], cs @@ -95,6 +109,7 @@ install_handlers: ;;;;;;;;;;;;;;;;;; Data ;;;;;;;;;;;;;;;;;; INT_13_OFFSET equ 0x4C +INT_15_OFFSET equ 0x54 INT_19_OFFSET equ 0x64 db 'VXTX - VirtualXT BIOS Extensions', 0xA diff --git a/bios/vxtx.bin b/bios/vxtx.bin index faa2daf6..954a04f7 100644 Binary files a/bios/vxtx.bin and b/bios/vxtx.bin differ diff --git a/lib/vxt/system.c b/lib/vxt/system.c index 75337ff3..7b8d9596 100644 --- a/lib/vxt/system.c +++ b/lib/vxt/system.c @@ -381,7 +381,7 @@ VXT_API vxt_byte vxt_system_read_byte(CONSTP(vxt_system) s, vxt_pointer addr) { if (addr >= 0x100000) { addr -= 0x100000; - return (addr >= UMA_SIZE) ? 0xFF : s->ext_mem[addr]; + return (addr >= EXT_MEM_SIZE) ? 0xFF : s->ext_mem[addr]; } CONSTSP(vxt_peripheral) dev = s->devices[s->mem_map[addr >> 4]]; @@ -394,7 +394,7 @@ VXT_API void vxt_system_write_byte(CONSTP(vxt_system) s, vxt_pointer addr, vxt_b if (addr >= 0x100000) { addr -= 0x100000; - if (addr < UMA_SIZE) + if (addr < EXT_MEM_SIZE) s->ext_mem[addr] = data; return; } diff --git a/lib/vxt/system.h b/lib/vxt/system.h index 4a562c51..0ab58903 100644 --- a/lib/vxt/system.h +++ b/lib/vxt/system.h @@ -29,9 +29,11 @@ #define MAX_TIMERS 256 #define INT64 long long -#define UMA_SIZE (0x10000 - 16) #define PERIPHERAL_SIGNATURE 0xFAF129C3 + // Set this to 64K (not 64-16) because anything less causes problem with himem.sys. +#define EXT_MEM_SIZE 0x10000 + #define VERIFY_PERIPHERAL(p, r) \ if (((struct peripheral*)(p))->sig != PERIPHERAL_SIGNATURE) { \ VXT_LOG("Invalid peripheral!"); \ @@ -61,7 +63,7 @@ struct system { vxt_byte io_map[VXT_IO_MAP_SIZE]; vxt_byte mem_map[VXT_MEM_MAP_SIZE]; - vxt_byte ext_mem[UMA_SIZE]; + vxt_byte ext_mem[EXT_MEM_SIZE]; vxt_allocator *alloc; struct cpu cpu;