Prex Home / Browse Source - Prex Version: 0.9.0

root/include/sys/bootinfo.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2005-2007, Kohsuke Ohtani
   3  * All rights reserved.
   4  *
   5  * Redistribution and use in source and binary forms, with or without
   6  * modification, are permitted provided that the following conditions
   7  * are met:
   8  * 1. Redistributions of source code must retain the above copyright
   9  *    notice, this list of conditions and the following disclaimer.
  10  * 2. Redistributions in binary form must reproduce the above copyright
  11  *    notice, this list of conditions and the following disclaimer in the
  12  *    documentation and/or other materials provided with the distribution.
  13  * 3. Neither the name of the author nor the names of any co-contributors
  14  *    may be used to endorse or promote products derived from this software
  15  *    without specific prior written permission.
  16  *
  17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27  * SUCH DAMAGE.
  28  */
  29 
  30 /*
  31  * Boot information
  32  *
  33  * The boot information is stored by an OS loader, and
  34  * it is refered by kernel later in boot time.
  35  */
  36 
  37 #ifndef _SYS_BOOTINFO_H
  38 #define _SYS_BOOTINFO_H
  39 
  40 #include <sys/types.h>
  41 
  42 #define MAXIMGNAME      16
  43 
  44 /*
  45  * Video information
  46  */
  47 struct vidinfo
  48 {
  49         int     pixel_x;        /* screen pixels */
  50         int     pixel_y;
  51         int     text_x;         /* text size, in characters */
  52         int     text_y;
  53 };
  54 
  55 /*
  56  * Module information for kernel, driver, and boot tasks.
  57  * An OS loader will build this structure regardless of its file format.
  58  */
  59 struct module
  60 {
  61         char            name[MAXIMGNAME]; /* name of image */
  62         paddr_t         phys;           /* physical address */
  63         size_t          size;           /* size of image */
  64         vaddr_t         entry;          /* entry address */
  65         vaddr_t         text;           /* text address */
  66         vaddr_t         data;           /* data address */
  67         size_t          textsz;         /* text size */
  68         size_t          datasz;         /* data size */
  69         size_t          bsssz;          /* bss size */
  70 };
  71 
  72 /*
  73  * Physical memory
  74  */
  75 struct physmem
  76 {
  77         paddr_t         base;           /* start address */
  78         psize_t         size;           /* size in bytes */
  79         int             type;           /* type */
  80 };
  81 
  82 /* memory types */
  83 #define MT_USABLE       1
  84 #define MT_MEMHOLE      2
  85 #define MT_RESERVED     3
  86 #define MT_BOOTDISK     4
  87 
  88 #define NMEMS           8               /* max number of memory slots */
  89 
  90 /*
  91  * Boot information
  92  */
  93 struct bootinfo
  94 {
  95         struct vidinfo  video;          /* video information */
  96         struct physmem  ram[NMEMS];     /* physical ram table */
  97         int             nr_rams;        /* number of ram blocks */
  98         struct physmem  bootdisk;       /* boot disk in memory */
  99         int             nr_tasks;       /* number of boot tasks */
 100         struct module   kernel;         /* kernel image */
 101         struct module   driver;         /* driver image */
 102         struct module   tasks[1];       /* boot tasks image */
 103 };
 104 
 105 #define BOOTINFOSZ      1024            /* max size of boot information */
 106 
 107 #endif /* !_SYS_BOOTINFO_H */

/* [<][>][^][v][top][bottom][index][help] */