Date: Fri, 14 Jul 2017 09:47:07 +0200 From: Polytropon <freebsd@edvax.de> To: Doug Hardie <bc979@lafn.org> Cc: David Christensen <dpchrist@holgerdanske.com>, freebsd-questions@freebsd.org Subject: Re: Unusual Question Message-ID: <20170714094707.976eb9c1.freebsd@edvax.de> In-Reply-To: <B63B13F0-D5E4-4C32-AD9B-B9D505AFDAA2@mail.sermon-archive.info> References: <888578F8-AD68-4993-823C-152789F3C929@mail.sermon-archive.info> <b5b8a49e-804d-15be-25b7-ff7c29a5ae8a@holgerdanske.com> <B63B13F0-D5E4-4C32-AD9B-B9D505AFDAA2@mail.sermon-archive.info>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 13 Jul 2017 23:11:41 -0700, Doug Hardie wrote: > > > On 13 July 2017, at 21:44, David Christensen <dpchrist@holgerdanske.com> 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, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170714094707.976eb9c1.freebsd>