README.ipl revision 1.1.4.2       1  1.1.4.2  rmind #	$NetBSD: README.ipl,v 1.1.4.2 2014/05/18 17:45:11 rmind Exp $
      2  1.1.4.2  rmind 
      3  1.1.4.2  rmind Coding note:
      4  1.1.4.2  rmind 
      5  1.1.4.2  rmind 	In order to make this relocatable, you must follow following
      6  1.1.4.2  rmind 	restrictions:
      7  1.1.4.2  rmind 
      8  1.1.4.2  rmind 	1. Do not place any objects in text segment
      9  1.1.4.2  rmind 	1.1. For compiler,
     10  1.1.4.2  rmind 		(1) do not declare or define any objects to be placed in
     11  1.1.4.2  rmind 		    text segment, that is, do not use ``const'' keyword
     12  1.1.4.2  rmind 		    (but declaring a pointer to const is probably OK),
     13  1.1.4.2  rmind 
     14  1.1.4.2  rmind 		(2) make sure string literals, if any, are placed in data
     15  1.1.4.2  rmind 		    segment (use traditional compiler),
     16  1.1.4.2  rmind 
     17  1.1.4.2  rmind 		(3) avoid initialization of automatic objects (non-static
     18  1.1.4.2  rmind 		    function-local variables) of aggregate types (arrays,
     19  1.1.4.2  rmind 		    structs and unions), which may implicitly emits
     20  1.1.4.2  rmind 		    constant data.
     21  1.1.4.2  rmind 
     22  1.1.4.2  rmind 	     In summary, do not use ANSI extension.  Use traditional C. :-)
     23  1.1.4.2  rmind 
     24  1.1.4.2  rmind 	1.2. For linker, do not actually place objects in text segment.
     25  1.1.4.2  rmind 
     26  1.1.4.2  rmind 	2. Do not use function pointers.
     27  1.1.4.2  rmind 
     28  1.1.4.2  rmind 
     29  1.1.4.2  rmind On-disk layout:
     30  1.1.4.2  rmind 
     31  1.1.4.2  rmind 	We have 6.5KB for the primary boot.
     32  1.1.4.2  rmind 
     33  1.1.4.2  rmind 	disk address
     34  1.1.4.2  rmind 	start	 size
     35  1.1.4.2  rmind 	000000	0000FC	LIF header
     36  1.1.4.2  rmind 	0000FC	000104	unused
     37  1.1.4.2  rmind 	000200	000194	disklabel (404 bytes for 16-partition label)
     38  1.1.4.2  rmind 	000394	00006C	unused
     39  1.1.4.2  rmind 	000400	000400	ipl part 2 (1KB)
     40  1.1.4.2  rmind 	000800	000100	optional LIF directory
     41  1.1.4.2  rmind 	000900	000100	unused
     42  1.1.4.2  rmind 	000A00	000600	ipl part 3 (1.5KB)
     43  1.1.4.2  rmind 	001000	001000	ipl part 1 (4KB)
     44  1.1.4.2  rmind 	002000		(file system starts here)
     45  1.1.4.2  rmind 
     46  1.1.4.2  rmind 
     47  1.1.4.2  rmind On-memory layout on IPL startup:
     48  1.1.4.2  rmind 
     49  1.1.4.2  rmind 	The firmware loads ipl part 1 on the memory, and executes it.
     50  1.1.4.2  rmind 
     51  1.1.4.2  rmind 	address offset
     52  1.1.4.2  rmind 	 start	 size
     53  1.1.4.2  rmind 	000000	001000	ipl part 1
     54  1.1.4.2  rmind 	001000	000A00	(not loaded yet)
     55  1.1.4.2  rmind 			(bss section etc)
     56  1.1.4.2  rmind 	x	001000	temporary disk buffer
     57  1.1.4.2  rmind 	x+1000		stack
     58  1.1.4.2  rmind 
     59  1.1.4.2  rmind 
     60  1.1.4.2  rmind Then the IPL will load the rest of itself:
     61  1.1.4.2  rmind 
     62  1.1.4.2  rmind 	ipl part 1 loads parts 2 and 3, then continues execution.
     63  1.1.4.2  rmind 
     64  1.1.4.2  rmind 	address offset
     65  1.1.4.2  rmind 	 start	 size
     66  1.1.4.2  rmind 	000000	001000	ipl part 1
     67  1.1.4.2  rmind 	001000	000400	ipl part 2
     68  1.1.4.2  rmind 	001400	000600	ipl part 3
     69  1.1.4.2  rmind 	001A00	xxxxxx	(bss section etc)
     70