1 /* $NetBSD: libi386.h,v 1.40 2013/11/24 17:20:00 jakllsch Exp $ */
5 * Matthias Drochner. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 typedef unsigned long physaddr_t
;
31 /* this is in startup code */
32 void vpbcopy(const void *, void *, size_t);
33 void pvbcopy(const void *, void *, size_t);
34 void pbzero(void *, size_t);
35 physaddr_t
vtophys(void *);
37 ssize_t
pread(int, void *, size_t);
38 void startprog(physaddr_t
, uint32_t, uint32_t *, physaddr_t
);
39 void multiboot(physaddr_t
, physaddr_t
, physaddr_t
);
41 int exec_netbsd(const char *, physaddr_t
, int, int, void (*)(void));
42 int exec_multiboot(const char *, char *);
48 int biosvideomode(void);
49 #ifdef CONSERVATIVE_MEMDETECT
50 #define getextmem() getextmem1()
52 #define getextmem() getextmemx()
54 void printmemlist(void);
58 void clear_pc_screen(void);
61 #define CONSDEV_COM0 1
62 #define CONSDEV_COM1 2
63 #define CONSDEV_COM2 3
64 #define CONSDEV_COM3 4
65 #define CONSDEV_COM0KBD 5
66 #define CONSDEV_COM1KBD 6
67 #define CONSDEV_COM2KBD 7
68 #define CONSDEV_COM3KBD 8
69 #define CONSDEV_AUTO (-1)
71 char awaitkey(int, int);
74 /* this is in "user code"! */
75 int parsebootfile(const char *, char **, char **, int *, int *, const char **);
78 physaddr_t
ppbcopy(physaddr_t
, physaddr_t
, int);
80 physaddr_t
xmsalloc(int);
84 char *gettrailer(char *);
85 int parseopts(const char *, int *);
86 int parseboot(char *, char **, int *);
89 struct bootblk_command
{
94 void docommand(char *);
96 void editline(char *, size_t, char *);
98 #endif /* defined(__minix) */
100 /* in "user code": */
101 void command_help(char *);
102 extern const struct bootblk_command commands
[];
104 /* asm bios/dos calls */
105 __compactcall
int biosdisk_extread(int, void *);
106 int biosdisk_read(int, int, int, int, int, void *);
107 __compactcall
int biosdisk_reset(int);
109 __compactcall
int biosgetrtc(u_long
*);
110 int biosgetsystime(void);
113 __compactcall
int computc(int, int);
116 int conisshift(void);
118 __compactcall
void conputc(int);
122 int getchar_ex(void);
123 #endif /* defined(__minix) */
125 int getextmem2(int *);
126 __compactcall
int getextmemps2(void *);
127 int getmementry(int *, int *);
129 __compactcall
int biosdisk_int13ext(int);
130 __compactcall
int biosdisk_getinfo(int);
131 struct biosdisk_extinfo
;
132 __compactcall
int biosdisk_getextinfo(int, struct biosdisk_extinfo
*);
133 int get_harddrives(void);
134 void biosdisk_probe(void);
136 int pcibios_cfgread(unsigned int, int, int *);
137 int pcibios_cfgwrite(unsigned int, int, int);
138 int pcibios_finddev(int, int, int, unsigned int *);
139 int pcibios_present(int *);
143 int dosread(int, char *, int);
144 int dosseek(int, int, int);
145 extern int doserrno
; /* in dos_file.S */
147 void module_add(char *);
148 void splash_add(char *);
149 void rnd_add(char *);
151 void userconf_add(char *);
153 struct btinfo_framebuffer
;
154 void framebuffer_configure(struct btinfo_framebuffer
*);