The code for handling the messages buffer wasn't up to date in the 2.7
source. Access to /kern/msgbuf would hang the system and dmesg would
just fail with illegal address. This patch fixes both problems.
Apply by doing:
cd /usr/src
patch -p0 < 020_pmax_msgbuf.patch
/*
@@ -147,7 +148,6 @@
#else
int bufpages = 0;
#endif
-int msgbufmapped = 0; /* set when safe to use msgbuf */
int maxmem; /* max memory per process */
int physmem; /* max supported memory, changes to actual */
int physmem_boardmax; /* {model,simm}-specific bound on physmem */
@@ -678,10 +678,10 @@
/*
* Initialize error message buffer (at end of core).
*/
- maxmem -= btoc(sizeof (struct msgbuf));
+ maxmem -= btoc(MSGBUFSIZE);
msgbufp = (struct msgbuf *)(MIPS_PHYS_TO_KSEG0(maxmem << PGSHIFT));
- msgbufmapped = 1;
-
+ initmsgbuf((caddr_t)msgbufp, round_page(MSGBUFSIZE));
+
/*
* Allocate space for system data structures.
* The first available kernel virtual address is in "v".
@@ -792,6 +792,11 @@
pmapdebug = 0;
#endif
+ for (i = 0; i < btoc(MSGBUFSIZE); i++)
+ pmap_enter(pmap_kernel(), (vm_offset_t)msgbufp,
+ maxmem + i * NBPG, VM_PROT_READ|VM_PROT_WRITE, TRUE,
+ VM_PROT_READ|VM_PROT_WRITE);
+
/*
* Good {morning,afternoon,evening,night}.
*/
@@ -1195,6 +1200,7 @@
dumpsys()
{
int error;
+ extern int msgbufmapped;