This procedure is called by “main” (1614) to initialise the buffer pool. Empty, doubly linked circular lists are set up:
for the “av”-list (“bfreelist” is head);
the “b”-list for null devices (“dev == NODEV”) (“bfreelist” is again head);
a “b”-list for each major device type.
For each buffer:
the buffer header is linked into the “b”-list for the device “NODEV” (–1);
the address of the buffer is set in the header (5067);
the buffer flags are set as “B_BUSY” (this doesn’t seem to be really necessary) (5072);
the buffer header is linked into the “av”-list by a call on “brelse” (5073);
The number of block devices is recorded as “nblkdev”. This is used for checking values for “dev” in “getblk” (4927), “getmdev” (6192) and “openi” (6720). Inspection of “bdevsw” (4656) shows that “nblkdev” will be set to eight whereas the value one is what is really required.
This result could be obtained by “editing” as follows:
/5084/m/5081/ "nblkdev=i; /5083/m/5077/ "i++