Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | /*
* linux/arch/mips/kernel/setup.c
*
* Copyright (C) 1995 Linus Torvalds
*/
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/malloc.h>
#include <linux/ldt.h>
#include <linux/user.h>
#include <linux/a.out.h>
#include <linux/tty.h>
#include <asm/bootinfo.h>
#include <asm/segment.h>
#include <asm/system.h>
/*
* Tell us the machine setup..
*/
char wait_available; /* set if the "wait" instruction available */
/*
* Bus types ..
*/
int EISA_bus = 0;
/*
* Setup options
*/
struct drive_info_struct drive_info;
struct screen_info screen_info;
unsigned char aux_device_present;
extern int ramdisk_size;
extern int root_mountflags;
extern int end;
extern char empty_zero_page[PAGE_SIZE];
/*
* Initialise this structure so that it will be placed in the
* .data section of the object file
*/
struct bootinfo boot_info = BOOT_INFO;
/*
* This is set up by the setup-routine at boot-time
*/
#define PARAM empty_zero_page
#define EXT_MEM (boot_info.memupper)
#define DRIVE_INFO (boot_info.drive_info)
#define SCREEN_INFO (screen_info)
#define MOUNT_ROOT_RDONLY (boot_info.mount_root_rdonly)
#define RAMDISK_SIZE (boot_info.ramdisk_size)
#if 0
#define ORIG_ROOT_DEV (*(unsigned short *) (PARAM+0x1FC))
#define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF))
#endif
#define COMMAND_LINE (boot_info.command_line)
static char command_line[CL_SIZE] = { 0, };
void setup_arch(char **cmdline_p,
unsigned long * memory_start_p, unsigned long * memory_end_p)
{
unsigned long memory_start, memory_end;
char c = ' ', *to = command_line, *from = COMMAND_LINE;
int len = 0;
#if 0
ROOT_DEV = to_kdev_t(ORIG_ROOT_DEV);
#endif
drive_info = DRIVE_INFO;
screen_info = SCREEN_INFO;
#if 0
aux_device_present = AUX_DEVICE_INFO;
#endif
memory_end = EXT_MEM;
memory_end &= PAGE_MASK;
ramdisk_size = RAMDISK_SIZE;
if (MOUNT_ROOT_RDONLY)
root_mountflags |= MS_RDONLY;
memory_start = (unsigned long) &end - KERNELBASE;
for (;;) {
if (c == ' ' && *(unsigned long *)from == *(unsigned long *)"mem=") {
memory_end = simple_strtoul(from+4, &from, 0);
if ( *from == 'K' || *from == 'k' ) {
memory_end = memory_end << 10;
from++;
} else if ( *from == 'M' || *from == 'm' ) {
memory_end = memory_end << 20;
from++;
}
}
c = *(from++);
if (!c)
break;
if (CL_SIZE <= ++len)
break;
*(to++) = c;
}
*to = '\0';
*cmdline_p = command_line;
*memory_start_p = memory_start;
*memory_end_p = memory_end;
}
|