Path: utzoo!attcan!utgpu!watmath!att!dptg!rutgers!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!lll-winken!ames!uhccux!munnari.oz.au!mimir!hugin!augean!sirius!chook.ua.oz!cagney From: cagney@chook.ua.oz (Andrew Cagney - aka Noid) Newsgroups: comp.os.minix Subject: patch for DOSREAD to fix disk validation problem Message-ID: <549@sirius.ua.oz.au> Date: 21 Sep 89 05:20:46 GMT Sender: news@sirius.ua.oz.au Reply-To: cagney@chook.ua.oz (Andrew Cagney - aka Noid) Organization: Comp Sci, Uni of Adelaide, Australia Lines: 38 The below patch fixes a problem when reading MicroByte DOS disks. DOSREAD, to verify that a disk is in DOS format, looks at the first 3 bytes of the boot block checking for a jump instruction. Unfortunatly 8086's have more than one jump instruction and in the case of a MicroByte disk the check was for the wrong one. This patch changes the check so that two different jmp instructions are accepted. The patch is against v1.4a of dosread. Andrew Cagney (Noid) ------------------------------------------------------------------------------ echo x - dosread.c.cdif sed '/^X/s///' > dosread.c.cdif << '/' X*** /users/projects/leopard/minix-src/usr/src/commands/dosread.c Wed Aug 16 20:07:31 1989 X--- dosread.c Thu Sep 21 11:58:19 1989 X*************** X*** 394,400 **** X leave(1); X /**************/ X if (((boot.media_type & 0xf0) != 0xf0) X! || (boot.jump[0] != 0xeb) || (boot.jump[2] != 0x90) ) { X printf("DISK is not DOS Format.\n"); X leave(1); X } X--- 394,402 ---- X leave(1); X /**************/ X if (((boot.media_type & 0xf0) != 0xf0) X! || (((boot.jump[0] != 0xeb/*JMPS*/) X! || (boot.jump[2] != 0x90/*NOP*/)) X! &&(boot.jump[0] != 0xe9/*JMP*/)) ) { X printf("DISK is not DOS Format.\n"); X leave(1); X } /