2 * Mach Operating System
3 * Copyright (c) 1992, 1991 Carnegie Mellon University
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16 * Carnegie Mellon requests users of this software to return to
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
26 * from: Mach, Revision 2.2 92/04/04 11:35:03 rpd
27 * $FreeBSD: src/sys/i386/boot/cdboot/boot.h,v 1.3 1999/08/28 00:43:17 peter Exp $
28 * $DragonFly: src/sys/i386/boot/cdboot/Attic/boot.h,v 1.2 2003/06/17 04:28:34 dillon Exp $
31 * Extensions for El Torito CD-ROM booting:
33 * Copyright © 1997 Pluto Technologies International, Inc. Boulder CO
34 * Copyright © 1997 interface business GmbH, Dresden.
35 * All rights reserved.
37 * This code has been written by Jörg Wunsch, Dresden.
38 * Direct comments to <joerg_wunsch@interface-business.de>.
40 * Redistribution and use in source and binary forms, with or without
41 * modification, are permitted provided that the following conditions
43 * 1. Redistributions of source code must retain the above copyright
44 * notice, this list of conditions and the following disclaimer.
45 * 2. Redistributions in binary form must reproduce the above copyright
46 * notice, this list of conditions and the following disclaimer in the
47 * documentation and/or other materials provided with the distribution.
49 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
50 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
51 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
52 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
53 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
54 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
55 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
57 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
58 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
59 * POSSIBILITY OF SUCH DAMAGE.
62 #include <sys/param.h>
66 * Specification packet per El Torito, BIOS int 0x13 fn 0x4b00/0x4b01
70 u_char size; /* must be 0x13 */
78 u_char drvno; /* emulated drive number */
79 u_char ctrlindx; /* controller index, see El Torito */
80 u_int32_t lba; /* LBA of emulated disk drive */
81 u_int16_t devspec; /* device specification, see El Torito */
82 u_int16_t ubufseg; /* user buffer segment */
83 u_int16_t loadseg; /* load segment; 0 => use BIOS default 0x7c0 */
84 u_int16_t seccnt; /* number of auto-loaded (virtual) sectors */
85 u_char cyls; /* same values as in int 0x13, fn 8 */
91 * Disk address packet for extended BIOS int 0x13 fn's 0x41...0x48.
95 u_char size; /* size of daddrpacket, must be 0x10 */
98 * number of 512-byte blocks to transfer,
102 u_int16_t boffs; /* bseg:boffs denominate the transfer buffer */
104 u_int32_t lba; /* actually a 64-bit type, but 64-bit arith */
105 u_int32_t lbahigh; /* is expensive, and we don't really need it */
109 # define DPRINTF(x) printf x
117 void real_to_prot(void);
118 void prot_to_real(void);
120 void startprog(unsigned int physaddr, int howto, int bootdev,
121 /* XXX struct bootinfo * */ unsigned int bootinfo);
122 void pbzero(void *dst, size_t count);
123 void pcpy(const void *src, void *dst, size_t count);
127 int biosread(int dev, int cyl, int head, int sec, int nsec, void *offset);
128 int getbootspec(struct specpacket *offset);
129 int biosreadlba(struct daddrpacket *daddr);
133 int get_diskinfo(int drive);
134 int memsize(int extended);
137 extern int loadflags;
139 void boot(int drive);
145 extern u_int32_t sessionstart;
147 int devopen(u_int32_t session);
148 void seek(u_int32_t offs);
149 int read(u_char *addr, size_t size);
150 int xread(u_char *addr, size_t size);
151 int openrd(char *name);
155 void printf(const char *format, ...);
159 int strcasecmp(const char *s1, const char *s2);
160 int strcmp(const char *s1, const char *s2);
161 void bcopy(const void *from, void *to, size_t len);
164 /* probe_keyboard.c */
165 int probe_keyboard(void);
168 void serial_putc(int ch);
169 int serial_getc(void);
170 int serial_ischar(void);
171 void init_serial(void);
175 extern unsigned long tw_chars;
178 void *malloc(size_t size);
179 void free(void *chunk);