Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!haven!udel!mmdf From: Peter_Van_Epp@cc.sfu.ca Newsgroups: comp.os.minix Subject: Booting Minix from 1.44m floppies (long) Message-ID: <7806@nigel.udel.EDU> Date: 10 Jan 90 04:12:07 GMT Sender: mmdf@udel.EDU Lines: 576 The following uue encoded shar file will allow Minix to be booted from 1.44m 3.5 inch floppies (and 1.2m AT floppies and 720k 3.5 floppies and last but not least 360k 5.25 floppies) and has been booted succesfully from all of them! I would characterize the mods as experimental at the moment (although I don't forsee any changes to this part of things), there is a portability problem to Minix ST due to the changes that has not been addressed here (but is easy to fix if required). A little history to explain why this was done, I have a PS/2 model 55 at work that has only a 1.44m floppy and a 60m hard drive, and neither 1.3 nor 1.5.0 could boot from a 1.44m floppy. In the course of modifying bootblok.s to do that I discovered that 720k support depended on a hard coded Prom address (bad news for people without that prom!) but that keeping the current test procedure (which involved seeking to track 64 to see if this is a 720k drive) ground the heads on my 360k floppy when the rom table was replaced with a proper 720k table (probably why the rom table was there!). To fix this (and to start addressing a similar problem in floppy.c!) I looked at the data in the DOS boot sector (in Advanced MSDOS by Ray Duncan good book!). and discovered that the total number of sectors, number of sectors per track, and number of heads are written into offset 0x13 to 0x1B of the boot block. I have now modified bootblok.s (here in source form since the cdif was 10k and the source was 11k and change!), build.c and the makefile. The change involves build reading the disk boot sector (meaning no more build to a file, sorry!) , saveing the values in 0x13 to 0x1B, then, when patching the Minix sizes into the boot block, also patch the disk values back into offset 0x13 to 0x1B (this needs to be either conditional compiled out or the same space needs to be kept free of code for the ST in order to use the same build for both neither of which I have done so far!) At boot time, bootblok.s has been modified to read the total size of the disk from location 0x13 (put there by build) and checks that it is one of 720, 1440, 2400, or 2800 sectors (360k etc.) and selects the correct parameter block for the floppy controller (or complains if the drive doesn't match!). As mentioned, this code has been used to succesfully boot all of these disks (and 720k in 1.44m drives but not 360k in 1.2m) and it all seems to work. I intend to now look at doing the same thing to floppy.c and mkfs (to stop mkfs zeroing the boot block most likely) since I suspect that we should always be able to read the boot block from a floppy in at most 2 tries, we will then have hard information from the floppy, (to take care of 720k media in a 1.44m drive) and this both allow better error checking (we know what the end block of this media is not the end block of the largest media possible etc.) and may take less time to figure out what kind of floppy is in the drive. Here is the bootblok, build and makefile portion: --------------------- cut here ------------------------- table !"#$%&'()*+,-./0123456789:;<=>? @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ begin 644 boot.shar M96-H;R!X("T@8G5I;&0N8RYC9&EF"G-E9" G+UY8+W,O+R\G(#X@8G5I;&0Nz M8RYC9&EF(#P\("71E7-T96T@9&%T82!S<&%Cc M92X@5&AE(&9I;&4@F4@;V8@=&AE(&1I71E7-T96T@9&%T82!S<&%C92X@5&AE(&9I;&4@2!"F4L(&-L:6-K7W-Hf M:69T+@I8*R @(" *6"L@(" @4%9%(#8@2F%N(#DP+B!-;V1I9GD@=&\@F4@x M:6X@:&5A9&5R("HO"E@@("-D969I;F4@4T507TE$7T))5" P>#(P(" @(" @w M(" @+RH@8FET('1H870@=&5L;',@:68@9FEL92!I2!O9F9Sf M970@:6X@82!D:7-K(&)L;V-K("HO"E@K( I8*R C9&5F:6YE(&=E=%]I;G0He M8G5F9BD)"2@H*BAB=69F("L@,2D@/#P@."D@?" H*F)U9F8@)B P>&9F*2D*d M6"L@"E@@(&-H87(@*FYA;65;72 ]('LB7&YK97)N96PB+" B;6T@(" @(BP@c M(F9S(" @("(L(")I;FET(" B+" B9G-C:R @(GT["E@@( I8("!M86EN*&%Rb M9V,L(&%R9W8I"E@J*BHJ*BHJ*BHJ*BHJ*BH*6"HJ*B Q,C(L,3(Y("HJ*BH*a M6" @"E@@(" @:68@*&%R9V,@(3T@4%)/1U)!35,K,RD@<&5X:70H(G-E=F5Nz M(&9I;&4@;F%M97,@97AP96-T960N("(L("(B*3L*6" @"E@A(" @24]I;FETy M*"D["0D)+RH@8VAE8VL@9F]R($1-06]V97)R=6X@*$1/4RD@*B\*6"$@("!Cx M3$H87)G=ELQ72D["E@M+2T@,34R+#$V," Mt M+2TM"E@@( I8(" @(&EF("AA&ET*")Ss M979E;B!F:6QE(&YA;65S(&5X<&5C=&5D+B B+" B(BD["E@@( I8(2 @($E/r M:6YI="@I.PD)"0DO*B!C:&5C:R!F;W(@1$U!;W9EF4@:6YC;'5D:6YG(&9S8VL@:7,@)6QD+EQN(BP@86QL7W-I>F4I.PI8d M(2 C96QS90I8(2 @('!R:6YT9B@B3W!EF4I.PI8(2 @('!Rb M:6YT9B@B7&Y4;W1A;"!S:7IE(&EN8VQU9&EN9R!FF4I.PI8(2 C96YD:68*6"$@"E@A(" @+RH@36%K92!T:&4@=&ARz M964@<&%T8VAE&ET*# I.PI8("!]"E@@( I8(" *6" @"E@@(&-Ow M<'DQ*&9I;&5?;F%M92D*6" @8VAAF4@:6YC;'5Dp M:6YG(&9S8VL@:7,@)6QD+EQN(BP@86QL7W-I>F4I.PI8(2 *6"$@(" O*B!-o M86ME('1H92!T:')E92!P871C:&5S('1O('1H92!O=71P=70@9FEL92!OF4L)F)O;W1?<&%R;7,Im M.PI8(" @('!A=&-H,B@I.PI8(" @('!A=&-H,R@I.PI8(" @(&5X:70H,"D[l M"E@@('T*6" @"E@@( I8*R!G971?9&ES:U]P87)M&ET*")C86XG="!O<&5N("(L(&9I;&4I.PI8g M*R C96YD:68*6"L@("!R96%D7V)L;V-K*" H=6YS:6=N960I(# L(&)U9F8If M.PD*6"L@("!B;V]T7W!AF4@(" @(#T@9V5T7VEN="@Fe M8G5F9EM325I%7T]&1E-%5%TI.PI8*R @(&)O;W1?<&%R;7,M/G-E8W1O'0])35U("!D871A/24U=2 @8G-S/24U=2 @=&]T/24U1" @:&5X/24U6" @u M)7-<;B(L"E@@(" @(" @(" @(" @(" @("!N86UE6VYU;5TL('1E>'1?8GETt M97,L(&1A=&%?8GET97,L(&)S71E'0])35U("!D871A/24U=2 @8G-S/24U=2 @=&]T/24U;&0@(&AE>#TE-6QXm M(" E71E71EPI8(" Oy M*B!4:&ES('!R;V=R86T@;F]W(&AAF5S(&]F('1H92!K97)N96PL(&UM+"!F6"]S+R\O)R ^(&UA:V5F:6QE+F-D:68@/#P@)R\G"E@J*BH@+W5S0I8?"!D:7-K(&EN=&\@861D#=#,# @86YD(&IU;7!S('1O(&ET+B @5&AI7-T96T@9G)Ob M;2!T:&4@8F]O="!D:7-K971T92!I;G1O(&UE;6]R>2P@86YD('1H96X@:G5Ma M<',@=&\@9G-C:RX*6'P@3&]A9&EN9R!I2P@7-T96T@:7,N("!7:&5N('1H92!B;V]Ts M8FQO:R!P2!O9B!T:&4@=V]R9',@<&%T8VAEo M9"!I;G1O('1H92!B;V]T(&)L;V-K(&)Y(&)U:6QD.@I8? I8?"!7;W)D(&%Tn M(" Q.3H@(R!T;W1A;"!S96-T;W)S(&]N('1H92!D:7-K"EA\(%=O#)&13 @t M(" @(" @("!\(&AE'0*6&)E9W1E>'0Z"E@N9&%T80I88F5G9&%T83H*6"YB2!B;V]T8FQO8VL@=&\@8F]O='-E9PI8l M(" @(" @("!M;W8@(" @(&%X+"-"24]34T5'"E@@(" @(" @(&UO=B @(" @k M9',L87@*6" @(" @(" @>&]R(" @("!S:2QS:2 @(" @(" @(" @?"!D I8(" @(" @("!X;W(@(" @(&1Ih M+&1I(" @(" @(" @("!\(&5S.F1I("T@;F5W(&)L;V-K"E@@(" @(" @(&UOg M=B @(" @8W@L(S(U-B @(" @(" @('P@(R @=V]R9',@=&\@;6]V90I8"6IMf M< EM;W9E"0E\(&)R86YC:"!AF4@<&%R86UE=&5R#$S(&EN('1H92!B;V]T('-Ed M8W1O2!$3U,@*&]R(&$@36EN:7@@9F]R;6%T('!R;V=R86TA*2X@"EA\(%-Iz M;F-E($1/4R!P=71S('1H92!V86QU97,@870@=&AE('-P96-I86P@;&]C871Iy M;VYS('5S960@:&5R92P@8G5I;&0@9&]E2 H:68@2!B=6EL9"D*h M6 I8? ET:&4@8F]O="!C;V1E('-T87)T"QC" @(" @(" @a M(" @?"!S970@"PCx M,@D)?"!R97-E="!V:61E;PI8"6EN= DP>#$P"E@*6" @(" @(" @;6]V(" @w M("!A>"PC,'@P,C P"7P@0DE/4R!C86QL(&EN('!U="!C=7)S;W(@:6X@=6P@v M8V]R;F5R"E@@(" @(" @('AO&]R(" @u M("!D>"QD> I8(" @(" @("!I;G0@(" @(#!X,3 *6" @(" @(" @;6]V(" @t M("!B>"PC9W)E970*6" @(" @(" @8V%L;" @("!PF4@9&ES:R!P87)A;65T97)S(&)Y(')E861I;F<@=VAA="!F;W)M870@r MF4L(S )"7P@:68@=&AE('1O=&%L(&1Ij M"QS:7IE"0E\(&=E="!T:&4@=&]T86P@g M;G5M8F5R(&]F('-E8W1O"PC8F%D7V1R:79E"7P@=&AE('1H92!B860@9')I=F4@t M;65S&]R"6%X+&%X"0E\('-E="!%4R!T;R!S96=M96YT(# @q M=&\@861D D)?"!I"QA> D)?"!T;R!L;V%D($UI;FEX(&EN+@I8"6ENh M= DP>#$S"E@)"EA\($QO860@=&AE(&]P97)A=&EN9R!S>7-T96T@9G)O;2!Dg M:7-K971T92X*6&QO860Z"E@)8V%L; ES971R96<)"7P@"P@9'@*6 EM;W8)8G@L9&ES:W-E8PE\(&)X(#T@;G5M8F5R(&]F(&YE>'0@e M"PC,0D)?"!Mc M=6QT:7!L>2!S96-T;W(@;G5M8F5R(&)Y(#,R"E@)" H=VET:"!B>" ](# I"E@)>&]R"6)X+&)X"0E\('-Ey M92!A8F]V90I8"6%D9 ED:7-K"PC9F1E# S1C(@(" @("!\(&MI;&P@=&AE(&UO=&]R"E@@(" @(" @(&UO=B @(" @o M87@L(S!X,# P0PI8(" @(" @("!O=70*6" @(" @(" @8VQI"E@);6]V"6)Xn M+'1R86-K'!E8W1S(",@ I8(" @(" @("!M;W8@(" @(&%X+&9S8VM?9',@(" @("!\('-E="!S96=Ml M96YT(')E9VES=&5R" @(" @(" @(" @?"!W;W)D'0@9&ES:R!B;&]C:R!T;R!R96%D+"!D:7-K6QI;F1E" ](&YE>'0@F4*6 EM;W8)8W@L87@)"7P@8W@@w M/2!T" ]('-E8W1O" ](&YE>'0@ D)?"!As M>" ](&QA"PC,@D)?"!D:7-K('-E8W1O"QA> D)?"!D>" ](&YE>'0@6]N9"!E;F0@;V8@ D)?"!D>" ](&QA6]N9" V-$L@8F]U;F1A6]N9" V-$L@8F]U;F1A&]R"61X+&1X"0E\(&1H(#T@u M:&5A9"P@9&P@/2!D2!"6"!T:&5N(')E8F]O="$)"E@*6&5R&]R"6-X+&-X"EAE0I8"6QOh M;W )97)R,0I8"6EN= DP>#$Y"E@*6 I8<')I;G0Z(" @(" @(" @(" @(" @g M(" @(" @(" @("!\('!R:6YT('-T" @(" @(" @(" @(" @?"!I;F-Rz M96UE;G0@" @(" @y M(" @(" @(" @?"!S879E(&)X"E@@(" @(" @(&UO=F(@(" @8FPL(S$@(" @x M(" @(" @('P@9F]R96=R;W5N9"!C;VQO<@I8"7AO I8(" @(" @("!J;7 @(" @('!R:6YT(" @(" @(" @t M("!\(&YE>'0@8VAA$$Q+" P># Rn M+" P>#(U+" R+" Q."P@,'@Q0BP@,'A&1BP@,'@V0RP@,'A&-BP@,'@P1BP@m M- I8"EA\(#$N,B!M96<@-2XR-2!I;F-H(&9L;W!P>2!P87)A;65T97)S("A!l M5"!H:6=H(&1E;G-I='DI"E@*6&9D,3)S(" ](#(T,# )?"!N=6UB97(@;V8@k M71E"3!X1$8L(#!X,#(L(#!X,C4Lf M(#(L(#DL(#!X,D$L(#!X1D8L(#!X-3 L(#!X1C8L(#!X,$8L(#(@"E@*6'P@e M,S8P:R U+C(U(&EN8V@@9FQO<'!Y('!AF4@,%QR7&XB( I8"EAB861?9')I=F4Z"E@)+F%S8VEZx M(")"860@9')I=F4@='EP95QR7&XB"E@*6&9D97)R.@DN87-C:7H@(E)E860@w M97)R;W(N7')<;B(*6 I89W)E970Z"2YAB B7')";V]T:6YG($U)3DE8v M(#$N-2XP+B @0V]P>7)I9VAT(#$Y.3 @4')E;G1I8V4M2&%L;"P@26YC+EQRu M7&XB"E@*6'P@1&]N)W0@9F]R9V5T('1H870@=V]R9',@-3 P("T@-3$P(&%Rt M92!F:6QL960@:6X@8GD@8G5I;&0N("!4:&4@