From owner-freebsd-drivers@FreeBSD.ORG Tue May 15 14:53:03 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE53616A407 for ; Tue, 15 May 2007 14:53:03 +0000 (UTC) (envelope-from die.gestalt@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.238]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8B813C45B for ; Tue, 15 May 2007 14:53:03 +0000 (UTC) (envelope-from die.gestalt@gmail.com) Received: by nz-out-0506.google.com with SMTP id s1so185613nze for ; Tue, 15 May 2007 07:53:02 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=oB1kPl34dcUYfvrSxVgsv41S77TznEOl6EsaBhPzr4UUkZT0uZpuAjIVYtewhtP3DsRegJaqX/TLWLjr9o6dxaD241oH/LCX9yHwhZ4bOOJQqRs4Q/EBhuKzrozMeBterVUjoSHw7NA/2BrLZ95X4pJHUJ7RJRBcKJu0mkQMbjA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=t8BsR2IhbswBWejmeRhinsfRMDbe3l6f2NV5UgH/eVWjHr6TB2oAJqEU+wjXGDowZgInBUtL6+zJzBTN4QdmHMxTkfO12Z7h7ZiD9bOXs35o9069pYM9LUCtT8xBNYKvdlD9aC0dI/RgmAsagozMZzVt31GAuVRG5xN51fGolF0= Received: by 10.64.181.12 with SMTP id d12mr923615qbf.1179239093069; Tue, 15 May 2007 07:24:53 -0700 (PDT) Received: by 10.64.184.8 with HTTP; Tue, 15 May 2007 07:24:52 -0700 (PDT) Message-ID: <5bf3e10d0705150724q3f0fd25fq89094bd02d8f9d29@mail.gmail.com> Date: Tue, 15 May 2007 16:24:52 +0200 From: "Die Gestalt" To: freebsd-drivers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Generic int 13h driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2007 14:53:03 -0000 Hi gurus, As the subject implies I'm currently doing the most unholy thing ever. I'm writing a driver that accesses hard disks through BIOS int13h. The reasons why I'm doing this are many, but mainly I will be in a situation where I will not be able to update my kernel and where I want to support as much devices as possible. I know this will be slow and I know this will only work on the i386 platform, I accept that. So far so good, I have a skeleton which is able to query the drive parameters and some basic stuff. But when I want to read, this doesn't work, except in QEmu (http://www.qemu.org). I've tried on a VMWare and a real machine, what I get is a stall for maybe 10 s (sometimes not) and the operations returns saying it's successful but my buffer is actually left untouched. I get no kernel message. My code makes use of the vm86_datacall() API to make requests to the int 13h. I've tried both function 02h and 42h without success. Of course I only attempt this on devices where support has been removed from the kernel (to avoid all conflict). No X server is running on the test machine. I've compiled a kernel without APIC and ACPI support and removed as many devices as possible same problem. So my questions are : - Why does it work in QEmu and not in VMWare or on my laptop ? - Is there something in the VM86 monitor that would prevent this from working ? Thanks in advance any help or hint would be greatly appreciated.