freebsd-dev/sys/i386/boot/biosboot/boot.h

103 lines
2.7 KiB
C
Raw Normal View History

1993-06-12 14:58:17 +00:00
/*
* Mach Operating System
* Copyright (c) 1992, 1991 Carnegie Mellon University
* All Rights Reserved.
1995-05-30 08:16:23 +00:00
*
1993-06-12 14:58:17 +00:00
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
1995-05-30 08:16:23 +00:00
*
1993-06-12 14:58:17 +00:00
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
1995-05-30 08:16:23 +00:00
*
1993-06-12 14:58:17 +00:00
* Carnegie Mellon requests users of this software to return to
1995-05-30 08:16:23 +00:00
*
1993-06-12 14:58:17 +00:00
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
1995-05-30 08:16:23 +00:00
*
1993-06-12 14:58:17 +00:00
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:35:03 rpd
* $Id: boot.h,v 1.22 1997/09/24 07:44:34 phk Exp $
1993-06-12 14:58:17 +00:00
*/
#include <sys/param.h>
#include <sys/time.h>
#include <ufs/ffs/fs.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
1993-06-12 14:58:17 +00:00
#define RB_DUAL 0x40000 /* XXX */
#define RB_PROBEKBD 0x80000 /* XXX */
extern char *devs[];
extern char *name;
1993-06-12 14:58:17 +00:00
extern struct fs *fs;
extern struct inode inode;
extern int dosdev, unit, slice, part, maj, boff, poff;
Load the kernel symbol table in the boot loader and not at compile time. (Boot with the -D flag if you want symbols.) Make it easier to extend `struct bootinfo' without losing either forwards or backwards compatibility. ddb_aout.c: Get the symbol table from wherever the loader put it. Nuke db_symtab[SYMTAB_SPACE]. boot.c: Enable loading of symbols. Align them on a page boundary. Add printfs about the symbol table sizes. Pass the memory sizes to the kernel. Fix initialization of `unit' (it got moved out of the loop). Fix adding the bss size (it got moved inside an ifdef). Initialize serial port when RB_SERIAL is toggled on. Fix comments. Clean up formatting of recently added code. io.c: Clean up formatting of recently added code. netboot/main.c, machdep.c, wd.c: Change names of bootinfo fields. LINT: Nuke SYMTAB_SPACE. Fix comment about DODUMP. Makefile.i386: Nuke use of dbsym. Exclude gcc symbols from kernel unless compiling with -g. Remove unused macro. Fix comments and formatting. genassym.c: Generate defines for some new bootinfo fields. Change names of old ones. locore.s: Copy only the valid part of the `struct bootinfo' passed by the loader. Reserve space for symbol table, if any. machdep.c: Check the memory sizes passed by the loader, if any. Don't use them yet. bootinfo.h: Add a size field so that we can resolve some mismatches between the loader bootinfo and the kernel boot info. The version number is not so good for this because of historical botches and because it's harder to maintain. Add memory size and symbol table fields. Change the names of everything. Hacks to save a few bytes: asm.S, boot.c, boot2.S: Replace `ouraddr' by `(BOOTSEG << 4)'. boot.c: Don't statically initialize `loadflags' to 0. Disable the "REDUNDANT" code that skips the BIOS variables. Eliminate `total'. Combine some more printfs. boot.h, disk.c, io.c, table.c: Move all statically initialzed data to table.c. io.c: Don't put the A20 gate bits in a variable.
1995-01-25 21:40:47 +00:00
extern unsigned long tw_chars;
extern int loadflags;
extern struct disklabel disklabel;
/* asm.S */
#if ASM_ONLY
void real_to_prot(void);
void prot_to_real(void);
#endif
void startprog(unsigned int physaddr, int howto, int bootdev,
/* XXX struct bootinfo * */ unsigned int bootinfo);
void pcpy(const void *src, void *dst, size_t count);
/* bios.S */
int biosread(int dev, int cyl, int head, int sec, int nsec, void *offset);
void putc(int c);
int getc(void);
int ischar(void);
int get_diskinfo(int drive);
int memsize(int extended);
void vesa_mode(int mode);
/* boot.c */
void boot(int drive);
/* boot2.S */
void boot2(void);
/* disk.c */
int devopen(void);
void devread(char *iodest, int sector, int cnt);
/* io.c */
void gateA20(void);
void printf(const char *format, ...);
void putchar(int c);
void delay1ms(void);
int gets(char *buf);
int strcmp(const char *s1, const char *s2);
#ifdef CDBOOT
int strcasecmp(const char *s1, const char *s2);
#endif /* !CDBOOT */
void bcopy(const void *from, void *to, size_t len);
void twiddle(void);
/* probe_keyboard.c */
int probe_keyboard(void);
/* serial.S */
void serial_putc(int ch);
int serial_getc(void);
int serial_ischar(void);
void init_serial(void);
/* sys.c */
void xread(char *addr, int size);
void read(char *buffer, int count);
int openrd(void);