pbsdboot.h revision 1.10 1 1.10 takemura /* $NetBSD: pbsdboot.h,v 1.10 2000/08/29 15:10:18 takemura Exp $ */
2 1.6 takemura
3 1.6 takemura /*-
4 1.6 takemura * Copyright (c) 1999 Shin Takemura.
5 1.6 takemura * All rights reserved.
6 1.6 takemura *
7 1.6 takemura * This software is part of the PocketBSD.
8 1.6 takemura *
9 1.6 takemura * Redistribution and use in source and binary forms, with or without
10 1.6 takemura * modification, are permitted provided that the following conditions
11 1.6 takemura * are met:
12 1.6 takemura * 1. Redistributions of source code must retain the above copyright
13 1.6 takemura * notice, this list of conditions and the following disclaimer.
14 1.6 takemura * 2. Redistributions in binary form must reproduce the above copyright
15 1.6 takemura * notice, this list of conditions and the following disclaimer in the
16 1.6 takemura * documentation and/or other materials provided with the distribution.
17 1.6 takemura * 3. All advertising materials mentioning features or use of this software
18 1.6 takemura * must display the following acknowledgement:
19 1.6 takemura * This product includes software developed by the PocketBSD project
20 1.6 takemura * and its contributors.
21 1.6 takemura * 4. Neither the name of the project nor the names of its contributors
22 1.6 takemura * may be used to endorse or promote products derived from this software
23 1.6 takemura * without specific prior written permission.
24 1.6 takemura *
25 1.6 takemura * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 1.6 takemura * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 1.6 takemura * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 1.6 takemura * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 1.6 takemura * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 1.6 takemura * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 1.6 takemura * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 1.6 takemura * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 1.6 takemura * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 1.6 takemura * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 1.6 takemura * SUCH DAMAGE.
36 1.6 takemura *
37 1.6 takemura */
38 1.6 takemura #define STANDALONE_WINDOWS_SIDE
39 1.6 takemura #include <stand.h>
40 1.6 takemura #include <machine/bootinfo.h>
41 1.6 takemura #include <machine/platid.h>
42 1.6 takemura
43 1.6 takemura extern TCHAR szAppName[ ];
44 1.6 takemura #define whoami szAppName
45 1.6 takemura #define PREFNAME TEXT("pbsdboot.ini")
46 1.9 takemura #define LOGNAME TEXT("pbsdboot.log")
47 1.6 takemura #define PATHBUFLEN 200
48 1.6 takemura
49 1.6 takemura
50 1.6 takemura /*
51 1.6 takemura * For some reason, we can't include Windows' header files.
52 1.6 takemura * So we must declare here.
53 1.6 takemura */
54 1.6 takemura double wcstod(const wchar_t *, wchar_t **);
55 1.6 takemura long wcstol(const wchar_t *, wchar_t **, int);
56 1.6 takemura unsigned long wcstoul(const wchar_t *, wchar_t **, int);
57 1.6 takemura BOOL VirtualCopy(LPVOID, LPVOID, DWORD, DWORD);
58 1.6 takemura
59 1.6 takemura /*
60 1.6 takemura * structure declarations
61 1.6 takemura */
62 1.6 takemura struct map_s {
63 1.6 takemura caddr_t entry;
64 1.6 takemura caddr_t base;
65 1.6 takemura int pagesize;
66 1.6 takemura int leafsize;
67 1.6 takemura int nleaves;
68 1.6 takemura caddr_t arg0;
69 1.6 takemura caddr_t arg1;
70 1.6 takemura caddr_t arg2;
71 1.6 takemura caddr_t arg3;
72 1.6 takemura caddr_t *leaf[32];
73 1.6 takemura };
74 1.6 takemura
75 1.6 takemura struct preference_s {
76 1.6 takemura int setting_idx;
77 1.6 takemura int fb_type;
78 1.6 takemura int fb_width, fb_height, fb_linebytes;
79 1.10 takemura int boot_time;
80 1.6 takemura long fb_addr;
81 1.6 takemura unsigned long platid_cpu, platid_machine;
82 1.6 takemura TCHAR setting_name[PATHBUFLEN];
83 1.6 takemura TCHAR kernel_name[PATHBUFLEN];
84 1.6 takemura TCHAR options[PATHBUFLEN];
85 1.6 takemura BOOL check_last_chance;
86 1.6 takemura BOOL load_debug_info;
87 1.6 takemura BOOL serial_port;
88 1.7 takemura BOOL reverse_video;
89 1.10 takemura BOOL autoboot;
90 1.6 takemura };
91 1.6 takemura
92 1.8 takemura struct path_s {
93 1.8 takemura TCHAR* name;
94 1.8 takemura LANGID langid;
95 1.8 takemura unsigned long flags;
96 1.8 takemura #define PATH_SAVE 1
97 1.8 takemura };
98 1.8 takemura
99 1.6 takemura /*
100 1.6 takemura * Machine dependent information
101 1.6 takemura */
102 1.6 takemura struct system_info {
103 1.6 takemura unsigned int si_dramstart;
104 1.6 takemura unsigned int si_drammaxsize;
105 1.6 takemura DWORD si_pagesize;
106 1.6 takemura unsigned char *si_asmcode;
107 1.6 takemura int si_asmcodelen;
108 1.6 takemura int (*si_boot) __P((caddr_t));
109 1.6 takemura int si_intrvec;
110 1.6 takemura };
111 1.6 takemura extern struct system_info system_info;
112 1.6 takemura
113 1.6 takemura extern struct preference_s pref;
114 1.6 takemura extern TCHAR* where_pref_load_from;
115 1.6 takemura
116 1.6 takemura /*
117 1.6 takemura * main.c
118 1.6 takemura */
119 1.6 takemura BOOL CheckCancel(int progress);
120 1.10 takemura extern HWND hDlgMain;
121 1.6 takemura
122 1.6 takemura /*
123 1.6 takemura * layout.c
124 1.6 takemura */
125 1.6 takemura int CreateMainWindow(HINSTANCE hInstance, HWND hWnd, LPCTSTR name, int cmdbar_height);
126 1.6 takemura
127 1.6 takemura /*
128 1.6 takemura * vmem.c
129 1.6 takemura */
130 1.6 takemura int vmem_exec(caddr_t entry, int argc, char *argv[], struct bootinfo *bi);
131 1.6 takemura caddr_t vmem_get(caddr_t phys_addr, int *length);
132 1.6 takemura int vmem_init(caddr_t start, caddr_t end);
133 1.6 takemura void vmem_dump_map(void);
134 1.6 takemura caddr_t vtophysaddr(caddr_t page);
135 1.6 takemura void vmem_free(void);
136 1.6 takemura caddr_t vmem_alloc(void);
137 1.6 takemura
138 1.6 takemura /*
139 1.6 takemura * elf.c
140 1.6 takemura */
141 1.6 takemura int getinfo(int fd, caddr_t *start, caddr_t *end);
142 1.6 takemura int loadfile(int fd, caddr_t *entry);
143 1.6 takemura
144 1.6 takemura /*
145 1.6 takemura * mips.c
146 1.6 takemura */
147 1.6 takemura int mips_boot(caddr_t map);
148 1.6 takemura
149 1.6 takemura /*
150 1.6 takemura * pbsdboot.c
151 1.6 takemura */
152 1.6 takemura int pbsdboot(TCHAR*, int argc, char *argv[], struct bootinfo *bi);
153 1.6 takemura
154 1.6 takemura /*
155 1.6 takemura * print.c
156 1.6 takemura */
157 1.6 takemura int debug_printf(LPWSTR lpszFmt, ...);
158 1.6 takemura int msg_printf(UINT type, LPWSTR caption, LPWSTR lpszFmt, ...);
159 1.9 takemura int stat_printf(LPWSTR lpszFmt, ...);
160 1.9 takemura int set_debug_log(TCHAR* path);
161 1.9 takemura void close_debug_log(void);
162 1.9 takemura
163 1.6 takemura
164 1.6 takemura #define MSG_ERROR (MB_OK | MB_ICONERROR)
165 1.6 takemura #define MSG_INFO (MB_OK | MB_ICONINFORMATION)
166 1.6 takemura
167 1.6 takemura /*
168 1.6 takemura * disptest.c
169 1.6 takemura */
170 1.6 takemura void hardware_test(void);
171 1.6 takemura
172 1.6 takemura
173 1.6 takemura /*
174 1.6 takemura * preference.c
175 1.6 takemura */
176 1.6 takemura void pref_init(struct preference_s* pref);
177 1.6 takemura void pref_dump(struct preference_s* pref);
178 1.6 takemura int pref_read(TCHAR* filename, struct preference_s* pref);
179 1.8 takemura int pref_load(struct path_s load_path[], int pathlen);
180 1.8 takemura int pref_save(struct path_s load_path[], int pathlen);
181 1.6 takemura int pref_write(TCHAR* filename, struct preference_s* buf);
182 1.6 takemura
183 1.6 takemura
184 1.6 takemura /*
185 1.6 takemura * systeminfo.c
186 1.6 takemura */
187 1.6 takemura int set_system_info(platid_t* platid);
188 1.6 takemura
189 1.8 takemura
190 1.8 takemura /*
191 1.8 takemura * palette.c
192 1.8 takemura */
193 1.8 takemura enum palette_status { PAL_ERROR, PAL_NOERROR, PAL_SUCCEEDED };
194 1.8 takemura extern enum palette_status palette_succeeded;
195 1.8 takemura void palette_init(HWND hWnd);
196 1.8 takemura void palette_set(HWND hWnd);
197 1.8 takemura void palette_check(HWND hWnd);
198 1.6 takemura
199 1.6 takemura /*
200 1.6 takemura * vr41xx.c
201 1.6 takemura */
202 1.6 takemura void vr41xx_init(SYSTEM_INFO *info);
203 1.6 takemura
204 1.6 takemura
205 1.6 takemura /*
206 1.6 takemura * tx39xx.c
207 1.6 takemura */
208 1.6 takemura void tx39xx_init(SYSTEM_INFO *info);
209