[comp.os.minix] Init.c speed setting patches

cwr@pnet01.cts.com (Will Rose) (08/14/90)

I got tired of hitting keys to change speed when logging on via getty, and
so added code to init to make it run getty at the default speed given in
/etc/ttys; while I was at it, I allowed comments to exist on any line of
/etc/ttys, tho' the significant characters must still be a) at the start of
a line and b) in tty order.  Judging by the questions, /etc/ttys is one of
the more obscure files for beginners, and a few comments in it might help.
 
The changes add about 200 bytes to the code, and 300 to the stack.  They
seem worth it.  Below is a cdiff against 1.5.10, compressed and uuencoded.
 
Good luck - Will
==============================================================
table
 !"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
begin 644 init.cdif.Z
M'YV-*@*"2.,F#1T78US$J!$#1@(J=<J " )'#@@9-"[.T%$CAXZ&(&+DR %#z
M08N3 PL>').@R1LW$^N<"3GCH@R.-W3,J"F2I(* 0(,*5?%38 T9+#J""*H y
M!(@19,J8(2CQ2!$J5+(D2"#B11DZ8UZ<^4HGCX@$+U2 L(HU"P@S;RR221.&x
M#8@D3EX\J4)EZ8NF( !#E4H5!)0D1*8P>4)E2@(<6].":!,&3YHV==J <)-9w
M3!F+;\R H%-V#H@R;NC(25/&M(J_(9Y&G>I&8MLI0JH8V8H"QU+#B!4SGI("v
MK5HQ=<R8^?PV+@@Y9<+,=3/3*]@7I/.XABV;<&T04Z@$&;)D2A(M11*@$"GCu
M]YPT>LJ$1C$&31B+*E(4ETS0X G3<] 1QAAK^ 688+,55@0625#Q15M&!)$$t
M$PG(4,,,D:E57QILD &"?1Y6](88;)31AFEW&(3&:&49Z-1@M$FT8(-?+%C$s
M$!%.6&$--&0(PH8=_OA&'1VZ<0(=I^%1QA@@S/%&&U^A0=!,KYF$TE%)Y0#"r
M22<AZ%U55V6U55=?A356=F=)QE96S<E%EUUXZ<67BX&]F.!WAR6V6&./^4B9q
M99AIQED;GH$F6G:FH:8::]LI$!N,A=V6VVZ/.60<",@IQQQ<%D$GW90@6!<6p
MH@8^>J=$X8U7WGG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BVJXC>J!-8J?T*J'VRJ)Na
'X*+"!Z,' J()z
 y
end
--------------------------------------------------------------
"And in that heaven of all   | Will Rose
  their wish, there shall be | UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!cw
  no more land, say fish."   | ARPA: crash!pnet01!cwr@nosc.mil
  Rupert Brooke.             | INET: cwr@pnet01.cts.com

UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!cwr
ARPA: crash!pnet01!cwr@nosc.mil
INET: cwr@pnet01.cts.com

ast@cs.vu.nl (Andy Tanenbaum) (08/14/90)

In article <3934@crash.cts.com> cwr@pnet01.cts.com (Will Rose) writes:
>I got tired of hitting keys to change speed when logging on via getty, and
>so added code to init to make it run getty at the default speed given in
>/etc/ttys

Does this mean that dynamic speed selection is now disabled (I haven't
had a chance to inspect the fix)?  If so, I'm not sure if this is better
or worse.

Andy Tanenbaum (ast@cs.vu.nl)

archer%segin4.segin.fr@relay.prime.com (Vincent Archer) (08/16/90)

Will Rose <cwr@pnet01.cts.com> says:
> [stuff about getty]
>                              Judging by the questions, /etc/ttys is one of
> the more obscure files for beginners, and a few comments in it might help.

I agree with you, ttys is the strangest and most obscure configuration file,
yet the most important. The recently posted man.4 somewhat explains how to
alter it, but that's neither simple nor straightforward for the novice user.

Better yet: discard /etc/ttys in favor to a /etc/inittab! My patched (but not
yet de-bugged) tools/init.c uses /etc/inittab if there's one to be found, then
falls back to /etc/ttys. That way, the INIT process can replace the master(1)
server, and several different commands can be run on various ttys rather than
only login/getty (for example hangup, my program that reinitialises the modem
at the end of the RS232, then wait for a ring indication, connect the modem
and THEN execs itself to getty; pretty useful for a BBS).

If all bugs regarding utmp/wtmp disappear, then I'll post patches to init next
week (or the week after).


    Vincent


Vincent Archer             | Email:archer%segin4.segin.fr@relay.prime.com
"People that are good at finding excuses are never good at anything else"