ast@cs.vu.nl (Andy Tanenbaum) (10/06/87)
27c27,30 < #define MAX_RAM 512 /* maxium RAM disk size in blocks */ --- > #define MAX_RAM 16384 /* maximum RAM disk size in blocks */ > #define RAM_IMAGE (dev_nr)0x303 /* major-minor dev where root image is kept */ > #define EM_ORIGIN 0x100000 /* origin of extended memory RAM disk on AT */ > #define MAX_CRD 255 /* if root fs > MAX_CRD, use extended mem */ 109c112 < * been killed by a signal, so don't check the return code. If the send --- > * been killed by a signal), so don't check the return code. If the send 225c228,230 < phys_clicks ram_clicks, init_org, init_text_clicks, init_data_clicks; --- > dev_nr root_device; > phys_clicks ram_clicks, init_org, init_text_clicks, init_data_clicks; > long base; 233,239c238,257 < < /* Get size of RAM disk by reading root file system's super block */ < bp = get_block(BOOT_DEV, SUPER_BLOCK, NORMAL); /* get RAM super block */ < copy(super_block, bp->b_data, sizeof(struct super_block)); < sp = &super_block[0]; < if (sp->s_magic != SUPER_MAGIC) < panic("Diskette in drive 0 is not root file system", NO_NUM); --- > base = (long) init_org + (long) init_text_clicks + (long) init_data_clicks; > base = base << CLICK_SHIFT; > > /* Get size of RAM disk by reading root file system's super block. > * First read block 0 from the floppy. If this is a valid file system, use > * it as the root image, otherwise try the hard disk (RAM_IMAGE). > */ > root_device = BOOT_DEV; /* try floppy disk first */ > bp = get_block(root_device, SUPER_BLOCK, NORMAL); /* get RAM super block */ > copy(super_block, bp->b_data, sizeof(struct super_block)); > sp = &super_block[0]; > if (sp->s_magic != SUPER_MAGIC) { > put_block(bp, NORMAL); /* return the floppy's super block */ > root_device = RAM_IMAGE; > bp = get_block(root_device, SUPER_BLOCK, NORMAL); /* get RAM super block */ > copy(super_block, bp->b_data, sizeof(struct super_block)); > sp = &super_block[0]; > } > if (sp->s_magic != SUPER_MAGIC) > panic("Invalid root file system", NO_NUM); 244a263,273 > /* There are two possibilities now (by convention): > * count < MAX_CRD ==> RAM disk is in core > * count >=MAX_CRD ==> RAM disk is in extended memory (AT only) > * In the latter case, tell MM that RAM disk size is 0 and tell the ram disk > * driver than the device begins at 1MB. > */ > if (count > MAX_CRD) { > ram_clicks = 0; /* MM does not have to allocate any core */ > base = EM_ORIGIN; /* tell RAM disk driver RAM disk origin */ > } > 258,259c287 < m1.POSITION = (long) init_org + (long) init_text_clicks + init_data_clicks; < m1.POSITION = m1.POSITION << CLICK_SHIFT; --- > m1.POSITION = base; 264,266c292,296 < printf("Loading RAM disk from root diskette. Loaded: 0K "); < for (i = 0; i < count; i++) { < bp = get_block(BOOT_DEV, (block_nr) i, NORMAL); --- > if (ram_clicks == 0) > printf("RAM disk of %d blocks is in extended memory\n\n", count); > printf("Loading RAM disk. Loaded: 0K "); > for (i = 0; i < count; i++) { > bp = get_block(root_device, (block_nr) i, NORMAL); 273,276c303,308 < if (k_loaded % 5 == 0) printf("\b\b\b\b\b%3DK %c", k_loaded, 0); < } < < printf("\rRAM disk loaded. Please remove root diskette. \n\n"); --- > if (k_loaded % 5 == 0) printf("\b\b\b\b\b\b%4DK %c", k_loaded, 0); > } > if (root_device == BOOT_DEV) > printf("\rRAM disk loaded. Please remove root diskette. \n\n"); > else > printf("\rRAM disk loaded. \n\n");