src/boot/boot.c File Reference

#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
#include <errno.h>
#include <ibm/partition.h>
#include <ibm/bios.h>
#include <minix/config.h>
#include <minix/type.h>
#include <minix/dmap.h>
#include <minix/const.h>
#include <minix/minlib.h>
#include <minix/syslib.h>
#include <kernel/const.h>
#include <sys/video.h>
#include "rawfs.h"
#include "boot.h"

Go to the source code of this file.

Classes

struct  token
struct  biosdev

Defines

#define BIOS   (!UNIX)
#define nil   0
#define _POSIX_SOURCE   1
#define _MINIX   1
#define EXTERN
#define arraysize(a)   (sizeof(a) / sizeof((a)[0]))
#define arraylimit(a)   ((a) + arraysize(a))
#define between(a, c, z)   ((unsigned) ((c) - (a)) <= ((z) - (a)))
#define CDSECTOR_SIZE   2048
#define FACTOR   (CDSECTOR_SIZE/SECTOR_SIZE)
#define istty   (1)
#define alarm(n)   (0)
#define null   (resnames[0])
#define b_getenv(name)   (*searchenv(name))
#define STRINGIT2(x)   #x
#define STRINGIT1(x)   STRINGIT2(x)
#define DEV_FD0   0x0200
#define minor_p0s0   128
#define apm_perror(label, ax)   ((void)0)
#define apm_printf
#define B_NOSIG   -1

Enumerations

enum  resnames {
  R_NULL, R_BOOT, R_CTTY, R_DELAY,
  R_ECHO, R_EXIT, R_HELP, R_LS,
  R_MENU, R_OFF, R_SAVE, R_SET,
  R_TRAP, R_UNSET
}
enum  whatfun { NOFUN, SELECT, DEFFUN, USERFUN }

Functions

char * bios_err (int err)
int readsectors (u32_t bufaddr, u32_t sector, U8_t count)
char * unix_err (int err)
void rwerr (char *rw, off_t sec, int err)
void readerr (off_t sec, int err)
void writerr (off_t sec, int err)
void readblock (off_t blk, char *buf, int block_size)
char * readline (void)
int sugar (char *tok)
char * onetoken (char **aline)
token ** tokenize (token **acmds, char *line)
char * poptoken (void)
void voidtoken (void)
void parse_code (char *code)
int interrupt (void)
int get_master (char *master, struct part_entry **table, u32_t pos)
void initialize (void)
int reserved (char *s)
void sfree (char *s)
char * copystr (char *s)
int is_default (environment *e)
environment ** searchenv (char *name)
char * b_value (char *name)
char * b_body (char *name)
int b_setenv (int flags, char *name, char *arg, char *value)
int b_setvar (int flags, char *name, char *value)
void b_unset (char *name)
long a2l (char *a)
char * ul2a (u32_t n, unsigned b)
char * ul2a10 (u32_t n)
unsigned a2x (char *a)
void get_parameters (void)
void addparm (char *n)
void save_parameters (void)
void show_env (void)
int numprefix (char *s, char **ps)
int numeric (char *s)
dev_t name2dev (char *name)
int exec_bootstrap (void)
void boot_device (char *devname)
void ctty (char *line)
void ls (char *dir)
u32_t milli_time (void)
u32_t milli_since (u32_t base)
void unschedule (void)
void schedule (long msec, char *cmd)
int expired (void)
void delay (char *msec)
 if (e->arg![1]=',')
void help (void)
void execute (void)
int run_trailer (void)
void monitor (void)
void boot (void)

Variables

char version [] = "2.20"
int serial_line = -1
u16_t vid_port
u32_t vid_mem_base
u32_t vid_mem_size
int fsok = -1
unsigned char boot_spec [24]
tokencmds
int err
int activate
struct biosdev bootdev
struct biosdev tmpdev
char resnames [][6]
char * addptr
char * Thandler
u32_t Tbase
u32_t Tcount
enum whatfun arg [0]


Define Documentation

#define _MINIX   1

Definition at line 11 of file boot.c.

#define _POSIX_SOURCE   1

Definition at line 10 of file boot.c.

#define alarm ( n   )     (0)

Definition at line 197 of file boot.c.

#define apm_perror ( label,
ax   )     ((void)0)

Definition at line 1256 of file boot.c.

#define apm_printf

Definition at line 1257 of file boot.c.

#define arraylimit ( a   )     ((a) + arraysize(a))

Definition at line 46 of file boot.c.

#define arraysize ( a   )     (sizeof(a) / sizeof((a)[0]))

Definition at line 45 of file boot.c.

#define b_getenv ( name   )     (*searchenv(name))

Definition at line 773 of file boot.c.

#define B_NOSIG   -1

Definition at line 1373 of file boot.c.

#define between ( a,
c,
 )     ((unsigned) ((c) - (a)) <= ((z) - (a)))

Definition at line 47 of file boot.c.

#define BIOS   (!UNIX)

Definition at line 7 of file boot.c.

#define CDSECTOR_SIZE   2048

#define DEV_FD0   0x0200

Definition at line 1104 of file boot.c.

#define EXTERN

Definition at line 42 of file boot.c.

#define FACTOR   (CDSECTOR_SIZE/SECTOR_SIZE)

#define istty   (1)

Definition at line 196 of file boot.c.

#define minor_p0s0   128

Definition at line 1106 of file boot.c.

#define nil   0

Definition at line 9 of file boot.c.

#define null   (resnames[0])

Definition at line 727 of file boot.c.

#define STRINGIT1 ( x   )     STRINGIT2(x)

#define STRINGIT2 ( x   )     #x


Enumeration Type Documentation

enum resnames

Enumerator:
R_NULL 
R_BOOT 
R_CTTY 
R_DELAY 
R_ECHO 
R_EXIT 
R_HELP 
R_LS 
R_MENU 
R_OFF 
R_SAVE 
R_SET 
R_TRAP 
R_UNSET 

Definition at line 716 of file boot.c.

enum whatfun

Enumerator:
NOFUN 
SELECT 
DEFFUN 
USERFUN 

Definition at line 1554 of file boot.c.


Function Documentation

long a2l ( char *  a  ) 

Definition at line 867 of file boot.c.

unsigned a2x ( char *  a  ) 

Definition at line 897 of file boot.c.

void addparm ( char *  n  ) 

Definition at line 1002 of file boot.c.

char* b_body ( char *  name  ) 

Definition at line 784 of file boot.c.

int b_setenv ( int  flags,
char *  name,
char *  arg,
char *  value 
)

Definition at line 792 of file boot.c.

int b_setvar ( int  flags,
char *  name,
char *  value 
)

Definition at line 829 of file boot.c.

void b_unset ( char *  name  ) 

Definition at line 841 of file boot.c.

char* b_value ( char *  name  ) 

Definition at line 776 of file boot.c.

char* bios_err ( int  err  ) 

Definition at line 67 of file boot.c.

void boot ( void   ) 

Definition at line 1934 of file boot.c.

void boot_device ( char *  devname  ) 

Definition at line 1420 of file boot.c.

char* copystr ( char *  s  ) 

Definition at line 746 of file boot.c.

void ctty ( char *  line  ) 

Definition at line 1446 of file boot.c.

void delay ( char *  msec  ) 

Definition at line 1539 of file boot.c.

int exec_bootstrap ( void   ) 

Definition at line 1375 of file boot.c.

void execute ( void   ) 

Definition at line 1657 of file boot.c.

int expired ( void   ) 

Definition at line 1533 of file boot.c.

int get_master ( char *  master,
struct part_entry **  table,
u32_t  pos 
)

Definition at line 503 of file boot.c.

void get_parameters ( void   ) 

Definition at line 918 of file boot.c.

void help ( void   ) 

Definition at line 1616 of file boot.c.

if ( e->arg!  [1] = ','  ) 

Definition at line 1557 of file boot.c.

void initialize ( void   ) 

Definition at line 529 of file boot.c.

int interrupt ( void   ) 

Definition at line 483 of file boot.c.

int is_default ( environment e  ) 

Definition at line 757 of file boot.c.

void ls ( char *  dir  ) 

Definition at line 1476 of file boot.c.

u32_t milli_since ( u32_t  base  ) 

Definition at line 1503 of file boot.c.

u32_t milli_time ( void   ) 

Definition at line 1498 of file boot.c.

void monitor ( void   ) 

Definition at line 1917 of file boot.c.

dev_t name2dev ( char *  name  ) 

Definition at line 1110 of file boot.c.

int numeric ( char *  s  ) 

Definition at line 1096 of file boot.c.

int numprefix ( char *  s,
char **  ps 
)

Definition at line 1079 of file boot.c.

char* onetoken ( char **  aline  ) 

Definition at line 384 of file boot.c.

void parse_code ( char *  code  ) 

Definition at line 474 of file boot.c.

char* poptoken ( void   ) 

Definition at line 456 of file boot.c.

void readblock ( off_t  blk,
char *  buf,
int  block_size 
)

Definition at line 180 of file boot.c.

void readerr ( off_t  sec,
int  err 
)

Definition at line 177 of file boot.c.

static int readline ( void   ) 

Definition at line 341 of file boot.c.

int readsectors ( u32_t  bufaddr,
u32_t  sector,
U8_t  count 
)

Definition at line 128 of file boot.c.

int reserved ( char *  s  ) 

Definition at line 729 of file boot.c.

int run_trailer ( void   ) 

Definition at line 1903 of file boot.c.

void rwerr ( char *  rw,
off_t  sec,
int  err 
)

Definition at line 171 of file boot.c.

void save_parameters ( void   ) 

Definition at line 1007 of file boot.c.

void schedule ( long  msec,
char *  cmd 
)

Definition at line 1523 of file boot.c.

environment** searchenv ( char *  name  ) 

Definition at line 762 of file boot.c.

void sfree ( char *  s  ) 

Definition at line 740 of file boot.c.

void show_env ( void   ) 

Definition at line 1048 of file boot.c.

int sugar ( char *  tok  ) 

Definition at line 378 of file boot.c.

token** tokenize ( token **  acmds,
char *  line 
)

Definition at line 432 of file boot.c.

char* ul2a ( u32_t  n,
unsigned  b 
)

Definition at line 880 of file boot.c.

char* ul2a10 ( u32_t  n  ) 

Definition at line 891 of file boot.c.

char* unix_err ( int  err  ) 

Definition at line 161 of file boot.c.

void unschedule ( void   ) 

Definition at line 1512 of file boot.c.

void voidtoken ( void   ) 

Definition at line 468 of file boot.c.

void writerr ( off_t  sec,
int  err 
)

Definition at line 178 of file boot.c.


Variable Documentation

int activate

Definition at line 496 of file boot.c.

char* addptr

Definition at line 1000 of file boot.c.

enum whatfun arg[0]

unsigned char boot_spec[24]

Definition at line 65 of file boot.c.

struct biosdev bootdev

Definition at line 453 of file boot.c.

void err

Definition at line 454 of file boot.c.

int fsok = -1

Definition at line 55 of file boot.c.

char resnames[][6]

Initial value:

 {
        "", "boot", "ctty", "delay", "echo", "exit", "help",
        "ls", "menu", "off", "save", "set", "trap", "unset",
}

Definition at line 721 of file boot.c.

int serial_line = -1

Definition at line 49 of file boot.c.

Definition at line 1510 of file boot.c.

Definition at line 1510 of file boot.c.

char* Thandler

Definition at line 1509 of file boot.c.

struct biosdev tmpdev

char version[] = "2.20"

Definition at line 5 of file boot.c.

Definition at line 52 of file boot.c.

Definition at line 53 of file boot.c.

Definition at line 51 of file boot.c.


Generated on Tue Mar 9 04:36:21 2010 for Minix by  doxygen 1.5.8