Device rename: `rd' => `md'

This commit is contained in:
pk 1997-01-01 23:32:41 +00:00
parent fe71b17fca
commit fbfb9e1144
3 changed files with 41 additions and 40 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.15 1996/12/27 01:53:41 mark Exp $ */
/* $NetBSD: machdep.c,v 1.16 1997/01/01 23:40:13 pk Exp $ */
/*
* Copyright (c) 1994-1996 Mark Brinicombe.
@ -131,7 +131,7 @@ int max_processes;
int cpu_cache;
int cpu_ctrl;
u_int ramdisc_size; /* Ramdisc size */
u_int memory_disc_size; /* Memory disc size */
u_int videodram_size; /* Amount of DRAM to reserve for video */
vm_offset_t videodram_start;
@ -1472,13 +1472,13 @@ initarm(prom_id)
cpu_cache = 0x03;
boothowto = 0;
#ifndef RAMDISKSIZE
#define RAMDISKSIZE 0
#ifndef MEMORY_DISK_SIZE
#define MEMORY_DISK_SIZE 0
#endif
ramdisc_size = RAMDISKSIZE * 1024;
memory_disc_size = MEMORY_DISK_SIZE * 1024;
#ifdef RAMDISK_HOOKS
boot_args = "root=/dev/rd0a swapsize=0";
#ifdef MEMORY_DISK_HOOKS
boot_args = "root=/dev/md0a swapsize=0";
#else
if (strcmp(prom_id->bootdev, "fd") == 0) {
boot_args = "root=/dev/fd0a swapsize=0";
@ -2502,14 +2502,14 @@ process_kernel_args()
printf("Maximum \"in memory\" processes = %d\n",
max_processes);
}
ptr = strstr(args, "ramdisc=");
ptr = strstr(args, "memory disc=");
if (ptr) {
ramdisc_size = (u_int)strtoul(ptr + 8, NULL, 10);
ramdisc_size *= 1024;
if (ramdisc_size < 32*1024)
ramdisc_size = 32*1024;
if (ramdisc_size > 2048*1024)
ramdisc_size = 2048*1024;
memory_disc_size = (u_int)strtoul(ptr + 8, NULL, 10);
memory_disc_size *= 1024;
if (memory_disc_size < 32*1024)
memory_disc_size = 32*1024;
if (memory_disc_size > 2048*1024)
memory_disc_size = 2048*1024;
}
ptr = strstr(args, "videodram=");
if (ptr) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: stubs.c,v 1.12 1996/10/17 02:52:26 mark Exp $ */
/* $NetBSD: stubs.c,v 1.13 1997/01/01 23:40:15 pk Exp $ */
/*
* Copyright (c) 1994,1995 Mark Brinicombe.
@ -57,7 +57,7 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
#include <dev/ramdisk.h>
#include <dev/md.h>
#include <machine/param.h>
#include <machine/vmparam.h>
#include <machine/cpu.h>
@ -89,11 +89,11 @@ extern int nfs_mountroot();
int do_mountroot();
int (*mountroot)() = do_mountroot;
#ifdef RAMDISK_HOOKS
extern struct rd_conf *bootrd;
#endif /* RAMDISK_HOOKS */
#ifdef MEMORY_DISK_HOOKS
extern struct md_conf *bootmd;
#endif /* MEMORY_DISK_HOOKS */
int load_ramdisc_from_floppy __P((struct rd_conf *rd, dev_t dev));
int load_memory_disc_from_floppy __P((struct md_conf *md, dev_t dev));
int
@ -101,25 +101,26 @@ do_mountroot()
{
int error;
#if (NFDC > 0 && NRD > 0 && defined(RAMDISK_HOOKS))
#if (NFDC > 0 && NMD > 0 && defined(MEMORY_DISK_HOOKS))
/*
* Ok ideally the ramdisc would be loaded via the rd_open_hook() but since
* Ok ideally the memory disc would be loaded via the md_open_hook() but since
* we are loading the ramdisc from floppy we only want to load it during
* the boot and not at any other time.
*/
/*
* Ok bit of bodging here. The ramdisc minor is the unit number. However if booting
* from the ramdisc we limit to always booting off minor 0 i.e. rd0 The ramdisc
* device passed as the root device is only used to identify the ramdisc major. The
* minor, instead of indicating the ramdisc unit is used to indicate the floppy
* minor that should be used for loading the boot ramdisc which is unit 0.
* Ok bit of bodging here. The memory disc minor is the unit number. However
* if booting from the memory disc we limit to always booting off minor 0
* i.e. rd0. The memory disc device passed as the root device is only used to
* identify the memory disc major. The minor, instead of indicating the memory
* disc unit is used to indicate the floppy minor that should be used for
* loading the boot memory disc which is unit 0.
*/
if (major(rootdev) == 18 && bootrd) {
if (load_ramdisc_from_floppy(bootrd, makedev(17, minor(rootdev))) != 0)
panic("Failed to load ramdisc\n");
if (load_memory_disc_from_floppy(bootmd, makedev(17, minor(rootdev))) != 0)
panic("Failed to load memory disc\n");
boothowto |= RB_SINGLE;
rootdev = makedev(major(rootdev), 0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.15 1996/11/13 06:46:12 thorpej Exp $ */
/* $NetBSD: fd.c,v 1.16 1997/01/01 23:32:41 pk Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum.
@ -1275,14 +1275,14 @@ fdioctl(dev, cmd, addr, flag)
}
#include "rd.h"
#if NRD > 0
#include "md.h"
#if NMD > 0
#include <dev/ramdisk.h>
#include <dev/md.h>
int
load_ramdisc_from_floppy(rd, dev)
struct rd_conf *rd;
load_memory_disc_from_floppy(md, dev)
struct md_conf *md;
dev_t dev;
{
struct buf *bp;
@ -1294,21 +1294,21 @@ load_ramdisc_from_floppy(rd, dev)
if (major(dev) != 17)
return(EINVAL);
if (rd->rd_type == RD_UNCONFIGURED || rd->rd_addr == 0)
if (md->md_type == MD_UNCONFIGURED || md->md_addr == 0)
return(EBUSY);
type = FDTYPE(dev) - 1;
if (type < 0) type = 0;
floppysize = fd_types[type].size << (fd_types[type].secsize + 7);
if (rd->rd_size < floppysize) {
if (md->md_size < floppysize) {
printf("Ramdisc not big enough for floppy image\n");
return(EINVAL);
}
/* We have the ramdisk ! */
/* We have the memory disk ! */
printf("Loading ramdisc : %4dK ", 0);
printf("Loading memory disc : %4dK ", 0);
/* obtain a buffer */
@ -1341,7 +1341,7 @@ load_ramdisc_from_floppy(rd, dev)
if (biowait(bp))
panic("Cannot load floppy image\n");
bcopy((caddr_t)bp->b_data, (caddr_t)rd->rd_addr
bcopy((caddr_t)bp->b_data, (caddr_t)md->md_addr
+ loop * fd_types[type].sectrac * DEV_BSIZE,
fd_types[type].sectrac * DEV_BSIZE);
}