MIT_JOS_Lab52024-01-13 17:54:28ClientClientdevfile_readdevfile_readServerServerserve_readserve_read/lib/file.c/lib/file.c/fs/serv.c/fs/serv.ccall fsipc()call fsipc()fsipcfsipctypetypefsipcbuffsipcbufpermissionpermission4G4GUSTACKTOPUSTACKTOPDISKMAP+DISKSIZEDISKMAP+DISKSIZEDISKMAPDISKMAPUTEXTUTEXTfsreqfsreqNormal User StackNormal User Stack1024struct Fd*1024...3GB IDE Disk Space3GB IDE Disk Spaceunion Fsipc *fsrequnion Fsipc *fsreqProgram Data & HeapProgram Data & Heap.......................0xeebef0000xeebef0000xeebed0000xeebed0000xd00000000xd00000001024 x PGSIZE1024 x PGSIZE0x100000000x100000000x0ffff0000x0ffff0000x008000000x00800000opentab[MAXOPEN]opentab[MAXOPEN]construct fsipcbufconstruct fsipcbufunion Fsipc fsipcbuf union Fsipc fsipcbuf struct Fsreq_readstruct Fsreq_read struct Fsret_readstruct Fsret_read char ret_buf[PGSIZE];char ret_buf[PGSIZE];opentab[MAXOPEN]opentab[MAXOPEN]struct OpenFile *ostruct OpenFile *ouint32_t o_fileid;uint32_t o_fileid;struct File *o_file;struct File *o_file;int o_mode;int o_mode;struct Fd *o_fd;struct Fd *o_fd;int req_fileid;int req_fileid;size_t req_n;size_t req_n;look uplook upo->o_fileo->o_fileret->ret_bufret->ret_bufreq->req_nreq->req_no->o_fd->fd_offset)o->o_fd->...move resultinto bufferflowmove result...ipc_send(whom, r, pg, perm);ipc_send(whom, r, pg, perm);ipc_recv(NULL, dstva, NULL)ipc_recv(NULL, dstva, NULL)ipc_find_env(ENV_TYPE_FS)ipc_find_env(ENV_TYPE_FS) ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U)ipc_send(fsenv, type, &fsipcbuf...memmove(buf, fsipcbuf.readRet.ret_buf, r);memmove(buf, fsipcbuf.readRet.ret_buf, r); 上一篇:__pycache__的认识记录下一篇:Python的.pyc文件