From owner-freebsd-questions@freebsd.org Fri Jul 14 07:47:30 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FE9ED99AE4 for ; Fri, 14 Jul 2017 07:47:30 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay10.qsc.de (mailrelay10.qsc.de [212.99.163.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDC51805DB for ; Fri, 14 Jul 2017 07:47:29 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay10.qsc.de; Fri, 14 Jul 2017 09:47:09 +0200 Received: from r56.edvax.de (port-92-195-0-242.dynamic.qsc.de [92.195.0.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 34B6B3CBF9; Fri, 14 Jul 2017 09:47:07 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v6E7l7qx007880; Fri, 14 Jul 2017 09:47:07 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Fri, 14 Jul 2017 09:47:07 +0200 From: Polytropon To: Doug Hardie Cc: David Christensen , freebsd-questions@freebsd.org Subject: Re: Unusual Question Message-Id: <20170714094707.976eb9c1.freebsd@edvax.de> In-Reply-To: References: <888578F8-AD68-4993-823C-152789F3C929@mail.sermon-archive.info> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay10.qsc.de with D14CB68340A X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.1489 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 07:47:30 -0000 On Thu, 13 Jul 2017 23:11:41 -0700, Doug Hardie wrote: > > > On 13 July 2017, at 21:44, David Christensen wrote: > > If the machine has BIOS and the system drive isn't too large, > > write an assembly program that fits into the MBR bootstrap code > > area to wipe the rest of the drive, assemble the program, write > > it into the MBR, and reboot. > > > > > > Bonus: the program deletes the MBR when done wiping the rest of the drive. > > Neat idea, but I have a number of these systems and they all use > different disk drives. That would be a lot of work writing drivers > for each type. If the machines have BIOS, you can use BIOS interrupt calls which should be the same for all drives, comparable to the biosdisk() DOS functions. Let's see if I can get the basics together... you'd basically do something like this: biosdisk(0x03, 0x80, h, c, s, 1, (void *)crap); 0x03 is "write", 0x80 is 1st disk detected by BIOS; h, c, s is the head / cylinder / sector address of where you want to write to; 1 is the amount of blocks to write, and crap is a pointer to a vector of unsigned char, for example 512 bytes, the size of a block (addressed by h / c / s, where 0 / 0 / 1 is the starting location of the MBR), containing some random crap (or NULs) you want to write. The translation to assembly is left to the shocked reader. :-) Sources: http://www.digitalmars.com/rtl/bios.html#biosdisk https://en.wikipedia.org/wiki/BIOS_interrupt_call What terrible memories it recalls... ;-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...