Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!mailrus!cornell!rochester!udel!mmdf From: Leisner.Henr@xerox.com (marty) Newsgroups: comp.os.minix Subject: Re: Block special file sizes Message-ID: <3428@louie.udel.EDU> Date: 22 Jul 88 13:52:14 GMT Sender: mmdf@udel.EDU Lines: 44 Andy, you say: mkfs does it. It's the only way. This is the only way FS can tell when end of file has been hit on a device. So where does FS get the size? I had a headache with 1.1 trying to run mkfs on my hard disk. Eventually what I did was remove size checks on block special devices and let the device driver break if it can't seek. Seems reasonable. From my current working version (quasi-protected mode 1.2): minix/fs/read.c in read_write() ... position = f->filp_pos; if (position < (file_pos) 0) return(EINVAL); rip = f->filp_ino; f_size = rip->i_size; r = OK; cum_io = 0; virg = TRUE; mode_word = rip->i_mode & I_TYPE; #ifdef ORIGINAL if (mode_word == I_BLOCK_SPECIAL && f_size == 0) f_size = MAX_P_LONG; #else if(mode_word == I_BLOCK_SPECIAL) f_size = MAX_P_LONG; #endif I have no idea where rip->i_size got initialized to something meaningful for hard disk partitions, but the number did not make sense. Off the boot disk , it certainly wasn't 0. This fix allowed me to make hard disk partitions on my genuwine IBM PC AT (I initially thought mkfs was broken but the above code makes the difference. What happens is rw_chunk fails eventually when the device driver rejects the request. marty ARPA: leisner.henr@xerox.com GV: leisner.henr NS: martin leisner:wbst139:xerox UUCP: nsc!nscimg!amps!marty, hplabs!parcvax!leisner