亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? binfmt_coff.c

?? LINUX1.0源代碼,代碼條理清晰
?? C
?? 第 1 頁 / 共 2 頁
字號:
 *  THIS IS THE POINT OF NO RETURN. THE NEW PROCESS WILL TRAP OUT SHOULD
 *  SOMETHING FAIL IN THE LOAD SEQUENCE FROM THIS POINT ONWARD.
 */
    if (status >= 0) {
	long text_scnptr = COFF_LONG (text_sect->s_scnptr);
	long text_size   = COFF_LONG (text_sect->s_size);
	long text_vaddr  = COFF_LONG (text_sect->s_vaddr);

	long data_scnptr;
	long data_size;
	long data_vaddr;

	long bss_size;
	long bss_vaddr;
/*
 *  Generate the proper values for the data fields
 */
	if (data_sect != NULL) {
	    data_scnptr = COFF_LONG (data_sect->s_scnptr);
	    data_size   = COFF_LONG (data_sect->s_size);
	    data_vaddr  = COFF_LONG (data_sect->s_vaddr);
	}
	else {
	    data_scnptr = 0;
	    data_size   = 0;
	    data_vaddr  = 0;
	}
/*
 *  Generate the proper values for the bss fields
 */
	if (bss_sect != NULL) {
	    bss_size  = COFF_LONG (bss_sect->s_size);
	    bss_vaddr = COFF_LONG (bss_sect->s_vaddr);
	}
	else {
	    bss_size  = 0;
	    bss_vaddr = 0;
	}
/*
 *  Flush the executable from memory. At this point the executable is
 *  committed to being defined or a segmentation violation will occur.
 */
	if (lib_ok) {
#ifdef COFF_DEBUG
	    printk ("flushing executable\n");
#endif
	    flush_old_exec (bprm);
/*
 *  Define the initial locations for the various items in the new process
 */
	    current->mmap        = NULL;
	    current->rss         = 0;
/*
 *  Construct the parameter and environment string table entries.
 */
	    bprm->p += change_ldt (0, bprm->page);
	    bprm->p -= MAX_ARG_PAGES*PAGE_SIZE;
	    bprm->p  = (unsigned long) create_tables ((char *) bprm->p,
						      bprm->argc,
						      bprm->envc,
						      1);
/*
 *  Do the end processing once the stack has been constructed
 */
	    current->start_code  = text_vaddr & PAGE_MASK;
	    current->end_code    = text_vaddr + text_size;
	    current->end_data    = data_vaddr + data_size;
	    current->start_brk   =
	    current->brk         = bss_vaddr + bss_size;
	    current->suid        =
	    current->euid        = bprm->e_uid;
	    current->sgid        =
	    current->egid        = bprm->e_gid;
	    current->executable  = bprm->inode; /* Store inode for file  */
	    ++bprm->inode->i_count;             /* Count the open inode  */
	    regs->eip            = start_addr;  /* Current EIP register  */
	    regs->esp            =
	    current->start_stack = bprm->p;
	}
/*
 *   Map the text pages
 */

#ifdef COFF_DEBUG
	printk (".text: vaddr = %d, size = %d, scnptr = %d\n",
		 text_vaddr,
		 text_size,
		 text_scnptr);
#endif
	status = do_mmap (fp,
			  text_vaddr & PAGE_MASK,
			  text_size + (text_vaddr & ~PAGE_MASK),
			  PROT_READ | PROT_EXEC,
			  MAP_FIXED | MAP_SHARED,
			  text_scnptr & PAGE_MASK);

	status = (status == (text_vaddr & PAGE_MASK)) ? 0 : -ENOEXEC;
/*
 *   Map the data pages
 */
	if (status >= 0 && data_size != 0) {
#ifdef COFF_DEBUG
	    printk (".data: vaddr = %d, size = %d, scnptr = %d\n",
		     data_vaddr,
		     data_size,
		     data_scnptr);
#endif
	    status = do_mmap (fp,
			      data_vaddr & PAGE_MASK,
			      data_size + (data_vaddr & ~PAGE_MASK),
			      PROT_READ | PROT_WRITE | PROT_EXEC,
			      MAP_FIXED | MAP_PRIVATE,
			      data_scnptr & PAGE_MASK);

	    status = (status == (data_vaddr & PAGE_MASK)) ? 0 : -ENOEXEC;
	}
/*
 *   Construct the bss data for the process. The bss ranges from the
 *   end of the data (which may not be on a page boundry) to the end
 *   of the bss section. Allocate any necessary pages for the data.
 */
	if (status >= 0 && bss_size != 0) {
#ifdef COFF_DEBUG
	    printk (".bss: vaddr = %d, size = %d\n",
		     bss_vaddr,
		     bss_size);
#endif
	    zeromap_page_range (PAGE_ALIGN (bss_vaddr),
				PAGE_ALIGN (bss_size),
				PAGE_COPY);

	    status = clear_memory (bss_vaddr, bss_size);
	}
/*
 *  Load any shared library for the executable.
 */
	if (status >= 0 && lib_ok && lib_count != 0) {
	    int nIndex;
	    COFF_SCNHDR *sect_ptr = sect_bufr;
/*
 *  Find the library sections. (There should be atleast one. It was counted
 *  earlier.) This will evenutally recurse to our code and load the shared
 *  library with our own procedures.
 */
	    for (nIndex = 0; nIndex < sections; ++nIndex) {
		long int sect_flags = COFF_LONG (sect_ptr->s_flags);
		if (sect_flags == COFF_STYP_LIB) {
		    status = preload_library (bprm, sect_ptr, fp);
		    if (status != 0)
			break;
		}
	    sect_ptr = (COFF_SCNHDR *) &((char *) sect_ptr) [COFF_SCNHSZ];
	    }
	}
/*
 *   Generate any needed trap for this process. If an error occured then
 *   generate a segmentation violation. If the process is being debugged
 *   then generate the load trap. (Note: If this is a library load then
 *   do not generate the trap here. Pass the error to the caller who
 *   will do it for the process in the outer lay of this procedure call.)
 */
	if (lib_ok) {
	    if (status < 0)
		send_sig (SIGSEGV, current, 0);	/* Generate the error trap  */
	    else {
		if (current->flags & PF_PTRACED)
		    send_sig (SIGTRAP, current, 0);
	    }
	    status = 0;		/* We are committed. It can't fail */
	}
    }
/*
 *  Do any cleanup processing
 */
    if (fd >= 0)
	sys_close (fd);		/* Close unused code file      */

    if (sect_bufr != NULL)
	kfree (sect_bufr);	/* Release section list buffer */
/*
 *  Return the completion status.
 */
#ifdef COFF_DEBUG
    printk ("binfmt_coff: result = %d\n", status);
#endif
    return (status);
}

/*
 *  This procedure will load the library listed in the file name given
 *  as the paramter. The result will be non-zero should something fail
 *  to load.
 */

static int
preload_this_library (struct linux_binprm *exe_bprm, char *lib_name)
{
    int   status;
    int   old_fs = get_fs();
/*
 *  If debugging then print "we have arrived"
 */
#ifdef COFF_DEBUG
    printk ("%s loading shared library %s\n",
	    exe_bprm->filename,
	    lib_name);
#endif
/*
 *  Change the FS register to the proper kernel address space and attempt
 *  to load the library. The library name is allocated from the kernel
 *  pool.
 */
    set_fs (get_ds ());
    status = sys_uselib (lib_name);
    set_fs (old_fs);
/*
 *  Return the success/failure to the caller.
 */
    return (status);
}

/*
 *  This procedure is called to load a library section. The various
 *  libraries are loaded from the list given in the section data.
 */

static int
preload_library (struct linux_binprm *exe_bprm,
		 COFF_SCNHDR * sect, struct file *fp)
{
    int status = 0;		/* Completion status                  */
    long nbytes;		/* Count of bytes in the header area  */
/*
 *  Fetch the size of the section. There must be enough room for atleast
 *  one entry.
 */
    nbytes = COFF_LONG (sect->s_size);
    if (nbytes < COFF_SLIBSZ) {
	status = -ENOEXEC;
#ifdef COFF_DEBUG
	printk ("library section too small\n");
#endif
    }
/*
 *  Allocate a buffer to hold the section data
 */
    else {
	COFF_SLIBHD *phdr;
	char *buffer = (char *) kmalloc (nbytes, GFP_KERNEL);

        if (0 == buffer) {
	    status = -ENOEXEC;
#ifdef COFF_DEBUG
	    printk ("kmalloc failed\n");
#endif
	}
	else {
	    int old_fs   = get_fs ();
/*
 *  Read the section data from the disk file.
 */
	    set_fs (get_ds ());   /* Make it point to the proper location    */
	    status = read_exec (exe_bprm->inode,     /* INODE for file       */
			    COFF_LONG (sect->s_scnptr), /* Disk location     */
			    buffer,                     /* Buffer for read   */
			    nbytes);                    /* Byte count reqd.  */
	    set_fs (old_fs);                         /* Restore the selector */
/*
 *  Check the result. The value returned is the byte count actaully read.
 */
	    if (status >= 0 && status != nbytes) {
#ifdef COFF_DEBUG
		printk ("read of lib section was short\n");
#endif
		status = -ENOEXEC;
	    }
	}
/*
 *  At this point, go through the list of libraries in the data area.
 */
	phdr = (COFF_SLIBHD *) buffer;
	while (status >= 0 && nbytes > COFF_SLIBSZ) {
	    int entry_size  = COFF_LONG (phdr->sl_entsz)   * sizeof (long);
	    int header_size = COFF_LONG (phdr->sl_pathndx) * sizeof (long);
/*
 *  Validate the sizes of the various items. I don't trust the linker!!
 */
	    if ((unsigned) header_size >= (unsigned) nbytes ||
		entry_size <= 0 ||
		(unsigned) entry_size <= (unsigned) header_size) {
		status = -ENOEXEC;
#ifdef COFF_DEBUG
		printk ("header count is invalid\n");
#endif
	    }
/*
 *  Load the library. Stop the load process on the first error.
 */
	    else {
		status = preload_this_library (exe_bprm,
					       &((char *) phdr)[header_size]);
#ifdef COFF_DEBUG
		printk ("preload_this_library result = %d\n", status);
#endif
	    }
/*
 *  Point to the next library in the section data.
 */
	    nbytes -= entry_size;
	    phdr = (COFF_SLIBHD *) &((char *) phdr)[entry_size];
	}
/*
 *  Release the space for the library list.
 */
	if (buffer != NULL)
	    kfree (buffer);
    }
/*
 *  Return the resulting status to the caller.
 */
    return (status);
}

/*
 *  This procedure is called by the main load sequence. It will load
 *  the executable and prepare it for execution. It provides the additional
 *  parameters used by the recursive coff loader and tells the loader that
 *  this is the main executable. How simple it is . . . .
 */

int
load_coff_binary (struct linux_binprm *bprm, struct pt_regs *regs)
{
    return (load_object (bprm, regs, 1));
}

/*
 *   Load the image for any shared library.
 *
 *   This is called when we need to load a library based upon a file name.
 */

int
load_coff_library (int fd)
{
    struct linux_binprm *bprm;  /* Parameters for the load operation   */
    int    status;              /* Status of the request               */
/*
 *  Read the first portion of the file.
 */
    bprm = (struct linux_binprm *) kmalloc (sizeof (struct linux_binprm),
					    GFP_KERNEL);
    if (0 == bprm) {
#ifdef COFF_DEBUG
	printk ("kmalloc failed\n");
#endif
        status = -ENOEXEC;
    }
    else {
        struct file         *file;  /* Pointer to the file table           */
        struct pt_regs       regs;  /* Register work area                  */
        int old_fs = get_fs ();     /* Previous FS register value          */

        memset (bprm, '\0', sizeof (struct linux_binprm));

	file           = current->filp[fd];
	bprm->inode    = file->f_inode;   /* The only item _really_ needed */
	bprm->filename = "";              /* Make it a legal string        */
/*
 *  Read the section list from the disk file.
 */
	set_fs (get_ds ());   /* Make it point to the proper location    */
	status = read_exec (bprm->inode,	 /* INODE for file       */
			    0L,                  /* Offset in the file   */
			    bprm->buf,           /* Buffer for read      */
			    sizeof (bprm->buf)); /* Size of the buffer   */
	set_fs (old_fs);	                 /* Restore the selector */
/*
 *  Try to load the library.
 */
	status = load_object (bprm, &regs, 0);
/*
 *  Release the work buffer and return the result.
 */
	kfree (bprm);                 /* Release the buffer area */
    }
/*
 *  Return the result of the load operation
 */
    return (status);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人精品免费在线| 久久国内精品视频| 黄色成人免费在线| 色噜噜狠狠色综合中国| 国产欧美日本一区视频| 日日夜夜精品视频天天综合网| 成人国产电影网| 精品久久久久香蕉网| 亚洲一区二区av在线| 9久草视频在线视频精品| 777欧美精品| 一区二区三区在线不卡| 成人av资源网站| 久久精品一区二区三区四区| 亚洲 欧美综合在线网络| 99精品在线免费| 国产亚洲一本大道中文在线| 欧美a级一区二区| 国产日韩欧美不卡| 免费人成网站在线观看欧美高清| 91免费国产视频网站| 国产欧美一区二区三区网站| 极品美女销魂一区二区三区| 91精品欧美福利在线观看| 亚洲精品v日韩精品| 99免费精品在线| 国产欧美一区二区三区网站| 国精产品一区一区三区mba视频 | 欧美日韩精品一区二区三区蜜桃 | 337p亚洲精品色噜噜| 亚洲精品视频在线观看网站| 成人h动漫精品一区二区| 精品sm捆绑视频| 美女国产一区二区| 在线不卡一区二区| 亚洲成人久久影院| 欧美三区免费完整视频在线观看| 亚洲美女电影在线| 一本大道av一区二区在线播放| 中文字幕在线一区免费| 成人午夜在线视频| 亚洲国产成人一区二区三区| 国产在线精品一区二区夜色| 精品国产伦一区二区三区观看体验| 日韩二区在线观看| 91精品国产综合久久小美女| 五月开心婷婷久久| 7777精品久久久大香线蕉| 亚洲成人你懂的| 欧美日韩欧美一区二区| 亚洲成精国产精品女| 欧美日韩一区二区三区四区五区| 亚洲综合久久久| 欧美日韩国产另类一区| 日本欧美大码aⅴ在线播放| 91精品在线观看入口| 美脚の诱脚舐め脚责91| 精品成人免费观看| 高清成人免费视频| 国产精品久久久久久久久免费相片 | 亚洲美女电影在线| 欧美性受极品xxxx喷水| 亚洲成人先锋电影| 欧美电视剧免费观看| 国产精品白丝jk黑袜喷水| 亚洲国产高清aⅴ视频| 91色乱码一区二区三区| 亚洲午夜三级在线| 欧美一二三在线| 国产精品一区二区无线| 国产精品网曝门| 中文字幕av资源一区| 99国产欧美久久久精品| 亚洲国产日韩在线一区模特 | 国产成人啪午夜精品网站男同| 中文欧美字幕免费| 色久优优欧美色久优优| 日韩精品视频网站| 久久精品这里都是精品| 91网站最新地址| 天天综合天天做天天综合| 精品国产一区二区三区久久久蜜月 | 国产999精品久久久久久| 日韩一区中文字幕| 欧美美女直播网站| 国产一区二区导航在线播放| 综合久久国产九一剧情麻豆| 欧美日韩一区不卡| 国产成人免费视频一区| 一个色在线综合| 日韩精品一区二区三区四区 | 国内精品伊人久久久久av影院 | 久久视频一区二区| 91蜜桃传媒精品久久久一区二区| 无码av免费一区二区三区试看| 日韩欧美电影在线| 9i看片成人免费高清| 日韩精品福利网| 欧美国产乱子伦 | 成人免费视频caoporn| 亚洲夂夂婷婷色拍ww47 | 色婷婷综合久久久中文一区二区| 日韩av二区在线播放| 国产精品美女视频| 日韩一级片在线播放| 99天天综合性| 久久国产精品99久久久久久老狼| 综合久久久久久久| 26uuu国产一区二区三区| 国产精品色婷婷| 欧美日韩二区三区| eeuss影院一区二区三区| 蜜臀av一区二区| 一区二区三区在线看| 国产欧美一区二区三区在线看蜜臀 | 国产激情视频一区二区在线观看 | 亚洲精品一二三四区| 久久综合久久综合久久综合| 在线国产电影不卡| 成人精品视频一区二区三区尤物| 三级在线观看一区二区 | 日韩视频在线永久播放| 色婷婷av一区二区三区软件| 国产伦精品一区二区三区视频青涩| 亚洲国产精品久久艾草纯爱| 中文字幕欧美日韩一区| 日韩美女视频在线| 欧美视频第二页| 91小视频免费看| 国产成人在线视频网址| 免费成人在线观看| 亚洲综合色区另类av| 综合电影一区二区三区 | 欧美一区二区三区色| 91久久一区二区| av在线不卡电影| 国产精品一色哟哟哟| 麻豆成人av在线| 婷婷六月综合网| 亚洲综合丝袜美腿| 亚洲欧美一区二区三区国产精品| 久久伊99综合婷婷久久伊| 制服丝袜av成人在线看| 欧美在线不卡一区| 99精品偷自拍| 成人禁用看黄a在线| 国产jizzjizz一区二区| 国产一区高清在线| 久久 天天综合| 久久精品av麻豆的观看方式| 日韩精品亚洲专区| 视频一区二区三区在线| 午夜精品久久久久影视| 亚洲黄网站在线观看| 亚洲免费观看在线观看| 亚洲男人天堂一区| 亚洲婷婷综合色高清在线| 亚洲欧洲精品天堂一级| 国产精品伦理在线| 中文字幕在线一区二区三区| 中文字幕亚洲欧美在线不卡| 国产精品卡一卡二卡三| 国产精品国产三级国产普通话三级| 国产天堂亚洲国产碰碰| 中文字幕精品三区| 国产精品日韩成人| 中文字幕在线播放不卡一区| 中文字幕在线不卡一区 | 欧美大肚乱孕交hd孕妇| 欧美大片在线观看| 精品国产sm最大网站| 2024国产精品| 国产欧美日韩综合| 国产精品福利在线播放| 一区二区三区中文字幕| 亚洲图片自拍偷拍| 日本中文字幕一区二区视频| 久久精品国产久精国产爱| 国内精品在线播放| 成人不卡免费av| 91丝袜高跟美女视频| 欧美三级中文字幕| 日韩一区二区三区免费看 | 久久亚洲一区二区三区明星换脸| 久久久久久免费网| 亚洲视频一二区| 天堂va蜜桃一区二区三区漫画版| 久久成人久久鬼色| 北岛玲一区二区三区四区 | 国产精品888| 91亚洲大成网污www| 在线播放日韩导航| 亚洲精品一区在线观看| 国产精品国产三级国产a| 亚洲永久精品国产| 激情综合一区二区三区| 成人福利在线看| 欧美喷潮久久久xxxxx| 久久久久久久久97黄色工厂| 亚洲欧洲一区二区三区|