VirtualBox

source: vbox/trunk/src/VBox/Devices/PC/BIOS/parallel.c@ 69496

Last change on this file since 69496 was 69496, checked in by vboxsync, 7 years ago

*: scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1/*
2 * Copyright (C) 2006-2017 Oracle Corporation
3 *
4 * This file is part of VirtualBox Open Source Edition (OSE), as
5 * available from http://www.virtualbox.org. This file is free software;
6 * you can redistribute it and/or modify it under the terms of the GNU
7 * General Public License (GPL) as published by the Free Software
8 * Foundation, in version 2 as it comes in the "COPYING" file of the
9 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
10 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
11 *
12 * This code is based on:
13 *
14 * ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
15 *
16 * Copyright (C) 2002 MandrakeSoft S.A.
17 *
18 * MandrakeSoft S.A.
19 * 43, rue d'Aboukir
20 * 75002 Paris - France
21 * http://www.linux-mandrake.com/
22 * http://www.mandrakesoft.com/
23 *
24 * This library is free software; you can redistribute it and/or
25 * modify it under the terms of the GNU Lesser General Public
26 * License as published by the Free Software Foundation; either
27 * version 2 of the License, or (at your option) any later version.
28 *
29 * This library is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32 * Lesser General Public License for more details.
33 *
34 * You should have received a copy of the GNU Lesser General Public
35 * License along with this library; if not, write to the Free Software
36 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
37 *
38 */
39
40
41#include <stdint.h>
42#include "biosint.h"
43#include "inlines.h"
44
45void BIOSCALL int17_function(pusha_regs_t regs, uint16_t es, uint16_t ds, volatile iret_addr_t iret_addr)
46{
47 uint16_t addr,timeout;
48 uint8_t val8;
49
50 int_enable();
51
52 addr = read_word(0x0040, (regs.u.r16.dx << 1) + 8);
53 if ((regs.u.r8.ah < 3) && (regs.u.r16.dx < 3) && (addr > 0)) {
54 timeout = read_byte(0x0040, 0x0078 + regs.u.r16.dx) << 8;
55 if (regs.u.r8.ah == 0) {
56 outb(addr, regs.u.r8.al);
57 val8 = inb(addr+2);
58 outb(addr+2, val8 | 0x01); // send strobe
59 outb(addr+2, val8 & ~0x01);
60 while (((inb(addr+1) & 0x40) == 0x40) && (timeout)) {
61 timeout--;
62 }
63 }
64 if (regs.u.r8.ah == 1) {
65 val8 = inb(addr+2);
66 outb(addr+2, val8 & ~0x04); // send init
67 outb(addr+2, val8 | 0x04);
68 }
69 val8 = inb(addr+1);
70 regs.u.r8.ah = (val8 ^ 0x48);
71 if (!timeout) regs.u.r8.ah |= 0x01;
72 ClearCF(iret_addr.flags);
73 } else {
74 SetCF(iret_addr.flags); // Unsupported
75 }
76}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette