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