From: Kevin O'Connor Date: Fri, 25 Sep 2009 01:01:16 +0000 (-0400) Subject: Interrupts should be enabled when calling 16bit code. X-Git-Tag: rel-0.5.0~99 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f8e800dea4aad59c83254bddd8e9ccfcd3b45774;p=people%2Fandrewcoop%2Fseabios.git Interrupts should be enabled when calling 16bit code. Set most code paths to have interrupts on when calling 16bit code. This fixes at least one optionrom that needed irqs on. --- diff --git a/src/boot.c b/src/boot.c index b6afd35..7b74007 100644 --- a/src/boot.c +++ b/src/boot.c @@ -328,6 +328,7 @@ call_boot_entry(u16 bootseg, u16 bootip, u8 bootdrv) struct bregs br; memset(&br, 0, sizeof(br)); + br.flags = F_IF; br.code = SEGOFF(bootseg, bootip); // Set the magic number in ax and the boot drive in dl. br.dl = bootdrv; @@ -344,6 +345,7 @@ boot_disk(u8 bootdrv, int checksig) // Read sector struct bregs br; memset(&br, 0, sizeof(br)); + br.flags = F_IF; br.dl = bootdrv; br.es = bootseg; br.ah = 2; @@ -459,6 +461,7 @@ do_boot(u16 seq_nr) // Boot failed: invoke the boot recovery function struct bregs br; memset(&br, 0, sizeof(br)); + br.flags = F_IF; call16_int(0x18, &br); } diff --git a/src/optionroms.c b/src/optionroms.c index 18526f4..bdc0cb5 100644 --- a/src/optionroms.c +++ b/src/optionroms.c @@ -87,6 +87,7 @@ __callrom(struct rom_header *rom, u16 offset, u16 bdf) struct bregs br; memset(&br, 0, sizeof(br)); + br.flags = F_IF; br.ax = bdf; br.bx = 0xffff; br.dx = 0xffff; @@ -442,6 +443,7 @@ vga_setup() dprintf(1, "Turning on vga console\n"); struct bregs br; memset(&br, 0, sizeof(br)); + br.flags = F_IF; br.ax = 0x0003; call16_int(0x10, &br); diff --git a/src/output.c b/src/output.c index 6a164e1..da585b4 100644 --- a/src/output.c +++ b/src/output.c @@ -70,6 +70,7 @@ screenc(u8 c) return; struct bregs br; memset(&br, 0, sizeof(br)); + br.flags = F_IF; br.ah = 0x0e; br.al = c; call16_int(0x10, &br); diff --git a/src/post.c b/src/post.c index c21b46e..45a319d 100644 --- a/src/post.c +++ b/src/post.c @@ -227,5 +227,6 @@ _start() dprintf(3, "Jump to int19\n"); struct bregs br; memset(&br, 0, sizeof(br)); + br.flags = F_IF; call16_int(0x19, &br); } diff --git a/src/ramdisk.c b/src/ramdisk.c index 83aa7c4..36b9f22 100644 --- a/src/ramdisk.c +++ b/src/ramdisk.c @@ -73,7 +73,7 @@ ramdisk_copy(struct disk_op_s *op, int iswrite) // Call int 1587 to copy data. struct bregs br; memset(&br, 0, sizeof(br)); - br.flags = F_CF; + br.flags = F_CF|F_IF; br.ah = 0x87; br.es = GET_SEG(SS); br.si = (u32)gdt; diff --git a/src/util.c b/src/util.c index 841c00a..c09b851 100644 --- a/src/util.c +++ b/src/util.c @@ -239,6 +239,7 @@ usleep(u32 usec) { struct bregs br; memset(&br, 0, sizeof(br)); + br.flags = F_IF; br.ah = 0x86; br.cx = usec >> 16; br.dx = usec; @@ -251,6 +252,7 @@ check_for_keystroke() { struct bregs br; memset(&br, 0, sizeof(br)); + br.flags = F_IF; br.ah = 1; call16_int(0x16, &br); return !(br.flags & F_ZF); @@ -262,6 +264,7 @@ get_raw_keystroke() { struct bregs br; memset(&br, 0, sizeof(br)); + br.flags = F_IF; call16_int(0x16, &br); return br.ah; }