Selaa lähdekoodia

[image] Remove non-working image loaders

The WinCE, a.out and FreeBSD loaders are designed to be #included by
core/loader.c, which no longer exists.  These old loaders are not
usable anymore and cause compilation failures when enabled in
config/general.h.

Signed-off-by: Marin Hannache <mareo@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Marin Hannache 12 vuotta sitten
vanhempi
commit
7865ae0dea

+ 0
- 7
src/arch/i386/Makefile Näytä tiedosto

@@ -88,13 +88,6 @@ SRCDIRS 	+= arch/i386/interface/syslinux
88 88
 SRCDIRS		+= arch/i386/interface/vmware
89 89
 SRCDIRS		+= arch/i386/hci/commands
90 90
 
91
-# The various xxx_loader.c files are #included into core/loader.c and
92
-# should not be compiled directly.
93
-#
94
-NON_AUTO_SRCS	+= arch/i386/core/aout_loader.c
95
-NON_AUTO_SRCS	+= arch/i386/core/freebsd_loader.c
96
-NON_AUTO_SRCS	+= arch/i386/core/wince_loader.c
97
-
98 91
 # Include common x86 Makefile
99 92
 #
100 93
 MAKEDEPS	+= arch/x86/Makefile

+ 0
- 144
src/arch/i386/core/aout_loader.c Näytä tiedosto

@@ -1,144 +0,0 @@
1
-/* a.out */
2
-struct exec {
3
-	unsigned long      a_midmag;	/* flags<<26 | mid<<16 | magic */
4
-	unsigned long      a_text;	/* text segment size */
5
-	unsigned long      a_data;	/* initialized data size */
6
-	unsigned long      a_bss;	/* uninitialized data size */
7
-	unsigned long      a_syms;	/* symbol table size */
8
-	unsigned long      a_entry;	/* entry point */
9
-	unsigned long      a_trsize;	/* text relocation size */
10
-	unsigned long      a_drsize;	/* data relocation size */
11
-};
12
-
13
-struct aout_state {
14
-	struct exec head;
15
-	unsigned long curaddr;
16
-	int segment;			/* current segment number, -1 for none */
17
-	unsigned long loc;		/* start offset of current block */
18
-	unsigned long skip;		/* padding to be skipped to current segment */
19
-	unsigned long toread;		/* remaining data to be read in the segment */
20
-};
21
-
22
-static struct aout_state astate;
23
-
24
-static sector_t aout_download(unsigned char *data, unsigned int len, int eof);
25
-static inline os_download_t aout_probe(unsigned char *data, unsigned int len)
26
-{
27
-	unsigned long start, mid, end, istart, iend;
28
-	if (len < sizeof(astate.head)) {
29
-		return 0;
30
-	}
31
-	memcpy(&astate.head, data, sizeof(astate.head));
32
-	if ((astate.head.a_midmag & 0xffff) != 0x010BL) {
33
-		return 0;
34
-	}
35
-	
36
-	printf("(a.out");
37
-	aout_freebsd_probe();
38
-	printf(")... ");
39
-	/* Check the aout image */
40
-	start  = astate.head.a_entry;
41
-	mid    = (((start + astate.head.a_text) + 4095) & ~4095) + astate.head.a_data;
42
-	end    = ((mid + 4095) & ~4095) + astate.head.a_bss;
43
-	istart = 4096;
44
-	iend   = istart + (mid - start);
45
-	if (!prep_segment(start, mid, end, istart, iend))
46
-		return dead_download;
47
-	astate.segment = -1;
48
-	astate.loc = 0;
49
-	astate.skip = 0;
50
-	astate.toread = 0;
51
-	return aout_download;
52
-}
53
-
54
-static sector_t aout_download(unsigned char *data, unsigned int len, int eof)
55
-{
56
-	unsigned int offset;	/* working offset in the current data block */
57
-
58
-	offset = 0;
59
-
60
-#ifdef AOUT_LYNX_KDI
61
-	astate.segment++;
62
-	if (astate.segment == 0) {
63
-		astate.curaddr = 0x100000;
64
-		astate.head.a_entry = astate.curaddr + 0x20;
65
-	}
66
-	memcpy(phys_to_virt(astate.curaddr), data, len);
67
-	astate.curaddr += len;
68
-	return 0;
69
-#endif
70
-
71
-	do {
72
-		if (astate.segment != -1) {
73
-			if (astate.skip) {
74
-				if (astate.skip >= len - offset) {
75
-					astate.skip -= len - offset;
76
-					break;
77
-				}
78
-				offset += astate.skip;
79
-				astate.skip = 0;
80
-			}
81
-
82
-			if (astate.toread) {
83
-				if (astate.toread >= len - offset) {
84
-					memcpy(phys_to_virt(astate.curaddr), data+offset,
85
-						len - offset);
86
-					astate.curaddr += len - offset;
87
-					astate.toread -= len - offset;
88
-					break;
89
-				}
90
-				memcpy(phys_to_virt(astate.curaddr), data+offset, astate.toread);
91
-				offset += astate.toread;
92
-				astate.toread = 0;
93
-			}
94
-		}
95
-
96
-		/* Data left, but current segment finished - look for the next
97
-		 * segment.  This is quite simple for a.out files.  */
98
-		astate.segment++;
99
-		switch (astate.segment) {
100
-		case 0:
101
-			/* read text */
102
-			astate.curaddr = astate.head.a_entry;
103
-			astate.skip = 4096;
104
-			astate.toread = astate.head.a_text;
105
-			break;
106
-		case 1:
107
-			/* read data */
108
-			/* skip and curaddr may be wrong, but I couldn't find
109
-			 * examples where this failed.  There is no reasonable
110
-			 * documentation for a.out available.  */
111
-			astate.skip = ((astate.curaddr + 4095) & ~4095) - astate.curaddr;
112
-			astate.curaddr = (astate.curaddr + 4095) & ~4095;
113
-			astate.toread = astate.head.a_data;
114
-			break;
115
-		case 2:
116
-			/* initialize bss and start kernel */
117
-			astate.curaddr = (astate.curaddr + 4095) & ~4095;
118
-			astate.skip = 0;
119
-			astate.toread = 0;
120
-			memset(phys_to_virt(astate.curaddr), '\0', astate.head.a_bss);
121
-			goto aout_startkernel;
122
-		default:
123
-			break;
124
-		}
125
-	} while (offset < len);
126
-
127
-	astate.loc += len;
128
-
129
-	if (eof) {
130
-		unsigned long entry;
131
-
132
-aout_startkernel:
133
-		entry = astate.head.a_entry;
134
-		done(1);
135
-
136
-		aout_freebsd_boot();
137
-#ifdef AOUT_LYNX_KDI
138
-		xstart32(entry);
139
-#endif
140
-		printf("unexpected a.out variant\n");
141
-		longjmp(restart_etherboot, -2);
142
-	}
143
-	return 0;
144
-}

+ 0
- 377
src/arch/i386/core/freebsd_loader.c Näytä tiedosto

@@ -1,377 +0,0 @@
1
-/* bootinfo */
2
-#define BOOTINFO_VERSION 1
3
-#define NODEV           (-1)    /* non-existent device */
4
-#define PAGE_SHIFT      12              /* LOG2(PAGE_SIZE) */
5
-#define PAGE_SIZE       (1<<PAGE_SHIFT) /* bytes/page */
6
-#define PAGE_MASK       (PAGE_SIZE-1)
7
-#define N_BIOS_GEOM     8
8
-
9
-struct bootinfo {
10
-        unsigned int            bi_version;
11
-        const unsigned char     *bi_kernelname;
12
-        struct nfs_diskless     *bi_nfs_diskless;
13
-                                /* End of fields that are always present. */
14
-#define bi_endcommon            bi_n_bios_used
15
-        unsigned int            bi_n_bios_used;
16
-        unsigned long           bi_bios_geom[N_BIOS_GEOM];
17
-        unsigned int            bi_size;
18
-        unsigned char           bi_memsizes_valid;
19
-        unsigned char           bi_pad[3];
20
-        unsigned long           bi_basemem;
21
-        unsigned long           bi_extmem;
22
-        unsigned long           bi_symtab;
23
-        unsigned long           bi_esymtab;
24
-	/* Note that these are in the FreeBSD headers but were not here... */
25
-	unsigned long           bi_kernend;		/* end of kernel space */
26
-	unsigned long           bi_envp;		/* environment */
27
-	unsigned long           bi_modulep;		/* preloaded modules */
28
-};
29
-
30
-static struct bootinfo bsdinfo;
31
-
32
-#ifdef ELF_IMAGE
33
-static Elf32_Shdr *shdr;	/* To support the FreeBSD kludge! */
34
-static Address symtab_load;
35
-static Address symstr_load;
36
-static int symtabindex;
37
-static int symstrindex;
38
-#endif
39
-
40
-static enum {
41
-	Unknown, Tagged, Aout, Elf, Aout_FreeBSD, Elf_FreeBSD,
42
-} image_type = Unknown;
43
-
44
-static unsigned int off;
45
-
46
-
47
-#ifdef ELF_IMAGE
48
-static void elf_freebsd_probe(void)
49
-{
50
-	image_type = Elf;
51
-	if (	(estate.e.elf32.e_entry & 0xf0000000) && 
52
-		(estate.e.elf32.e_type == ET_EXEC))
53
-	{
54
-		image_type = Elf_FreeBSD;
55
-		printf("/FreeBSD");
56
-		off = -(estate.e.elf32.e_entry & 0xff000000);
57
-		estate.e.elf32.e_entry += off;
58
-	}
59
-	/* Make sure we have a null to start with... */
60
-	shdr = 0;
61
-	
62
-	/* Clear the symbol index values... */
63
-	symtabindex = -1;
64
-	symstrindex = -1;
65
-	
66
-	/* ...and the load addresses of the symbols  */
67
-	symtab_load = 0;
68
-	symstr_load = 0;
69
-}
70
-
71
-static void elf_freebsd_fixup_segment(void)
72
-{
73
-	if (image_type == Elf_FreeBSD) {
74
-		estate.p.phdr32[estate.segment].p_paddr += off;
75
-	}
76
-}
77
-
78
-static void elf_freebsd_find_segment_end(void)
79
-{
80
-	/* Count the bytes read even for the last block
81
-	 * as we will need to know where the last block
82
-	 * ends in order to load the symbols correctly.
83
-	 * (plus it could be useful elsewhere...)
84
-	 * Note that we need to count the actual size,
85
-	 * not just the end of the disk image size.
86
-	 */
87
-	estate.curaddr += 
88
-		(estate.p.phdr32[estate.segment].p_memsz - 
89
-		estate.p.phdr32[estate.segment].p_filesz);
90
-}
91
-
92
-static int elf_freebsd_debug_loader(unsigned int offset)
93
-{
94
-	/* No more segments to be loaded - time to start the
95
-	 * nasty state machine to support the loading of
96
-	 * FreeBSD debug symbols due to the fact that FreeBSD
97
-	 * uses/exports the kernel's debug symbols in order
98
-	 * to make much of the system work!  Amazing (arg!)
99
-	 *
100
-	 * We depend on the fact that for the FreeBSD kernel,
101
-	 * there is only one section of debug symbols and that
102
-	 * the section is after all of the loaded sections in
103
-	 * the file.  This assumes a lot but is somewhat required
104
-	 * to make this code not be too annoying.  (Where do you
105
-	 * load symbols when the code has not loaded yet?)
106
-	 * Since this function is actually just a callback from
107
-	 * the network data transfer code, we need to be able to
108
-	 * work with the data as it comes in.  There is no chance
109
-	 * for doing a seek other than forwards.
110
-	 *
111
-	 * The process we use is to first load the section
112
-	 * headers.  Once they are loaded (shdr != 0) we then
113
-	 * look for where the symbol table and symbol table
114
-	 * strings are and setup some state that we found
115
-	 * them and fall into processing the first one (which
116
-	 * is the symbol table) and after that has been loaded,
117
-	 * we try the symbol strings.  Note that the order is
118
-	 * actually required as the memory image depends on
119
-	 * the symbol strings being loaded starting at the
120
-	 * end of the symbol table.  The kernel assumes this
121
-	 * layout of the image.
122
-	 *
123
-	 * At any point, if we get to the end of the load file
124
-	 * or the section requested is earlier in the file than
125
-	 * the current file pointer, we just end up falling
126
-	 * out of this and booting the kernel without this
127
-	 * information.
128
-	 */
129
-
130
-	/* Make sure that the next address is long aligned... */
131
-	/* Assumes size of long is a power of 2... */
132
-	estate.curaddr = (estate.curaddr + sizeof(long) - 1) & ~(sizeof(long) - 1);
133
-	
134
-	/* If we have not yet gotten the shdr loaded, try that */
135
-	if (shdr == 0)
136
-	{
137
-		estate.toread = estate.e.elf32.e_shnum * estate.e.elf32.e_shentsize;
138
-		estate.skip = estate.e.elf32.e_shoff - (estate.loc + offset);
139
-		if (estate.toread)
140
-		{
141
-#if ELF_DEBUG
142
-			printf("shdr *, size %lX, curaddr %lX\n", 
143
-				estate.toread, estate.curaddr);
144
-#endif
145
-			
146
-			/* Start reading at the curaddr and make that the shdr */
147
-			shdr = (Elf32_Shdr *)phys_to_virt(estate.curaddr);
148
-			
149
-			/* Start to read... */
150
-			return 1;
151
-		}
152
-	}
153
-	else
154
-	{
155
-		/* We have the shdr loaded, check if we have found
156
-		 * the indexs where the symbols are supposed to be */
157
-		if ((symtabindex == -1) && (symstrindex == -1))
158
-		{
159
-			int i;
160
-			/* Make sure that the address is page aligned... */
161
-			/* Symbols need to start in their own page(s)... */
162
-			estate.curaddr = (estate.curaddr + 4095) & ~4095;
163
-			
164
-			/* Need to make new indexes... */
165
-			for (i=0; i < estate.e.elf32.e_shnum; i++)
166
-			{
167
-				if (shdr[i].sh_type == SHT_SYMTAB)
168
-				{
169
-					int j;
170
-					for (j=0; j < estate.e.elf32.e_phnum; j++)
171
-					{
172
-						/* Check only for loaded sections */
173
-						if ((estate.p.phdr32[j].p_type | 0x80) == (PT_LOAD | 0x80))
174
-						{
175
-							/* Only the extra symbols */
176
-							if ((shdr[i].sh_offset >= estate.p.phdr32[j].p_offset) &&
177
-								((shdr[i].sh_offset + shdr[i].sh_size) <=
178
-									(estate.p.phdr32[j].p_offset + estate.p.phdr32[j].p_filesz)))
179
-							{
180
-								shdr[i].sh_offset=0;
181
-								shdr[i].sh_size=0;
182
-								break;
183
-							}
184
-						}
185
-					}
186
-					if ((shdr[i].sh_offset != 0) && (shdr[i].sh_size != 0))
187
-					{
188
-						symtabindex = i;
189
-						symstrindex = shdr[i].sh_link;
190
-					}
191
-				}
192
-			}
193
-		}
194
-		
195
-		/* Check if we have a symbol table index and have not loaded it */
196
-		if ((symtab_load == 0) && (symtabindex >= 0))
197
-		{
198
-			/* No symbol table yet?  Load it first... */
199
-			
200
-			/* This happens to work out in a strange way.
201
-			 * If we are past the point in the file already,
202
-			 * we will skip a *large* number of bytes which
203
-			 * ends up bringing us to the end of the file and
204
-			 * an old (default) boot.  Less code and lets
205
-			 * the state machine work in a cleaner way but this
206
-			 * is a nasty side-effect trick... */
207
-			estate.skip = shdr[symtabindex].sh_offset - (estate.loc + offset);
208
-			
209
-			/* And we need to read this many bytes... */
210
-			estate.toread = shdr[symtabindex].sh_size;
211
-			
212
-			if (estate.toread)
213
-			{
214
-#if ELF_DEBUG
215
-				printf("db sym, size %lX, curaddr %lX\n", 
216
-					estate.toread, estate.curaddr);
217
-#endif
218
-				/* Save where we are loading this... */
219
-				symtab_load = estate.curaddr;
220
-				
221
-				*((long *)phys_to_virt(estate.curaddr)) = estate.toread;
222
-				estate.curaddr += sizeof(long);
223
-				
224
-				/* Start to read... */
225
-				return 1;
226
-			}
227
-		}
228
-		else if ((symstr_load == 0) && (symstrindex >= 0))
229
-		{
230
-			/* We have already loaded the symbol table, so
231
-			 * now on to the symbol strings... */
232
-			
233
-			
234
-			/* Same nasty trick as above... */
235
-			estate.skip = shdr[symstrindex].sh_offset - (estate.loc + offset);
236
-			
237
-			/* And we need to read this many bytes... */
238
-			estate.toread = shdr[symstrindex].sh_size;
239
-			
240
-			if (estate.toread)
241
-			{
242
-#if ELF_DEBUG
243
-				printf("db str, size %lX, curaddr %lX\n", 
244
-					estate.toread, estate.curaddr);
245
-#endif
246
-				/* Save where we are loading this... */
247
-				symstr_load = estate.curaddr;
248
-				
249
-				*((long *)phys_to_virt(estate.curaddr)) = estate.toread;
250
-				estate.curaddr += sizeof(long);
251
-				
252
-				/* Start to read... */
253
-				return 1;
254
-			}
255
-		}
256
-	}
257
-	/* all done */
258
-	return 0;
259
-}
260
-
261
-static void elf_freebsd_boot(unsigned long entry) 
262
-{
263
-	if (image_type != Elf_FreeBSD)
264
-		return;
265
-
266
-	memset(&bsdinfo, 0, sizeof(bsdinfo));
267
-	bsdinfo.bi_basemem = meminfo.basememsize;
268
-	bsdinfo.bi_extmem = meminfo.memsize;
269
-	bsdinfo.bi_memsizes_valid = 1;
270
-	bsdinfo.bi_version = BOOTINFO_VERSION;
271
-	bsdinfo.bi_kernelname = virt_to_phys(KERNEL_BUF);
272
-	bsdinfo.bi_nfs_diskless = NULL;
273
-	bsdinfo.bi_size = sizeof(bsdinfo);
274
-#define RB_BOOTINFO     0x80000000      /* have `struct bootinfo *' arg */  
275
-	if(freebsd_kernel_env[0] != '\0'){
276
-		freebsd_howto |= RB_BOOTINFO;
277
-		bsdinfo.bi_envp = (unsigned long)freebsd_kernel_env;
278
-	}
279
-	
280
-	/* Check if we have symbols loaded, and if so,
281
-	 * made the meta_data needed to pass those to
282
-	 * the kernel. */
283
-	if ((symtab_load !=0) && (symstr_load != 0))
284
-	{
285
-		unsigned long *t;
286
-		
287
-		bsdinfo.bi_symtab = symtab_load;
288
-		
289
-		/* End of symbols (long aligned...) */
290
-		/* Assumes size of long is a power of 2... */
291
-		bsdinfo.bi_esymtab = (symstr_load +
292
-			sizeof(long) +
293
-			*((long *)phys_to_virt(symstr_load)) +
294
-			sizeof(long) - 1) & ~(sizeof(long) - 1);
295
-		
296
-		/* Where we will build the meta data... */
297
-		t = phys_to_virt(bsdinfo.bi_esymtab);
298
-		
299
-#if ELF_DEBUG
300
-		printf("Metadata at %lX\n",t);
301
-#endif
302
-		
303
-		/* Set up the pointer to the memory... */
304
-		bsdinfo.bi_modulep = virt_to_phys(t);
305
-		
306
-		/* The metadata structure is an array of 32-bit
307
-		 * words where we store some information about the
308
-		 * system.  This is critical, as FreeBSD now looks
309
-		 * only for the metadata for the extended symbol
310
-		 * information rather than in the bootinfo.
311
-		 */
312
-		/* First, do the kernel name and the kernel type */
313
-		/* Note that this assumed x86 byte order... */
314
-		
315
-		/* 'kernel\0\0' */
316
-		*t++=MODINFO_NAME; *t++= 7; *t++=0x6E72656B; *t++=0x00006C65;
317
-		
318
-		/* 'elf kernel\0\0' */
319
-		*t++=MODINFO_TYPE; *t++=11; *t++=0x20666C65; *t++=0x6E72656B; *t++ = 0x00006C65;
320
-		
321
-		/* Now the symbol start/end - note that they are
322
-		 * here in local/physical address - the Kernel
323
-		 * boot process will relocate the addresses. */
324
-		*t++=MODINFOMD_SSYM | MODINFO_METADATA; *t++=sizeof(*t); *t++=bsdinfo.bi_symtab;
325
-		*t++=MODINFOMD_ESYM | MODINFO_METADATA; *t++=sizeof(*t); *t++=bsdinfo.bi_esymtab;
326
-		
327
-		*t++=MODINFO_END; *t++=0; /* end of metadata */
328
-		
329
-		/* Since we have symbols we need to make
330
-		 * sure that the kernel knows its own end
331
-		 * of memory...  It is not _end but after
332
-		 * the symbols and the metadata... */
333
-		bsdinfo.bi_kernend = virt_to_phys(t);
334
-		
335
-		/* Signal locore.s that we have a valid bootinfo
336
-		 * structure that was completely filled in. */
337
-		freebsd_howto |= 0x80000000;
338
-	}
339
-	
340
-	xstart32(entry, freebsd_howto, NODEV, 0, 0, 0, 
341
-		virt_to_phys(&bsdinfo), 0, 0, 0);
342
-	longjmp(restart_etherboot, -2);
343
-}
344
-#endif
345
-
346
-#ifdef AOUT_IMAGE
347
-static void aout_freebsd_probe(void)
348
-{
349
-	image_type = Aout;
350
-	if (((astate.head.a_midmag >> 16) & 0xffff) == 0) {
351
-		/* Some other a.out variants have a different
352
-		 * value, and use other alignments (e.g. 1K),
353
-		 * not the 4K used by FreeBSD.  */
354
-		image_type = Aout_FreeBSD;
355
-		printf("/FreeBSD");
356
-		off = -(astate.head.a_entry & 0xff000000);
357
-		astate.head.a_entry += off;
358
-	}
359
-}
360
-
361
-static void aout_freebsd_boot(void)
362
-{
363
-	if (image_type == Aout_FreeBSD) {
364
-		memset(&bsdinfo, 0, sizeof(bsdinfo));
365
-		bsdinfo.bi_basemem = meminfo.basememsize;
366
-		bsdinfo.bi_extmem = meminfo.memsize;
367
-		bsdinfo.bi_memsizes_valid = 1;
368
-		bsdinfo.bi_version = BOOTINFO_VERSION;
369
-		bsdinfo.bi_kernelname = virt_to_phys(KERNEL_BUF);
370
-		bsdinfo.bi_nfs_diskless = NULL;
371
-		bsdinfo.bi_size = sizeof(bsdinfo);
372
-		xstart32(astate.head.a_entry, freebsd_howto, NODEV, 0, 0, 0, 
373
-			virt_to_phys(&bsdinfo), 0, 0, 0);
374
-		longjmp(restart_etherboot, -2);
375
-	}
376
-}
377
-#endif

+ 0
- 273
src/arch/i386/core/wince_loader.c Näytä tiedosto

@@ -1,273 +0,0 @@
1
-#define LOAD_DEBUG	0
2
-
3
-static int get_x_header(unsigned char *data, unsigned long now);
4
-static void jump_2ep();
5
-static unsigned char ce_signature[] = {'B', '0', '0', '0', 'F', 'F', '\n',};
6
-static char ** ep;
7
-
8
-#define BOOT_ARG_PTR_LOCATION 0x001FFFFC
9
-
10
-typedef struct _BOOT_ARGS{
11
-	unsigned char ucVideoMode;
12
-	unsigned char ucComPort;
13
-	unsigned char ucBaudDivisor;
14
-	unsigned char ucPCIConfigType;
15
-	
16
-	unsigned long dwSig;
17
-	#define BOOTARG_SIG 0x544F4F42
18
-	unsigned long dwLen;
19
-	
20
-	unsigned char ucLoaderFlags;
21
-	unsigned char ucEshellFlags;
22
-	unsigned char ucEdbgAdapterType;
23
-	unsigned char ucEdbgIRQ;
24
-	
25
-	unsigned long dwEdbgBaseAddr;
26
-	unsigned long dwEdbgDebugZone;	
27
-	unsigned long dwDHCPLeaseTime;
28
-	unsigned long dwEdbgFlags;
29
-	
30
-	unsigned long dwEBootFlag;
31
-	unsigned long dwEBootAddr;
32
-	unsigned long dwLaunchAddr;
33
-	
34
-	unsigned long pvFlatFrameBuffer;
35
-	unsigned short vesaMode;
36
-	unsigned short cxDisplayScreen;
37
-	unsigned short cyDisplayScreen;
38
-	unsigned short cxPhysicalScreen;
39
-	unsigned short cyPhysicalScreen;
40
-	unsigned short cbScanLineLength;
41
-	unsigned short bppScreen;
42
-	
43
-	unsigned char RedMaskSize;
44
-	unsigned char REdMaskPosition;
45
-	unsigned char GreenMaskSize;
46
-	unsigned char GreenMaskPosition;
47
-	unsigned char BlueMaskSize;
48
-	unsigned char BlueMaskPosition;
49
-} BOOT_ARGS;
50
-
51
-BOOT_ARGS BootArgs;
52
-
53
-static struct segment_info{
54
-	unsigned long addr;		// Section Address
55
-	unsigned long size;		// Section Size
56
-	unsigned long checksum;		// Section CheckSum
57
-} X;
58
-
59
-#define PSIZE	(1500)			//Max Packet Size
60
-#define DSIZE  (PSIZE+12)
61
-static unsigned long dbuffer_available =0;
62
-static unsigned long not_loadin =0;
63
-static unsigned long d_now =0;
64
-
65
-unsigned long entry;
66
-static unsigned long ce_curaddr;
67
-
68
-
69
-static sector_t ce_loader(unsigned char *data, unsigned int len, int eof);
70
-static os_download_t wince_probe(unsigned char *data, unsigned int len)
71
-{
72
-	if (strncmp(ce_signature, data, sizeof(ce_signature)) != 0) {
73
-		return 0;
74
-	}
75
-	printf("(WINCE)");
76
-	return ce_loader;
77
-}
78
-
79
-static sector_t ce_loader(unsigned char *data, unsigned int len, int eof)
80
-{
81
-	static unsigned char dbuffer[DSIZE];
82
-	int this_write = 0;
83
-	static int firsttime = 1;
84
-
85
-	/*
86
-	 *	new packet in, we have to 
87
-	 *	[1] copy data to dbuffer,
88
-	 *
89
-	 *	update...
90
-	 *	[2]  dbuffer_available
91
-	 */
92
-	memcpy( (dbuffer+dbuffer_available), data, len);	//[1]
93
-	dbuffer_available += len;	// [2]
94
-	len = 0;
95
-
96
-	d_now = 0;
97
-	
98
-#if 0
99
-	printf("dbuffer_available =%ld \n", dbuffer_available);
100
-#endif 
101
-	
102
-	if (firsttime) 
103
-	{
104
-		d_now = sizeof(ce_signature);
105
-		printf("String Physical Address = %lx \n", 
106
-			*(unsigned long *)(dbuffer+d_now));
107
-		
108
-		d_now += sizeof(unsigned long);
109
-		printf("Image Size = %ld [%lx]\n", 
110
-			*(unsigned long *)(dbuffer+d_now), 
111
-			*(unsigned long *)(dbuffer+d_now));
112
-		
113
-		d_now += sizeof(unsigned long);
114
-		dbuffer_available -= d_now;			
115
-		
116
-		d_now = (unsigned long)get_x_header(dbuffer, d_now);
117
-		firsttime = 0;
118
-	}
119
-	
120
-	if (not_loadin == 0)
121
-	{
122
-		d_now = get_x_header(dbuffer, d_now);
123
-	}
124
-	
125
-	while ( not_loadin > 0 )
126
-	{
127
-		/* dbuffer do not have enough data to loading, copy all */
128
-#if LOAD_DEBUG
129
-		printf("[0] not_loadin = [%ld], dbuffer_available = [%ld] \n", 
130
-			not_loadin, dbuffer_available);
131
-		printf("[0] d_now = [%ld] \n", d_now);
132
-#endif
133
-		
134
-		if( dbuffer_available <= not_loadin)
135
-		{
136
-			this_write = dbuffer_available ;
137
-			memcpy(phys_to_virt(ce_curaddr), (dbuffer+d_now), this_write );
138
-			ce_curaddr += this_write;
139
-			not_loadin -= this_write;
140
-			
141
-			/* reset index and available in the dbuffer */
142
-			dbuffer_available = 0;
143
-			d_now = 0;
144
-#if LOAD_DEBUG
145
-			printf("[1] not_loadin = [%ld], dbuffer_available = [%ld] \n", 
146
-				not_loadin, dbuffer_available);
147
-			printf("[1] d_now = [%ld], this_write = [%d] \n", 
148
-				d_now, this_write);
149
-#endif
150
-				
151
-			// get the next packet...
152
-			return (0);
153
-		}
154
-			
155
-		/* dbuffer have more data then loading ... , copy partital.... */
156
-		else
157
-		{
158
-			this_write = not_loadin;
159
-			memcpy(phys_to_virt(ce_curaddr), (dbuffer+d_now), this_write);
160
-			ce_curaddr += this_write;
161
-			not_loadin = 0;
162
-			
163
-			/* reset index and available in the dbuffer */
164
-			dbuffer_available -= this_write;
165
-			d_now += this_write;
166
-#if LOAD_DEBUG
167
-			printf("[2] not_loadin = [%ld], dbuffer_available = [%ld] \n", 
168
-				not_loadin, dbuffer_available);
169
-			printf("[2] d_now = [%ld], this_write = [%d] \n\n", 
170
-				d_now, this_write);
171
-#endif
172
-			
173
-			/* dbuffer not empty, proceed processing... */
174
-			
175
-			// don't have enough data to get_x_header..
176
-			if ( dbuffer_available < (sizeof(unsigned long) * 3) )
177
-			{
178
-//				printf("we don't have enough data remaining to call get_x. \n");
179
-				memcpy( (dbuffer+0), (dbuffer+d_now), dbuffer_available);
180
-				return (0);
181
-			}
182
-			else
183
-			{
184
-#if LOAD_DEBUG				
185
-				printf("with remaining data to call get_x \n");
186
-				printf("dbuffer available = %ld , d_now = %ld\n", 
187
-					dbuffer_available, d_now);
188
-#endif					
189
-				d_now = get_x_header(dbuffer, d_now);
190
-			}
191
-		}
192
-	}
193
-	return (0);
194
-}
195
-
196
-static int get_x_header(unsigned char *dbuffer, unsigned long now)
197
-{
198
-	X.addr = *(unsigned long *)(dbuffer + now);
199
-	X.size = *(unsigned long *)(dbuffer + now + sizeof(unsigned long));
200
-	X.checksum = *(unsigned long *)(dbuffer + now + sizeof(unsigned long)*2);
201
-
202
-	if (X.addr == 0)
203
-	{
204
-		entry = X.size;
205
-		done(1);
206
-		printf("Entry Point Address = [%lx] \n", entry);
207
-		jump_2ep();		
208
-	}
209
-
210
-	if (!prep_segment(X.addr, X.addr + X.size, X.addr + X.size, 0, 0)) {
211
-		longjmp(restart_etherboot, -2);
212
-	}
213
-
214
-	ce_curaddr = X.addr;
215
-	now += sizeof(unsigned long)*3;
216
-
217
-	/* re-calculate dbuffer available... */
218
-	dbuffer_available -= sizeof(unsigned long)*3;
219
-
220
-	/* reset index of this section */
221
-	not_loadin = X.size;
222
-	
223
-#if 1
224
-	printf("\n");
225
-	printf("\t Section Address = [%lx] \n", X.addr);
226
-	printf("\t Size = %d [%lx]\n", X.size, X.size);
227
-	printf("\t Checksum = %ld [%lx]\n", X.checksum, X.checksum);
228
-#endif
229
-#if LOAD_DEBUG
230
-	printf("____________________________________________\n");
231
-	printf("\t dbuffer_now = %ld \n", now);
232
-	printf("\t dbuffer available = %ld \n", dbuffer_available);
233
-	printf("\t not_loadin = %ld \n", not_loadin);
234
-#endif
235
-
236
-	return now;
237
-}
238
-
239
-static void jump_2ep()
240
-{
241
-	BootArgs.ucVideoMode = 1;
242
-	BootArgs.ucComPort = 1;
243
-	BootArgs.ucBaudDivisor = 1;
244
-	BootArgs.ucPCIConfigType = 1;	// do not fill with 0
245
-	
246
-	BootArgs.dwSig = BOOTARG_SIG;
247
-	BootArgs.dwLen = sizeof(BootArgs);
248
-	
249
-	if(BootArgs.ucVideoMode == 0)
250
-	{
251
-		BootArgs.cxDisplayScreen = 640;
252
-		BootArgs.cyDisplayScreen = 480;
253
-		BootArgs.cxPhysicalScreen = 640;
254
-		BootArgs.cyPhysicalScreen = 480;
255
-		BootArgs.bppScreen = 16;
256
-		BootArgs.cbScanLineLength  = 1024;
257
-		BootArgs.pvFlatFrameBuffer = 0x800a0000;	// ollie say 0x98000000
258
-	}	
259
-	else if(BootArgs.ucVideoMode != 0xFF)
260
-	{
261
-		BootArgs.cxDisplayScreen = 0;
262
-		BootArgs.cyDisplayScreen = 0;
263
-		BootArgs.cxPhysicalScreen = 0;
264
-		BootArgs.cyPhysicalScreen = 0;
265
-		BootArgs.bppScreen = 0;
266
-		BootArgs.cbScanLineLength  = 0;
267
-		BootArgs.pvFlatFrameBuffer = 0;	
268
-	}
269
-
270
-	ep = phys_to_virt(BOOT_ARG_PTR_LOCATION);
271
-	*ep= virt_to_phys(&BootArgs);
272
-	xstart32(entry);
273
-}

+ 0
- 9
src/config/config.c Näytä tiedosto

@@ -155,18 +155,9 @@ REQUIRE_OBJECT ( nbi );
155 155
 #ifdef IMAGE_ELF
156 156
 REQUIRE_OBJECT ( elfboot );
157 157
 #endif
158
-#ifdef IMAGE_FREEBSD
159
-REQUIRE_OBJECT ( freebsd );
160
-#endif
161 158
 #ifdef IMAGE_MULTIBOOT
162 159
 REQUIRE_OBJECT ( multiboot );
163 160
 #endif
164
-#ifdef IMAGE_AOUT
165
-REQUIRE_OBJECT ( aout );
166
-#endif
167
-#ifdef IMAGE_WINCE
168
-REQUIRE_OBJECT ( wince );
169
-#endif
170 161
 #ifdef IMAGE_PXE
171 162
 REQUIRE_OBJECT ( pxe_image );
172 163
 #endif

+ 0
- 3
src/config/general.h Näytä tiedosto

@@ -94,10 +94,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
94 94
  */
95 95
 //#define	IMAGE_NBI		/* NBI image support */
96 96
 //#define	IMAGE_ELF		/* ELF image support */
97
-//#define	IMAGE_FREEBSD		/* FreeBSD kernel image support */
98 97
 //#define	IMAGE_MULTIBOOT		/* MultiBoot image support */
99
-//#define	IMAGE_AOUT		/* a.out image support */
100
-//#define	IMAGE_WINCE		/* WinCE image support */
101 98
 //#define	IMAGE_PXE		/* PXE image support */
102 99
 //#define	IMAGE_SCRIPT		/* iPXE script image support */
103 100
 //#define	IMAGE_BZIMAGE		/* Linux bzImage image support */

Loading…
Peruuta
Tallenna