[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- Kernel: type 12 trap, code=3D0
Best Regards
Ouyang kai=B4=D3=CD=F8=D5=BE=B5=C3=B5=BD=B8=FC=B6=E0=D0=C5=CF=A2=A1=A3M=
SN Explorer =C3=E2=B7=D1=CF=C2=D4=D8:http://explorer.msn.com/lccn
------=_NextPart_002_0004_01C20A4F.BD05C000
Content-Type: text/html; charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<HTML><BODY STYLE=3D"font:10pt verdana; border:none;"><DIV>Hi,</DIV> <DIV=
>Very thank your help! Now the box can boot. <BR>I have some other proble=
ms about proc and thread.<BR>From the FreeBSD5.0 viewpoint, there are rea=
l thread in kernel, there are associated with KSE.<BR>So many functions p=
arameters change from proc to thread.<BR>There is the function in RAIDFra=
me in FreeBSD4.x. </DIV> <DIV>int raidlookup(path, p, vpp)<BR> char&=
nbsp; *path;<BR> struct proc *p;<BR> struct vnode **vpp;&=
nbsp;/* result */<BR>{<BR> struct nameidata nd;<BR> struct vnod=
e *vp;<BR> struct vattr va;<BR> int err=
or, flags;</DIV> <DIV> /* Sanity check the p_fd fields. This i=
s really just a hack */<BR> if (!p->p_fd->fd_rdir || !p->p_=
fd->fd_cdir)<BR> printf("Warning: p_fd fields not set\n");<=
BR> <BR> if (!p->p_fd->fd_rdir)<BR> p->p_fd=
->fd_rdir =3D rootvnode;<BR> if (!p->p_fd->fd_cdir)<BR>&nbs=
p; p->p_fd->fd_cdir =3D rootvnode;<BR> NDINIT(&nd, LO=
OKUP, FOLLOW, UIO_SYSSPACE, path, p);<BR> flags =3D FREAD | FWRITE;<=
BR> if ((error =3D vn_open(&nd, flags, 0)) !=3D 0) {<BR> &n=
bsp;rf_printf(2, "RAIDframe: vn_open returned %d\n", error);<BR> &nb=
sp;return (error);<BR> }<BR> vp =3D nd.ni_vp;<BR> if (vp-&=
gt;v_usecount > 1) {<BR> VOP_UNLOCK(vp, 0, p);<BR> &nb=
sp;(void) vn_close(vp, FREAD | FWRITE, p->p_ucred, p);<BR> =
rf_printf(1, "raidlookup() vp->v_usecount > 1\n");<BR> r=
eturn (EBUSY);<BR> }<BR> if ((error =3D VOP_GETATTR(vp, &va=
, p->p_ucred, p)) !=3D 0) {<BR> VOP_UNLOCK(vp, 0, p);<BR>&n=
bsp; (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, p);<BR> =
; rf_printf(1, "raidlookup() VOP_GETATTR returned %d", error);<BR>&n=
bsp; return (error);<BR> }<BR> /* XXX: eventually we shoul=
d handle VREG, too. */<BR> if (va.va_type !=3D VCHR) {<BR> &nbs=
p;VOP_UNLOCK(vp, 0, p);<BR> (void) vn_close(vp, FREAD | FWRITE=
, p->p_ucred, p);<BR> rf_printf(1, "Returning ENOTBLK\n");<=
BR> return (ENOTBLK);<BR> }<BR> VOP_UNLOCK(vp, 0, p)=
;<BR> NDFREE(&nd, NDF_ONLY_PNBUF);<BR> *vpp =3D vp;<BR>&nbs=
p;return (0);<BR>}</DIV> <DIV>Based on the explain of the thread: struct =
proc *td_proc; /* Associated process. */ in the struct thread.<=
BR>and refer to the CCD code.<BR>I modify this function as following:<BR>=
int raidlookup(path, td, vpp)<BR> char *path;<BR> s=
truct thread *td;<BR> struct vnode **vpp; /* result */<BR>{<BR>=
struct nameidata nd;<BR> struct vnode *vp;<BR> struct vat=
tr va;<BR> struct proc *p;<BR> int erro=
r, flags;</DIV> <DIV> /* Sanity check the p_fd fields. This is=
really just a hack */<BR> p =3D td->td_proc;<BR> if (!p->=
;p_fd->fd_rdir || !p->p_fd->fd_cdir)<BR> printf("Warn=
ing: p_fd fields not set\n");<BR> <BR> if (!p->p_fd->fd_r=
dir)<BR> p->p_fd->fd_rdir =3D rootvnode;<BR> if (!p=
->p_fd->fd_cdir)<BR> p->p_fd->fd_cdir =3D rootvnod=
e;<BR> NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, td);<BR>&=
nbsp;flags =3D FREAD | FWRITE;<BR> if ((error =3D vn_open(&nd, &=
amp;flags, 0)) !=3D 0) {<BR> rf_printf(2, "RAIDframe: vn_open =
returned %d\n", error);<BR> return (error);<BR> }<BR>&nbs=
p;vp =3D nd.ni_vp;<BR> if (vp->v_usecount > 1) {<BR> &nbs=
p;VOP_UNLOCK(vp, 0, td);<BR> (void) vn_close(vp, FREAD | FWRIT=
E, td->td_ucred, td);<BR> rf_printf(1, "raidlookup() vp->=
;v_usecount > 1\n");<BR> return (EBUSY);<BR> }<BR>&nbs=
p;if ((error =3D VOP_GETATTR(vp, &va, td->td_ucred, td)) !=3D 0) {=
<BR> VOP_UNLOCK(vp, 0, td);<BR> (void) vn_close(vp,=
FREAD | FWRITE, td->td_ucred, td);<BR> rf_printf(1, "raidl=
ookup() VOP_GETATTR returned %d", error);<BR> return (error);<=
BR> }<BR> /* XXX: eventually we should handle VREG, too. */<BR>=
if (va.va_type !=3D VCHR) {<BR> VOP_UNLOCK(vp, 0, td);<B=
R> (void) vn_close(vp, FREAD | FWRITE,td->td_ucred, td);<BR=
> rf_printf(1, "Returning ENOTBLK\n");<BR> return (=
ENOTBLK);<BR> }<BR> VOP_UNLOCK(vp, 0, td);<BR> NDFREE(&=
;nd, NDF_ONLY_PNBUF);<BR> *vpp =3D vp;<BR> return (0);<BR>}</DI=
V> <DIV>Now the system will be crash , when it excutes the "p =3D td->=
td_proc".<BR>the system Information is :<BR>kernel: type 12 trap, code=3D=
0<BR>Stopped at raidlookup+0x19: movl 0(%eax),%ebx</DIV> <DIV>If I mask t=
he instructions form "p =3D td->td_proc" to "p->p_fd->fd_cdir =3D=
rootvnode;",<BR>trace the code, I find it will be crash in vn_open.<BR>s=
ystem infor:<BR>Stopped at vn_open+0x9: pushl 0x78(%eax)<BR>Why?<BR>I ana=
lyse the ccd code, it transfered the vn_open function, only change the se=
cond parameter.</DIV> <DIV> </DIV> <DIV>Best Regards</DIV> <DIV>&nbs=
p; Ouyang kai</DIV></BODY></HTML><br clear=3Dall><hr>=B4=D3=CD=F8=D5=BE=B5=
=C3=B5=BD=B8=FC=B6=E0=D0=C5=CF=A2=A1=A3MSN Explorer =C3=E2=B7=D1=CF=C2=D4=
=D8=A3=BA<a href=3D'http://explorer.msn.com/lccn'>http://explorer.msn.com=
/lccn</a><br></p>
------=_NextPart_002_0004_01C20A4F.BD05C000--
------=_NextPart_001_0003_01C20A4F.BD05C000
Content-Type: text/plain; name="help.txt"
Content-Disposition: attachment; filename="help.txt"
Content-Transfer-Encoding: quoted-printable
Hi,
Very thank your help! Now the box can boot. =20
I have some other problems about proc and thread.