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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? genhd.c

?? LINUX1.0源代碼,代碼條理清晰
?? C
字號(hào):
/*
 *  Code extracted from
 *  linux/kernel/hd.c
 *
 *  Copyright (C) 1991, 1992  Linus Torvalds
 */

/*
 *  Thanks to Branko Lankester, lankeste@fwi.uva.nl, who found a bug
 *  in the early extended-partition checks and added DM partitions
 */

#include <linux/config.h>
#include <linux/fs.h>
#include <linux/genhd.h>
#include <linux/kernel.h>

struct gendisk *gendisk_head = NULL;

static int current_minor = 0;
extern int *blk_size[];
extern void rd_load(void);
extern int ramdisk_size;

/*
 * Create devices for each logical partition in an extended partition.
 * The logical partitions form a linked list, with each entry being
 * a partition table with two entries.  The first entry
 * is the real data partition (with a start relative to the partition
 * table start).  The second is a pointer to the next logical partition
 * (with a start relative to the entire extended partition).
 * We do not create a Linux partition for the partition tables, but
 * only for the actual data partitions.
 */

static void extended_partition(struct gendisk *hd, int dev)
{
	struct buffer_head *bh;
	struct partition *p;
	unsigned long first_sector, this_sector;
	int mask = (1 << hd->minor_shift) - 1;

	first_sector = hd->part[MINOR(dev)].start_sect;
	this_sector = first_sector;

	while (1) {
		if ((current_minor & mask) >= (4 + hd->max_p))
			return;
		if (!(bh = bread(dev,0,1024)))
			return;
	  /*
	   * This block is from a device that we're about to stomp on.
	   * So make sure nobody thinks this block is usable.
	   */
		bh->b_dirt=0;
		bh->b_uptodate=0;
		if (*(unsigned short *) (bh->b_data+510) == 0xAA55) {
			p = (struct partition *) (0x1BE + bh->b_data);
		/*
		 * Process the first entry, which should be the real
		 * data partition.
		 */
			if (p->sys_ind == EXTENDED_PARTITION ||
			    !(hd->part[current_minor].nr_sects = p->nr_sects))
				goto done;  /* shouldn't happen */
			hd->part[current_minor].start_sect = this_sector + p->start_sect;
			printk(" %s%c%d", hd->major_name,
				'a'+(current_minor >> hd->minor_shift),
				mask & current_minor);
			current_minor++;
			p++;
		/*
		 * Process the second entry, which should be a link
		 * to the next logical partition.  Create a minor
		 * for this just long enough to get the next partition
		 * table.  The minor will be reused for the real
		 * data partition.
		 */
			if (p->sys_ind != EXTENDED_PARTITION ||
			    !(hd->part[current_minor].nr_sects = p->nr_sects))
				goto done;  /* no more logicals in this partition */
			hd->part[current_minor].start_sect = first_sector + p->start_sect;
			this_sector = first_sector + p->start_sect;
			dev = ((hd->major) << 8) | current_minor;
			brelse(bh);
		} else
			goto done;
	}
done:
	brelse(bh);
}

static void check_partition(struct gendisk *hd, unsigned int dev)
{
	static int first_time = 1;
	int i, minor = current_minor;
	struct buffer_head *bh;
	struct partition *p;
	unsigned long first_sector;
	int mask = (1 << hd->minor_shift) - 1;

	if (first_time)
		printk("Partition check:\n");
	first_time = 0;
	first_sector = hd->part[MINOR(dev)].start_sect;
	if (!(bh = bread(dev,0,1024))) {
		printk("  unable to read partition table of device %04x\n",dev);
		return;
	}
	printk("  %s%c:", hd->major_name, 'a'+(minor >> hd->minor_shift));
	current_minor += 4;  /* first "extra" minor */
	if (*(unsigned short *) (bh->b_data+510) == 0xAA55) {
		p = (struct partition *) (0x1BE + bh->b_data);
		for (i=1 ; i<=4 ; minor++,i++,p++) {
			if (!(hd->part[minor].nr_sects = p->nr_sects))
				continue;
			hd->part[minor].start_sect = first_sector + p->start_sect;
			printk(" %s%c%d", hd->major_name,'a'+(minor >> hd->minor_shift), i);
			if ((current_minor & 0x3f) >= 60)
				continue;
			if (p->sys_ind == EXTENDED_PARTITION) {
				printk(" <");
				extended_partition(hd, (hd->major << 8) | minor);
				printk(" >");
			}
		}
		/*
		 * check for Disk Manager partition table
		 */
		if (*(unsigned short *) (bh->b_data+0xfc) == 0x55AA) {
			p = (struct partition *) (0x1BE + bh->b_data);
			for (i = 4 ; i < 16 ; i++, current_minor++) {
				p--;
				if ((current_minor & mask) >= mask-2)
					break;
				if (!(p->start_sect && p->nr_sects))
					continue;
				hd->part[current_minor].start_sect = p->start_sect;
				hd->part[current_minor].nr_sects = p->nr_sects;
				printk(" %s%c%d", hd->major_name,
					'a'+(current_minor >> hd->minor_shift),
					current_minor & mask);
			}
		}
	} else
		printk(" bad partition table");
	printk("\n");
	brelse(bh);
}

/* This function is used to re-read partition tables for removable disks.
   Much of the cleanup from the old partition tables should have already been
   done */

/* This function will re-read the partition tables for a given device,
and set things back up again.  There are some important caveats,
however.  You must ensure that no one is using the device, and no one
can start using the device while this function is being executed. */

void resetup_one_dev(struct gendisk *dev, int drive)
{
	int i;
	int start = drive<<dev->minor_shift;
	int j = start + dev->max_p;
	int major = dev->major << 8;

	current_minor = 1+(drive<<dev->minor_shift);
	check_partition(dev, major+(drive<<dev->minor_shift));

	for (i=start ; i < j ; i++)
		dev->sizes[i] = dev->part[i].nr_sects >> (BLOCK_SIZE_BITS - 9);
}

static void setup_dev(struct gendisk *dev)
{
	int i;
	int j = dev->max_nr * dev->max_p;
	int major = dev->major << 8;
	int drive;
	

	for (i = 0 ; i < j; i++)  {
		dev->part[i].start_sect = 0;
		dev->part[i].nr_sects = 0;
	}
	dev->init();	
	for (drive=0 ; drive<dev->nr_real ; drive++) {
		current_minor = 1+(drive<<dev->minor_shift);
		check_partition(dev, major+(drive<<dev->minor_shift));
	}
	for (i=0 ; i < j ; i++)
		dev->sizes[i] = dev->part[i].nr_sects >> (BLOCK_SIZE_BITS - 9);
	blk_size[dev->major] = dev->sizes;
}
	
/* This may be used only once, enforced by 'static int callable' */
asmlinkage int sys_setup(void * BIOS)
{
	static int callable = 1;
	struct gendisk *p;
	int nr=0;

	if (!callable)
		return -1;
	callable = 0;

	for (p = gendisk_head ; p ; p=p->next) {
		setup_dev(p);
		nr += p->nr_real;
	}
		
	if (ramdisk_size)
		rd_load();
	mount_root();
	return (0);
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品久久99久久久久| 国产欧美精品一区二区色综合 | 国产精品久久久久久亚洲毛片 | 国产在线观看一区二区| 色成人在线视频| 久久久久久久久久美女| 亚洲国产毛片aaaaa无费看 | 日本美女一区二区三区| 91浏览器在线视频| 欧美激情综合五月色丁香| 奇米在线7777在线精品| 欧美私人免费视频| 亚洲欧美中日韩| 成人性生交大片免费看视频在线| 91精品国产乱码久久蜜臀| 亚洲人成网站在线| 成人毛片老司机大片| 久久众筹精品私拍模特| 精品伊人久久久久7777人| 欧美精品在欧美一区二区少妇| 国产精品久久久久aaaa| 高清不卡一区二区在线| 久久只精品国产| 国产一区二区免费看| 精品久久久久久久一区二区蜜臀| 日韩精品一二三| 欧美日韩中字一区| 亚洲mv在线观看| 欧美性大战久久久久久久蜜臀 | 天堂精品中文字幕在线| 在线观看亚洲精品| 一级中文字幕一区二区| 日本久久一区二区| 一区二区三区不卡视频在线观看| 色综合天天综合| 亚洲一区二区综合| 欧美日韩免费一区二区三区视频 | 国产人成亚洲第一网站在线播放| 国模娜娜一区二区三区| 久久蜜桃av一区精品变态类天堂 | 欧美精彩视频一区二区三区| 国产综合久久久久久久久久久久| 2021久久国产精品不只是精品| 久久精品72免费观看| 精品国产精品网麻豆系列| 国产一区二区三区美女| 欧美高清在线精品一区| 色婷婷国产精品久久包臀 | 一区在线中文字幕| 色老汉一区二区三区| 日日摸夜夜添夜夜添精品视频 | 91黄色免费网站| 日韩激情一二三区| 久久久亚洲欧洲日产国码αv| 国产91综合网| 亚洲综合色丁香婷婷六月图片| 欧美精品vⅰdeose4hd| 激情综合色播激情啊| 国产精品嫩草影院av蜜臀| jizz一区二区| 日韩一区欧美二区| 国产精品伦一区| 欧美日韩国产影片| 国产精品一区2区| 亚洲欧美日韩综合aⅴ视频| 91精品国产综合久久国产大片 | 视频一区视频二区中文| 久久久九九九九| 日本高清不卡在线观看| 久久草av在线| 亚洲精品免费在线播放| 日韩精品一区二区在线观看| 91一区二区三区在线观看| 日韩成人伦理电影在线观看| 国产三级三级三级精品8ⅰ区| 欧美性感一类影片在线播放| 国产乱妇无码大片在线观看| 亚洲国产精品自拍| 国产欧美日韩在线| 4438x亚洲最大成人网| 成人免费视频播放| 久久机这里只有精品| 亚洲精品国产无天堂网2021| 国产亚洲视频系列| 欧美精选一区二区| 欧美在线视频全部完| 国产99精品国产| 麻豆中文一区二区| 夜夜嗨av一区二区三区网页 | 日韩视频一区二区在线观看| 99视频精品免费视频| 激情六月婷婷久久| 日韩中文字幕91| 一区二区免费在线播放| 国产拍欧美日韩视频二区| 日韩免费视频一区二区| 91精品免费在线观看| 日本福利一区二区| 色悠悠亚洲一区二区| 成人一区二区视频| 国产电影精品久久禁18| 久久97超碰色| 麻豆一区二区99久久久久| 午夜亚洲福利老司机| 亚洲人123区| 国产精品国产三级国产a| 亚洲精品一区二区三区影院 | 国产调教视频一区| 久久午夜免费电影| 精品成人一区二区三区| 日韩欧美aaaaaa| 日韩一区二区三区视频在线| 欧美精品视频www在线观看| 欧美唯美清纯偷拍| 91九色最新地址| 欧美色综合久久| 欧美三级日本三级少妇99| 在线看不卡av| 欧美精品1区2区3区| 91精品国产aⅴ一区二区| 91精品国产综合久久久久久| 91精品免费观看| 日韩一区二区三区在线视频| 欧美成人精品福利| 久久夜色精品国产噜噜av| 国产无遮挡一区二区三区毛片日本| 久久亚洲精品小早川怜子| 欧美高清一级片在线观看| 亚洲色图视频免费播放| 一区二区免费看| 亚洲va韩国va欧美va精品| 精品亚洲aⅴ乱码一区二区三区| 92精品国产成人观看免费| 99免费精品在线观看| 欧美午夜精品理论片a级按摩| 欧美日韩一级黄| 欧美精品一区二区三区蜜桃视频| 国产亚洲一区二区三区在线观看| 国产日韩成人精品| 亚洲自拍偷拍欧美| 另类欧美日韩国产在线| 岛国精品在线播放| 欧美中文字幕一区| 精品人在线二区三区| 亚洲视频你懂的| 日韩不卡手机在线v区| 夫妻av一区二区| 欧美午夜精品一区二区蜜桃| wwww国产精品欧美| 一区二区三区在线观看网站| 人人超碰91尤物精品国产| 国产99一区视频免费| 欧美日韩精品免费| 欧美激情综合在线| 日本aⅴ精品一区二区三区 | 久久电影国产免费久久电影 | 国产福利一区二区三区视频| 91色综合久久久久婷婷| 欧美xfplay| 亚洲黄色免费网站| 国产成人免费视频精品含羞草妖精 | 国产成人午夜视频| 在线一区二区三区| 久久午夜国产精品| 日韩成人午夜精品| 一本色道久久综合亚洲aⅴ蜜桃 | 色悠悠久久综合| 久久先锋影音av鲁色资源网| 亚洲123区在线观看| 99久久久国产精品| 日韩精品一区二区三区swag| 亚洲男人的天堂在线aⅴ视频| 国内精品不卡在线| 欧美日韩一区不卡| 日韩美女啊v在线免费观看| 国产一区二区三区电影在线观看| 欧美日韩大陆在线| 一区二区欧美视频| www.欧美.com| 久久伊人中文字幕| 精彩视频一区二区| 欧美一二三四在线| 亚洲地区一二三色| 色94色欧美sute亚洲线路一ni| 国产日韩综合av| 国产成人在线视频免费播放| 欧美电影免费观看高清完整版在线| 亚洲韩国精品一区| 日本二三区不卡| 亚洲色图一区二区三区| 成人免费视频视频在线观看免费 | 一区二区三区欧美| 91麻豆自制传媒国产之光| 中文字幕的久久| 成人黄色免费短视频| 国产欧美精品一区二区色综合 | 欧美三日本三级三级在线播放| 自拍偷自拍亚洲精品播放| 97精品电影院| 亚洲免费观看高清完整版在线|