From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stas Sergeev Subject: Re: Emulated PCI devices? Date: Wed, 19 Oct 2016 01:50:39 +0300 Message-ID: References: <201610182145.RAA07490@Stone.Rodents-Montreal.ORG> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=list.ru; s=mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject; bh=iFHmW4anjKgzUgtyglUFj3aRN+xPzwf6p8LjAbR4CK4=; b=FDxS49kshKBwxL2c6o86RE//yc08zrfBByYFW4Wd0MGWwsjuRg00cUkxDCW97XQhzPEK/jrGw8yPvw/BW4tlV7pVAqy1Me7/h4Eiq/mA09jM80R2UJTCUJtI2qLoWfPcfGEzirLJZHUbTSPTPpA3fGOnce2t5BNaqjQdvh3+0Zs=; In-Reply-To: <201610182145.RAA07490@Stone.Rodents-Montreal.ORG> Sender: linux-msdos-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="utf-8"; format="flowed" To: Mouse , linux-msdos@vger.kernel.org 19.10.2016 00:45, Mouse пишет: > I'm working with dosemu and would like to add an emulated PCI device to > the emulated DOS machine. Obviously, I know enough about the hardware > I want to emulate to believe I can write an emulation of it. > > But I'm not sure where to hook it in. (I'm working based on commit > 18f6f5cdf1beceae8c7532718bfaf423e4a44f6a.) Good luck. > I found > src/base/async/pci_bios.c and src/base/dev/misc/pci.c, but they appear > to be all about giving the emulated machine access to real PCI hardware > on the real machine. That's not what I want; I'm trying to supply the > emulated machine with hardware that is not actually present. > > There is src/env/video/matrox.c, which appears to be monkeying with PCI > stuff, but even that checks the real machine's /proc/pci and doesn't > run unless there's real hardware backing it (see matroxProbe(), which > incidentally is incorrectly commented as being MGAProbe). > > Is this something that's already got hooks supporting it, or am I > breaking new ground here? There was never any need to emulate the PCI device for DOS. There are hardly too many DOS drivers for the PCI devices. Maybe you can instead emulate the ISA version of that device, which should be much simpler than adding the PCI bus emulator. Or maybe you simply want to use qemu because I can't think of the real use-cases where you want to emulate some modern device under dosemu or dosbox.