Subject: RE: ramdisk creation problems
To: 'Neil A. Carson' <efoo@crl.dec.com>
From: Edwin Foo <efoo@crl.dec.com>
List: port-arm32
Date: 12/12/1998 21:37:46
Thanks Neil for the heads-up.

I successfully patched mdsetimage.c to implement the workaround -- ramdisks
now load fine into the kernel. If anyone else has a use for this, here is
the diff between my temporary solution and mdsetimage.c from -current as of
19981211:

bash-2.02# diff mdsetimage.c mdsetimage.c.orig
56,58d55
< /* HACK for broken kernel page fault handlers */
< #include <strings.h>
<
157d153
< #ifdef NORMAL_OPERATION
165,181d160
< #else
<       /* make a temporary buffer to hold the ramdisk, then bcopy it */
<       {
<       void *tmpbuf = malloc(fssb.st_size);
<       if ((rv = read(fsfd, tmpbuf, fssb.st_size)) != fssb.st_size) {
<               if (rv == -1)
<                       err(1, "read %s", fsfile);
<               else
<                       errx(1, "unexpected EOF reading %s", fsfile);
<       }
<       printf("done copying into tmp buffer.\n");
<       bcopy(tmpbuf, mappedkfile+md_root_offset, fssb.st_size);
<       printf("done with the bcopy\n");
<       free(tmpbuf);
<       }
< #endif

-Edwin

-----Original Message-----
From: Neil A. Carson [mailto:neil@causality.com]
Sent: Saturday, December 12, 1998 7:24 PM
To: Edwin Foo
Cc: 'port-arm32@netbsd.org'
Subject: Re: ramdisk creation problems


mdsetimage on the ARM with UVM is stuffed; this is due to the page
paults not being handled properly by the kernel when mdsetimage copyouts
the data into the mmap()ed kernel image.

The unfortunate solution right now is to get mdsetimage to read into a
buffer and then bcopy that buffer into the mmap()ed kernel. This is on
the to-fix list.

-- 
Neil A. Carson