forked from chenshuo/old-minix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchanges.txt
1452 lines (1159 loc) · 59.7 KB
/
changes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Short list of differences between 2.0 and 2.0.4:
- The ability to run Minix under DOS.
- New and improved network task. More stable then the old inet, and
allows for user-space serial IP (PPP). ("Allows for" means that only
a simple SLIP daemon is supplied. Look for PPP elsewhere.)
- Network configuration changed from behind the times RARP to modern DHCP,
see boot(8).
- Disk like devices (/dev/hd*, cd*, sd*) changed to generic controller
names (/dev/c0d*, /dev/c1d*, etc.). Read controller(4) for the gory
details. Example: /dev/c0d0p1s0 is now what used to be /dev/hd2a!
(It may not seem like it, but this is a simplification.)
- The 4 gigabyte disk limit has been replaced by a 2 terabyte limit. (IDE
disks still limited to 128G though. Individual partitions also still
limited to 4G.)
- The Minix /bin/sh is replaced by the BSD shell (formerly /usr/bin/ash.)
Makes life easier (always line editing), but is also more memory hungry,
which is why we have:
- A simple form of swapping that may make life on really old crates
bearable. (Alas it isn't good enough to counter the memory need of
the BSD shell, so 2.0.3 and 2.0.4 need more than 640K in 16-bit mode.
This will be fixed in a next version, really.)
- Console driver lines/columns is no longer fixed at 80x25. (See boot
monitor's 'console' variable.)
- The 'cc' driver now does separate I&D by default. You need 'cc -com' to
get common I&D binaries. (Only the bootstraps really need this.)
- Its now enough to use 'cc -D_MINIX' to have all POSIX, common UNIX and
Minix extensions defined. (One used to use -D_MINIX -D_POSIX_SOURCE).
- In 16-bit mode, what used to be 'cc -m' is now the default. The new
'cc -m' behaviour is to change C code to K&R style before passing it to
the C compiler to reduce memory use even further.
- Support in MM for #! to name the interpreter in scripts. Random scripts
are no longer seen as shell scripts, #!/bin/sh is required.
- Startup scripts (/etc/rc, /usr/etc/rc) rewritten. Single user mode
(boot -s) to interrupt the boot process and do repairs. Daily
cleanup scripts that are run each night from cron, not just at
reboot. Minix can now run continuously. (Ignoring the little fact
that the clock tick counter will overflow in 414 days.)
- The monitor has a new 'off' command that turns ATX machines off. (Try
'shutdown -x off'.)
Short list of changes in commands:
- pc, m2: Pascal and Modula-2 compilers.
- readclock -w: Write the current time into the CMOS clock.
readclock -2: Add 20 years to compensate for a clock with a Y2K bug.
- Several old, useless or minix-only commands removed.
Short list of changes in manual pages:
- New: pc(1), m2(1), env(1), uptime(1), xargs(1), crontab(1),
rdate(1), rget(1), regex(3), dosd(4), ACK(7), cron(8),
config(8), dosminix(8), serial-ip(8), slip(8).
- Changed: cc(1), rhosts(5), installation manuals.
Important kernel changes in 2.0.4 needing clarification:
Two changes in the kernel may be a stumbling block for the innocent
reader trying to make sense of the 2.0.4 code with the 2.0 based book
in hand. One change is the share interrupt code needed for PCI, and
the other change is the more sophisticated timer code that makes life
easier within a driver.
The interrupt handlers used to be a simple array of function pointers
indexed by the IRQ. PCI requires shared interrupts, which means that
more than one handler may be called on an interrupt. So we have to
keep a list of several handlers, and we have to keep track of which
handler declares the interrupt to be "handled". Only if all handlers
say that the interrupt has been fully serviced can the IRQ be reenabled.
Each IRQ now has a list of little "IRQ hooks". An IRQ hook is a small
struct containing the following data: A pointer to the next hook to
form a list of handlers for the IRQ, a pointer to the function that
handles the interrupt, the IRQ number, and an ID bit.
When a hook is registered for an IRQ it gets a unique ID bit. An array
irq_actids[] contains the set of ID bits per IRQ that are still active,
i.e. the handler has not yet declared the interrupt to be fully
handled. Only if irq_actids[irq] == 0 is the IRQ reenabled. The
functions enable_irq() and disable_irq() now work on hooks instead of
IRQs, clear or set the ID bit of that hook, and make sure that the IRQ
is masked if irq_actids[irq] is nonzero.
The interrupt handler functions withing the drivers haven't changed
much, they still return true if the interrupt has been fully handled.
The only difference is that they must allow to be called when there's
nothing going on, because another device using the same IRQ has
triggered an interrupt.
The other big change is the timer code. There used to be one kind of
timer: You send a message to the clock task asking for a handler to be
called by the clock task (!) at a certain time. This setup is a bit
odd, because to start a timer you have to send a high level message,
but calling the handler was done using a low level function call from
the clock task.
Timers happen to be started very often, some drivers start one on any
operation if the device may choke on it. Most of the time the handlers
have nothing to do, because devices usually do as they're told. Also a
driver may handle more than one device, so it needs more than one timer.
The new timer code makes starting timers cheap, allows a task to have as
many timers as it wants, allows handlers to be run by the clock task
(asynchronous), or allows the handlers to be run by any other task
(synchronous).
The technique used for these timers is the same as for the shared IRQs.
A timer is a small lump of data that can be linked in lists, and
functions for starting, stopping and handling timers all work on this
bit of data. In this case the function interface is a better
description than the contents of timer.h (see kernel/type.h for that).
void tmr_settimer(timer_t *tp, int task, clock_t exp_time, tmr_func_t fp);
Activates a timer to run function 'fp' at time 'exp_time'. The
timer is owned and handled by the given task. The timer is added to
a list maintained by the clock. If it expires then it is added to a
list of expired timers for the task that owns it. If that task is
the clock then the handlers are immediately run, otherwise an
interrupt message is sent to the owning task.
void tmr_clrtimer(timer_t *tp)
Remove the timer from the active and expired timer lists, disabling
it. This is done if the timer is no longer needed, or more often
by tmr_settimer if a timer is set to a different time. (One often
doesn't bother to stop a timer if the handler can tell that its no
longer needed.)
void tmr_exptimers(void)
Runs the handlers of all the expired timers of the current task.
The clock task runs this function if any timer expires, and a task
should call it on an interrupt message if it owns timers. This
call is often prefixed by a quick test to see if there are any
expired timers, but that's only an optimization to avoid a call.
Each timer structure may carry a int or a pointer that can be used later
by the handler. A good example of the use of these timers is the floppy
driver. It has one timer per floppy to turn the motor off, and a global
timer for floppy spinup or to time out an operation. Search for 'tmr_'
in the code to find the uses. (The floppy is also a good example for why
the new timers were needed. After adding timeouts on any operation the
messages to the clock task took so much time that slower machines could
no longer keep up with the floppy and degraded to one sector per
revolution...)
The timers for the alarm() system call and the timers for the
asynchronous task have also been changed into using the new timer
code. The old code had separate code for these two that had to be
tested separately on any clock tick. Now it's all one type of timer.
(The synchronous alarm task is now more comment than code.)
Long list of differences between 2.0 and 2.0.4:
(Warning: This list is riddled with lame jokes and other silly things that
happen to sneak in when doing something as boring as compiling this list.)
include/ansi.h
Sets _POSIX_SOURCE if _MINIX is set. This means that just
'cc -D_MINIX' is enough to also add posix support. (Makes no sense
without anyway.)
include/configfile.h
New header file for the common configuration file format.
include/dirent.h
Include <sys/types.h> by itself. This fixes the bug that required
<sys/types.h> to be included before most things in C source files.
Many other standard include files also do this, but I won't bore
you by mentioning them here.
include/errno.h
Unused internal errors E_BAD_SRC and E_NO_MESSAGE removed.
include/ibm/cmos.h
include/ibm/portio.h
Definitions for the CMOS clock and IBM port I/O routines. The I/O
routines should have the same names as those used within the Linux
kernel and most of them are also seen in *BSD if I'm not mistaken.
The kernel now uses these routines instead of in_byte() etc. The
new naming is more regular instead of that of the old "add em when
we need em" routines.
include/ibm/int86.h
Defines 'union reg86', a type used to carry register values for
interrupt calls. Used by the BIOS and DOS drivers, and by the
experimental user mode BIOS calls.
include/ibm/partition.h
Unused older Minix partition type removed.
include/minix/boot.h
Removed. MM and FS use a new system call to get boot parameters, a
call that can also be used from user space (see svrctl and sysenv).
include/minix/callnr.h
New svrctl system call, an ioctl like call for servers and tasks.
Is used to implement small stuff for which a full blown system call
is too much honour.
include/minix/com.h
One task renamed (DL_ETH -> DP8390) and several changed from specific
names (CDROM, SCSI, WINCHESTER) to a generic controller name
(CTRLR(n)). The OPTIONAL_IO attribute is replaced by DEV_SCATTER
and DEV_GATHER device codes to write to or read from an array of
blocks. Appearance of the DOSDSK and RTL8139 tasks. FUNC_TO_CALL
removed with the old timer code.
include/minix/config.h
Release and version number changed from 3 digits to just 2. With
one release every so many years we don't need three levels.
ROBUST setting removed, because it is the opposite of robustness.
NR_CTRLRS added, specifying the number of controller tasks.
ENABLE_NETWORKING removed. The inet server is no longer part of the
kernel image. It is optionally started later as a program.
ENABLE_ATAPI added for the ATAPI (CDROM) support in the AT/IDE driver.
Cosmetic change of "ADAPTEC" in "AHA1540" in this and several other
files.
Added ENABLE_FATFILE and ENABLE_DOSFILE for two "file as disk" drivers.
ENABLE_DP8390 is a new master switch for the network drivers based
on the DP8390 chip. Code for specific cards can be turned on with
ENABLE_WDETH, ENABLE_NE2000, and ENABLE_3C503.
Atari and shadowing code removed. It's not used, so I can't maintain
it working with respect to other changes.
Release and version numbering changed back to 3 digits. ENABLE_SWAP
added to turn the swapping code on. (Not that you want it off,
because memory starved machines need it and memory rich machines
don't care. It's just something to label the swapping code with.)
Added ENABLE_PCI to enable PCI support for drivers that need it.
Added ENABLE_RTL8139 for the new Realtek 8139 100 Mbit ethernet card.
NR_RS_LINES can now go to 4. (Shared IRQs made that possible.)
include/minix/const.h
Copyright changed to tell you that /usr/src/LICENSE contains the new
BSD style license. "Do what you want with this, but don't mention
us, and don't blame us for anything" is what us normal people think
the lawyers are saying there.
CLICK_SIZE increased from 256 to 1024 to make swapping to disk more
efficient. Has the side effect of increasing the maximum addressable
memory in 16-bit protected mode to 64 MB. (You need 512 processes
of 128K to reach that amount. The process tables can't possibly
be that big.)
include/minix/ioctl.h
Contains helper macros and the definition of ioctl(). Used by the
many <*/ioc_*.h> include files that <sys/ioctl.h> has split into.
include/minix/partition.h
Partition base and size are now u64_t, a structure posing as a 64
bit number.
include/minix/swap.h
Describes the header used on swap files/partitions.
include/minix/u64.h
A buch of routines for 64 bit operations. There is no 'long long',
so we have to make do with this.
include/net/
Complete overhaul for the new network task.
include/regex.h
POSIX regex library header file.
include/regexp.h
Names prefixed by _v8_ to keep them from clashing with the POSIX
version.
include/signal.h
SIGCHLD signal (child terminated) added to the supported set. _NSIG
raised from 16 to 17.
include/stdio.h
Added snprintf() and vsnprintf() to help code to combat buffer
overflows.
include/string.h
Added strncasecmp() and strnlen().
include/sys/ioc_disk.h
include/sys/ioc_memory.h
include/sys/ioc_scsi.h
include/sys/ioc_sound.h
include/sys/ioc_tape.h
include/sys/ioc_tty.h
What <sys/ioctl.h> has been split into.
include/sys/ioctl.h
Some new calls for the network task.
New calls for user mode BIOS calls and manipulating LDT entries
(memory mapping.)
Mitsumi CD-ROM ioctls removed.
Changed to include <minix/ioctl.h> and all <*/ioc_*.h>. Code using
<sys/ioctl.h> sees no difference. Minix specific code may choose to
only include those among <*/ioc_*.h> that it really needs. Mostly
to reduce memory needed by the preprocessor, but also for data
hiding reasons. (Only use the minimum you need.)
include/sys/svrctl.h
New svrctl for odd system calls: Calls for a program to sign on as
a server (inet), swapon/off, get boot parameter.
include/sys/types.h
New u64_t type defined as a struct of two u32_t's. Number of links
type nlink_t changed to a short so that more than 127 links can be
made on a V2 file system, something it supported all along, but FS
didn't offer it.
src/LICENSE
Removed: "Free for educational use" license.
Added: "Free for any use" BSD style license.
src/Makefile
You can now make 'world', 'libraries', 'all', and 'install'. Just
type 'make' to see what each does.
src/boot/
Edparams command merged into boot.c, block caching removed to reduce
complexity, simply "one command" functions don't need {}, 'memsize'
and 'emssize' removed in favour of 'memory', new 'leader' and 'trailer'
functions to print greeting messages.
A20 enable/disable code in boothead.s has special code for PS/2
machines.
Bootblock no longer fiddles with the floppy parameters. Really old
crates that expect this no longer boot without a workaround. New
systems that do not expect this now work.
Sit in a HLT to save power while doing nothing.
Use new BIOS calls to break the old 8G BIOS barrier. Limit now 2T.
BOOT.COM and MKFILE.COM code ported from Minix-vmd.
Extboot code replaced by more generic jumpboot bootstrap.
Knowledge of controller style devices added, while remaining
backwards compatible to I don't know when.
New 'off' command to turn machines that can do power management off.
New 'ctty n' command to duplicate the monitor I/O on serial line <n>.
More console modes supported, like 80x34 for instance.
src/commands/aal/
Added 'u' flag to make aal more ar compatible.
src/commands/ash/
Ash no longer runs any old file as a script if it has executable bits.
It leaves this to execve(), and execve only runs scripts that start
with #!.
Don't turn on -e or -x until .profile is done.
src/commands/cron/
New cron backported from Minix-vmd. Has per-user cronjobs and stuff.
See cron(8) and crontab(1).
src/commands/dhcpd/
New DHCP client/server program. See dhcpd(8) and dhcp.conf(5).
Since 2.0.4: Server code has seen and supports more weird clients,
client code more resilient against buggy servers.
src/commands/ftpd/
Allows clients without reverse DNS. Given up on trying to improve
the world on this point. There are worse things. Leave passwd and
group file out of chrooted environment to give spammers no names.
src/commands/i386/asmconv/
GNU assembly parser added by R. Veldema, but still buggy. Fixes
by Will Rose not yet incorporated. (I totally forgot about this
until I saw it here while I compiled this list for 2.1.)
src/commands/i386/mtools-3.9.7/
New mtools command to operate on FAT file systems to replace the
buggy dos{dir,read,write} on 386+ systems with enough memory.
Type 'mtools' to see how it works. The manual pages were junk,
so the're not added. With -? you can figure it all out.
(I really should start a commands/big hierarchy.)
src/commands/i86/cc.c
ASCII EM parser added to translation tables. "What's that?", you
say? ACK translates from high level to an abstract machine, named
EM, which in turn is translated to the target machine. The ability
to compile ASCII EM code is nice for machine independent libary
files written in EM assembly.
Made 'cc -m -i' the default. Repaired the irrel pass (-m) to not
choke on big functions, and made it able to turn a standard C file
to K&R for the new -m flag.
src/commands/ibm/
Removed the Mitsumi stuff (cdplay, etc.).
src/commands/ibm/loadfont.c
Changed to be able to load the appropriate font from a combined font
file, a file that contains 8x8, 8x14, and 8x16 dot fonts. Font
files in /usr/lib/fonts/ replaced by combined fonts.
src/commands/ibm/loadkeys.c
Work on /dev/console instead of standard input, which made no sense.
src/commands/ibm/part.c
Changed to know about controller devices and 64 bit disk offsets.
Larger list of major device numbers to know disks from other stuff.
Still user-hostile/expert-friendly.
src/commands/ibm/partition.c
Now able to add a partition to an existing table. Not easy to use
alas.
src/commands/ibm/readclock.c
Revamped to properly set the clock (Philip read a data sheet), and
a Y2K kludge to add 20 years to a clock set 20 years back because it
can't run in 2000. (Options -w and -2.)
Reads a TZ boot variable that tells the timezone of the hardware
clock. Use 'TZ=GMT0' and forget about summer and winter time
changeovers. (Windows will go bonkers, of course, which is why
my Windows systems use the timezone of Casablanca. Windows doesn't
know what time it is no matter what timezone you use.)
src/commands/make/
An "include" command added to the syntax. Timing problem on fast
machines fixed.
src/commands/reboot/
Log shutdown messages in /usr/adm/log instead of authlog. (Reduces
the number of logfiles to one.)
src/commands/rlogind/
Renamed 'rld' to 'rlogind'. Changed for the new .rhosts that allow
wildcards and CIDR notation. More secure against DNS trickery.
src/commands/scripts/DESCRIBE.sh
src/commands/scripts/MAKEDEV.sh
Code to describe/create new ethernet and controller devices added.
src/commands/scripts/cd.sh
A script for all the commands builtin to the shell. Simply lets
the shell do the work. Thanks to the new #! stuff in MM this can
work. Does [, cd, command, echo, expr, false, getopts, read, test,
true, umask, and wait. Does away with any C code for same.
src/commands/scripts/clear.sh
Short for 'tget -str cl'. Replaces clr.c thanks to #!.
commands/scripts/mkdist.sh
Changed a bit so that Minix-vmd can call it. Can now build
distributions under Minix-vmd of a Minix system mounted by it.
src/commands/sh/
Old Minix shell. Now installed as /usr/bin/msh.
src/commands/simple/at.c
Still puts an at job in /usr/spool/at/, but alerts cron to this
instead of letting the now dead atrun command run the job.
src/commands/simple/atrun.c
Removed. Cron now keeps track of and runs at jobs.
src/commands/simple/cat.c
Proper option processing, proper error messages.
src/commands/simple/cleantmp.c
New command to carefully clean out /tmp directories.
src/commands/simple/cp.c
Uses a temp file for hard link administration so that it no longer
blows up trying to keep track of too many hard links. Some mistakes
in 'clone -s' fixed.
src/commands/simple/crc.c
Use strerror() to print a meaningful error message instead of just
"cannot open". Not a very spectacular change, but I wanted to pay
attention to this, as many programmers still have lousy error
reporting in their code.
src/commands/simple/date.c
Added a bit of silliness in the form of a -S flag. It gives the
time as "eternal september". September used to be the time that
new, uneducated, college students learned about the net. With the
start of Prodigy and AOL close to september 1993 some say that
that month never ended. It's Sun Sep 2805 17:28:16 CEST 1993 when
I write this. :-)
src/commands/simple/df.c
Replaced by the Minix-vmd version that has many more options, including
POSIX mandated 'df -P'.
src/commands/simple/ed.c
Added 'ed -s' as a synonym for 'ed -'. Fixed a bug with character
classes that went unnoticed for an amazing time. (Using two regular
expressions went bad on the second.)
src/commands/simple/env.c
New environment manipulation command. Not very useful, but POSIX
mandates it. Useful for one thing though, #!/usr/bin/env perl
at the top of a script does a PATH search for perl!
src/commands/simple/fsck.c
"Huge directory" warnings removed. Directories really can get big.
Errors with overflows on filesystems with exactly 65535 inodes fixed.
LINK_MAX changed to SHRT_MAX to allow for more links on a V2 file
system. (LINK_MAX has to advertise the smaller V1 maximum.)
src/commands/simple/fsck1.c
LINK_MAX replaced by CHAR_MAX just in case...
src/commands/simple/getty.c
Run a shell on the console if you can't execute login. Shrunk to
the bare minimum by removing the useless suspend/resume signals.
src/commands/simple/grep.c
Grep fix to work properly as grep and also as egrep. I believe
Michael Haardt gave me the patches.
src/commands/simple/hostaddr.c
Changed to use data gathered by DHCP.
src/commands/simple/intr.c
Used in /etc/rc to connect a program back to the console, because
/etc/rc is now run completely disconnected to keep programs from
having a process group and dying when /etc/rc is done.
src/commands/simple/id.c
Merged with the Minix-vmd version, no difference in function.
src/commands/simple/in.rshd.c
Like in.rlogind changed for the improved .rhosts.
src/commands/simple/irdpd.c
Old "look for a router" daemon. Still available for odd cases, but
replaced by DHCP normally.
src/commands/simple/isoread.c
Fixed by Al Woodhull so that it now actually works. Added a new -B
command to print byte offsets and lengths of a file on a CD. Useful
to build a Minix partition table on an ISO image that points into
disk images on that CD. Helpful to create a bootable CD.
src/commands/simple/kill.c
You can now use 'kill -HUP' instead of 'kill -1'. See signal list
in sigaction(2).
src/commands/simple/last.c
Show time since boot if called as "uptime".
src/commands/simple/login.c
Can now print a welcome banner for in.telnetd.
src/commands/simple/look.c
Replaced by the Minix-vmd version, same function.
src/commands/simple/lpd.c
Small changes in special character handling. Still too stupid to be
useful.
src/commands/simple/ls.c
The -T option shows time to the second. -D (formerly -T) sorts by
file type. -h shows sizes abbreviated. This is a halfbaked ls,
whole alphabet still far from fully used as option letters.
src/commands/simple/mail.c
Added -s option by Al Woodhull. Cron needs it send send mail to a
user if a cron job produces output.
src/commands/simple/man.c
Aren't you happy to know that it now also handles Solaris 8 manual
pages?
src/commands/simple/mkdir.c
Allows you to write 'mkdir -m 755' too. The -m option used to only
do symbolic modes, as if anyone can remember how.
src/commands/simple/mkswap.c
New command to initialize swap partitions or files as such.
src/commands/simple/mount.c
src/commands/simple/umount.c
Let mount and umount turn on/off swapping with -s.
src/commands/simple/nonamed.c
Use the name daemons found by DHCP for information.
Added a cache to make it useful for offline use.
src/commands/simple/pr_routes.c
Shows interface device names instead of their IP addresses, and shows
destinations in CIDR notation. One route fits on one line now.
src/commands/simple/printf.c
New command that is works like the printf() library function. It's
a new echo that doesn't suffer from BSD vs SystemV incompatibilities.
(Under SystemV the behaviour of 'echo -e' is the default.)
src/commands/simple/rarpd.c
Dumbed down to be a pure RARP daemon. It used to configure the
network devices, but that is now dhcpd's job.
src/commands/simple/rdate.c
Gets the time from a remote machine and sets the local clock.
src/commands/simple/rget.c
The rget and rput command pair implement a kind of pipe across a
network. Used a lot by yours truly.
src/commands/simple/slip.c
Implementation of the SLIP protocol, but no header compression.
Merely an example of Pseudo IP network device programming. Real PPP
programs can be obtained at the other side of the world.
src/commands/simple/stat.c
New command that is the shell level equivalent of the stat(2) system
call.
src/commands/simple/stty.c
Taught about pixel sizes, mostly useful to guess the console font
size.
src/commands/simple/sysenv.c
New command to show the boot environment with the help of the svrctl(2)
system call. Just type 'sysenv'.
src/commands/simple/tcpd.c
Has a normal and a paranoid version. The latter is run if
/etc/serv.access exists to enable network access restrictions.
No longer wrongly masks SIGCHLD under 2.0.4.
src/commands/simple/xargs.c
New xargs command obtained from BSD.
src/commands/urlget/
New command to get a file from a Web or FTP site.
src/etc/hostname.file
This and more files added as defaults to fill /etc/ with (mkdist).
src/etc/inet.conf
New configuration file for inet.
Changed under 2.0.4 to use /dev/psip0 as the default.
src/etc/profile
Timezone now by default GMT instead of CET. (I happen to be in
The Netherlands, i.e. the CET timezone. You shouldn't be bothered
by that fact.)
src/etc/rc
Large changes in system startup. /etc/rc now knows a single user
mode (boot -s) and calls /usr/etc/rc to do the hard work. (Inspired
by Minix-vmd.)
src/fs/
The 'dont_reply' variable has been removed. The code now passes the
error code "SUSPEND" back up to the main loop, which is treated by
FS as "don't send a reply message now, the process is suspended".
It's not always mentioned below if { dont_reply = 1; return(0); }
is replaced by { return(SUSPEND) };
src/fs/Makefile
FS is now needs the -lsys library for calls to the system task.
src/fs/cache.c
The scatter/gather I/O has been rewritten. It used to use a vector
of individual (position, buf, nbytes, read/write) requests. This
was too rich for the way it was used. Now a single starting disk
position is used, its all reads (GATHER) or all writes (SCATTER)
and the vector only describes memory as (address, size) pairs.
So one big disk block is read into a bunch of memory blocks, or
written from a bunch of memory blocks. (In retrospect the gather
= read and scatter = write names should have been reversed. "Gather"
just reminds one too much of reading and scatter of writing.)
One important point is that the device drivers only need to do the
first element of the memory vector, the rest is optional. So
a floppy disk driver may stop at the end of a track. The write
code in cache.c knows this and will repeat a scatter operation
until all the dirty blocks are written out.
src/fs/device.c
The interface to the devices has been improved. In order to "open"
a device one used to do this:
major = (dev >> MAJOR) & BYTE;
task = dmap[major].dmap_task;
dev_mess.m_type = DEV_OPEN;
dev_mess.DEVICE = dev;
dev_mess.COUNT = R_BIT|W_BIT;
(*dmap[major].dmap_open)(task, &dev_mess);
r = dev_mess.REP_STATUS;
All this tedious code has been replaced by:
r = dev_open(dev, FS_PROC_NR, R_BIT|W_BIT);
In many places in FS one can find dev_open() and dev_close()
replacing the seven line equivalent. The existing dev_io()
routine has had its arguments rearranged a bit, but is basically
unchanged. (Only the specific "nonblock" flags became a generic
"flags" field.)
The dev_*() routines use the dmap[] table to interface to a several
kinds of devices. Usually its gen_opcl() and gen_io() for generic
devices. (Note that separate open and close routines have been
mapped to a single opcl.) Some devices require special processing,
so there is tty_opcl() for terminals to do "controlling terminal"
stuff, ctty_*() for /dev/tty, and clone_opcl() for the TCP/IP
server.
Ergo:
dev_open(), ---> dmap_opcl ---> gen_opcl(), tty_opcl(),
dev_close() ctty_opcl(), clone_opcl()
dev_io() ---> dmap_io ---> gen_io(), ctty_io()
The *_opcl() functions also use dev_io()/dmap_io to pass there
request down to the device after doing special open/close processing.
(Whether they use dev_io() or dmap_io depends on what is convenient
at a given point in the code. Dev_io() builds a message and chooses
the proper dmap[] entry, something one may have already done.)
src/fs/glo.h
Definition of 'dont_reply' removed.
src/fs/inode.c
Some casts and masks on i_nlinks removed to allow i_nlinks to have a
larger value for V2 file systems.
src/fs/link.c
Links maximum now depends on the file system type. CHAR_MAX or
SHRT_MAX is used instead of LINK_MAX.
src/fs/main.c
Main now uses the new sys_sysctl() call to get boot parameters out
of the kernel. (Sys_sysctl() is the kernel interface of the new
svrctl() system call.) The old SYS_GBOOT call to get some boot
parameters is dead. Variables like ROOT_DEV that aliased boot
parameter fields have been renamed to root_dev.
A special process ID value PID_SERVER has been invented to mark
processes that are or have become a server, like MM, FS and INET.
Many examples of the new dev_open() and dev_close() found here.
Don't send a reply if the message return code is SUSPEND.
src/fs/misc.c
Addition of the FS side of the new svrctl() system call. It
implements the FSSIGNON call that allows a process to tell FS that
it is becoming a server and that it wants to handle a given
group of devices in a given way. (I.e. "generic", "as a terminal",
"clone on open". The latter is for inet, where each open of a
TCP/IP devices causes a new device inode to spring to life for the
new TCP/IP connection.
Do_reboot() now carefully exits all processes and unmounts all
filesystems. This should take care of mysterious bitmap errors
that plagued 2.0.3.
src/fs/mount.c
Unmount code put in an unmount() function that both the umount
and reboot system calls can use.
src/fs/open.c
Pipe administration moved to the proper first two different zone
number slots in the in-core inode. Leave last zone number free.
Named pipe open code allows for a SUSPEND code out of pipe_open().
This is the only place where removal of dont_reply was a bit tricky,
although the result is no less readable.
src/fs/pipe.c
The totally unused XOPEN code removed. There is a dmap[] call
here that I dare not replace by dev_io(). Too strange.
Return a SUSPEND code if suspend(XPIPE) is done.
src/fs/read.c
Unneeded check of rw position against MAX_FILE_POS removed. It
caused I/O of more than 4G through character devices to fail.
(Many character devices don't even care about the position.)
(Found by people doing I/O speed tests. Today's hardware is so
ridiculously fast that they ran into the limit in no time.)
Follow suspend(XPIPE) with a return(SUSPEND).
src/fs/table.c
Svrctl call added. Dosdisk table entry added. Open and close dmap[]
entries merged into a single opcl field. (They mostly contained
the same value already.) The /dev/ip entry is now always unused,
but can be claimed by INET later.
Reboot system call added, only to be called by MM.
src/fs/type.h
Types of d1_nlinks and d1_gid changed to u8_t, because they're
smaller than the new default set by the V2 file system.
src/inet/
Replaced by a much newer version. Stable, two ethernets and two
pseudo IP networks for serial IP for instance. For 2.0.3 the
startup code was changed to allow the program to start as an
ordinary program, to configure itself from /etc/inet.conf and to
become a server with a few svrctl() calls.
src/kernel/
I/O functions like in_byte, out_byte, in_word, etc, replaced by inb,
outb, inw, etc. Use of <sys/ioctl.h> replaced by as few <*/ioc_*.h>
as possible. Milli_{delay,start,elapsed} replaced by micro_*
versions that allow more precise polling. These simple changes
aren't always noted below. The timer code changes are not always
mentioned except for their first occurrence.
src/kernel/3c503.[ch]
Code and definitions for the 3C503 network adapter by G. Falzoni.
src/kernel/aha1540.c
The file aha_scsi.c is renamed to aha1540.c to better reflect the
type of card. Useful if someone with lots of time writes a 2940
driver, so they won't clash in name.
src/kernel/*_wini.c
Each of the disk drivers can be tied to any of up to four controller
tasks through the boot monitor (c0=at, etc). To make this possible
the task number is no longer hardcoded.
The schedule/finish routines have been replaced by a single transfer
function. The abstraction went too far. The schedule function
usually did nothing but recode the I/O vector in a different
structure (struct trans) and hand it over to finish. Now this is
all done by transfer(). (Pity this schedule/finish mistake has been
immortalized in the second book. That's the problem with such major
mistakes, they never really go away.)
The transfer function now has to work with the simplyfied I/O vector.
This makes these questions unnecessary: "Byte positions still
consecutive?", "I/O direction still the same?", "Is this part of the
vector optional?"
64-bit byte position computations. Common code like this:
block = (w_dv->dv_base + pos) >> SECTOR_SHIFT;
Has due to the lack of a built-in 64-bit type been replaced by this:
block = div64u(add64ul(w_dv->dv_base, position), SECTOR_SIZE);
See the int64(3) manual page for a list of these 64 bit routines.
src/kernel/at_wini.c
Addition of ATAPI CD-ROM code by Michael Temari. (His changes were
fairly benign. Blame me for the huge differences.)
The port_read() and _write() functions are renamed to phys_insw()
and _outsw(). There are also plain insw() and outsw() that move
data to the local address space, the phys_*() are special versions
for kernel use that move data to or from absolute memory addresses.
Sort of like the difference between memcpy() and phys_copy().
Timer code changed from:
clock_mess(WAKEUP, w_timeout);
To:
tmr_settimer(&w_tmr_timeout, CLOCK, get_uptime() + WAKEUP, w_timeout);
(Start an asynchronous timer with data in w_tmr_timeout, WAKEUP
ticks from now to call function w_timeout().)
src/kernel/bios_wini.c
Old bios13 calls removed in favour of the newer, more generic,
int86 call. (Drivers can now make any BIOS call they want.)
This driver is still the most easily understood of all drivers.
Read it first if you want to study disk drivers.
2.0.4 fixes an obscure bug in the use of 'al'.
src/kernel/clock.c
Old timer value returned by alarm(2) rounded up to the nearest second.
Alarm should never return 0 if the timer is still running.
Next_alarm, watch_dog[], sys_table[] all gone in favour of a single
list of timers under 'timers' and a single list of user process
alarms in tmr_alarm[].
The one global message 'mc' is moved to clock_task() as a local
variable and the do_xxx functions that need it now take a message
pointer. Data hiding, limited scope, and all that.
Do_clocktick() only cares about one list of timers now, sees which
ones have expired, moves those to p_exptimers of the owning process
and runs tmr_exptimers on the timers that are owned by CLOCK itself.
Tmr_inittimer(), a macro, initializes a new timer variable, but
this is not necessary on a timer in global storage, so it's
hardy ever used. Tmr_settimer() clears a timer if running and
then starts it to expire at a certain time. Tmr_clrtimer()
stops a timer. Tmr_exptimers() runs all functions of the
expired timers on the p_exptimers list of the current process.
A common variable in the timer code is 'atp', or "alias to a timer
pointer" that is set so that '*atp' aliases the first pointer in a
timer list {atp = &p->p_exptimers;}, moved to alias the next timer
in the list {atp = &(*atp)->tmr_next;}, used to cut out a timer
{*atp = (*atp)->tmr_next;}, or to insert a timer
{tp->tmr_next = *atp; *atp = tp;}. That's easier than walking a
list with a prev_ptr in tow. Really.
The do_setalarm and do_setsynalarm functions have been merged into
one function that schedules the cause_alarm or cause_synalarm to be
called by either the CLOCK or the SYN_ALRM_TASK. The timers used
for this are found in the tmr_alarm[] array for each process.
Cause_alarm() uses cause_sig() to have a SIGALRM be sent to the
process that wants it. Cause_synalarm() sends a CLOCK_INT message
to the calling process, which is usually a server like INET. The
syn_alrm_task()'s only job is to expire timers.
All the milli_xxx functions have been replaced by micro_xxx
functions that only differ in the factor 1000 implied by the name.
Some drivers need more precise timing. A milli_delay(n) macro that
calls micro_delay(1000*(n)) keeps us from having to update too
much code. Note the last few lines at the end of micro_elapsed(),
avoiding overflow in computations with large numbers can be tricky.
These changes cause a few timing constants to be 1000 times bigger
in several drivers.
src/kernel/console.c
Screen dimensions (rows/columns) now variable and obtained from the
BIOS tables. This makes it possible to run the console in 132x43 if
the video card permits. Reverse video bug fixed. Report screen
pixel sizes in termios struct.
src/kernel/const.h
IRQ vectors renumbered to 0x50 (more or less free) and 0x70 (same
as BIOS). This does not upset DOS.
Unused INIT_SP macro removed. A leftover from the time when MM, FS
and init had to set up their own stack.
Lock() and unlock() changed to macros that call intr_disable() and
intr_enable() found in <ibm/portio.h>. They are mostly used to
guard an area of code against interrupts, so the lock/unlock names
better describe what they're doing. Or are we hiding their true
nature here?
A new macro structof() can be used to compute the address of a
structure given a pointer to a field within that structure. Used
in functions that have a struct with information per device and a
timer per device. With structof() we can go from timer pointer
to a pointer for the struct with information. Don't worry, it's
only used in a few drivers.
src/kernel/dosfile.c
New driver to see a big DOS file as a Minix disk using DOS file I/O.
src/kernel/dp8390.c
Allow the DPETHn variables to specify a PCI device, namely the
RTL8029 NE2000 clone.
src/kernel/driver.c
Changes to allow one task to make I/O calls to another task, like
dosdisk to at_wini. The do_rdwt and do_vrdwt rewritten to use
transfer instead of schedule/finish.
The main loop calls tmr_exptimers() and the clock_mess() function
is gone.
src/kernel/fatfile.c
New driver to see a big file on a FAT file system by interpreting
a FAT file system directly to find the blocks of a file.
src/kernel/floppy.c
Loose arrays carrying floppy parameters merged into one array of
structs. Some parameters (like start times, head settle times)
increased a bit after observing reference manual. (Not that the
old parameters ever seemed to be a problem.) Series of fdc_out()
calls replaced by a single fdc_command() with better checking.
After changing the floppy parameters to "better" number for 2.0.3
that came directly out of some spec sheet the numbers are now back
to what they were and what actually works. If it works, don't fix it.
Thanks to Mike Haertel the floppy driver works again on an original
IBM PC/AT. It's floppy controller didn't like to seek to a cylinder
it was already sitting on.
Floppy motors are now independently stopped thanks to the new timers.
Before there was only one timer, so motors, once started, were kept
running until all could be stopped. (This at a time when many PCs
don't even have a floppy anymore, let alone more than one.)
src/kernel/glo.h
The old irq_table[] for one handler per IRQ is replaced by a list
of interrupt hook pointers in irq_hooks[] and bitmaps for the active
handlers in irq_actids[].
src/kernel/i8259.c
As the file with code that interfaces with the i8259 interrupt
controller you can expect a few changes for shared interrupts.
Get_irq_handler() was never used and spurious_irq() no longer needed,
so they're gone.
Put_irq_handler() now takes the address of an interrupt hook and
chains that hook into a list of hooks for an IRQ. It computes a