Check-in [68e0673f07]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Obtaining of the boot section information.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 68e0673f07f3ce6e6caaea3b125e720de665b689
User & Date: stephanie.gawroriski 2019-09-15 00:35:54
Context
2019-09-15
00:47
Base loop logic for processing pool entries. check-in: 1e49cd8105 user: stephanie.gawroriski tags: trunk
00:35
Obtaining of the boot section information. check-in: 68e0673f07 user: stephanie.gawroriski tags: trunk
00:28
Add comment as to why the sections are fixed size. check-in: df35bd6594 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/libs/tool-jarfile/dev/shadowtail/jarfile/JarMinimizer.java.

261
262
263
264
265
266
267
268


269
270
271
272
273

274
275
276

277
278
279
280

281
282
283
284
285
286
287
288
289


290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340

341
342
343
344
345
346
347
				header.writeInt(0);
			}
		}
		
		// Doing bootstrapping?
		if (bootstrap != null)
		{
			throw new todo.TODO();


			
			/* --- INITIALIZER TO GET THE BOOT POINTER
			private final Initializer __init(int[] __poolp, int[] __ksfa)
				throws NullPointerException
			{

			if (__poolp == null || __ksfa == null)
				throw new NullPointerException("NARG");
			

			Map<ClassName, LoadedClassInfo> boots = this._boots;
			ClassName kn = new ClassName(
				"cc/squirreljme/jvm/Bootstrap");
			

			// Initializer used for memory purposes
			Initializer rv = new Initializer();
			
			// Initialize the bootstrap pool, which may recursively initialize
			// more constant pools in order for other methods to be executed
			// properly
			int poolptr = this.__initPool(rv, kn);
			__poolp[0] = poolptr;
			


			// Allocate and setup kernel object pointer
			__ksfa[0] = this._sfieldarea;
			
			// Done with initialization, the ROM writer will dump the data needed
			// for the kernel to start properly
			return rv;
			}
			*/
			
			/* --- BOOT PROPERTIES WRITER
			// Round data stream to 4 bytes
			while ((jdos.size() & 3) != 0)
				jdos.write(0);
			
			// Write address to the boot table
			int baseaddr,
				injaraddr;
			__dos.writeInt((hfs[hat++] = 
				(injaraddr = (reloff + (baseaddr = jdos.size())))));
			
			// Debug
			if (_ENABLE_DEBUG)
				todo.DEBUG.note("Boot RAM written at @%08x", injaraddr);
			
			// Initialize and write startup memory
			int[] poolptr = new int[1],
				ksfa = new int[1];
			Initializer init = this.__init(poolptr, ksfa);
			
			// Load class IDs for the byte array
			int clab = this.__classId(init, new ClassName("[B")),
				claab = this.__classId(init, new ClassName("[[B"));
			
			// Write boot memory
			byte[] bootmem = init.toByteArray();
			jdos.write(bootmem);
			
			// Write length of the boot RAM initialize area
			__dos.writeInt((hfs[hat++] = bootmem.length));
			
			// Bootstrap pool, static field pointer offset, and the offset
			// to the bootstrap's code
			__dos.writeInt((hfs[hat++] = poolptr[0]));
			__dos.writeInt((hfs[hat++] = ksfa[0]));
			__dos.writeInt(this.__classMethodCodeAddress(
				"cc/squirreljme/jvm/Bootstrap",
				"__start",
				null));
			__dos.writeInt((hfs[hat++] = clab));
			__dos.writeInt((hfs[hat++] = claab));
			*/

		}
		
		// No bootstrapping being done
		else
		{
			// Boot memory offset, size
			header.writeInt(0);







|
>
>

<
<
|
<
>
|
|
<
>
|
|
<

>
|
|

|
|
|
<
<

>
>
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>







261
262
263
264
265
266
267
268
269
270
271


272

273
274
275

276
277
278

279
280
281
282
283
284
285
286


287
288
289
290
291















292

































293
294
295
296
297
298
299
300
				header.writeInt(0);
			}
		}
		
		// Doing bootstrapping?
		if (bootstrap != null)
		{
			// The class being booted
			LoadedClassInfo booting = bootstrap.findClass(
				"cc/squirreljme/jvm/Bootstrap");
			


			// Get all the bootstrap information before it is written!

			int bootpool = booting.poolPointer();
			int bootsfbp = bootstrap.staticFieldAreaAddress();
			int bootmeth = booting.methodCodeAddress(

				new MethodName("__start"), null);
			int bootidba = bootstrap.findClass("[B").infoPointer();
			int bootidbd = bootstrap.findClass("[[B").infoPointer();

			
			// Setup the BootRAM
			TableSectionOutputStream.Section bootram = out.addSection(
				bootstrap.initializer.toByteArray(), 4);
			
			// Boot memory offset, size
			header.writeSectionAddressInt(bootram);
			header.writeSectionSizeInt(bootram);


			
			// Pool, sfa, code, classidba, classidbaa
			header.writeInt(bootpool);
			header.writeInt(bootsfbp);
			header.writeInt(bootmeth);















			header.writeInt(bootidba);

































			header.writeInt(bootidbd);
		}
		
		// No bootstrapping being done
		else
		{
			// Boot memory offset, size
			header.writeInt(0);